capgo and adk autoupdates. card tags
This commit is contained in:
@@ -1,5 +1,20 @@
|
||||
apply plugin: 'com.android.application'
|
||||
|
||||
// ---- Cardy: versioning and signing ----
|
||||
|
||||
// versionCode from the build time (UTC): yyDDDHHmm (year, day of year, time), e.g. 262721430.
|
||||
// Grows with every build and stays below Android's limit (2100000000) until 2099.
|
||||
// Override with -PcardyVersionCode=... (the APK publishing script passes the value it records).
|
||||
def cardyVersionCode = project.findProperty('cardyVersionCode') ?: new Date().format('yyDDDHHmm', TimeZone.getTimeZone('UTC'))
|
||||
def cardyVersionName = project.findProperty('cardyVersionName') ?: '1.0'
|
||||
|
||||
// Release key: android/keystore.properties (not in git) with storeFile, storePassword, keyAlias, keyPassword.
|
||||
// Debug builds use the same key so that Android Studio builds and published APKs can replace each other.
|
||||
def keystoreProps = new Properties()
|
||||
def keystoreFile = rootProject.file('keystore.properties')
|
||||
if (keystoreFile.exists()) keystoreFile.withInputStream { keystoreProps.load(it) }
|
||||
def hasReleaseKey = ['storeFile', 'storePassword', 'keyAlias', 'keyPassword'].every { keystoreProps.getProperty(it)?.trim() }
|
||||
|
||||
android {
|
||||
namespace = "com.aggtaa.cardy"
|
||||
compileSdk = rootProject.ext.compileSdkVersion
|
||||
@@ -7,8 +22,8 @@ android {
|
||||
applicationId "com.aggtaa.cardy"
|
||||
minSdkVersion rootProject.ext.minSdkVersion
|
||||
targetSdkVersion rootProject.ext.targetSdkVersion
|
||||
versionCode 1
|
||||
versionName "1.0"
|
||||
versionCode cardyVersionCode as Integer
|
||||
versionName cardyVersionName
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
aaptOptions {
|
||||
// Files and dirs to omit from the packaged assets dir, modified to accommodate modern web apps.
|
||||
@@ -16,14 +31,32 @@ android {
|
||||
ignoreAssetsPattern = '!.svn:!.git:!.ds_store:!*.scc:.*:!CVS:!thumbs.db:!picasa.ini:!*~'
|
||||
}
|
||||
}
|
||||
signingConfigs {
|
||||
if (hasReleaseKey) {
|
||||
cardy {
|
||||
storeFile file(keystoreProps.getProperty('storeFile').trim())
|
||||
storePassword keystoreProps.getProperty('storePassword')
|
||||
keyAlias keystoreProps.getProperty('keyAlias').trim()
|
||||
keyPassword keystoreProps.getProperty('keyPassword')
|
||||
}
|
||||
}
|
||||
}
|
||||
buildTypes {
|
||||
release {
|
||||
minifyEnabled false
|
||||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
||||
if (hasReleaseKey) signingConfig signingConfigs.cardy
|
||||
}
|
||||
debug {
|
||||
if (hasReleaseKey) signingConfig signingConfigs.cardy
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!hasReleaseKey) {
|
||||
logger.warn('Cardy: android/keystore.properties is missing or incomplete: debug builds use the debug key, release builds are unsigned.')
|
||||
}
|
||||
|
||||
repositories {
|
||||
flatDir{
|
||||
dirs '../capacitor-cordova-android-plugins/src/main/libs', 'libs'
|
||||
|
||||
Reference in New Issue
Block a user