apply plugin: 'com.android.application' // Release signing key lives OUTSIDE the repo (never commit it): // %USERPROFILE%\.xenia\keystore.properties (storeFile, storePassword, keyAlias, keyPassword) // Override the location with the XENIA_KEYSTORE_PROPS env var. Every APK handed to // a venue must be signed with this same key, or phones refuse to install updates. def keystorePropsFile = file(System.getenv('XENIA_KEYSTORE_PROPS') ?: "${System.getProperty('user.home')}/.xenia/keystore.properties") def keystoreProps = new Properties() if (keystorePropsFile.exists()) { keystorePropsFile.withInputStream { keystoreProps.load(it) } } android { namespace = "gr.bonamin.xenia" compileSdk = rootProject.ext.compileSdkVersion defaultConfig { applicationId "gr.bonamin.xenia" minSdkVersion rootProject.ext.minSdkVersion targetSdkVersion rootProject.ext.targetSdkVersion // Bump BOTH for every APK handed out: Android only installs an update over // an existing install when versionCode is higher. versionCode 1 versionName "1.0.0" 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:!*~' } } signingConfigs { release { if (keystoreProps['storeFile']) { storeFile file(keystoreProps['storeFile']) storePassword keystoreProps['storePassword'] keyAlias keystoreProps['keyAlias'] keyPassword keystoreProps['keyPassword'] } } } buildTypes { release { if (keystoreProps['storeFile']) { signingConfig signingConfigs.release } else { logger.warn("Xenia: no keystore at ${keystorePropsFile} - release APK will be UNSIGNED") } 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') 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") }