-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
83 lines (66 loc) · 2.18 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
plugins {
id("java")
id("com.github.johnrengelman.shadow") version "8.1.1"
if (JavaVersion.current().isJava11Compatible) {
id("com.diffplug.spotless") version "6.25.0"
}
else {
id("com.diffplug.spotless") version "6.13.0"
}
}
group = "org.komamitsu"
version = "1.4.0"
repositories {
mavenCentral()
}
dependencies {
implementation("net.bytebuddy:byte-buddy:1.14.12")
testImplementation("org.junit.jupiter:junit-jupiter-api:5.8.1")
testImplementation("org.junit.jupiter:junit-jupiter-params:5.8.1")
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:5.8.1")
testImplementation("org.mockito:mockito-core:4.11.0")
testImplementation("org.mockito:mockito-junit-jupiter:4.11.0")
}
tasks.getByName<Test>("test") {
useJUnitPlatform()
}
tasks.jar {
manifest {
attributes(mapOf("Premain-Class" to "org.komamitsu.chaosdukey.Agent"))
}
}
spotless {
java {
target("src/*/java/**/*.java")
importOrder()
removeUnusedImports()
googleJavaFormat()
}
}
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
configurations["intTestRuntimeOnly"].extendsFrom(configurations.runtimeOnly.get())
dependencies {
intTestImplementation("org.junit.jupiter:junit-jupiter:5.8.1")
intTestRuntimeOnly("org.junit.platform:junit-platform-launcher")
}
val integrationTest = task<Test>("integrationTest") {
description = "Runs integration tests."
group = "verification"
testClassesDirs = sourceSets["intTest"].output.classesDirs
classpath = sourceSets["intTest"].runtimeClasspath
dependsOn("shadowJar")
useJUnitPlatform()
val configFile = project.layout.buildDirectory.dir("resources").get()
.dir("intTest").file("chaos-dukey.properties").asFile.absoluteFile
jvmArgs("-javaagent:build/libs/${project.name}-${project.version}-all.jar=configFile=${configFile}")
}
tasks.check { dependsOn(integrationTest) }