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/.project
|
||||||
dist/java/.settings/
|
dist/java/.settings/
|
||||||
dist/java/bin/
|
dist/java/bin/
|
||||||
|
dist/java/artifacts/
|
||||||
|
|
||||||
# intellij insists on creating the wrapper every time even if it's not strictly necessary
|
# intellij insists on creating the wrapper every time even if it's not strictly necessary
|
||||||
dist/java/gradle/
|
dist/java/gradle/
|
||||||
|
|
49
dist/java/build.gradle
vendored
49
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 {
|
configurations {
|
||||||
windowsJar {
|
windowsJar {
|
||||||
canBeConsumed = true
|
canBeConsumed = true
|
||||||
|
@ -68,15 +78,27 @@ configurations {
|
||||||
canBeResolved = false
|
canBeResolved = false
|
||||||
extendsFrom implementation, runtimeOnly
|
extendsFrom implementation, runtimeOnly
|
||||||
}
|
}
|
||||||
|
multiplatformJar {
|
||||||
|
canBeConsumed = true
|
||||||
|
canBeResolved = false
|
||||||
|
extendsFrom implementation, runtimeOnly
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
java {
|
java {
|
||||||
sourceCompatibility = targetCompatibility = JavaVersion.VERSION_11
|
sourceCompatibility = targetCompatibility = JavaVersion.VERSION_11
|
||||||
artifacts {
|
withSourcesJar()
|
||||||
windowsJar(windowsJar)
|
withJavadocJar()
|
||||||
macosJar(macosJar)
|
}
|
||||||
linuxJar(linuxJar)
|
|
||||||
}
|
artifacts {
|
||||||
|
archives jar
|
||||||
|
archives sourcesJar
|
||||||
|
archives javadocJar
|
||||||
|
windowsJar(windowsJar)
|
||||||
|
macosJar(macosJar)
|
||||||
|
linuxJar(linuxJar)
|
||||||
|
multiplatformJar(multiplatformJar)
|
||||||
}
|
}
|
||||||
|
|
||||||
repositories {
|
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.SonatypeHost
|
||||||
import com.vanniktech.maven.publish.JavaLibrary
|
|
||||||
import com.vanniktech.maven.publish.JavadocJar
|
|
||||||
mavenPublishing {
|
mavenPublishing {
|
||||||
publishToMavenCentral(SonatypeHost.CENTRAL_PORTAL) //, true) // TODO re-enable autopublish!
|
publishToMavenCentral(SonatypeHost.CENTRAL_PORTAL) //, true) // TODO re-enable autopublish!
|
||||||
signAllPublications()
|
signAllPublications()
|
||||||
coordinates(project.group, rootProject.name, project.version)
|
coordinates(project.group, rootProject.name, project.version)
|
||||||
configure(new JavaLibrary(new JavadocJar.Javadoc(), true))
|
|
||||||
|
|
||||||
pom {
|
pom {
|
||||||
name = rootProject.name
|
name = rootProject.name
|
||||||
|
|
Loading…
Reference in a new issue