2018-11-19 10:25:28 +00:00
|
|
|
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"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-07-31 03:21:48 +00:00
|
|
|
apply plugin: 'com.android.library'
|
2018-11-19 10:25:28 +00:00
|
|
|
apply plugin: 'kotlin-android'
|
2018-07-31 03:21:48 +00:00
|
|
|
|
2018-09-11 03:02:16 +00:00
|
|
|
|
2018-11-19 10:25:28 +00:00
|
|
|
def DEFAULT_COMPILE_SDK_VERSION = 27
|
|
|
|
def DEFAULT_BUILD_TOOLS_VERSION = "28.0.3"
|
|
|
|
def DEFAULT_TARGET_SDK_VERSION = 27
|
2018-11-30 09:13:44 +00:00
|
|
|
def DEFAULT_SUPPORT_LIB_VERSION = "27.0.2"
|
2018-07-31 03:21:48 +00:00
|
|
|
|
2018-11-19 10:25:28 +00:00
|
|
|
android {
|
|
|
|
compileSdkVersion rootProject.hasProperty('compileSdkVersion') ? rootProject.compileSdkVersion : DEFAULT_COMPILE_SDK_VERSION
|
|
|
|
buildToolsVersion rootProject.hasProperty('buildToolsVersion') ? rootProject.buildToolsVersion : DEFAULT_BUILD_TOOLS_VERSION
|
2018-07-31 03:21:48 +00:00
|
|
|
defaultConfig {
|
2018-11-19 10:25:28 +00:00
|
|
|
minSdkVersion 16
|
|
|
|
targetSdkVersion rootProject.hasProperty('targetSdkVersion') ? rootProject.targetSdkVersion : DEFAULT_TARGET_SDK_VERSION
|
2018-08-08 06:02:40 +00:00
|
|
|
versionCode 1
|
|
|
|
versionName "1.0"
|
2018-07-31 03:21:48 +00:00
|
|
|
}
|
2018-11-19 10:25:28 +00:00
|
|
|
buildTypes {
|
|
|
|
release {
|
|
|
|
minifyEnabled false
|
|
|
|
}
|
|
|
|
}
|
|
|
|
productFlavors {
|
|
|
|
}
|
|
|
|
lintOptions {
|
|
|
|
disable 'GradleCompatible'
|
|
|
|
}
|
|
|
|
compileOptions {
|
|
|
|
sourceCompatibility JavaVersion.VERSION_1_8
|
|
|
|
targetCompatibility JavaVersion.VERSION_1_8
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
repositories {
|
|
|
|
mavenCentral()
|
2018-11-30 01:59:12 +00:00
|
|
|
jcenter()
|
2018-11-19 10:25:28 +00:00
|
|
|
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."
|
|
|
|
)
|
|
|
|
}
|
2018-07-31 03:21:48 +00:00
|
|
|
}
|
|
|
|
|
2018-11-30 09:13:44 +00:00
|
|
|
def supportVersion = rootProject.hasProperty('supportLibVersion') ? rootProject.supportLibVersion : DEFAULT_SUPPORT_LIB_VERSION
|
|
|
|
|
2018-07-31 03:21:48 +00:00
|
|
|
dependencies {
|
2018-09-11 19:31:44 +00:00
|
|
|
implementation 'com.facebook.react:react-native:+'
|
2018-11-30 09:13:44 +00:00
|
|
|
implementation "com.android.support:appcompat-v7:$supportVersion"
|
2018-11-19 10:25:28 +00:00
|
|
|
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
|
2018-07-31 03:21:48 +00:00
|
|
|
}
|