apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-kapt'
apply plugin: 'kotlin-parcelize'  // to send safeArgs between different fragments we must parcelize
apply plugin: "androidx.navigation.safeargs.kotlin"  //id 'androidx.navigation.safeargs'
apply plugin: 'dagger.hilt.android.plugin'
apply plugin: 'com.google.android.libraries.mapsplatform.secrets-gradle-plugin'

/*
 *
 * NOTE: to build navigator:
 * - SmasApp/NavigatorApp are controlling how the app is built:
 * - whether it will be personalized to LASH or not
 */

def VERSION_NAME="$VERSION_CODE"

android {
  compileSdkVersion 31

  defaultConfig {
    applicationId "cy.ac.ucy.cs.anyplace.navigator"
    minSdkVersion 29  // AndroidX (android 9)
    targetSdkVersion 31
    versionCode 6
    versionName "$VERSION_NAME-nav"

    testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
  }

  buildTypes {
    release {
      minifyEnabled false
      proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
    }
  }
  buildFeatures {
    dataBinding true
    viewBinding true
  }
  packagingOptions {
    resources {
      excludes += ['META-INF/DEPENDENCIES']
    }
  }
  compileOptions {
    sourceCompatibility JavaVersion.VERSION_11
    targetCompatibility JavaVersion.VERSION_11
  }
  kotlinOptions {
    jvmTarget = '11'
  }
    namespace 'cy.ac.ucy.cs.anyplace.navigator'

}

dependencies {
  // CORE
  //// KOTLIN
  //  implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$ver_kotlin"
  //  implementation "org.jetbrains.kotlin:kotlin-stdlib:$ver_kotlin"
  implementation "androidx.core:core-ktx:1.6.0"
  //// UI NAVIGATION
  implementation "androidx.navigation:navigation-fragment-ktx:$ver_nav"
  implementation "androidx.navigation:navigation-ui-ktx:$ver_nav"


  // Internal libraries
  implementation 'androidx.appcompat:appcompat:1.3.1'
  //// COROUTINES
  implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:$ver_coroutines"
  implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:$ver_coroutines"
  implementation "androidx.lifecycle:lifecycle-runtime-ktx:$ver_lifecycle"
  implementation "androidx.lifecycle:lifecycle-service:$ver_lifecycle"

  // FusedLocation provider (coarse/fine grain)
  // GOOGLE SERVICES
  //// FusedLocation (coarse/fine grain)
  implementation 'com.google.android.gms:play-services-location:18.0.0'
  //// GOOGLE MAPS & UTILS
  implementation 'com.google.android.gms:play-services-maps:17.0.1'
  implementation 'com.google.maps.android:android-maps-utils:2.2.2' // updated from 0.3 !

  implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
  implementation 'androidx.preference:preference-ktx:1.1.1'
  implementation 'com.google.android.material:material:1.4.0'

  //// DEPENDENCY INJECTION (dagger/hilt)
  implementation "com.google.dagger:hilt-android:$ver_hilt"
  kapt "com.google.dagger:hilt-android-compiler:$ver_hilt"
  implementation 'androidx.legacy:legacy-support-v4:1.0.0'

  implementation 'com.google.android.gms:play-services-location:18.0.0'
  implementation 'androidx.constraintlayout:constraintlayout:2.0.4'

  implementation 'com.squareup.okhttp3:okhttp:4.3.1'
  // Retrofit
  implementation 'com.squareup.retrofit2:retrofit:2.9.0'
  implementation 'com.squareup.retrofit2:converter-gson:2.9.0'


  /***                Anyplace libraries:                           ***/
  // implementation 'com.github.dmsl:anyplace-lib-core:4.0.2'           // JitPack
  //  implementation 'com.github.dmsl:anyplace-lib-android:v4.0.1'   // JitPack
  // local inclusion: requires pulling the all submodules (see README.md)
  // implementation project(path: ':lib-core')
  implementation project(path: ':lib-android')
  implementation project(path: ':lib-core')
}