12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697 |
- buildscript {
- ext.kotlin_version = '1.2.71'
- repositories {
- google()
- jcenter()
- maven {
- url 'https://maven.fabric.io/public'
- }
- }
- dependencies {
- classpath 'com.android.tools.build:gradle:3.2.1'
- classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
- }
- }
-
- apply plugin: 'com.android.library'
- apply plugin: 'kotlin-android'
-
-
- def DEFAULT_COMPILE_SDK_VERSION = 27
- def DEFAULT_BUILD_TOOLS_VERSION = "28.0.3"
- def DEFAULT_TARGET_SDK_VERSION = 27
- def DEFAULT_SUPPORT_LIB_VERSION = "27.0.2"
-
- android {
- compileSdkVersion rootProject.hasProperty('compileSdkVersion') ? rootProject.compileSdkVersion : DEFAULT_COMPILE_SDK_VERSION
- buildToolsVersion rootProject.hasProperty('buildToolsVersion') ? rootProject.buildToolsVersion : DEFAULT_BUILD_TOOLS_VERSION
- defaultConfig {
- minSdkVersion 16
- targetSdkVersion rootProject.hasProperty('targetSdkVersion') ? rootProject.targetSdkVersion : DEFAULT_TARGET_SDK_VERSION
- versionCode 1
- versionName "1.0"
- }
- buildTypes {
- release {
- minifyEnabled false
- }
- }
- productFlavors {
- }
- lintOptions {
- disable 'GradleCompatible'
- }
- compileOptions {
- sourceCompatibility JavaVersion.VERSION_1_8
- targetCompatibility JavaVersion.VERSION_1_8
- }
- }
-
- repositories {
- mavenCentral()
- jcenter()
- maven {
- url 'https://maven.google.com/'
- name 'Google'
- }
-
- // Stolen from react-native-firebase, thanks dudes!
- def found = false
- def parentDir = rootProject.projectDir
- def reactNativeAndroidName = 'React Native (Node Modules)'
-
- 1.upto(4, {
- if (found) return true
- parentDir = parentDir.parentFile
- def reactNativeAndroid = new File(
- parentDir,
- 'node_modules/react-native/android'
- )
-
- if (reactNativeAndroid.exists()) {
- maven {
- url reactNativeAndroid.toString()
- name reactNativeAndroidName
- }
-
- println "${project.name}: using React Native sources from ${reactNativeAndroid.toString()}"
- found = true
- }
- })
-
- if (!found) {
- throw new GradleException(
- "${project.name}: unable to locate React Native Android sources, " +
- "ensure you have you installed React Native as a dependency and try again."
- )
- }
- }
-
- def supportVersion = rootProject.hasProperty('supportLibVersion') ? rootProject.supportLibVersion : DEFAULT_SUPPORT_LIB_VERSION
-
- dependencies {
- implementation 'com.facebook.react:react-native:+'
- implementation "com.android.support:appcompat-v7:$supportVersion"
- implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
- }
|