Use Kotlin DSL for library gradle files (#3628)

This commit is contained in:
arkon 2020-06-27 14:02:46 -04:00 committed by GitHub
parent 1556685031
commit be6c269621
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 56 additions and 59 deletions

View File

@ -0,0 +1,6 @@
object AndroidConfig {
const val compileSdk = 27
const val minSdk = 16
const val targetSdk = 27
const val buildTools = "29.0.3"
}

View File

@ -3,4 +3,7 @@ object Deps {
const val version = "1.3.72" const val version = "1.3.72"
const val stdlib = "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$version" const val stdlib = "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$version"
} }
const val jsoup = "org.jsoup:jsoup:1.13.1"
const val okhttp = "com.squareup.okhttp3:okhttp:3.10.0"
} }

View File

@ -1,30 +0,0 @@
apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
android {
compileSdkVersion 27
buildToolsVersion '29.0.3'
defaultConfig {
minSdkVersion 16
targetSdkVersion 27
versionCode 1
versionName '1.0.0'
}
buildTypes {
release {
minifyEnabled false
}
}
}
repositories {
mavenCentral()
}
dependencies {
compileOnly "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
compileOnly 'com.squareup.okhttp3:okhttp:3.10.0'
compileOnly 'org.jsoup:jsoup:1.13.1'
}

View File

@ -0,0 +1,24 @@
plugins {
id("com.android.library")
kotlin("android")
}
android {
compileSdkVersion(AndroidConfig.compileSdk)
buildToolsVersion(AndroidConfig.buildTools)
defaultConfig {
minSdkVersion(AndroidConfig.minSdk)
targetSdkVersion(AndroidConfig.targetSdk)
}
}
repositories {
mavenCentral()
}
dependencies {
compileOnly(Deps.kotlin.stdlib)
compileOnly(Deps.okhttp)
compileOnly(Deps.jsoup)
}

View File

@ -1,29 +0,0 @@
apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
android {
compileSdkVersion 27
buildToolsVersion '29.0.3'
defaultConfig {
minSdkVersion 16
targetSdkVersion 27
versionCode 1
versionName '1.0.0'
}
buildTypes {
release {
minifyEnabled false
}
}
}
repositories {
mavenCentral()
}
dependencies {
compileOnly "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
compileOnly 'com.squareup.okhttp3:okhttp:3.10.0'
}

View File

@ -0,0 +1,23 @@
plugins {
id("com.android.library")
kotlin("android")
}
android {
compileSdkVersion(AndroidConfig.compileSdk)
buildToolsVersion(AndroidConfig.buildTools)
defaultConfig {
minSdkVersion(AndroidConfig.minSdk)
targetSdkVersion(AndroidConfig.targetSdk)
}
}
repositories {
mavenCentral()
}
dependencies {
compileOnly(Deps.kotlin.stdlib)
compileOnly(Deps.okhttp)
}