Skip to content

Commit

Permalink
Reproducible build: we also need a build script.
Browse files Browse the repository at this point in the history
Part of #418.
  • Loading branch information
dennisguse committed Dec 27, 2024
1 parent 3ce0e2c commit fba09bc
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 2 deletions.
28 changes: 28 additions & 0 deletions RELEASE_BUILD.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!/bin/bash

set -e

export JAVA_HOME=/usr/lib/jvm/java-17-openjdk-amd64/

JAVA_VERSION=`java --version`
if [[ $JAVA_VERSION != "openjdk 17."* ]]; then
echo "OpenJDK version should be 17.X"
exit -1;
fi

RELEASE_STORE_PASSWORD=
read -s -p "Enter store password: " RELEASE_STORE_PASSWORD
echo ""
read -s -p "Enter key alias: " RELEASE_KEY_ALIAS
echo ""
read -s -p "Enter key password: " RELEASE_KEY_PASSWORD
echo ""

./gradlew --no-configuration-cache \
clean \
assembleReproducibleRelease \
-Drelease_store_file=`ls ../*.jks` \
-Drelease_store_file="../keystore_opentracks.jks" \
-Drelease_store_password="$RELEASE_STORE_PASSWORD" \
-Drelease_key_alias="$RELEASE_KEY_ALIAS" \
-Drelease_key_password="$RELEASE_KEY_PASSWORD"
13 changes: 11 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,14 @@ android {
keyPassword System.getProperty('nightly_key_password')
}
}
release {
if (System.getProperty("release_store_file") != null) {
storeFile file(System.getProperty("release_store_file"))
storePassword System.getProperty("release_store_password")
keyAlias System.getProperty("release_key_alias")
keyPassword System.getProperty("release_key_password")
}
}
}

namespace 'de.dennisguse.opentracks'
Expand Down Expand Up @@ -113,12 +121,13 @@ android {
applicationId 'de.dennisguse.opentracks'
versionNameSuffix 'irreproducible'
}
reproducible {
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
dimension 'version'
applicationId 'de.dennisguse.opentracks.playstore'
signingConfig signingConfigs.release
}
}

Expand All @@ -132,7 +141,7 @@ android {
outputFileName = "${applicationId}_${variant.versionCode}.apk"
}

if (variant.flavorName== 'nightly') {
if (variant.flavorName == 'nightly') {
setVersionCodeOverride(getVersionCode())
setVersionNameOverride(getVersionName())
}
Expand Down

0 comments on commit fba09bc

Please sign in to comment.