buildscript {
  ext.safeExtGet = {prop, fallback ->
    rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback
  }
}

apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'

android {
  compileSdkVersion safeExtGet('compileSdkVersion', 34)
  namespace "com.subjectlift"

  defaultConfig {
    minSdkVersion safeExtGet('minSdkVersion', 24)
    targetSdkVersion safeExtGet('targetSdkVersion', 34)
  }
}

repositories {
  google()
  mavenCentral()
}

dependencies {
  implementation "com.facebook.react:react-native:+"
  // Host app may define kotlinVersion (RN template) or kotlin_version — never rely on a bare $kotlin_version.
  implementation "org.jetbrains.kotlin:kotlin-stdlib:${safeExtGet('kotlinVersion', safeExtGet('kotlin_version', '1.9.22'))}"

  // ML Kit Subject Segmentation (Play Services–delivered; see ML Kit Android docs)
  implementation 'com.google.android.gms:play-services-mlkit-subject-segmentation:16.0.0-beta1'
}
