123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149 |
- // JReleaser config for release builds to Central Portal
- if (project.hasProperty('RELEASE')) {
- apply plugin: 'org.jreleaser'
- jreleaser {
- deploy {
- maven {
- mavenCentral {
- sonatype {
- active = 'ALWAYS'
- username = getRepositoryUsername()
- password = getRepositoryPassword()
- url = 'https://central.sonatype.com/api/v1/publisher'
- stagingRepository("${buildDir}/staging-deploy")
- sign = false
- verifyPom = false
- }
- }
- }
- }
- }
- }
- project("spine-libgdx") {
- apply plugin: "java-library"
- apply plugin: "maven-publish"
- apply plugin: "signing"
- dependencies {
- implementation "com.badlogicgames.gdx:gdx:$libgdxVersion"
- }
- tasks.register("sourceJar", Jar) {
- archiveClassifier.set("sources")
- from(sourceSets.main.allJava)
- }
- tasks.javadoc {
- failOnError = false
- options.addStringOption('Xdoclint:none', '-quiet')
- }
- tasks.register("javadocJar", Jar) {
- dependsOn javadoc
- archiveClassifier.set("javadoc")
- from(javadoc.destinationDir)
- }
- afterEvaluate {
- publishing {
- publications {
- create("release", MavenPublication) {
- from(components.java)
- artifact(tasks.getByName("sourceJar"))
- artifact(tasks.getByName("javadocJar"))
- groupId = "com.esotericsoftware.spine"
- artifactId = "spine-libgdx"
- version = project.version
- pom {
- packaging = "jar"
- name = POM_NAME
- if(!POM_DESCRIPTION.isEmpty())
- description = POM_DESCRIPTION
- url = POM_URL
- licenses {
- license {
- name = POM_LICENCE_NAME
- url = POM_LICENCE_URL
- distribution = POM_LICENCE_DIST
- }
- }
- developers {
- developer {
- name.set("Esoteric Software")
- email.set("[email protected]")
- }
- }
- scm {
- connection = POM_SCM_CONNECTION
- developerConnection = POM_SCM_DEV_CONNECTION
- url = POM_SCM_URL
- }
- }
- }
- }
- repositories {
- maven {
- name = "SonaType"
- url = project.version.endsWith("-SNAPSHOT")
- ? getSnapshotRepositoryUrl()
- // If release build, dump artifacts to root project build/staging-deploy folder for consumption by jreleaser
- : rootProject.layout.buildDirectory.dir('staging-deploy')
- if (project.version.endsWith("-SNAPSHOT") && (getRepositoryUsername() || getRepositoryPassword())) {
- credentials {
- username = getRepositoryUsername()
- password = getRepositoryPassword()
- }
- }
- }
- }
- }
- signing {
- useGpgCmd()
- sign(publishing.publications["release"])
- }
- // Simply using "required" in signing block doesn't work because taskGraph isn't ready yet.
- gradle.taskGraph.whenReady {
- tasks.withType(Sign) {
- onlyIf { !project.version.endsWith("-SNAPSHOT") }
- }
- }
- }
- }
- // JReleaser config for release builds to Central Portal
- if (project.hasProperty('RELEASE')) {
- apply plugin: 'org.jreleaser'
- jreleaser {
- deploy {
- maven {
- mavenCentral {
- sonatype {
- active = 'ALWAYS'
- username = getRepositoryUsername()
- password = getRepositoryPassword()
- url = 'https://central.sonatype.com/api/v1/publisher'
- stagingRepository("${rootProject.buildDir}/staging-deploy")
- sign = false
- verifyPom = false
- }
- }
- }
- }
- }
- // For release builds, create a task that depends on publishing and finalizes with jreleaser
- tasks.register('publishRelease') {
- dependsOn tasks.withType(PublishToMavenRepository)
- finalizedBy tasks.named('jreleaserDeploy')
- }
- }
|