mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge
synced 2024-11-30 14:02:56 +01:00
Add nightly release setup
This commit is contained in:
parent
b62357dfe2
commit
1e6cde6790
@ -5,9 +5,9 @@ pipeline:
|
|||||||
- pwd #bump
|
- pwd #bump
|
||||||
- ./gradlew assembleDebug --stacktrace
|
- ./gradlew assembleDebug --stacktrace
|
||||||
|
|
||||||
|
when:
|
||||||
|
repo: Freeyourgadget/Gadgetbridge
|
||||||
|
branch: master
|
||||||
#this doesn't work yet:
|
#this doesn't work yet:
|
||||||
#https://github.com/woodpecker-ci/woodpecker/issues/687
|
#https://github.com/woodpecker-ci/woodpecker/issues/687
|
||||||
#when:
|
|
||||||
#repo: Freeyourgadget/Gadgetbridge
|
|
||||||
#branch: master
|
|
||||||
|
|
||||||
|
@ -14,6 +14,18 @@ tasks.withType(Test) {
|
|||||||
systemProperty "logback.configurationFile", System.getProperty("user.dir", null) + "/app/src/main/assets/logback.xml"
|
systemProperty "logback.configurationFile", System.getProperty("user.dir", null) + "/app/src/main/assets/logback.xml"
|
||||||
systemProperty "GB_LOGFILES_DIR", Files.createTempDirectory("gblog").toString()
|
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 = { ->
|
def getGitHashShort = { ->
|
||||||
try {
|
try {
|
||||||
@ -49,12 +61,65 @@ android {
|
|||||||
vectorDrawables.useSupportLibrary = true
|
vectorDrawables.useSupportLibrary = true
|
||||||
multiDexEnabled true
|
multiDexEnabled true
|
||||||
buildConfigField "String", "GIT_HASH_SHORT", "\"${getGitHashShort()}\""
|
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 {
|
buildTypes {
|
||||||
release {
|
release {
|
||||||
minifyEnabled true
|
minifyEnabled true
|
||||||
proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
|
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 {
|
lintOptions {
|
||||||
|
@ -527,7 +527,7 @@
|
|||||||
|
|
||||||
<provider
|
<provider
|
||||||
android:name=".contentprovider.PebbleContentProvider"
|
android:name=".contentprovider.PebbleContentProvider"
|
||||||
android:authorities="com.getpebble.android.provider"
|
android:authorities="@string/pebble_content_provider"
|
||||||
android:exported="true" />
|
android:exported="true" />
|
||||||
|
|
||||||
<provider
|
<provider
|
||||||
|
4
app/src/nightly/res/values/strings.xml
Normal file
4
app/src/nightly/res/values/strings.xml
Normal 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>
|
4
app/src/nopebble/res/values/strings.xml
Normal file
4
app/src/nopebble/res/values/strings.xml
Normal 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>
|
Loading…
Reference in New Issue
Block a user