|
| 1 | +apply plugin: 'com.android.application' |
| 2 | + |
| 3 | +android { |
| 4 | + namespace "dev.toolworks.trustynotes" |
| 5 | + compileSdk rootProject.ext.compileSdkVersion |
| 6 | + defaultConfig { |
| 7 | + applicationId "dev.toolworks.trustynotes" |
| 8 | + minSdkVersion rootProject.ext.minSdkVersion |
| 9 | + targetSdkVersion rootProject.ext.targetSdkVersion |
| 10 | + versionCode 1 |
| 11 | + versionName "1.0" |
| 12 | + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" |
| 13 | + aaptOptions { |
| 14 | + // Files and dirs to omit from the packaged assets dir, modified to accommodate modern web apps. |
| 15 | + // Default: https://android.googlesource.com/platform/frameworks/base/+/282e181b58cf72b6ca770dc7ca5f91f135444502/tools/aapt/AaptAssets.cpp#61 |
| 16 | + ignoreAssetsPattern '!.svn:!.git:!.ds_store:!*.scc:.*:!CVS:!thumbs.db:!picasa.ini:!*~' |
| 17 | + } |
| 18 | + } |
| 19 | + buildTypes { |
| 20 | + release { |
| 21 | + minifyEnabled false |
| 22 | + proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' |
| 23 | + } |
| 24 | + } |
| 25 | + signingConfigs { |
| 26 | + release { |
| 27 | + def props = new Properties() |
| 28 | + def propFile = rootProject.file('app/signing.properties') |
| 29 | + if (propFile.exists()) { |
| 30 | + props.load(new FileInputStream(propFile)) |
| 31 | + storeFile file(props['STORE_FILE']) |
| 32 | + storePassword props['STORE_PASSWORD'] |
| 33 | + keyAlias props['KEY_ALIAS'] |
| 34 | + keyPassword props['KEY_PASSWORD'] |
| 35 | + } |
| 36 | + } |
| 37 | + } |
| 38 | + buildTypes { |
| 39 | + release { |
| 40 | + signingConfig signingConfigs.release |
| 41 | + minifyEnabled true |
| 42 | + proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' |
| 43 | + } |
| 44 | + } |
| 45 | +} |
| 46 | + |
| 47 | +repositories { |
| 48 | + flatDir{ |
| 49 | + dirs '../capacitor-cordova-android-plugins/src/main/libs', 'libs' |
| 50 | + } |
| 51 | +} |
| 52 | + |
| 53 | +dependencies { |
| 54 | + implementation fileTree(include: ['*.jar'], dir: 'libs') |
| 55 | + implementation "androidx.appcompat:appcompat:$androidxAppCompatVersion" |
| 56 | + implementation "androidx.coordinatorlayout:coordinatorlayout:$androidxCoordinatorLayoutVersion" |
| 57 | + implementation "androidx.core:core-splashscreen:$coreSplashScreenVersion" |
| 58 | + implementation project(':capacitor-android') |
| 59 | + testImplementation "junit:junit:$junitVersion" |
| 60 | + androidTestImplementation "androidx.test.ext:junit:$androidxJunitVersion" |
| 61 | + androidTestImplementation "androidx.test.espresso:espresso-core:$androidxEspressoCoreVersion" |
| 62 | + implementation project(':capacitor-cordova-android-plugins') |
| 63 | +} |
| 64 | + |
| 65 | +apply from: 'capacitor.build.gradle' |
| 66 | + |
| 67 | +try { |
| 68 | + def servicesJSON = file('google-services.json') |
| 69 | + if (servicesJSON.text) { |
| 70 | + apply plugin: 'com.google.gms.google-services' |
| 71 | + } |
| 72 | +} catch(Exception e) { |
| 73 | + logger.info("google-services.json not found, google-services plugin not applied. Push Notifications won't work") |
| 74 | +} |
0 commit comments