apply plugin: 'com.android.library'
// AGP 9+ registers the `kotlin` extension itself, and applying kotlin-android on top of that fails configuration.
if (project.extensions.findByName('kotlin') == null) {
  apply plugin: 'kotlin-android'
}

apply plugin: 'maven-publish'

group = 'expo.modules.clerk.googlesignin'
version = '1.0.0'

def expoModulesCorePlugin = new File(project(":expo-modules-core").projectDir.absolutePath, "ExpoModulesCorePlugin.gradle")
apply from: expoModulesCorePlugin
applyKotlinExpoModulesCorePlugin()
useCoreDependencies()
useExpoPublishing()

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

android {
  namespace "expo.modules.clerk.googlesignin"

  compileSdkVersion safeExtGet("compileSdkVersion", 36)

  defaultConfig {
    minSdkVersion safeExtGet("minSdkVersion", 24)
    targetSdkVersion safeExtGet("targetSdkVersion", 36)
    versionCode 1
    versionName "1.0.0"
  }
}

dependencies {
  implementation project(':expo-modules-core')
  implementation "androidx.credentials:credentials:1.3.0"
  implementation "androidx.credentials:credentials-play-services-auth:1.3.0"
  implementation "com.google.android.libraries.identity.googleid:googleid:1.1.1"
  implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:1.7.3"
}
