Skip to content

Commit

Permalink
Convert top-level build.gradle to Kotlin
Browse files Browse the repository at this point in the history
  • Loading branch information
iSoron committed Jan 16, 2021
1 parent a5dfe0e commit 8206450
Show file tree
Hide file tree
Showing 8 changed files with 40 additions and 63 deletions.
15 changes: 0 additions & 15 deletions build.gradle

This file was deleted.

21 changes: 21 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -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")
}
}
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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
16 changes: 0 additions & 16 deletions settings.gradle

This file was deleted.

14 changes: 14 additions & 0 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
@@ -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")
5 changes: 0 additions & 5 deletions uhabits-android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,6 @@ plugins {
id "org.jlleitschuh.gradle.ktlint"
}

repositories {
google()
jcenter()
}

android {
compileSdkVersion COMPILE_SDK_VERSION as Integer

Expand Down
23 changes: 4 additions & 19 deletions uhabits-core/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -17,28 +17,13 @@
* 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 {
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 {
Expand All @@ -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")
Expand Down
7 changes: 0 additions & 7 deletions uhabits-server/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 8206450

Please sign in to comment.