def packageJson = new groovy.json.JsonSlurper().parseText(file('../package.json').text)
version = packageJson.version

buildscript {
    repositories {
        google()
        mavenCentral()
    }

    dependencies {
      classpath("com.android.tools.build:gradle:7.2.2")
      classpath("de.undercouch:gradle-download-task:5.0.1")
    }
}

apply plugin: 'com.android.library'

android {
    compileSdkVersion 31

    defaultConfig {
        buildToolsVersion "31.0.0"
        minSdkVersion 21
        targetSdkVersion 31
        versionCode 1
        versionName version
    }

    lintOptions {
        abortOnError false
    }
}

// Fix for https://github.com/facebook/react-native/issues/35210
repositories {
  // ref: https://www.baeldung.com/maven-local-repository
  mavenLocal()
  maven {
    // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
    url "$rootDir/../../../node_modules/react-native/android"
  }
  maven {
    // Android JSC is installed from npm
    url "$rootDir/../../../node_modules/jsc-android/dist"
  }
  mavenCentral {
    // We don't want to fetch react-native from Maven Central as there are
    // older versions over there.
    content {
      excludeGroup "com.facebook.react"
    }
  }
  google()
  maven { url 'https://www.jitpack.io' }
}

dependencies {
    compileOnly 'com.facebook.react:react-native:+'
    implementation 'com.google.code.gson:gson:2.8.9'
    implementation 'com.rudderstack.android.sdk:core:[1.26.0, 2.0.0)'
}
