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

    dependencies {
      classpath("com.android.tools.build:gradle:${safeExtGet('gradlePluginVersion', '8.7.0')}")
      classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:${safeExtGet('kotlinVersion', '2.1.0')}"
    }
}

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

def DEFAULT_COMPILE_SDK_VERSION = 35
def DEFAULT_MIN_SDK_VERSION = 24
def DEFAULT_TARGET_SDK_VERSION = 35 

android {
  compileSdkVersion safeExtGet('compileSdkVersion', DEFAULT_COMPILE_SDK_VERSION)

  namespace "com.steerpath.rnsmartmap"
  

  defaultConfig {
    minSdkVersion safeExtGet('minSdkVersion', DEFAULT_MIN_SDK_VERSION)
    targetSdkVersion safeExtGet('targetSdkVersion', DEFAULT_TARGET_SDK_VERSION)
    versionCode 1
    versionName "2.0"
  }
  lintOptions {
    abortOnError false
  }

  compileOptions {
    sourceCompatibility JavaVersion.VERSION_17
    targetCompatibility JavaVersion.VERSION_17
  }

  kotlinOptions {
    jvmTarget = '17'
  }

  lintOptions {
    abortOnError false
  }
}

repositories {
    mavenCentral()
    // For Steerpath Smart Map SDK
    maven { url "https://android-sdk.steerpath.net" }
    google()
}

dependencies {
    implementation "com.facebook.react:react-native"
    implementation "com.facebook.react:react-android"
    implementation "com.steerpath:smart:android-smart-2.0.1"
    implementation "androidx.lifecycle:lifecycle-runtime-ktx:2.8.7"
}
