// allow reading from local.properties?
// val properties = Properties()
// prop.load(project.rootProject.file("local.properties").reader())

buildscript {
  ext {
    VERSION_CODE="1.7.1" // NOTE: update value in [local.properties] also.

    // used for updating the dependencies/libraries
    ver_android_gradle_plugin = '7.1.3'
    ver_kotlin= '1.6.0' // kapt fails with higher version (w/ hilt)
    ver_hilt= '2.40.5' // 2.35 had issues
    ver_nav = "2.4.1" // has warning: BaseVariant.getApplicationIdTextResource
    ver_lifecycle = "2.4.1"
    ver_coroutines = '1.6.0'  // '1.5.2'
    ver_compose="1.2.0-alpha06"  // ver_compose="1.1.1"

    ver_accompanist= '0.24.5-alpha' // Smas Chat
    ver_room= '2.4.2'
  }

  repositories {
    google()
    mavenCentral()
  }

  dependencies {  // No app dependencies here (those in individual modules)
    classpath "com.android.tools.build:gradle:${ver_android_gradle_plugin}"
    classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.6.10"
    // for Navigation Component
    classpath "androidx.navigation:navigation-safe-args-gradle-plugin:$ver_nav"
    // for Dependency injection
    classpath "com.google.dagger:hilt-android-gradle-plugin:$ver_hilt"

    // for gmaps sdk password
    classpath "com.google.android.libraries.mapsplatform.secrets-gradle-plugin:secrets-gradle-plugin:2.0.1"
  }
}

allprojects {
  repositories {
    google()
    mavenCentral()
    maven { url 'https://jitpack.io' } // for publishing
  }
}

task clean(type: Delete) {
  delete rootProject.buildDir
}