Browse Source

Add support for sending coverage to codacy.

pull/786/head
Chris Smith 7 years ago
parent
commit
208870f1c7

+ 12
- 12
api/build.gradle View File

16
  */
16
  */
17
 
17
 
18
 plugins {
18
 plugins {
19
-  id 'java'
20
-  id 'findbugs'
21
-  id 'pmd'
22
-  id 'idea'
19
+    id 'java'
20
+    id 'jacoco'
21
+    id 'findbugs'
22
+    id 'pmd'
23
+    id 'idea'
23
 }
24
 }
24
 
25
 
25
 group = 'com.dmdirc'
26
 group = 'com.dmdirc'
26
 
27
 
27
 idea {
28
 idea {
28
     module {
29
     module {
29
-         sourceDirs += file('src/main/generated')
30
-         testSourceDirs += file('src/test/generated_tests')
31
-         generatedSourceDirs = [file('src/main/generated'), file('src/test/generated_tests')]
30
+        sourceDirs += file('src/main/generated')
31
+        testSourceDirs += file('src/test/generated_tests')
32
+        generatedSourceDirs = [file('src/main/generated'), file('src/test/generated_tests')]
32
     }
33
     }
33
 }
34
 }
34
 
35
 
42
     compile group: 'com.squareup.dagger', name: 'dagger-compiler', version: '1.2.5'
43
     compile group: 'com.squareup.dagger', name: 'dagger-compiler', version: '1.2.5'
43
     compile group: 'com.google.auto.value', name: 'auto-value', version: '1.2'
44
     compile group: 'com.google.auto.value', name: 'auto-value', version: '1.2'
44
 
45
 
45
-    compile group: 'org.slf4j', name: 'slf4j-api', version:'1.7.21'
46
+    compile group: 'org.slf4j', name: 'slf4j-api', version: '1.7.21'
46
     compile group: 'com.squareup.dagger', name: 'dagger', version: '1.2.5'
47
     compile group: 'com.squareup.dagger', name: 'dagger', version: '1.2.5'
47
-    compile group: 'com.google.guava', name:'guava', version: '19.0'
48
+    compile group: 'com.google.guava', name: 'guava', version: '19.0'
48
     compile group: 'com.dmdirc', name: 'com.dmdirc.config.binding', version: '+', changing: true
49
     compile group: 'com.dmdirc', name: 'com.dmdirc.config.binding', version: '+', changing: true
49
     compile group: 'com.dmdirc', name: 'com.dmdirc.config.provider', version: '+', changing: true
50
     compile group: 'com.dmdirc', name: 'com.dmdirc.config.provider', version: '+', changing: true
50
     compile group: 'com.dmdirc', name: 'com.dmdirc.events.eventbus', version: '+', changing: true
51
     compile group: 'com.dmdirc', name: 'com.dmdirc.events.eventbus', version: '+', changing: true
62
     mavenCentral()
63
     mavenCentral()
63
     maven { url 'https://artifactory.dmdirc.com/artifactory/repo' }
64
     maven { url 'https://artifactory.dmdirc.com/artifactory/repo' }
64
     maven { url 'https://oss.sonatype.org/content/repositories/snapshots' }
65
     maven { url 'https://oss.sonatype.org/content/repositories/snapshots' }
66
+    maven { url 'http://dl.bintray.com/typesafe/maven-releases' }
65
 }
67
 }
66
 
68
 
67
-task wrapper(type: Wrapper) {
68
-    gradleVersion = '2.13'
69
-}
69
+apply from: '../gradle/analysis.gradle'

+ 34
- 0
api/src/test/java/com/dmdirc/DummyTest.java View File

1
+/*
2
+ * Copyright (c) 2006-2017 DMDirc Developers
3
+ *
4
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
5
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation the
6
+ * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to
7
+ * permit persons to whom the Software is furnished to do so, subject to the following conditions:
8
+ *
9
+ * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the
10
+ * Software.
11
+ *
12
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
13
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS
14
+ * OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
15
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
16
+ */
17
+
18
+package com.dmdirc;
19
+
20
+import org.junit.Test;
21
+
22
+import static org.junit.Assert.assertTrue;
23
+
24
+/**
25
+ * Our build system likes at least one test per project...
26
+ */
27
+public class DummyTest {
28
+
29
+    @Test
30
+    public void testNothing() {
31
+        assertTrue(true);
32
+    }
33
+
34
+}

+ 19
- 1
build.gradle View File

1
+/*
2
+ * Copyright (c) 2006-2017 DMDirc Developers
3
+ *
4
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
5
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation the
6
+ * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to
7
+ * permit persons to whom the Software is furnished to do so, subject to the following conditions:
8
+ *
9
+ * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the
10
+ * Software.
11
+ *
12
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
13
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS
14
+ * OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
15
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
16
+ */
17
+
1
 plugins {
18
 plugins {
2
   id 'com.dmdirc.git-version' version '1.0'
19
   id 'com.dmdirc.git-version' version '1.0'
3
   id 'com.github.kt3k.coveralls' version '2.6.3'
20
   id 'com.github.kt3k.coveralls' version '2.6.3'
4
   id 'maven-publish'
21
   id 'maven-publish'
5
   id 'java'
22
   id 'java'
6
   id 'findbugs'
23
   id 'findbugs'
7
-  id 'pmd'
8
   id 'idea'
24
   id 'idea'
9
 }
25
 }
10
 
26
 
68
     mavenCentral()
84
     mavenCentral()
69
     maven { url 'https://artifactory.dmdirc.com/artifactory/repo' }
85
     maven { url 'https://artifactory.dmdirc.com/artifactory/repo' }
70
     maven { url 'https://oss.sonatype.org/content/repositories/snapshots' }
86
     maven { url 'https://oss.sonatype.org/content/repositories/snapshots' }
87
+    maven { url 'http://dl.bintray.com/typesafe/maven-releases' }
71
 }
88
 }
72
 
89
 
73
 apply from: 'gradle/analysis.gradle'
90
 apply from: 'gradle/analysis.gradle'
91
+apply from: 'gradle/codacy.gradle'
74
 apply from: 'gradle/publishing.gradle'
92
 apply from: 'gradle/publishing.gradle'
75
 apply from: 'gradle/jar.gradle'
93
 apply from: 'gradle/jar.gradle'
76
 apply from: 'gradle/fatjar.gradle'
94
 apply from: 'gradle/fatjar.gradle'

+ 3
- 0
bundles/com.dmdirc.config.binding/build.gradle View File

17
 
17
 
18
 plugins {
18
 plugins {
19
     id 'java'
19
     id 'java'
20
+    id 'jacoco'
20
     id 'findbugs'
21
     id 'findbugs'
21
     id 'pmd'
22
     id 'pmd'
22
     id 'idea'
23
     id 'idea'
51
 
52
 
52
 repositories {
53
 repositories {
53
     mavenCentral()
54
     mavenCentral()
55
+    maven { url 'http://dl.bintray.com/typesafe/maven-releases' }
54
 }
56
 }
55
 
57
 
58
+apply from: '../../gradle/analysis.gradle'

+ 34
- 0
bundles/com.dmdirc.config.binding/src/test/java/com/dmdirc/DummyTest.java View File

1
+/*
2
+ * Copyright (c) 2006-2017 DMDirc Developers
3
+ *
4
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
5
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation the
6
+ * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to
7
+ * permit persons to whom the Software is furnished to do so, subject to the following conditions:
8
+ *
9
+ * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the
10
+ * Software.
11
+ *
12
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
13
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS
14
+ * OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
15
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
16
+ */
17
+
18
+package com.dmdirc;
19
+
20
+import org.junit.Test;
21
+
22
+import static org.junit.Assert.assertTrue;
23
+
24
+/**
25
+ * Our build system likes at least one test per project...
26
+ */
27
+public class DummyTest {
28
+
29
+    @Test
30
+    public void testNothing() {
31
+        assertTrue(true);
32
+    }
33
+
34
+}

+ 4
- 0
bundles/com.dmdirc.config.provider/build.gradle View File

17
 
17
 
18
 plugins {
18
 plugins {
19
     id 'java'
19
     id 'java'
20
+    id 'jacoco'
20
     id 'findbugs'
21
     id 'findbugs'
21
     id 'pmd'
22
     id 'pmd'
22
     id 'idea'
23
     id 'idea'
54
 
55
 
55
 repositories {
56
 repositories {
56
     mavenCentral()
57
     mavenCentral()
58
+    maven { url 'http://dl.bintray.com/typesafe/maven-releases' }
57
 }
59
 }
58
 
60
 
61
+apply from: '../../gradle/analysis.gradle'
62
+

+ 4
- 0
bundles/com.dmdirc.events.eventbus/build.gradle View File

17
 
17
 
18
 plugins {
18
 plugins {
19
     id 'java'
19
     id 'java'
20
+    id 'jacoco'
20
     id 'findbugs'
21
     id 'findbugs'
21
     id 'pmd'
22
     id 'pmd'
22
     id 'idea'
23
     id 'idea'
51
 
52
 
52
 repositories {
53
 repositories {
53
     mavenCentral()
54
     mavenCentral()
55
+    maven { url 'http://dl.bintray.com/typesafe/maven-releases' }
54
 }
56
 }
55
 
57
 
58
+apply from: '../../gradle/analysis.gradle'
59
+

+ 34
- 0
bundles/com.dmdirc.events.eventbus/src/test/java/com/dmdirc/DummyTest.java View File

1
+/*
2
+ * Copyright (c) 2006-2017 DMDirc Developers
3
+ *
4
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
5
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation the
6
+ * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to
7
+ * permit persons to whom the Software is furnished to do so, subject to the following conditions:
8
+ *
9
+ * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the
10
+ * Software.
11
+ *
12
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
13
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS
14
+ * OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
15
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
16
+ */
17
+
18
+package com.dmdirc;
19
+
20
+import org.junit.Test;
21
+
22
+import static org.junit.Assert.assertTrue;
23
+
24
+/**
25
+ * Our build system likes at least one test per project...
26
+ */
27
+public class DummyTest {
28
+
29
+    @Test
30
+    public void testNothing() {
31
+        assertTrue(true);
32
+    }
33
+
34
+}

+ 4
- 0
bundles/com.dmdirc.util.io.yaml/build.gradle View File

17
 
17
 
18
 plugins {
18
 plugins {
19
     id 'java'
19
     id 'java'
20
+    id 'jacoco'
20
     id 'findbugs'
21
     id 'findbugs'
21
     id 'pmd'
22
     id 'pmd'
22
     id 'idea'
23
     id 'idea'
52
 
53
 
53
 repositories {
54
 repositories {
54
     mavenCentral()
55
     mavenCentral()
56
+    maven { url 'http://dl.bintray.com/typesafe/maven-releases' }
55
 }
57
 }
56
 
58
 
59
+apply from: '../../gradle/analysis.gradle'
60
+

+ 34
- 0
bundles/com.dmdirc.util.io.yaml/src/test/java/com/dmdirc/DummyTest.java View File

1
+/*
2
+ * Copyright (c) 2006-2017 DMDirc Developers
3
+ *
4
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
5
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation the
6
+ * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to
7
+ * permit persons to whom the Software is furnished to do so, subject to the following conditions:
8
+ *
9
+ * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the
10
+ * Software.
11
+ *
12
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
13
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS
14
+ * OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
15
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
16
+ */
17
+
18
+package com.dmdirc;
19
+
20
+import org.junit.Test;
21
+
22
+import static org.junit.Assert.assertTrue;
23
+
24
+/**
25
+ * Our build system likes at least one test per project...
26
+ */
27
+public class DummyTest {
28
+
29
+    @Test
30
+    public void testNothing() {
31
+        assertTrue(true);
32
+    }
33
+
34
+}

+ 3
- 0
bundles/com.dmdirc.util.system/build.gradle View File

17
 
17
 
18
 plugins {
18
 plugins {
19
     id 'java'
19
     id 'java'
20
+    id 'jacoco'
20
     id 'findbugs'
21
     id 'findbugs'
21
     id 'pmd'
22
     id 'pmd'
22
     id 'idea'
23
     id 'idea'
51
 
52
 
52
 repositories {
53
 repositories {
53
     mavenCentral()
54
     mavenCentral()
55
+    maven { url 'http://dl.bintray.com/typesafe/maven-releases' }
54
 }
56
 }
55
 
57
 
58
+apply from: '../../gradle/analysis.gradle'

+ 34
- 0
bundles/com.dmdirc.util.system/src/test/java/com/dmdirc/DummyTest.java View File

1
+/*
2
+ * Copyright (c) 2006-2017 DMDirc Developers
3
+ *
4
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
5
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation the
6
+ * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to
7
+ * permit persons to whom the Software is furnished to do so, subject to the following conditions:
8
+ *
9
+ * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the
10
+ * Software.
11
+ *
12
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
13
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS
14
+ * OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
15
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
16
+ */
17
+
18
+package com.dmdirc;
19
+
20
+import org.junit.Test;
21
+
22
+import static org.junit.Assert.assertTrue;
23
+
24
+/**
25
+ * Our build system likes at least one test per project...
26
+ */
27
+public class DummyTest {
28
+
29
+    @Test
30
+    public void testNothing() {
31
+        assertTrue(true);
32
+    }
33
+
34
+}

+ 2
- 2
circle.yml View File

37
 
37
 
38
 test:
38
 test:
39
   override:
39
   override:
40
-    - ./gradlew --stacktrace --parallel client:jar client:test:
40
+    - ./gradlew --stacktrace --parallel client:jar client:tests:
41
         pwd:
41
         pwd:
42
           ../meta
42
           ../meta
43
   post:
43
   post:
44
-    - ./gradlew client:jacocoTestReport client:coveralls:
44
+    - ./gradlew client:sendCoverageToCodacy client:jacocoTestReport client:coveralls:
45
         pwd:
45
         pwd:
46
           ../meta
46
           ../meta
47
 
47
 

+ 18
- 23
gradle/analysis.gradle View File

1
 /*
1
 /*
2
- * Copyright (c) 2006-2015 DMDirc Developers
2
+ * Copyright (c) 2006-2017 DMDirc Developers
3
  *
3
  *
4
- * Permission is hereby granted, free of charge, to any person obtaining a copy
5
- * of this software and associated documentation files (the "Software"), to deal
6
- * in the Software without restriction, including without limitation the rights
7
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
- * copies of the Software, and to permit persons to whom the Software is
9
- * furnished to do so, subject to the following conditions:
4
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
5
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation the
6
+ * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to
7
+ * permit persons to whom the Software is furnished to do so, subject to the following conditions:
10
  *
8
  *
11
- * The above copyright notice and this permission notice shall be included in
12
- * all copies or substantial portions of the Software.
9
+ * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the
10
+ * Software.
13
  *
11
  *
14
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20
- * SOFTWARE.
12
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
13
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS
14
+ * OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
15
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21
  */
16
  */
22
 
17
 
18
+apply plugin: 'pmd'
23
 apply plugin: 'jacoco'
19
 apply plugin: 'jacoco'
24
 apply plugin: 'com.github.kt3k.coveralls'
20
 apply plugin: 'com.github.kt3k.coveralls'
25
 
21
 
22
+configurations {
23
+    codacy
24
+}
25
+
26
 dependencies {
26
 dependencies {
27
+    codacy 'com.codacy:codacy-coverage-reporter:1.0.13'
28
+
27
     pmd group: 'net.sourceforge.pmd', name: 'pmd-core', version: '5.2.3'
29
     pmd group: 'net.sourceforge.pmd', name: 'pmd-core', version: '5.2.3'
28
     pmd group: 'net.sourceforge.pmd', name: 'pmd-java', version: '5.2.3'
30
     pmd group: 'net.sourceforge.pmd', name: 'pmd-java', version: '5.2.3'
29
 }
31
 }
48
     ignoreFailures = true
50
     ignoreFailures = true
49
 }
51
 }
50
 
52
 
51
-jacocoTestReport {
52
-    reports {
53
-        xml.enabled = true // coveralls plugin depends on xml format report
54
-        html.enabled = true
55
-    }
56
-}
57
-

+ 70
- 0
gradle/codacy.gradle View File

1
+/*
2
+ * Copyright (c) 2006-2017 DMDirc Developers
3
+ *
4
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
5
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation the
6
+ * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to
7
+ * permit persons to whom the Software is furnished to do so, subject to the following conditions:
8
+ *
9
+ * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the
10
+ * Software.
11
+ *
12
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
13
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS
14
+ * OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
15
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
16
+ */
17
+
18
+def javaProjects() {
19
+    allprojects.findAll { project -> project.plugins.hasPlugin('java') }
20
+}
21
+
22
+FileTree getJacocoClassDirs(Set<Project> projects) {
23
+    def classDirs = fileTree(dir: "${buildDir}/classes/main")
24
+    projects.each {
25
+        classDirs += fileTree(dir: "${it.buildDir}/classes/main")
26
+    }
27
+    return classDirs
28
+}
29
+
30
+FileCollection getJacocoSrcDirs(Set<Project> projects) {
31
+    Set srcDirs = sourceSets.main.java.srcDirs
32
+    projects.each {
33
+        srcDirs.add(it.sourceSets.main.java.srcDirs)
34
+    }
35
+    return files(srcDirs)
36
+}
37
+
38
+subprojects.each { evaluationDependsOn it.path }
39
+
40
+afterEvaluate {
41
+    task tests(dependsOn: javaProjects()*.test)
42
+
43
+    task jacocoMerge(type: JacocoMerge) {
44
+        javaProjects().each {
45
+            subproject -> executionData subproject.test
46
+        }
47
+    }
48
+
49
+    task jacocoCombinedTestReport(type: JacocoReport, dependsOn: jacocoMerge) {
50
+        classDirectories = getJacocoClassDirs(javaProjects())
51
+        sourceDirectories = getJacocoSrcDirs(javaProjects())
52
+        executionData = files("${buildDir}/jacoco/jacocoMerge.exec")
53
+
54
+        reports {
55
+            xml.enabled = true // coveralls plugin depends on xml format report
56
+            html.enabled = true
57
+        }
58
+    }
59
+
60
+    task sendCoverageToCodacy(type: JavaExec, dependsOn: jacocoCombinedTestReport) {
61
+        main = "com.codacy.CodacyCoverageReporter"
62
+        classpath = configurations.codacy
63
+        args = [
64
+                "-l",
65
+                "Java",
66
+                "-r",
67
+                "${buildDir}/reports/jacoco/jacocoCombinedTestReport/jacocoCombinedTestReport.xml"
68
+        ]
69
+    }
70
+}

+ 11
- 16
gradle/fatjar.gradle View File

1
 /*
1
 /*
2
- * Copyright (c) 2006-2015 DMDirc Developers
2
+ * Copyright (c) 2006-2017 DMDirc Developers
3
  *
3
  *
4
- * Permission is hereby granted, free of charge, to any person obtaining a copy
5
- * of this software and associated documentation files (the "Software"), to deal
6
- * in the Software without restriction, including without limitation the rights
7
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
- * copies of the Software, and to permit persons to whom the Software is
9
- * furnished to do so, subject to the following conditions:
4
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
5
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation the
6
+ * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to
7
+ * permit persons to whom the Software is furnished to do so, subject to the following conditions:
10
  *
8
  *
11
- * The above copyright notice and this permission notice shall be included in
12
- * all copies or substantial portions of the Software.
9
+ * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the
10
+ * Software.
13
  *
11
  *
14
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20
- * SOFTWARE.
12
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
13
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS
14
+ * OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
15
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21
  */
16
  */
22
 
17
 
23
 configurations {
18
 configurations {

+ 11
- 16
gradle/jar.gradle View File

1
 /*
1
 /*
2
- * Copyright (c) 2006-2015 DMDirc Developers
2
+ * Copyright (c) 2006-2017 DMDirc Developers
3
  *
3
  *
4
- * Permission is hereby granted, free of charge, to any person obtaining a copy
5
- * of this software and associated documentation files (the "Software"), to deal
6
- * in the Software without restriction, including without limitation the rights
7
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
- * copies of the Software, and to permit persons to whom the Software is
9
- * furnished to do so, subject to the following conditions:
4
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
5
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation the
6
+ * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to
7
+ * permit persons to whom the Software is furnished to do so, subject to the following conditions:
10
  *
8
  *
11
- * The above copyright notice and this permission notice shall be included in
12
- * all copies or substantial portions of the Software.
9
+ * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the
10
+ * Software.
13
  *
11
  *
14
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20
- * SOFTWARE.
12
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
13
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS
14
+ * OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
15
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21
  */
16
  */
22
 
17
 
23
 task createVersionConfig {
18
 task createVersionConfig {

+ 11
- 16
gradle/publishing.gradle View File

1
 /*
1
 /*
2
- * Copyright (c) 2006-2015 DMDirc Developers
2
+ * Copyright (c) 2006-2017 DMDirc Developers
3
  *
3
  *
4
- * Permission is hereby granted, free of charge, to any person obtaining a copy
5
- * of this software and associated documentation files (the "Software"), to deal
6
- * in the Software without restriction, including without limitation the rights
7
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
- * copies of the Software, and to permit persons to whom the Software is
9
- * furnished to do so, subject to the following conditions:
4
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
5
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation the
6
+ * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to
7
+ * permit persons to whom the Software is furnished to do so, subject to the following conditions:
10
  *
8
  *
11
- * The above copyright notice and this permission notice shall be included in
12
- * all copies or substantial portions of the Software.
9
+ * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the
10
+ * Software.
13
  *
11
  *
14
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20
- * SOFTWARE.
12
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
13
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS
14
+ * OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
15
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21
  */
16
  */
22
 
17
 
23
 publishing {
18
 publishing {

Loading…
Cancel
Save