// Pure Java module — no Kotlin plugin needed, so this compiles on every
// React Native scaffold (old and new) without the host project having
// to add a Kotlin Gradle plugin classpath dependency.
apply plugin: 'com.android.library'

def safeExtGet(prop, fallback) {
  rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback
}

android {
  if (project.android.hasProperty("namespace")) {
    namespace 'com.owlscope'
  }

  compileSdkVersion safeExtGet('compileSdkVersion', 34)

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

  compileOptions {
    sourceCompatibility JavaVersion.VERSION_1_8
    targetCompatibility JavaVersion.VERSION_1_8
  }
}

repositories {
  mavenCentral()
  google()
}

dependencies {
  implementation 'com.facebook.react:react-native:+'
}
