114 lines
2.8 KiB
Groovy
114 lines
2.8 KiB
Groovy
plugins {
|
|
id 'java-library'
|
|
id 'maven-publish'
|
|
alias(catalog.plugins.multi.release.jar)
|
|
alias(catalog.plugins.lombok)
|
|
alias(catalog.plugins.sambal)
|
|
}
|
|
|
|
allprojects {
|
|
group = "net.woggioni"
|
|
version = getProperty('jwo.version')
|
|
|
|
repositories {
|
|
maven {
|
|
url = 'https://woggioni.net/mvn/'
|
|
}
|
|
mavenCentral()
|
|
}
|
|
|
|
pluginManager.withPlugin('java-library') {
|
|
|
|
java {
|
|
|
|
toolchain {
|
|
languageVersion = JavaLanguageVersion.of(17)
|
|
vendor = JvmVendorSpec.GRAAL_VM
|
|
}
|
|
}
|
|
|
|
dependencies {
|
|
testImplementation catalog.junit.jupiter.api
|
|
testImplementation catalog.junit.jupiter.params
|
|
testRuntimeOnly catalog.junit.jupiter.engine
|
|
}
|
|
|
|
test {
|
|
useJUnitPlatform()
|
|
}
|
|
}
|
|
|
|
pluginManager.withPlugin(catalog.plugins.lombok.get().pluginId) {
|
|
lombok {
|
|
version = catalog.versions.lombok.get()
|
|
}
|
|
}
|
|
|
|
pluginManager.withPlugin('maven-publish') {
|
|
|
|
pluginManager.withPlugin('java-library') {
|
|
java {
|
|
withJavadocJar()
|
|
withSourcesJar()
|
|
}
|
|
}
|
|
|
|
publishing {
|
|
repositories {
|
|
maven {
|
|
url = 'https://mvn.woggioni.net/'
|
|
}
|
|
}
|
|
publications {
|
|
maven(MavenPublication) {
|
|
from(components["java"])
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
ext {
|
|
setProperty('jpms.module.name', 'net.woggioni.jwo')
|
|
}
|
|
|
|
|
|
configurations {
|
|
pathClassloaderTest
|
|
}
|
|
|
|
dependencies {
|
|
implementation catalog.slf4j.api
|
|
pathClassloaderTest group: 'com.google.inject', name: 'guice', version: getProperty('guice.version')
|
|
}
|
|
|
|
compileJava {
|
|
options.release = 8
|
|
options.compilerArgs << '-parameters'
|
|
}
|
|
|
|
TaskProvider<Zip> pathClassLoaderTestBundleTask = tasks.register("pathClassLoaderTestBundle", Zip) {
|
|
from(configurations.pathClassloaderTest)
|
|
archiveBaseName = "pathClassLoaderTestBundle"
|
|
}
|
|
|
|
test {
|
|
inputs.files(pathClassLoaderTestBundleTask)
|
|
useJUnitPlatform()
|
|
File junitJupiterEngineJar = configurations.getByName(JavaPlugin.TEST_RUNTIME_CLASSPATH_CONFIGURATION_NAME)
|
|
.resolvedConfiguration.resolvedArtifacts.grep { ResolvedArtifact resolvedArtifact ->
|
|
ModuleVersionIdentifier id = resolvedArtifact.moduleVersion.id
|
|
id.group == 'org.junit.jupiter' && id.name == 'junit-jupiter-engine'
|
|
}.collect {
|
|
ResolvedArtifact resolvedArtifact -> resolvedArtifact.file
|
|
}.first()
|
|
systemProperties([
|
|
'junit.jupiter.engine.jar' : junitJupiterEngineJar.toString(),
|
|
'path.classloader.test.bundle' : pathClassLoaderTestBundleTask.get().outputs.files.singleFile
|
|
])
|
|
|
|
jvmArgs(['--add-opens', 'java.base/sun.nio.fs=ALL-UNNAMED'])
|
|
}
|
|
|
|
|