diff --git a/build.gradle b/build.gradle deleted file mode 100644 index 7732d0fd9..000000000 --- a/build.gradle +++ /dev/null @@ -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() - } -} \ No newline at end of file diff --git a/build.gradle.kts b/build.gradle.kts new file mode 100644 index 000000000..6edb7ff9d --- /dev/null +++ b/build.gradle.kts @@ -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") + } +} diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 2aa714b7c..172cea8c2 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME 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 diff --git a/settings.gradle b/settings.gradle deleted file mode 100644 index 38441a14f..000000000 --- a/settings.gradle +++ /dev/null @@ -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' diff --git a/settings.gradle.kts b/settings.gradle.kts new file mode 100644 index 000000000..82351e167 --- /dev/null +++ b/settings.gradle.kts @@ -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") diff --git a/uhabits-android/build.gradle b/uhabits-android/build.gradle index 4c84bc9de..248b26f6d 100644 --- a/uhabits-android/build.gradle +++ b/uhabits-android/build.gradle @@ -26,11 +26,6 @@ plugins { id "org.jlleitschuh.gradle.ktlint" } -repositories { - google() - jcenter() -} - android { compileSdkVersion COMPILE_SDK_VERSION as Integer diff --git a/uhabits-core/build.gradle.kts b/uhabits-core/build.gradle.kts index f014c9109..b8228bb56 100644 --- a/uhabits-core/build.gradle.kts +++ b/uhabits-core/build.gradle.kts @@ -17,28 +17,13 @@ * with this program. If not, see . */ -val DAGGER_VERSION = "2.25.4" -val KOTLIN_VERSION = "1.4.21" -val KX_COROUTINES_VERSION = "1.4.2" - plugins { kotlin("multiplatform") 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 { - jvm { - withJava() - } + jvm().withJava() sourceSets { val commonMain by getting { @@ -58,10 +43,10 @@ kotlin { val jvmMain by getting { dependencies { 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("org.jetbrains.kotlin:kotlin-stdlib:$KOTLIN_VERSION") - implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core-jvm:$KX_COROUTINES_VERSION") + implementation("org.jetbrains.kotlin:kotlin-stdlib:1.4.21") + implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core-jvm:1.4.2") implementation("androidx.annotation:annotation:1.1.0") implementation("com.google.code.findbugs:jsr305:3.0.2") implementation("com.opencsv:opencsv:3.10") diff --git a/uhabits-server/build.gradle b/uhabits-server/build.gradle index 9d9b99672..d1e033e93 100644 --- a/uhabits-server/build.gradle +++ b/uhabits-server/build.gradle @@ -46,13 +46,6 @@ sourceSets { test.resources.srcDirs = ['testresources'] } -repositories { - mavenLocal() - jcenter() - maven { url 'https://kotlin.bintray.com/ktor' } - maven { url 'https://kotlin.bintray.com/kotlin-js-wrappers' } -} - dependencies { implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version" implementation "io.ktor:ktor-server-netty:$ktor_version"