build: properly release snapshots vs releases
@@ -31,7 +31,6 @@ plugins {
apply from: 'gradle/functions.gradle'
-group = 'org.apktool'
version = '2.5.1'
def suffix = 'SNAPSHOT'
@@ -69,7 +68,7 @@ allprojects {
gradle.startParameter.excludedTaskNames += "licenseTest"
}
-def apktoolVersion = 'unspecified'
+def mavenVersion = 'unspecified'
if (!('release' in gradle.startParameter.taskNames)) {
def hash = getCheckedOutGitCommitHash()
@@ -80,7 +79,7 @@ if (!('release' in gradle.startParameter.taskNames)) {
} else {
project.ext.set("hash", hash)
project.ext.set("apktool_version", version + "-" + hash + "-SNAPSHOT")
- apktoolVersion = version + "-dev"
+ mavenVersion = version + "-SNAPSHOT"
println "Building SNAPSHOT (" + getCheckedOutBranch() + "): " + hash
}
} else {
@@ -90,7 +89,7 @@ if (!('release' in gradle.startParameter.taskNames)) {
} else {
project.ext.set("apktool_version", version)
}
- apktoolVersion = version
+ mavenVersion = version
println "Building RELEASE (" + getCheckedOutBranch() + "): " + project.ext.apktool_version
}
@@ -150,19 +149,13 @@ subprojects {
publishing {
publications {
- mavenJava(MavenPublication) {
- groupId = group
- artifactId = project.name
- version = apktoolVersion
+ maven(MavenPublication) {
+ from components.java
+
+ groupId = 'org.apktool'
+ artifactId = 'apktool-lib'
+ version = mavenVersion
- versionMapping {
- usage('java-api') {
- fromResolutionOf('runtimeClasspath')
- }
- usage('java-runtime') {
- fromResolutionResult()
- }
- }
pom {
name = 'Apktool'
description = 'A tool for reverse engineering Android apk files.'
@@ -189,7 +182,7 @@ subprojects {
scm {
connection = 'scm:git:git://github.com/iBotPeaches/Apktool.git'
developerConnection = 'scm:git:git@github.com:iBotPeaches/Apktool.git'
- url = 'https://ibotpeaches.github.io/Apktool'
+ url = 'https://github.com/iBotPeaches/Apktool'
}
}
}
@@ -197,7 +190,11 @@ subprojects {
if (rootProject.hasProperty('ossrhUsername') && rootProject.hasProperty('ossrhPassword')) {
repositories {
maven {
+ if (mavenVersion.endsWith('-SNAPSHOT')) {
+ url = 'https://s01.oss.sonatype.org/content/repositories/snapshots/'
+ } else {
url = 'https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/'
+ }
credentials {
username ossrhUsername
password ossrhPassword
@@ -209,7 +206,7 @@ subprojects {
signing {
required { gradle.taskGraph.hasTask('publish') }
- sign(publishing.publications["mavenJava"])
+ sign(publishing.publications["maven"])
}
java {
