mirror of
https://github.com/kiwix/kiwix-android.git
synced 2025-09-14 09:57:31 -04:00
#1175 update base apk name, introduce semantic versioning
This commit is contained in:
parent
1febfd14b2
commit
c2585c6827
@ -165,6 +165,25 @@ tasks.withType(Test) {
|
|||||||
jacoco.includeNoLocationClasses = true
|
jacoco.includeNoLocationClasses = true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
def branchName = System.getenv('TRAVIS_PULL_REQUEST') ?: "false" == "false"
|
||||||
|
? System.getenv('TRAVIS_BRANCH') ?: "local"
|
||||||
|
: System.getenv('TRAVIS_PULL_REQUEST_BRANCH')
|
||||||
|
def buildNumber = System.getenv('TRAVIS_BUILD_NUMBER') ?: "dev"
|
||||||
|
|
||||||
|
ext{
|
||||||
|
versionMajor = 2
|
||||||
|
versionMinor = 5
|
||||||
|
versionPatch = 0
|
||||||
|
}
|
||||||
|
|
||||||
|
private String generateVersionName() {
|
||||||
|
"${ext.versionMajor}.${ext.versionMinor}.${ext.versionPatch}"
|
||||||
|
}
|
||||||
|
|
||||||
|
private Integer generateVersionCode() {
|
||||||
|
200000 + (ext.versionMajor * 10000) + (ext.versionMinor * 100) + (ext.versionPatch)
|
||||||
|
}
|
||||||
|
|
||||||
android {
|
android {
|
||||||
compileSdkVersion 27
|
compileSdkVersion 27
|
||||||
|
|
||||||
@ -175,6 +194,7 @@ android {
|
|||||||
// See https://github.com/linkedin/dexmaker/issues/65 for why we need the following line.
|
// See https://github.com/linkedin/dexmaker/issues/65 for why we need the following line.
|
||||||
testInstrumentationRunnerArguments.notClass = 'com.android.dex.DexIndexOverflowException'
|
testInstrumentationRunnerArguments.notClass = 'com.android.dex.DexIndexOverflowException'
|
||||||
vectorDrawables.useSupportLibrary = true
|
vectorDrawables.useSupportLibrary = true
|
||||||
|
archivesBaseName = "${branchName.replace('/', '-')}-$buildNumber"
|
||||||
}
|
}
|
||||||
|
|
||||||
aaptOptions {
|
aaptOptions {
|
||||||
@ -201,13 +221,12 @@ android {
|
|||||||
// All the usual Gradle options.
|
// All the usual Gradle options.
|
||||||
testLogging {
|
testLogging {
|
||||||
events "passed", "skipped", "failed", "standardOut", "standardError"
|
events "passed", "skipped", "failed", "standardOut", "standardError"
|
||||||
outputs.upToDateWhen {false}
|
outputs.upToDateWhen { false }
|
||||||
showStandardStreams = true
|
showStandardStreams = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
flavorDimensions "default"
|
flavorDimensions "default"
|
||||||
|
|
||||||
signingConfigs {
|
signingConfigs {
|
||||||
@ -265,12 +284,12 @@ android {
|
|||||||
def version_code = project.property('version_code')
|
def version_code = project.property('version_code')
|
||||||
versionCode version_code.toInteger()
|
versionCode version_code.toInteger()
|
||||||
} else {
|
} else {
|
||||||
versionCode 56
|
versionCode generateVersionCode()
|
||||||
}
|
}
|
||||||
if (project.hasProperty('version_name')) {
|
if (project.hasProperty('version_name')) {
|
||||||
versionName project.property('version_name')
|
versionName project.property('version_name')
|
||||||
} else {
|
} else {
|
||||||
versionName "2.5"
|
versionName generateVersionName()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -406,20 +425,12 @@ android {
|
|||||||
}
|
}
|
||||||
|
|
||||||
play {
|
play {
|
||||||
enabled = getCurrentBranchName() == "master"
|
enabled = branchName == "master"
|
||||||
serviceAccountCredentials = file("../google.json")
|
serviceAccountCredentials = file("../google.json")
|
||||||
track = "alpha"
|
track = "alpha"
|
||||||
resolutionStrategy = "fail"
|
resolutionStrategy = "fail"
|
||||||
}
|
}
|
||||||
|
|
||||||
private static String getCurrentBranchName() {
|
|
||||||
if (System.getenv('TRAVIS_PULL_REQUEST')!="false") System.getenv('TRAVIS_PULL_REQUEST_BRANCH')
|
|
||||||
else System.getenv('TRAVIS_BRANCH') ?: "local"
|
|
||||||
}
|
|
||||||
|
|
||||||
// Testdroid deployment configuration
|
|
||||||
def buildNumber = System.getenv('TRAVIS_BUILD_NUMBER')
|
|
||||||
|
|
||||||
def findJar(prefix) {
|
def findJar(prefix) {
|
||||||
configurations.runtime.filter { it.name.startsWith(prefix) }
|
configurations.runtime.filter { it.name.startsWith(prefix) }
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user