84 lines
1.9 KiB
Groovy
84 lines
1.9 KiB
Groovy
plugins {
|
|
id 'maven-publish'
|
|
id 'jacoco'
|
|
alias catalog.plugins.multi.release.jar
|
|
alias catalog.plugins.envelope
|
|
alias catalog.plugins.graalvm.native.image
|
|
alias catalog.plugins.sambal
|
|
}
|
|
|
|
import net.woggioni.gradle.graalvm.NativeImageTask
|
|
import org.gradle.nativeplatform.platform.internal.DefaultNativePlatform
|
|
|
|
dependencies {
|
|
implementation catalog.jwo
|
|
implementation catalog.picocli
|
|
implementation catalog.slf4j.simple
|
|
implementation rootProject
|
|
implementation project(':wcfg')
|
|
}
|
|
|
|
application {
|
|
mainClass = 'net.woggioni.wson.cli.WsonCli'
|
|
mainModule = 'net.woggioni.wson.cli'
|
|
}
|
|
|
|
compileJava {
|
|
options.compilerArgs = [
|
|
"--patch-module",
|
|
"net.woggioni.wson.cli=${sourceSets.main.output.asPath}"
|
|
]
|
|
options.javaModuleMainClass = 'net.woggioni.wson.cli.MainKt'
|
|
options.javaModuleVersion = project.version
|
|
}
|
|
|
|
configureNativeImage {
|
|
// args = [
|
|
// 'wson',
|
|
// '-f',
|
|
// '../test-utils/src/main/resources/wordpress.json',
|
|
// '-t',
|
|
// 'jbon',
|
|
// '-o',
|
|
// '/dev/null'
|
|
// ]
|
|
|
|
args = [
|
|
'wcfg',
|
|
'-f',
|
|
'../wcfg/src/test/resources/build.wcfg',
|
|
'-t',
|
|
'jbon',
|
|
'-o',
|
|
'/dev/null'
|
|
]
|
|
|
|
mergeConfiguration = true
|
|
}
|
|
|
|
Provider<NativeImageTask> nativeImageTaskProvider = tasks.named("nativeImage") {
|
|
useMusl = true
|
|
buildStaticImage = true
|
|
}
|
|
|
|
tasks.named(BasePlugin.ASSEMBLE_TASK_NAME, Task) {
|
|
inputs.files(nativeImageTaskProvider)
|
|
}
|
|
|
|
artifacts {
|
|
archives nativeImageTaskProvider.map(NativeImageTask.&getOutputFile)
|
|
}
|
|
|
|
publishing {
|
|
publications {
|
|
myDistribution(MavenPublication) {
|
|
artifact envelopeJar
|
|
def host = DefaultNativePlatform.host()
|
|
artifact(
|
|
source: nativeImageTaskProvider,
|
|
classifier: host.operatingSystem.name + '-' + host.architecture.name
|
|
)
|
|
}
|
|
}
|
|
}
|