-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
55 lines (49 loc) · 1.82 KB
/
build.gradle
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
plugins {
id 'java-gradle-plugin'
id 'com.gradle.plugin-publish' version '1.2.1'
}
version = '0.6'
group = 'com.github.iherasymenko.jlink'
dependencies {
testImplementation 'org.assertj:assertj-core:3.24.2'
testImplementation 'org.junit.jupiter:junit-jupiter:5.10.1'
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
}
gradlePlugin {
website = 'https://github.com/iherasymenko/jlink-gradle-plugin'
vcsUrl = 'https://github.com/iherasymenko/jlink-gradle-plugin'
plugins {
jlink {
displayName = 'jlink'
id = 'com.github.iherasymenko.jlink'
implementationClass = 'com.github.iherasymenko.jlink.JlinkApplicationPlugin'
description = 'This plugins adds jlink integration to your Gradle builds. As simple as that.'
tags.set(['java', 'jlink', 'jigsaw', 'modularity'])
}
}
}
tasks.named('compileJava', JavaCompile).configure { task ->
task.options.release.set(11)
}
tasks.named('compileTestJava', JavaCompile).configure { task ->
task.options.release.set(21)
}
tasks.withType(Test).configureEach { task ->
task.useJUnitPlatform()
// Required to test configuration cache in tests when using withDebug()
// https://github.com/gradle/gradle/issues/22765#issuecomment-1339427241
task.doFirst { it ->
if (it.jvmArgs.find { arg -> arg.startsWith('-agentlib:jdwp=') }) {
it.jvmArgs += [
"--add-opens",
"java.base/java.util=ALL-UNNAMED",
"--add-opens",
"java.base/java.util.concurrent.atomic=ALL-UNNAMED",
"--add-opens",
"java.base/java.lang.invoke=ALL-UNNAMED",
"--add-opens",
"java.base/java.net=ALL-UNNAMED",
]
}
}
}