1
0
mirror of https://codeberg.org/Freeyourgadget/Gadgetbridge synced 2024-06-06 13:17:59 +02:00

Add nightly release setup

This commit is contained in:
vanous 2022-01-27 18:00:22 +01:00 committed by Gitea
parent b62357dfe2
commit 1e6cde6790
5 changed files with 77 additions and 4 deletions

View File

@ -5,9 +5,9 @@ pipeline:
- pwd #bump
- ./gradlew assembleDebug --stacktrace
when:
repo: Freeyourgadget/Gadgetbridge
branch: master
#this doesn't work yet:
#https://github.com/woodpecker-ci/woodpecker/issues/687
#when:
#repo: Freeyourgadget/Gadgetbridge
#branch: master

View File

@ -14,6 +14,18 @@ tasks.withType(Test) {
systemProperty "logback.configurationFile", System.getProperty("user.dir", null) + "/app/src/main/assets/logback.xml"
systemProperty "GB_LOGFILES_DIR", Files.createTempDirectory("gblog").toString()
}
def getVersionCode = { ->
try {
def stdout = new ByteArrayOutputStream()
exec {
commandLine 'git', 'rev-list', 'HEAD', '--count'
standardOutput = stdout
}
return Integer.valueOf(stdout.toString().trim())
} catch (ignored) {
return null
}
}
def getGitHashShort = { ->
try {
@ -49,12 +61,65 @@ android {
vectorDrawables.useSupportLibrary = true
multiDexEnabled true
buildConfigField "String", "GIT_HASH_SHORT", "\"${getGitHashShort()}\""
resValue "string", "pebble_content_provider", "com.getpebble.android.provider"
}
signingConfigs {
nightly {
if (System.getProperty("nightly_store_file") != null) {
storeFile file(System.getProperty("nightly_store_file"))
storePassword System.getProperty("nightly_store_password")
keyAlias System.getProperty("nightly_key_alias")
keyPassword System.getProperty("nightly_key_password")
}
}
}
buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
resValue "string", "pebble_content_provider", "com.getpebble.android.provider"
}
nightly {
applicationIdSuffix ".nightly"
versionNameSuffix "-${getGitHashShort}"
minifyEnabled true
if (System.getProperty("nightly_store_file") != null) {
signingConfig signingConfigs.nightly
} else {
signingConfig signingConfigs.debug
}
proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
resValue "string", "pebble_content_provider", "com.getpebble.android.provider"
debuggable true
}
nopebble {
applicationIdSuffix ".nightly_nopebble"
versionNameSuffix "-${getGitHashShort}"
minifyEnabled true
if (System.getProperty("nightly_store_file") != null) {
signingConfig signingConfigs.nightly
} else {
signingConfig signingConfigs.debug
}
proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
resValue "string", "pebble_content_provider", "com.getpebble.android.nopebble.provider"
debuggable true
}
applicationVariants.all { variant ->
variant.resValue "string", "applicationId", variant.applicationId
if (variant.buildType.name == 'nightly' || variant.buildType.name == 'nopebble') {
variant.outputs.all {
setVersionCodeOverride(getVersionCode())
//setVersionNameOverride(getGitHashShort())
setVersionNameOverride(variant.versionName)
outputFileName = "${applicationId}_${variant.versionName}.apk"
}
}
}
}
lintOptions {

View File

@ -527,7 +527,7 @@
<provider
android:name=".contentprovider.PebbleContentProvider"
android:authorities="com.getpebble.android.provider"
android:authorities="@string/pebble_content_provider"
android:exported="true" />
<provider

View File

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<resources xmlns:tools="http://schemas.android.com/tools" tools:ignore="MissingTranslation">
<string name="app_name">Gadgetbridge (Nightly)</string>
</resources>

View File

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<resources xmlns:tools="http://schemas.android.com/tools" tools:ignore="MissingTranslation">
<string name="app_name">Gadgetbridge (Nightly, No Pebble provider)</string>
</resources>