react-native-webview/android/build.gradle

93 lines
2.5 KiB
Groovy
Raw Normal View History

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'
apply plugin: 'kotlin-android'
2018-07-31 03:21:48 +00:00
def DEFAULT_COMPILE_SDK_VERSION = 27
def DEFAULT_BUILD_TOOLS_VERSION = "28.0.3"
def DEFAULT_TARGET_SDK_VERSION = 27
2018-07-31 03:21:48 +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 {
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
}
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."
)
}
2018-07-31 03:21:48 +00:00
}
dependencies {
implementation 'com.facebook.react:react-native:+'
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
2018-07-31 03:21:48 +00:00
}