浏览代码

Merge pull request #31 from csmith/master

Various build file updates.
pull/32/head
Greg Holmes 9 年前
父节点
当前提交
f42c77395a
共有 2 个文件被更改,包括 34 次插入28 次删除
  1. 17
    27
      build.gradle
  2. 17
    1
      circle.yml

+ 17
- 27
build.gradle 查看文件

@@ -1,13 +1,11 @@
1
-import org.mdonoughe.JGitDescribeTask
2
-
3
-def jgit = new org.mdonoughe.JGitDescribeTask()
4
-jgit.setDir(new File("$projectDir", '.git'))
5
-project.version = jgit.getDescription() + '-SNAPSHOT'
1
+group = 'com.dmdirc'
6 2
 
3
+apply plugin: 'com.dmdirc.git-version'
7 4
 apply plugin: 'java'
8 5
 apply plugin: 'maven-publish'
6
+apply plugin: 'jacoco'
7
+apply plugin: 'com.github.kt3k.coveralls'
9 8
 
10
-group = 'com.dmdirc'
11 9
 
12 10
 sourceSets {
13 11
     main {
@@ -56,34 +54,26 @@ task wrapper(type: Wrapper) {
56 54
     gradleVersion = '2.2.1'
57 55
 }
58 56
 
59
-task getCredentials << {
60
-    def target = file('nexus-teamcity.gradle')
61
-    if (!target.exists()) {
62
-        new URL('http://www.dmdirc.com/private/nexus-teamcity.gradle').withInputStream{
63
-            i -> target.withOutputStream { it << i }
64
-        }
65
-    }
66
-
67
-    apply from: 'nexus-teamcity.gradle'
68
-    project.publishing.repositories[0].credentials {
69
-        username "$nexusUser"
70
-        password "$nexusPass"
71
-    }
72
-}
73
-
74
-task publishSnapshot(dependsOn: ['getCredentials', 'publishMavenJavaPublicationToSnapshotsRepository']) << {
57
+task publishSnapshot(dependsOn: 'publishMavenJavaPublicationToSnapshotsRepository') << {
75 58
 }
76 59
 
77 60
 buildscript {
78 61
     repositories {
79 62
         mavenCentral()
80
-        maven {
81
-            url 'http://artifactory.dmdirc.com/artifactory/repo'
82
-        }
63
+        maven { url 'http://artifactory.dmdirc.com/artifactory/repo' }
64
+        maven { url 'https://dl.bintray.com/dmdirc/releases/' }
83 65
     }
84 66
 
85 67
     dependencies {
86
-        classpath group: 'com.github.shanemcc', name: 'jgit-describe', version: '0.5'
87
-        classpath group: 'org.eclipse.jgit', name: 'org.eclipse.jgit', version: '2.3.1.+'
68
+        classpath group: 'com.dmdirc', name: 'git-version', version: '1.0'
69
+        classpath 'org.kt3k.gradle.plugin:coveralls-gradle-plugin:2.1.0'
88 70
     }
89 71
 }
72
+
73
+jacocoTestReport {
74
+    reports {
75
+        xml.enabled = true // coveralls plugin depends on xml format report
76
+        html.enabled = true
77
+    }
78
+}
79
+

+ 17
- 1
circle.yml 查看文件

@@ -2,4 +2,20 @@
2 2
 
3 3
 machine:
4 4
   java:
5
-    version: oraclejdk8
5
+    version: oraclejdk8
6
+  environment:
7
+    TERM: dumb
8
+
9
+checkout:
10
+  post:
11
+    - git fetch --tags
12
+
13
+dependencies:
14
+  override:
15
+    - ./gradlew dependencies
16
+
17
+test:
18
+  override:
19
+    - ./gradlew test
20
+  post:
21
+    - ./gradlew jacocoTestReport coveralls

正在加载...
取消
保存