-
Notifications
You must be signed in to change notification settings - Fork 7
/
build.gradle.kts
131 lines (110 loc) · 3.33 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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
plugins {
id("com.gradle.plugin-publish") version "0.12.0"
`java-gradle-plugin`
idea
kotlin("jvm") version "1.3.72"
}
java {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile> {
kotlinOptions {
jvmTarget = "1.8"
apiVersion = "1.3"
languageVersion = "1.3"
}
}
val junitVersion by extra { "5.7.0" }
group = "com.github.edeandrea"
version = "1.7"
sourceSets {
create("intTest") {
compileClasspath += sourceSets.main.get().output
runtimeClasspath += sourceSets.main.get().output
}
}
val intTestImplementation by configurations.getting {
extendsFrom(configurations.implementation.get())
}
val intTestRuntimeOnly by configurations.getting {
extendsFrom(configurations.runtimeOnly.get())
}
gradlePlugin {
testSourceSets(sourceSets["intTest"])
plugins {
create("xjcPlugin") {
id = "com.github.edeandrea.xjc-generation"
implementationClass = "com.github.edeandrea.xjcplugin.plugin.XjcPlugin"
displayName = "XJC Generation Plugin"
description = "A Gradle Plugin for generating JAXB Java sources using the XJC compiler"
}
}
}
pluginBundle {
website = "http://github.com/edeandrea/xjc-generation-gradle-plugin"
vcsUrl = "http://github.com/edeandrea/xjc-generation-gradle-plugin"
tags = listOf("xjc", "jaxb")
}
idea {
project {
jdkName = "1.8"
}
module {
isDownloadJavadoc = true
isDownloadSources = true
testSourceDirs = testSourceDirs + sourceSets["intTest"].allSource.srcDirs
testResourceDirs = testResourceDirs + sourceSets["intTest"].resources.srcDirs
val testScope = scopes["TEST"]
if (testScope != null) {
testScope["plus"]?.add(configurations["intTestCompile"])
}
}
}
repositories {
mavenCentral()
}
dependencies {
implementation(gradleKotlinDsl())
implementation(kotlin("stdlib-jdk8"))
implementation(kotlin("reflect"))
testImplementation("org.assertj:assertj-core:3.18.1")
testImplementation(kotlin("test-junit5"))
testImplementation("org.junit.jupiter:junit-jupiter-api:$junitVersion")
testImplementation("org.junit.jupiter:junit-jupiter-params:$junitVersion")
testImplementation(kotlin("gradle-plugin"))
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:$junitVersion")
intTestImplementation("org.assertj:assertj-core:3.18.1")
intTestImplementation(kotlin("test-junit5"))
intTestImplementation(gradleTestKit())
intTestImplementation("org.junit.jupiter:junit-jupiter-api:$junitVersion")
intTestImplementation("org.junit.jupiter:junit-jupiter-params:$junitVersion")
intTestRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:$junitVersion")
}
task<Test>("integrationTest") {
description = "Runs integration tests"
group = "verification"
testClassesDirs = sourceSets["intTest"].output.classesDirs
classpath = sourceSets["intTest"].runtimeClasspath
shouldRunAfter("test")
afterEvaluate {
systemProperty("gradle.user.home", "$buildDir/tmp/TestKit")
systemProperty("gradleVersion", gradle.gradleVersion)
systemProperty("testKitGradlePropsFile", "$buildDir/tmp/testkit-gradle.properties")
}
}
tasks.check {
dependsOn("integrationTest")
}
tasks.withType<Test>().configureEach {
useJUnitPlatform()
testLogging {
showStandardStreams = true
setExceptionFormat("full")
showStackTraces = true
events("passed", "failed", "skipped")
}
reports {
junitXml.isOutputPerTestCase = true
}
}