apply plugin: 'com.android.library'

group = 'expo.modules.spotifysdk'
version = '0.5.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
  }
}

project.android {
  compileSdkVersion safeExtGet("compileSdkVersion", 35)
  defaultConfig {
    minSdkVersion safeExtGet("minSdkVersion", 24)
    targetSdkVersion safeExtGet("targetSdkVersion", 35)
  }
  compileOptions {
    sourceCompatibility JavaVersion.VERSION_17
    targetCompatibility JavaVersion.VERSION_17
  }
  kotlinOptions {
    jvmTarget = "17"
  }
}

android {
  namespace "expo.modules.spotifysdk"
  defaultConfig {
    versionCode 1
    versionName "0.5.0"
    consumerProguardFiles "consumer-rules.pro"
  }
  lintOptions {
    abortOnError false
  }
}

repositories {
  mavenCentral()
}

dependencies {
  implementation "com.spotify.android:auth:4.0.1"
  implementation "com.squareup.okhttp3:okhttp:4.12.0"
  implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:1.8.1"
  implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:1.8.1"
}
