build.gradle 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  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.client"
  9. compileSdk rootProject.ext.compileSdkVersion
  10. defaultConfig {
  11. applicationId "br.com.diarista.client"
  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. resValue "string", "maps_api_key", (keystoreProperties['googleMapsApiKey'] ?: "")
  23. }
  24. signingConfigs {
  25. release {
  26. if (keystorePropertiesFile.exists()) {
  27. storeFile file(keystoreProperties['storeFile'])
  28. storePassword keystoreProperties['storePassword']
  29. keyAlias keystoreProperties['keyAlias']
  30. keyPassword keystoreProperties['keyPassword']
  31. }
  32. }
  33. }
  34. buildTypes {
  35. release {
  36. signingConfig signingConfigs.release
  37. minifyEnabled true
  38. shrinkResources true
  39. proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
  40. }
  41. }
  42. }
  43. repositories {
  44. flatDir{
  45. dirs '../capacitor-cordova-android-plugins/src/main/libs', 'libs'
  46. }
  47. }
  48. dependencies {
  49. implementation fileTree(include: ['*.jar'], dir: 'libs')
  50. implementation "androidx.appcompat:appcompat:$androidxAppCompatVersion"
  51. implementation "androidx.coordinatorlayout:coordinatorlayout:$androidxCoordinatorLayoutVersion"
  52. implementation "androidx.core:core-splashscreen:$coreSplashScreenVersion"
  53. implementation project(':capacitor-android')
  54. testImplementation "junit:junit:$junitVersion"
  55. androidTestImplementation "androidx.test.ext:junit:$androidxJunitVersion"
  56. androidTestImplementation "androidx.test.espresso:espresso-core:$androidxEspressoCoreVersion"
  57. implementation project(':capacitor-cordova-android-plugins')
  58. }
  59. apply from: 'capacitor.build.gradle'
  60. try {
  61. def servicesJSON = file('google-services.json')
  62. if (servicesJSON.text) {
  63. apply plugin: 'com.google.gms.google-services'
  64. }
  65. } catch(Exception e) {
  66. logger.info("google-services.json not found, google-services plugin not applied. Push Notifications won't work")
  67. }