apply plugin: 'com.android.application'

android {
  namespace "com.example.nexilissamplecodeionic"
  compileSdkVersion rootProject.ext.compileSdkVersion
  defaultConfig {
    applicationId "com.example.nexilissamplecodeionic"
    minSdkVersion rootProject.ext.minSdkVersion
    targetSdkVersion rootProject.ext.targetSdkVersion
    versionCode 1
    versionName "1.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:!*~'
    }
  }
  buildTypes {
    release {
      minifyEnabled false
      proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
  }

  packagingOptions {
    doNotStrip "*/armeabi-v7a/*.so"
    doNotStrip "*/arm64-v8a/*.so"

    exclude 'META-INF/DEPENDENCIES'
    exclude 'META-INF/LICENSE'
    exclude 'META-INF/LICENSE.txt'
    exclude 'META-INF/license.txt'
    exclude 'META-INF/NOTICE'
    exclude 'META-INF/NOTICE.txt'
    exclude 'META-INF/notice.txt'
    exclude 'META-INF/ASL2.0'
  }
}

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')
  implementation('***REPLACE***WITH***NEXILIS***VERSION***LIBRARY***') {
    transitive = true
  }
}

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")
}
