-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathbuild.gradle.kts
105 lines (84 loc) · 3.07 KB
/
build.gradle.kts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
import org.gradle.kotlin.dsl.`kotlin-dsl`
import org.gradle.kotlin.dsl.repositories
import org.jetbrains.kotlin.gradle.plugin.KotlinSourceSet
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
import com.novoda.gradle.release.PublishExtension
plugins {
`kotlin-dsl`
id("jacoco")
}
buildscript {
repositories { jcenter() }
dependencies { classpath("com.novoda:bintray-release:0.8.1") }
}
apply(mapOf("plugin" to "com.novoda.bintray-release"))
repositories {
mavenCentral()
jcenter()
}
configurations.create("ktlint")
java.sourceSets {
"integrationTest" {
withConvention(KotlinSourceSet::class) {
kotlin.srcDirs("src/integration-test/kotlin")
}
}
}
val jUnitPlatformVersion = "5.1.0"
val kotlinVersion = "1.2.31"
val jUnitLauncherVersion = "1.1.0"
configurations.getByName("integrationTestCompile").extendsFrom(configurations.testCompile)
configurations.getByName("integrationTestRuntime").extendsFrom(configurations.testRuntime)
dependencies {
"ktlint"("com.github.shyiko:ktlint:0.20.0")
compile("org.junit.jupiter:junit-jupiter-api:$jUnitPlatformVersion")
compile("org.jetbrains.kotlin:kotlin-stdlib:$kotlinVersion")
testCompile("io.github.glytching:junit-extensions:1.1.0")
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:$jUnitPlatformVersion")
testRuntimeOnly("org.jetbrains.kotlin:kotlin-reflect:$kotlinVersion")
"integrationTestCompile"("org.junit.platform:junit-platform-launcher:$jUnitLauncherVersion")
"integrationTestCompile"(gradleTestKit())
"integrationTestCompile"(java.sourceSets["main"].output)
"integrationTestCompile"(java.sourceSets["test"].output)
"integrationTestRuntimeOnly"("org.junit.jupiter:junit-jupiter-engine:$jUnitPlatformVersion")
}
tasks.create("integrationTest", Test::class.java) {
shouldRunAfter("test")
dependsOn("jar")
testClassesDirs = java.sourceSets["integrationTest"].output.classesDirs
classpath = java.sourceSets["integrationTest"].runtimeClasspath
exclude("**/resources/**")
systemProperty("unroll.extension.lib.jar.path", "${project.buildDir.absolutePath}/libs/${project.name}.jar")
}
tasks.create("ktlint", JavaExec::class.java) {
tasks.getByName("check").dependsOn(this)
classpath = configurations.getByName("ktlint")
main = "com.github.shyiko.ktlint.Main"
args("src/main/**/*.kt")
}
tasks.withType<KotlinCompile>().all {
kotlinOptions {
jvmTarget = "1.8"
}
}
tasks.withType<Test>().all {
tasks.getByName("check").dependsOn(this)
useJUnitPlatform()
}
tasks.create("jacoco", JacocoReport::class.java) {
dependsOn("test")
reports {
html.isEnabled = true
}
classDirectories = files("$buildDir/classes/kotlin/main")
sourceDirectories = files("src/main/kotlin")
executionData = files("$buildDir/jacoco/test.exec")
}
configure<PublishExtension> {
userOrg = "blindpirate"
repoName = "com.github.blindpirate"
groupId = "com.github.blindpirate"
artifactId = "junit5-unroll-extension"
publishVersion = "0.1.2"
desc = "JUnit 5 Unroll Extension for Kotlin"
}