ci(java): produce artifact with no classifier without native

This commit is contained in:
zaaarf 2024-09-18 14:11:02 +02:00
parent 3e68897f5f
commit 062f10b68a
No known key found for this signature in database
GPG key ID: C91CFF9E2262BBA1

View file

@ -31,11 +31,9 @@ dependencies {
annotationProcessor 'org.projectlombok:lombok:1.18.34' annotationProcessor 'org.projectlombok:lombok:1.18.34'
} }
shadowJar { tasks.register('cargoBuild', Exec) {
jar.archiveClassifier = archiveClassifier = osdetector.classifier workingDir '.'
dependencies { commandLine 'cargo', 'build', '--release', '--features=java'
include(dependency('com.github.adamheinrich:native-utils:master-SNAPSHOT'))
}
} }
def rustDir = projectDir.toPath() def rustDir = projectDir.toPath()
@ -44,8 +42,8 @@ def rustDir = projectDir.toPath()
.resolve('target') .resolve('target')
.resolve('release') .resolve('release')
.toFile() .toFile()
shadowJar {
processResources { dependsOn cargoBuild
outputs.upToDateWhen { false } // no caching outputs.upToDateWhen { false } // no caching
from(rustDir) { from(rustDir) {
include('*.dll') include('*.dll')
@ -53,17 +51,15 @@ processResources {
include('*dylib') include('*dylib')
into('natives/') into('natives/')
} }
archiveClassifier = osdetector.classifier
dependencies {
include(dependency('com.github.adamheinrich:native-utils:master-SNAPSHOT'))
}
} }
tasks.register('cargoBuild', Exec) {
workingDir '.'
commandLine 'cargo', 'build', '--release', '--features=java'
}
processResources.dependsOn cargoBuild
build.finalizedBy shadowJar build.finalizedBy shadowJar
mavenPublishing { mavenPublishing {
//publishToMavenCentral(SonatypeHost.S01) // for snapshots //publishToMavenCentral(SonatypeHost.S01) // for snapshots
publishToMavenCentral(SonatypeHost.CENTRAL_PORTAL) // central repository publishToMavenCentral(SonatypeHost.CENTRAL_PORTAL) // central repository