plugins {
  id 'com.android.library'
  id 'expo-module-gradle-plugin'
  id 'org.jetbrains.kotlin.android'
}

group = 'expo.modules.localllm'
// Single source of truth: the npm package version.
version = new groovy.json.JsonSlurper().parse(file('../package.json')).version

android {
  namespace "expo.modules.localllm"
  compileSdk 35

  defaultConfig {
    minSdk 26
    versionCode 1
    versionName project.version
    testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
    consumerProguardFiles 'proguard-rules.pro'
  }

  compileOptions {
    sourceCompatibility JavaVersion.VERSION_17
    targetCompatibility JavaVersion.VERSION_17
  }

  kotlinOptions {
    jvmTarget = '17'
  }

  lintOptions {
    abortOnError false
  }
}

dependencies {
  // Runtime tool declarations require beta5 and the schema API.
  implementation 'com.google.mlkit:genai-prompt:1.0.0-beta5'
  implementation 'com.google.mlkit:genai-schema:1.0.0-alpha2'
  // ML Kit calls the Job.cancel(message, cause) compatibility bridge that is
  // only present in recent coroutines releases. Pin Android explicitly so an
  // application's older transitive version cannot cause a runtime ABI error.
  implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.11.0'

  testImplementation 'junit:junit:4.13.2'
  testImplementation 'org.robolectric:robolectric:4.16.1'
  androidTestImplementation 'androidx.test:runner:1.7.0'
  androidTestImplementation 'junit:junit:4.13.2'
}
