-
Notifications
You must be signed in to change notification settings - Fork 2
/
build.gradle
151 lines (122 loc) · 3.14 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
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
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
plugins {
id("java")
id("maven-publish")
// id("signing") // Gradle whines about some signing task's implicit dependency on a publication task.
id("net.auoeke.gronk").version("3.+")
id("com.github.johnrengelman.shadow").version("latest.release")
}
final testProject = file("test/project").toPath()
version("0.4.1")
description("a javac plugin that disables exception checking and other bothersome restrictions")
javaVersion(22)
allprojects {
group("net.auoeke")
repositories {
mavenCentral()
}
}
gronk {
export(sourceSets.main, com.sun.source.util.Plugin.class.module.packages.collect {"jdk.compiler/" + it})
}
sourceSets {
test {
java.srcDirs = [testProject.resolve("source")]
}
}
repositories {
mavenLocal()
}
dependencies {
annotationProcessor("net.auoeke:uncheck-dummy") // Must avoid a dependency cycle somehow.
implementation("net.auoeke:reflect")
testAnnotationProcessor(rootProject)
testImplementation(gradleTestKit())
testImplementation("org.junit.jupiter:junit-jupiter-api")
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine")
}
java {
withJavadocJar()
}
javadoc {
options.addBooleanOption("-enable-preview", true)
options.addBooleanOption("Xdoclint:none", true)
options.addStringOption("-source", java.sourceCompatibility.toString())
}
tasks.withType(JavaCompile) {
options.compilerArgs << "-Xlint:-preview"
}
tasks.withType(Jar) {
manifest.attributes("Automatic-Module-Name": "uncheck")
}
shadowJar {
// assemble.dependsOn(it)
archiveAppendix = archiveClassifier.get()
archiveClassifier = null
relocate("net.auoeke.reflect", "net.auoeke.uncheck.reflect")
relocate("net.auoeke.result", "net.auoeke.uncheck.result")
relocate("net.gudenau.lib.unsafe", "net.auoeke.uncheck.unsafe")
}
test {
dependsOn(publishToMavenLocal)
mustRunAfter(clean)
useJUnitPlatform()
}
components.java {
withVariantsFromConfiguration(configurations.shadowRuntimeElements) {
// Exclude the fat JAR from the main publication.
skip()
}
}
publishing {
repositories {
maven(testProject.resolve("build/repository")) {
name = "test"
}
return
maven(findProperty("maven.repository")) {
username(findProperty("maven.username"))
password(findProperty("maven.password"))
}
}
publications {
main(MavenPublication) {
from(components.java)
}
dummy(MavenPublication) {
from(components.java)
artifactId("$project.name-dummy")
}
return // Shadow uses an old ASM that rejects Java 22.
fat(MavenPublication) {
shadow.component(fat)
groupId(project.group)
artifactId("$project.name-" + shadowJar.archiveAppendix.get())
version(project.version)
artifact(sourcesJar)
artifact(javadocJar)
}
}
return
publications.withType(MavenPublication) {
pom {
url = "https://github.com/nnym/uncheck"
licenses {
license {
name = "MIT"
url = "https://opensource.org/licenses/MIT"
}
}
developers {
developer {
id = "nnym"
email = "[email protected]"
}
}
scm {
url = "https://github.com/nnym/uncheck/tree/master"
connection = "scm:git:git://github.com/nnym/uncheck.git"
developerConnection = "scm:git:git://github.com/nnym/uncheck.git"
}
}
}
}