139 lines
3.6 KiB
Groovy
139 lines
3.6 KiB
Groovy
plugins {
|
|
id 'java-library'
|
|
alias catalog.plugins.kotlin.jvm
|
|
alias catalog.plugins.sambal
|
|
alias catalog.plugins.lombok
|
|
id 'maven-publish'
|
|
}
|
|
|
|
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
|
|
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
|
|
|
|
|
|
allprojects {
|
|
group = 'net.woggioni'
|
|
|
|
if(project.currentTag.isPresent()) {
|
|
version = project.currentTag
|
|
} else {
|
|
version = project.gitRevision.map { gitRevision ->
|
|
"${getProperty('gbcs.version')}.${gitRevision[0..10]}"
|
|
}
|
|
}
|
|
|
|
repositories {
|
|
maven {
|
|
url = getProperty('gitea.maven.url')
|
|
content {
|
|
includeModule 'net.woggioni', 'jwo'
|
|
includeModule 'net.woggioni', 'xmemcached'
|
|
includeGroup 'com.lys'
|
|
}
|
|
}
|
|
mavenCentral()
|
|
}
|
|
|
|
pluginManager.withPlugin('java-library') {
|
|
|
|
ext {
|
|
jpmsModuleName = project.group + '.' + project.name.replace('-', '.')
|
|
}
|
|
|
|
java {
|
|
withSourcesJar()
|
|
modularity.inferModulePath = true
|
|
toolchain {
|
|
languageVersion = JavaLanguageVersion.of(21)
|
|
vendor = JvmVendorSpec.ORACLE
|
|
}
|
|
}
|
|
|
|
test {
|
|
useJUnitPlatform()
|
|
}
|
|
|
|
tasks.withType(JavaCompile) {
|
|
modularity.inferModulePath = true
|
|
options.release = 21
|
|
}
|
|
|
|
tasks.named(JavaPlugin.COMPILE_JAVA_TASK_NAME, JavaCompile) {
|
|
options.compilerArgumentProviders << new CommandLineArgumentProvider() {
|
|
@Override
|
|
Iterable<String> asArguments() {
|
|
return ['--patch-module', project.jpmsModuleName + '=' + project.sourceSets.main.output.asPath]
|
|
}
|
|
}
|
|
options.javaModuleVersion = version
|
|
}
|
|
}
|
|
|
|
|
|
pluginManager.withPlugin(catalog.plugins.kotlin.jvm.get().pluginId) {
|
|
tasks.withType(KotlinCompile.class) {
|
|
compilerOptions.jvmTarget = JvmTarget.JVM_21
|
|
}
|
|
}
|
|
|
|
pluginManager.withPlugin(catalog.plugins.lombok.get().pluginId) {
|
|
lombok {
|
|
version = catalog.versions.lombok
|
|
}
|
|
}
|
|
|
|
pluginManager.withPlugin('maven-publish') {
|
|
|
|
publishing {
|
|
repositories {
|
|
maven {
|
|
name = "Gitea"
|
|
url = uri(getProperty('gitea.maven.url'))
|
|
|
|
credentials(HttpHeaderCredentials) {
|
|
name = "Authorization"
|
|
value = "token ${System.getenv()["PUBLISHER_TOKEN"]}"
|
|
}
|
|
|
|
authentication {
|
|
header(HttpHeaderAuthentication)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
tasks.withType(AbstractArchiveTask.class) {
|
|
archiveVersion = project.version
|
|
}
|
|
}
|
|
|
|
dependencies {
|
|
implementation catalog.jwo
|
|
implementation catalog.slf4j.api
|
|
implementation catalog.netty.codec.http
|
|
implementation catalog.netty.codec.http2
|
|
|
|
api project('gbcs-base')
|
|
api project('gbcs-api')
|
|
|
|
// runtimeOnly catalog.slf4j.jdk14
|
|
testRuntimeOnly catalog.logback.classic
|
|
|
|
testImplementation catalog.bcprov.jdk18on
|
|
testImplementation catalog.bcpkix.jdk18on
|
|
testImplementation catalog.junit.jupiter.api
|
|
testImplementation catalog.junit.jupiter.params
|
|
testRuntimeOnly catalog.junit.jupiter.engine
|
|
|
|
testRuntimeOnly project("gbcs-memcached")
|
|
}
|
|
|
|
publishing {
|
|
publications {
|
|
maven(MavenPublication) {
|
|
from(components["java"])
|
|
}
|
|
}
|
|
}
|
|
|