1
0
forked from GRIN/grim
Files
goblin/android/app/build.gradle
T
2ro 61545b767d android: version tracks GOBLIN_BUILD, not GRIM's frozen 0.3.6
versionCode/versionName were inherited from GRIM (5 / "0.3.6") at the fork and
never rewired to Goblin's build number, so every build shipped as versionCode 5
- Android could not tell builds apart and Settings showed 0.3.6 for build 130.
Gradle now derives both from the GOBLIN_BUILD env (the same number the Rust side
stamps into crate::BUILD), with a fallback to the old values for a keyless local
gradle build.
2026-07-03 11:47:38 -04:00

121 lines
3.8 KiB
Groovy

plugins {
id 'com.android.application'
}
android {
compileSdk = 36
ndkVersion '29.0.14206865'
buildToolsVersion = '36.1.0'
defaultConfig {
applicationId "st.goblin.wallet"
minSdk 24
targetSdk 36
// Version tracks Goblin's build number (GOBLIN_BUILD) so the Android
// package identity moves forward with every release instead of freezing.
// Same env the Rust side stamps into crate::BUILD; the in-app updater
// compares build numbers, and this keeps versionCode (Android's
// upgrade/downgrade integer) in lockstep. Bare local gradle → fallback.
// ponytail: fallback keeps a keyless ./gradlew working; CI/release sets the env
def goblinBuild = (System.getenv("GOBLIN_BUILD") ?: "").trim()
versionCode goblinBuild.isEmpty() ? 5 : goblinBuild.toInteger()
versionName goblinBuild.isEmpty() ? "0.3.6" : goblinBuild
}
lint {
checkReleaseBuilds false
}
def keystorePropertiesFile = rootProject.file("keystore.properties")
def keystoreProperties = new Properties()
if (keystorePropertiesFile.exists()) {
keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
signingConfigs {
release {
keyAlias keystoreProperties['keyAlias']
keyPassword keystoreProperties['keyPassword']
storeFile file(keystoreProperties['storeFile'])
storePassword keystoreProperties['storePassword']
}
}
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
if (keystorePropertiesFile.exists()) {
signedRelease {
initWith release
signingConfig signingConfigs.release
}
}
debug {
minifyEnabled false
debuggable true
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
}
namespace 'mw.gri.android'
flavorDimensions "mode"
productFlavors {
ci {
dimension "mode"
}
local {
dimension "mode"
}
}
applicationVariants.all { variant ->
def flavor = variant.productFlavors[0].name
// The ci branch reads the private-mirror properties at configuration time,
// which runs for every variant — only enter it when the mirror is configured.
if (flavor == "ci" && project.hasProperty("mavenHost")) {
repositories {
maven {
credentials {
username "$mavenUser"
password "$mavenPassword"
}
url "$mavenHost/repository/maven-central/"
allowInsecureProtocol = true
}
maven {
credentials {
username "$mavenUser"
password "$mavenPassword"
}
url "$mavenHost/repository/google-android-maven/"
allowInsecureProtocol = true
}
}
} else if (flavor == "local") {
repositories {
google()
mavenCentral()
}
}
}
}
dependencies {
implementation 'androidx.appcompat:appcompat:1.7.0'
// To use the Games Activity library
implementation "androidx.games:games-activity:2.0.2"
// Android Camera
implementation 'androidx.camera:camera-core:1.5.1'
implementation 'androidx.camera:camera-camera2:1.5.1'
implementation 'androidx.camera:camera-lifecycle:1.5.1'
}