mirror of
https://github.com/hexedtech/codemp.git
synced 2024-11-21 14:54:49 +01:00
ci(java): try to use publications
This commit is contained in:
parent
2e583028a6
commit
5dcfd341d3
2 changed files with 42 additions and 8 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -28,6 +28,7 @@ dist/java/.gradle/
|
|||
dist/java/.project
|
||||
dist/java/.settings/
|
||||
dist/java/bin/
|
||||
dist/java/artifacts/
|
||||
|
||||
# intellij insists on creating the wrapper every time even if it's not strictly necessary
|
||||
dist/java/gradle/
|
||||
|
|
43
dist/java/build.gradle
vendored
43
dist/java/build.gradle
vendored
|
@ -52,6 +52,16 @@ tasks.register('linuxJar', Jar) {
|
|||
}
|
||||
}
|
||||
|
||||
tasks.register('multiplatformJar', Jar) {
|
||||
outputs.upToDateWhen { false }
|
||||
archiveClassifier = 'all'
|
||||
from sourceSets.main.runtimeClasspath
|
||||
from('artifacts') {
|
||||
include('*')
|
||||
into('natives/')
|
||||
}
|
||||
}
|
||||
|
||||
configurations {
|
||||
windowsJar {
|
||||
canBeConsumed = true
|
||||
|
@ -68,15 +78,27 @@ configurations {
|
|||
canBeResolved = false
|
||||
extendsFrom implementation, runtimeOnly
|
||||
}
|
||||
multiplatformJar {
|
||||
canBeConsumed = true
|
||||
canBeResolved = false
|
||||
extendsFrom implementation, runtimeOnly
|
||||
}
|
||||
}
|
||||
|
||||
java {
|
||||
sourceCompatibility = targetCompatibility = JavaVersion.VERSION_11
|
||||
artifacts {
|
||||
withSourcesJar()
|
||||
withJavadocJar()
|
||||
}
|
||||
|
||||
artifacts {
|
||||
archives jar
|
||||
archives sourcesJar
|
||||
archives javadocJar
|
||||
windowsJar(windowsJar)
|
||||
macosJar(macosJar)
|
||||
linuxJar(linuxJar)
|
||||
}
|
||||
multiplatformJar(multiplatformJar)
|
||||
}
|
||||
|
||||
repositories {
|
||||
|
@ -116,14 +138,25 @@ tasks.register('nativeBuild', Jar) {
|
|||
}
|
||||
}
|
||||
|
||||
publishing {
|
||||
publications {
|
||||
mavenJava(MavenPublication) {
|
||||
artifact jar
|
||||
artifact sourcesJar
|
||||
artifact javadocJar
|
||||
artifact windowsJar
|
||||
artifact linuxJar
|
||||
artifact macosJar
|
||||
artifact multiplatformJar
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
import com.vanniktech.maven.publish.SonatypeHost
|
||||
import com.vanniktech.maven.publish.JavaLibrary
|
||||
import com.vanniktech.maven.publish.JavadocJar
|
||||
mavenPublishing {
|
||||
publishToMavenCentral(SonatypeHost.CENTRAL_PORTAL) //, true) // TODO re-enable autopublish!
|
||||
signAllPublications()
|
||||
coordinates(project.group, rootProject.name, project.version)
|
||||
configure(new JavaLibrary(new JavadocJar.Javadoc(), true))
|
||||
|
||||
pom {
|
||||
name = rootProject.name
|
||||
|
|
Loading…
Reference in a new issue