|
1 | 1 | buildscript { |
2 | | - ext.kotlin_version = '1.2.21' |
3 | | - ext.spek_version = '1.1.5' |
4 | | - |
5 | | - repositories { |
6 | | - jcenter() |
7 | | - } |
8 | | - dependencies { |
9 | | - classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" |
10 | | - classpath "org.jetbrains.dokka:dokka-gradle-plugin:0.9.16" |
11 | | - classpath 'org.junit.platform:junit-platform-gradle-plugin:1.1.0' |
12 | | - } |
| 2 | + ext.kotlin_version = '1.2.21' |
| 3 | + ext.spek_version = '1.1.5' |
| 4 | + |
| 5 | + repositories { jcenter() } |
| 6 | + dependencies { |
| 7 | + classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" |
| 8 | + classpath "org.jetbrains.dokka:dokka-gradle-plugin:0.9.16" |
| 9 | + classpath 'org.junit.platform:junit-platform-gradle-plugin:1.1.0' |
| 10 | + } |
13 | 11 | } |
14 | 12 |
|
15 | 13 | plugins { |
16 | | - id 'java-library' |
17 | | - id 'jacoco' |
18 | | - id 'maven-publish' |
19 | | - id 'com.jfrog.bintray' version '1.8.0' |
20 | | - id 'org.shipkit.java' version '2.0.2' |
21 | | - id 'com.diffplug.gradle.spotless' version '3.10.0' |
22 | | - id 'com.github.ben-manes.versions' version '0.17.0' |
| 14 | + id 'java-library' |
| 15 | + id 'jacoco' |
| 16 | + id 'maven-publish' |
| 17 | + id 'groovy' |
| 18 | + id 'com.jfrog.bintray' version '1.8.0' |
| 19 | + id 'org.shipkit.java' version '2.0.2' |
| 20 | + id 'com.diffplug.gradle.spotless' version '3.10.0' |
| 21 | + id 'com.github.ben-manes.versions' version '0.17.0' |
23 | 22 | } |
24 | 23 |
|
25 | 24 | apply plugin: 'kotlin' |
26 | 25 | apply plugin: 'org.jetbrains.dokka' |
27 | | -apply plugin: 'org.junit.platform.gradle.plugin' |
28 | 26 |
|
29 | 27 | group 'com.github.magneticflux' |
30 | 28 |
|
31 | 29 | repositories { |
32 | | - jcenter() |
33 | | - maven { url 'http://dl.bintray.com/jetbrains/spek' } |
| 30 | + jcenter() |
| 31 | + maven { url 'http://dl.bintray.com/jetbrains/spek' } |
34 | 32 | } |
35 | 33 |
|
36 | | -junitPlatform { |
37 | | - filters { |
38 | | - engines { |
39 | | - include 'spek' |
40 | | - } |
41 | | - } |
| 34 | +test { |
| 35 | + useJUnitPlatform { includeEngines 'spek', 'junit-vintage' } |
42 | 36 | } |
43 | 37 |
|
44 | 38 | publishing { |
45 | | - publications { |
46 | | - myPublication(MavenPublication) { |
47 | | - from components.java |
48 | | - //noinspection GroovyAssignabilityCheck |
49 | | - artifact sourcesJar |
50 | | - //noinspection GroovyAssignabilityCheck |
51 | | - artifact dokkaJavadocJar |
52 | | - } |
53 | | - } |
| 39 | + publications { |
| 40 | + myPublication(MavenPublication) { |
| 41 | + from components.java |
| 42 | + //noinspection GroovyAssignabilityCheck |
| 43 | + artifact sourcesJar |
| 44 | + //noinspection GroovyAssignabilityCheck |
| 45 | + artifact dokkaJavadocJar |
| 46 | + } |
| 47 | + } |
54 | 48 | } |
55 | 49 |
|
56 | 50 | dokka { |
57 | | - outputFormat = 'javadoc' |
58 | | - jdkVersion = 7 |
59 | | - impliedPlatforms = ["JVM"] |
| 51 | + outputFormat = 'javadoc' |
| 52 | + jdkVersion = 7 |
| 53 | + impliedPlatforms = ["JVM"] |
60 | 54 | } |
61 | 55 |
|
62 | 56 | task dokkaJavadocJar(type: Jar, dependsOn: dokka) { |
63 | | - classifier = 'javadoc' |
64 | | - from dokka.outputDirectory |
| 57 | + classifier = 'javadoc' |
| 58 | + //noinspection GroovyAssignabilityCheck |
| 59 | + from dokka.outputDirectory |
65 | 60 | } |
66 | 61 |
|
67 | 62 | spotless { |
68 | | - kotlin { |
69 | | - ktlint('0.14.0') |
70 | | - } |
71 | | -} |
72 | | - |
73 | | -dependencies { |
74 | | - implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" |
| 63 | + kotlin { ktlint('0.15.1') } |
75 | 64 |
|
76 | | - api 'org.simpleframework:simple-xml:2.7.1' |
77 | | - api 'org.threeten:threetenbp:1.3.6' |
| 65 | + groovy { greclipse() } |
78 | 66 |
|
79 | | - testImplementation 'org.hamcrest:java-hamcrest:2.0.0.0' |
80 | | - testImplementation "org.jetbrains.spek:spek-api:$spek_version" |
81 | | - testImplementation "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version" |
82 | | - testRuntimeOnly "org.jetbrains.spek:spek-junit-platform-engine:$spek_version" |
| 67 | + groovyGradle { greclipse() } |
83 | 68 | } |
84 | 69 |
|
85 | | -jacoco { |
86 | | - applyTo junitPlatformTest |
87 | | -} |
88 | | - |
89 | | -junitPlatformTest { |
90 | | - jacoco { |
91 | | - destinationFile = file("$buildDir/jacoco/test.exec") |
92 | | - } |
| 70 | +dependencies { |
| 71 | + implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" |
| 72 | + |
| 73 | + api 'org.simpleframework:simple-xml:2.7.1' |
| 74 | + api 'org.threeten:threetenbp:1.3.6' |
| 75 | + |
| 76 | + // Tests |
| 77 | + testImplementation 'org.hamcrest:java-hamcrest:2.0.0.0' |
| 78 | + |
| 79 | + // Spock |
| 80 | + testImplementation 'org.codehaus.groovy:groovy-all:2.4.13' |
| 81 | + testImplementation "org.spockframework:spock-core:1.1-groovy-2.4" |
| 82 | + testImplementation 'org.junit.jupiter:junit-jupiter-api:5.1.0' |
| 83 | + testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.1.0' |
| 84 | + testRuntimeOnly 'org.junit.vintage:junit-vintage-engine:5.1.0' |
| 85 | + testCompileOnly 'junit:junit:4.12' |
| 86 | + |
| 87 | + // Spek |
| 88 | + testImplementation "org.jetbrains.spek:spek-api:$spek_version" |
| 89 | + testImplementation "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version" |
| 90 | + testRuntimeOnly "org.jetbrains.spek:spek-junit-platform-engine:$spek_version" |
93 | 91 | } |
94 | 92 |
|
95 | 93 | jacocoTestReport { |
96 | | - executionData junitPlatformTest |
97 | | - sourceSets sourceSets.main |
98 | | - dependsOn(junitPlatformTest) |
99 | | - |
100 | | - reports { |
101 | | - //noinspection GroovyAssignabilityCheck |
102 | | - xml { |
103 | | - enabled true |
104 | | - } |
105 | | - } |
| 94 | + sourceSets sourceSets.main |
| 95 | + dependsOn test |
| 96 | + |
| 97 | + reports { |
| 98 | + //noinspection GroovyAssignabilityCheck |
| 99 | + xml { enabled true } |
| 100 | + } |
106 | 101 | } |
107 | 102 | check.dependsOn(jacocoTestReport) |
0 commit comments