mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-03-26 22:49:01 +08:00
[android] Fix publishing to Maven Central
This commit is contained in:
parent
14d21f8409
commit
5de003cb8f
@ -71,6 +71,5 @@ dependencies {
|
|||||||
debugImplementation(libs.androidx.ui.test.manifest)
|
debugImplementation(libs.androidx.ui.test.manifest)
|
||||||
|
|
||||||
implementation(project(":spine-android"))
|
implementation(project(":spine-android"))
|
||||||
// Run `./gradlew publishToMavenLocal` in `spine-android` to use from local maven repo.
|
// implementation("com.esotericsoftware.spine:spine-android:4.2.2-SNAPSHOT")
|
||||||
// implementation("com.esotericsoftware:spine-android:4.2")
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -62,7 +62,7 @@ fun AnimationState(nav: NavHostController) {
|
|||||||
controller.skeleton.setScaleX(0.5f)
|
controller.skeleton.setScaleX(0.5f)
|
||||||
controller.skeleton.setScaleY(0.5f)
|
controller.skeleton.setScaleY(0.5f)
|
||||||
|
|
||||||
controller.skeleton.findSlot("gun")?.color = Color(1f, 0f, 0f, 1f)
|
controller.skeleton.findSlot("gun")?.color?.set(Color(1f, 0f, 0f, 1f))
|
||||||
|
|
||||||
controller.animationStateData.setDefaultMix(0.2f)
|
controller.animationStateData.setDefaultMix(0.2f)
|
||||||
controller.animationState.setAnimation(0, "walk", true).setListener(object : AnimationState.AnimationStateListener {
|
controller.animationState.setAnimation(0, "walk", true).setListener(object : AnimationState.AnimationStateListener {
|
||||||
|
|||||||
@ -24,11 +24,11 @@ dependencyResolutionManagement {
|
|||||||
}
|
}
|
||||||
|
|
||||||
rootProject.name = "Spine Android Examples"
|
rootProject.name = "Spine Android Examples"
|
||||||
includeBuild("../spine-libgdx") {
|
//includeBuild("../spine-libgdx") {
|
||||||
dependencySubstitution {
|
// dependencySubstitution {
|
||||||
substitute(module("com.esotericsoftware.spine:spine-libgdx")).using(project(":spine-libgdx"))
|
// substitute(module("com.esotericsoftware.spine:spine-libgdx")).using(project(":spine-libgdx"))
|
||||||
}
|
// }
|
||||||
}
|
//}
|
||||||
//includeBuild("../../libgdx") {
|
//includeBuild("../../libgdx") {
|
||||||
// dependencySubstitution {
|
// dependencySubstitution {
|
||||||
// substitute(module("com.badlogicgames.gdx:gdx")).using(project(":gdx"))
|
// substitute(module("com.badlogicgames.gdx:gdx")).using(project(":gdx"))
|
||||||
|
|||||||
@ -1,6 +1,7 @@
|
|||||||
plugins {
|
plugins {
|
||||||
alias(libs.plugins.androidLibrary)
|
alias(libs.plugins.androidLibrary)
|
||||||
`maven-publish`
|
`maven-publish`
|
||||||
|
signing
|
||||||
}
|
}
|
||||||
|
|
||||||
android {
|
android {
|
||||||
@ -39,16 +40,47 @@ dependencies {
|
|||||||
androidTestImplementation(libs.androidx.espresso.core)
|
androidTestImplementation(libs.androidx.espresso.core)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
val libraryVersion = "4.2.2-SNAPSHOT" // Update this as needed
|
||||||
|
|
||||||
|
tasks.register<Jar>("sourceJar") {
|
||||||
|
archiveClassifier.set("sources")
|
||||||
|
from(android.sourceSets["main"].java.srcDirs)
|
||||||
|
}
|
||||||
|
|
||||||
afterEvaluate {
|
afterEvaluate {
|
||||||
publishing {
|
publishing {
|
||||||
publications {
|
publications {
|
||||||
create<MavenPublication>("mavenLocal") {
|
create<MavenPublication>("release") {
|
||||||
groupId = "com.esotericsoftware"
|
|
||||||
artifactId = "spine-android"
|
|
||||||
version = "4.2"
|
|
||||||
artifact(tasks.getByName("bundleReleaseAar"))
|
artifact(tasks.getByName("bundleReleaseAar"))
|
||||||
|
artifact(tasks.getByName("sourceJar"))
|
||||||
|
|
||||||
|
groupId = "com.esotericsoftware.spine"
|
||||||
|
artifactId = "spine-android"
|
||||||
|
version = libraryVersion
|
||||||
|
|
||||||
pom {
|
pom {
|
||||||
|
packaging = "aar"
|
||||||
|
name.set("spine-android")
|
||||||
|
description.set("Spine Runtime for Android")
|
||||||
|
url.set("https://github.com/esotericsoftware/spine-runtimes")
|
||||||
|
licenses {
|
||||||
|
license {
|
||||||
|
name.set("Spine Runtimes License")
|
||||||
|
url.set("http://esotericsoftware.com/spine-runtimes-license")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
developers {
|
||||||
|
developer {
|
||||||
|
name.set("Esoteric Software")
|
||||||
|
email.set("contact@esotericsoftware.com")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
scm {
|
||||||
|
url.set(pom.url.get())
|
||||||
|
connection.set("scm:git:${url.get()}.git")
|
||||||
|
developerConnection.set("scm:git:${url.get()}.git")
|
||||||
|
}
|
||||||
|
|
||||||
withXml {
|
withXml {
|
||||||
val dependenciesNode = asNode().appendNode("dependencies")
|
val dependenciesNode = asNode().appendNode("dependencies")
|
||||||
configurations.api.get().dependencies.forEach { dependency ->
|
configurations.api.get().dependencies.forEach { dependency ->
|
||||||
@ -68,8 +100,30 @@ afterEvaluate {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
repositories {
|
||||||
|
maven {
|
||||||
|
name = "SonaType"
|
||||||
|
url = uri(if (libraryVersion.endsWith("-SNAPSHOT")) {
|
||||||
|
"https://oss.sonatype.org/content/repositories/snapshots"
|
||||||
|
} else {
|
||||||
|
"https://oss.sonatype.org/service/local/staging/deploy/maven2"
|
||||||
|
})
|
||||||
|
|
||||||
|
credentials {
|
||||||
|
username = project.findProperty("ossrhUsername") as String?
|
||||||
|
password = project.findProperty("ossrhPassword") as String?
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
signing {
|
||||||
|
useGpgCmd()
|
||||||
|
sign(publishing.publications["release"])
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user