build.gradle 2.8 KB

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