-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathbuild.gradle.kts
More file actions
154 lines (130 loc) · 4.26 KB
/
Copy pathbuild.gradle.kts
File metadata and controls
154 lines (130 loc) · 4.26 KB
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
152
153
154
import ca.solostudios.nyx.util.codeMC
import ca.solostudios.nyx.util.reposiliteMaven
import ca.solostudios.nyx.util.soloStudios
import ca.solostudios.nyx.util.soloStudiosSnapshots
plugins {
`java-library`
`maven-publish`
alias(libs.plugins.nyx)
alias(libs.plugins.jmh)
alias(libs.plugins.axion.release)
}
nyx {
info {
name = "Seismic"
group = "com.dfsek"
module = "seismic"
version = scmVersion.version
description = """
Seismic is a Java sampler, math, type, and utility library.
""".trimIndent()
organizationName = "Polyhedral Development"
organizationUrl = "https://github.com/PolyhedralDev/"
repository.fromGithub("PolyhedralDev", "Seismic")
license.useLGPLv3()
developer {
id = "duplexsystem"
name = "Zoë Gidiere"
email = "duplexsys@protonmail.com"
url = "https://github.com/duplexsystem"
}
}
compile {
jvmTarget = 21
javadocJar = true
sourcesJar = true
allWarnings = true
distributeLicense = true
buildDependsOnJar = true
reproducibleBuilds = true
java {
allJavadocWarnings = true
noMissingJavadocWarnings = true
javadocWarningsAsErrors = true
compilerArgs.addAll(
listOf(
"-XDignore.symbol.file",
"-Xlint:-removal",
)
)
}
}
publishing {
withSignedPublishing()
repositories {
maven {
name = "Sonatype"
val repositoryId: String? by project
url = when {
repositoryId != null -> uri("https://s01.oss.sonatype.org/service/local/staging/deployByRepositoryId/$repositoryId/")
else -> uri("https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/")
}
credentials(PasswordCredentials::class)
}
maven("https://repo.codemc.io/repository/maven-releases/") {
name = "CodeMC"
credentials(PasswordCredentials::class)
}
reposiliteMaven("https://maven.solo-studios.ca/releases/") {
name = "SoloStudiosReleases"
credentials(PasswordCredentials::class)
}
reposiliteMaven("https://maven.solo-studios.ca/snapshots/") {
name = "SoloStudiosSnapshots"
credentials(PasswordCredentials::class)
}
}
}
}
repositories {
mavenLocal()
mavenCentral()
soloStudios()
soloStudiosSnapshots()
codeMC()
}
dependencies {
api(libs.jetbrains.annotations)
implementation(libs.slf4j.api)
jmh(libs.slf4j.simple)
jmh(libs.bundles.jmh)
jmhAnnotationProcessor(libs.jmh.generator.annprocess)
testImplementation(libs.junit.jupiter.api)
testImplementation(libs.junit.jupiter.params)
testRuntimeOnly(libs.junit.jupiter.engine)
testRuntimeOnly(libs.junit.platform.launcher)
testRuntimeOnly(libs.slf4j.simple)
}
tasks {
withType<JavaCompile>().configureEach {
options.isFork = true
options.isIncremental = true
}
withType<Test>().configureEach {
useJUnitPlatform()
maxHeapSize = "2G"
ignoreFailures = false
failFast = true
maxParallelForks = (Runtime.getRuntime().availableProcessors() - 1).coerceAtLeast(1)
}
withType<Jar>().configureEach {
dependsOn("dumpClasses")
from(layout.buildDirectory.dir("tmp/META-INF")) {
into("META-INF")
}
}
register("dumpClasses") {
dependsOn("compileJava")
val outputDir = layout.buildDirectory.dir("classes/java/main").get().asFile
val outputFile = layout.buildDirectory.file("tmp/META-INF/CLASS_MANIFEST_seismic").get().asFile
inputs.dir(outputDir)
outputs.file(outputFile)
doLast {
outputFile.printWriter().use { writer ->
fileTree(outputDir).matching { include("**/*.class") }.forEach {
writer.println(it.relativeTo(outputDir).path.replace("/", ".").removeSuffix(".class"))
}
}
}
}
}