Convert top-level build.gradle to Kotlin

pull/718/head
Alinson S. Xavier 5 years ago
parent a5dfe0ec51
commit 8206450456

@ -1,15 +0,0 @@
plugins {
id 'com.android.application' version "4.1.0" apply false
id "org.jetbrains.kotlin.android" version "$KOTLIN_VERSION" apply false
id "org.jetbrains.kotlin.kapt" version "$KOTLIN_VERSION" apply false
id "org.jetbrains.kotlin.android.extensions" version "$KOTLIN_VERSION" apply false
id "org.jetbrains.kotlin.multiplatform" version "1.4.21" apply false
id "org.jlleitschuh.gradle.ktlint" version "9.4.1"
}
// Needed for ktlint. Taken from: https://github.com/JLLeitschuh/ktlint-gradle/issues/181#issuecomment-443146206
allprojects {
repositories {
mavenCentral()
}
}

@ -0,0 +1,21 @@
plugins {
val kotlinVersion = "1.4.21"
id("com.android.application") version ("4.1.0") apply (false)
id("org.jetbrains.kotlin.android") version kotlinVersion apply (false)
id("org.jetbrains.kotlin.kapt") version kotlinVersion apply (false)
id("org.jetbrains.kotlin.android.extensions") version kotlinVersion apply (false)
id("org.jetbrains.kotlin.multiplatform") version kotlinVersion apply (false)
id("org.jlleitschuh.gradle.ktlint") version "9.4.1"
}
allprojects {
repositories {
google()
jcenter()
mavenCentral()
maven(url = "https://plugins.gradle.org/m2/")
maven(url = "https://oss.sonatype.org/content/repositories/snapshots/")
maven(url = "https://kotlin.bintray.com/ktor")
maven(url = "https://kotlin.bintray.com/kotlin-js-wrappers")
}
}

@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.5-all.zip distributionUrl=https\://services.gradle.org/distributions/gradle-6.8-all.zip

@ -1,16 +0,0 @@
pluginManagement {
repositories {
gradlePluginPortal()
jcenter()
google()
}
resolutionStrategy {
eachPlugin {
if (requested.id.id == "com.android.application") {
useModule("com.android.tools.build:gradle:${requested.version}")
}
}
}
}
include ':uhabits-android', ':uhabits-core', ':uhabits-server'

@ -0,0 +1,14 @@
pluginManagement {
repositories {
gradlePluginPortal()
jcenter()
google()
}
resolutionStrategy.eachPlugin {
if (requested.id.id == "com.android.application") {
useModule("com.android.tools.build:gradle:${requested.version}")
}
}
}
include(":uhabits-android", ":uhabits-core", ":uhabits-server")

@ -26,11 +26,6 @@ plugins {
id "org.jlleitschuh.gradle.ktlint" id "org.jlleitschuh.gradle.ktlint"
} }
repositories {
google()
jcenter()
}
android { android {
compileSdkVersion COMPILE_SDK_VERSION as Integer compileSdkVersion COMPILE_SDK_VERSION as Integer

@ -17,28 +17,13 @@
* with this program. If not, see <http://www.gnu.org/licenses/>. * with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
val DAGGER_VERSION = "2.25.4"
val KOTLIN_VERSION = "1.4.21"
val KX_COROUTINES_VERSION = "1.4.2"
plugins { plugins {
kotlin("multiplatform") kotlin("multiplatform")
id("org.jlleitschuh.gradle.ktlint") id("org.jlleitschuh.gradle.ktlint")
} }
repositories {
google()
jcenter()
mavenCentral()
maven(url = "https://plugins.gradle.org/m2/")
maven(url = "https://oss.sonatype.org/content/repositories/snapshots/")
}
kotlin { kotlin {
jvm { jvm().withJava()
withJava()
}
sourceSets { sourceSets {
val commonMain by getting { val commonMain by getting {
@ -58,10 +43,10 @@ kotlin {
val jvmMain by getting { val jvmMain by getting {
dependencies { dependencies {
implementation(kotlin("stdlib-jdk8")) implementation(kotlin("stdlib-jdk8"))
compileOnly("com.google.dagger:dagger:$DAGGER_VERSION") compileOnly("com.google.dagger:dagger:2.25.4")
implementation("com.google.guava:guava:30.0-jre") implementation("com.google.guava:guava:30.0-jre")
implementation("org.jetbrains.kotlin:kotlin-stdlib:$KOTLIN_VERSION") implementation("org.jetbrains.kotlin:kotlin-stdlib:1.4.21")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core-jvm:$KX_COROUTINES_VERSION") implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core-jvm:1.4.2")
implementation("androidx.annotation:annotation:1.1.0") implementation("androidx.annotation:annotation:1.1.0")
implementation("com.google.code.findbugs:jsr305:3.0.2") implementation("com.google.code.findbugs:jsr305:3.0.2")
implementation("com.opencsv:opencsv:3.10") implementation("com.opencsv:opencsv:3.10")

@ -46,13 +46,6 @@ sourceSets {
test.resources.srcDirs = ['testresources'] test.resources.srcDirs = ['testresources']
} }
repositories {
mavenLocal()
jcenter()
maven { url 'https://kotlin.bintray.com/ktor' }
maven { url 'https://kotlin.bintray.com/kotlin-js-wrappers' }
}
dependencies { dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version" implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
implementation "io.ktor:ktor-server-netty:$ktor_version" implementation "io.ktor:ktor-server-netty:$ktor_version"

Loading…
Cancel
Save