Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reproducible build: F-Droid needs build flavors (not build types). #2034

Merged
merged 1 commit into from
Dec 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/build_apk.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
shell: bash
run: |
echo ${NIGHTLY_STORE_FILE} | base64 -d > KEY_NIGHTLY.jks
./gradlew assembleNightly -Dnightly_store_file=KEY_NIGHTLY.jks -Dnightly_store_password="${NIGHTLY_STORE_PASSWORD}" -Dnightly_key_alias="${NIGHTLY_KEY_ALIAS}" -Dnightly_key_password="${NIGHTLY_STORE_PASSWORD}"
./gradlew assembleNightlyRelease -Dnightly_store_file=KEY_NIGHTLY.jks -Dnightly_store_password="${NIGHTLY_STORE_PASSWORD}" -Dnightly_key_alias="${NIGHTLY_KEY_ALIAS}" -Dnightly_key_password="${NIGHTLY_STORE_PASSWORD}"
env:
NIGHTLY_STORE_FILE: ${{ secrets.NIGHTLY_STORE_FILE }}
NIGHTLY_STORE_PASSWORD: ${{ secrets.NIGHTLY_STORE_PASSWORD }}
Expand Down
51 changes: 28 additions & 23 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ android {
}

defaultConfig {
applicationId "de.dennisguse.opentracks"
applicationId 'de.dennisguse.opentracks'
versionCode 5978
versionName "v4.17.1"

Expand All @@ -72,16 +72,16 @@ android {
minSdk 26
targetSdk 35

testInstrumentationRunner "de.dennisguse.opentracks.TestRunner"
testInstrumentationRunner 'de.dennisguse.opentracks.TestRunner'
testInstrumentationRunnerArguments clearPackageData: 'true'
}
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")
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')
}
}
}
Expand All @@ -90,41 +90,46 @@ android {

buildTypes {
debug {
applicationIdSuffix ".debug"
versionNameSuffix "-debug"
applicationIdSuffix '.debug'
versionNameSuffix '-debug'
}
release {
crunchPngs false
minifyEnabled false
}
}


flavorDimensions 'version'
productFlavors {
nightly {
applicationIdSuffix ".nightly"
dimension 'version'
applicationIdSuffix '.nightly'
signingConfig signingConfigs.nightly
}

release {
irreproducible {
// Non-reproducible: https://f-droid.org/de/packages/de.dennisguse.opentracks/
crunchPngs false
minifyEnabled false
versionNameSuffix "irreproducible"
dimension 'version'
applicationId 'de.dennisguse.opentracks'
versionNameSuffix 'irreproducible'
}

reproducible {
// Developer Binaries: https://github.com/OpenTracksApp/OSMDashboard/releases/download/v%v/de.dennisguse.opentracks.playstore_%v.apk
// FDroid: https://f-droid.org/de/packages/de.dennisguse.opentracks.playstore
// PlayStore: https://play.google.com/store/apps/details?id=de.dennisguse.opentracks.playstore
applicationIdSuffix ".playstore"

crunchPngs false
minifyEnabled false
dimension 'version'
applicationId 'de.dennisguse.opentracks.playstore'
}
}

applicationVariants.configureEach { variant ->
variant.resValue "string", "applicationId", variant.applicationId
variant.resValue 'string', 'applicationId', variant.applicationId

variant.outputs.configureEach {
if (variant.buildType.name == 'reproducible') {
outputFileName = "${applicationId}_${variant.buildType.name}_${variant.versionName}.apk"
outputFileName = '${applicationId}_${variant.buildType.name}_${variant.versionName}.apk'
} else {
outputFileName = "${applicationId}_${variant.buildType.name}_${variant.versionCode}.apk"
outputFileName = '${applicationId}_${variant.buildType.name}_${variant.versionCode}.apk'
}

if (variant.buildType.name == 'nightly') {
Expand Down
Loading