-
Notifications
You must be signed in to change notification settings - Fork 6
/
build.gradle
99 lines (87 loc) · 2.65 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
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
plugins {
id 'java'
id 'maven-publish'
id 'org.jetbrains.gradle.plugin.idea-ext' version '1.1.7'
}
group 'zone.rong'
version '2.1'
java {
withSourcesJar()
withJavadocJar()
}
tasks.withType(Javadoc).configureEach {
options {
quiet()
setEncoding 'UTF-8'
setSource '11'
addMultilineStringsOption('-add-exports').setValue(['java.base/jdk.internal.reflect=ALL-UNNAMED'])
}
}
tasks.withType(JavaCompile).configureEach {
it.javaCompiler = javaToolchains.compilerFor { JavaToolchainSpec toolchain ->
toolchain.languageVersion = JavaLanguageVersion.of(11)
toolchain.vendor = JvmVendorSpec.AZUL
}
options.compilerArgs += ['--add-exports=java.base/jdk.internal.reflect=ALL-UNNAMED']
}
idea.project.settings.compiler.javac.javacAdditionalOptions = compileJava.options.compilerArgs.join(' ')
repositories {
mavenCentral()
}
dependencies {
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.8.1'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.8.1'
}
test {
enabled = false
finalizedBy 'testVendorsAndVersions'
}
def testVendorsAndVersions = tasks.register('testVendorsAndVersions') {
group 'verification'
}
def targetVendors = [
(JvmVendorSpec.AZUL): ["Azul", 11, 17, 21],
(JvmVendorSpec.BELLSOFT): ["Bellsoft", 11, 17, 21],
(JvmVendorSpec.GRAAL_VM): ["Graal", 11, 17, 21],
(JvmVendorSpec.IBM): ["OpenJ9", 11, 17, 21],
(JvmVendorSpec.MICROSOFT): ["Microsoft", 11, 17, 21],
]
targetVendors.each { spec, info ->
for (int i = 1; i < info.size(); i++) {
Integer javaVersion = info[i]
def testTask = tasks.register("test${info[0]}_${javaVersion}", Test) { Test test ->
group 'verification'
test.javaLauncher = javaToolchains.launcherFor { JavaToolchainSpec toolchain ->
toolchain.languageVersion = JavaLanguageVersion.of(javaVersion)
toolchain.vendor = spec
}
test.useJUnitPlatform()
if (javaVersion < 17) {
test.jvmArgs '--illegal-access=deny'
}
}
testVendorsAndVersions.configure {
dependsOn testTask
}
}
}
publishing {
publications {
mavenJava(MavenPublication) {
from components.java
sourcesJar
javadocJar
artifactId = 'imaginebreaker'
}
}
repositories {
maven {
name = 'CleanroomMaven'
url = CleanroomMaven
credentials(PasswordCredentials)
authentication {
basic(BasicAuthentication)
}
}
}
}