react-native-webview/android/build.gradle

97 lines
2.8 KiB
Groovy

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"
}