83 lines
3.3 KiB
Groovy
83 lines
3.3 KiB
Groovy
apply plugin: 'com.android.application'
|
|
|
|
android {
|
|
namespace = "de.mrterm.app"
|
|
compileSdk = rootProject.ext.compileSdkVersion
|
|
defaultConfig {
|
|
applicationId "de.mrterm.app"
|
|
minSdkVersion rootProject.ext.minSdkVersion
|
|
targetSdkVersion rootProject.ext.targetSdkVersion
|
|
// Version kommt aus der package.json des Desktop-Projekts (build.js setzt -PmrtermVersion)
|
|
def v = (project.findProperty('mrtermVersion') ?: '0.0.1').toString()
|
|
def p = v.tokenize('.-')
|
|
versionCode (p[0].toInteger() * 10000 + p[1].toInteger() * 100 + p[2].toInteger())
|
|
versionName v
|
|
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
|
aaptOptions {
|
|
// Files and dirs to omit from the packaged assets dir, modified to accommodate modern web apps.
|
|
// Default: https://android.googlesource.com/platform/frameworks/base/+/282e181b58cf72b6ca770dc7ca5f91f135444502/tools/aapt/AaptAssets.cpp#61
|
|
ignoreAssetsPattern = '!.svn:!.git:!.ds_store:!*.scc:.*:!CVS:!thumbs.db:!picasa.ini:!*~'
|
|
}
|
|
}
|
|
// Signatur: keystore.properties (nicht im Repo) mit storeFile, storePassword, keyAlias, keyPassword
|
|
def ksFile = rootProject.file('keystore.properties')
|
|
signingConfigs {
|
|
release {
|
|
if (ksFile.exists()) {
|
|
def ks = new Properties()
|
|
ksFile.withInputStream { ks.load(it) }
|
|
storeFile rootProject.file(ks['storeFile'])
|
|
storePassword ks['storePassword']
|
|
keyAlias ks['keyAlias']
|
|
keyPassword ks['keyPassword']
|
|
}
|
|
}
|
|
}
|
|
// Eine APK je Prozessorarchitektur (libnode ist groß); Obtainium wählt die passende automatisch
|
|
splits {
|
|
abi {
|
|
enable true
|
|
reset()
|
|
include 'arm64-v8a', 'armeabi-v7a'
|
|
universalApk false
|
|
}
|
|
}
|
|
buildTypes {
|
|
release {
|
|
if (ksFile.exists()) signingConfig signingConfigs.release
|
|
minifyEnabled false
|
|
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
|
}
|
|
}
|
|
}
|
|
|
|
repositories {
|
|
flatDir{
|
|
dirs '../capacitor-cordova-android-plugins/src/main/libs', 'libs'
|
|
}
|
|
}
|
|
|
|
dependencies {
|
|
implementation fileTree(include: ['*.jar'], dir: 'libs')
|
|
implementation "androidx.appcompat:appcompat:$androidxAppCompatVersion"
|
|
implementation "androidx.coordinatorlayout:coordinatorlayout:$androidxCoordinatorLayoutVersion"
|
|
implementation "androidx.core:core-splashscreen:$coreSplashScreenVersion"
|
|
implementation project(':capacitor-android')
|
|
implementation "androidx.biometric:biometric:1.1.0"
|
|
testImplementation "junit:junit:$junitVersion"
|
|
androidTestImplementation "androidx.test.ext:junit:$androidxJunitVersion"
|
|
androidTestImplementation "androidx.test.espresso:espresso-core:$androidxEspressoCoreVersion"
|
|
implementation project(':capacitor-cordova-android-plugins')
|
|
}
|
|
|
|
apply from: 'capacitor.build.gradle'
|
|
|
|
try {
|
|
def servicesJSON = file('google-services.json')
|
|
if (servicesJSON.text) {
|
|
apply plugin: 'com.google.gms.google-services'
|
|
}
|
|
} catch(Exception e) {
|
|
logger.info("google-services.json not found, google-services plugin not applied. Push Notifications won't work")
|
|
}
|