Skip to content

Commit

Permalink
Improve dependency notation
Browse files Browse the repository at this point in the history
  • Loading branch information
BoD committed Dec 13, 2020
1 parent 08ec3b2 commit f9a2474
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 14 deletions.
1 change: 1 addition & 0 deletions buildSrc/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,5 @@ repositories {

dependencies {
implementation("ca.rmen:lib-french-revolutionary-calendar:1.8.0")
implementation("org.jetbrains.kotlin:kotlin-gradle-plugin-api:1.4.21")
}
4 changes: 3 additions & 1 deletion buildSrc/src/main/kotlin/Utils.kt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import ca.rmen.lfrc.FrenchRevolutionaryCalendar
import org.gradle.api.Project
import org.jetbrains.kotlin.gradle.plugin.KotlinDependencyHandler
import java.io.File
import java.io.FileInputStream
import java.io.FileOutputStream
Expand Down Expand Up @@ -132,4 +133,5 @@ fun Project.printSplashScreen() {
)
}

fun dependency(group: String, artifact: String, version: String) = "$group:$artifact:$version"
fun KotlinDependencyHandler.implementation(group: String, artifact: String, version: String) =
implementation("$group:$artifact:$version")
24 changes: 12 additions & 12 deletions library/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,10 @@ kotlin {

dependencies {
implementation(kotlin("stdlib"))
implementation(dependency("io.ktor", "ktor-client-core", Versions.KTOR))
implementation(dependency("io.ktor", "ktor-client-json", Versions.KTOR))
implementation(dependency("io.ktor", "ktor-client-serialization", Versions.KTOR))
implementation(dependency("io.ktor", "ktor-client-logging", Versions.KTOR))
implementation("io.ktor", "ktor-client-core", Versions.KTOR)
implementation("io.ktor", "ktor-client-json", Versions.KTOR)
implementation("io.ktor", "ktor-client-serialization", Versions.KTOR)
implementation("io.ktor", "ktor-client-logging", Versions.KTOR)
}
}
val commonTest by getting {
Expand All @@ -82,8 +82,8 @@ kotlin {

val jvmMain by getting {
dependencies {
implementation(dependency("org.jetbrains.kotlinx", "kotlinx-coroutines-jdk8", Versions.COROUTINES))
implementation(dependency("io.ktor", "ktor-client-okhttp", Versions.KTOR))
implementation("org.jetbrains.kotlinx", "kotlinx-coroutines-jdk8", Versions.COROUTINES)
implementation("io.ktor", "ktor-client-okhttp", Versions.KTOR)
}
}
val jvmTest by getting {
Expand All @@ -95,9 +95,9 @@ kotlin {

val androidMain by getting {
dependencies {
implementation(dependency("org.jetbrains.kotlinx", "kotlinx-coroutines-android", Versions.COROUTINES))
implementation(dependency("io.ktor", "ktor-client-okhttp", Versions.KTOR))
implementation(dependency("org.slf4j", "slf4j-android", Versions.SLF4J))
implementation("org.jetbrains.kotlinx", "kotlinx-coroutines-android", Versions.COROUTINES)
implementation("io.ktor", "ktor-client-okhttp", Versions.KTOR)
implementation("org.slf4j", "slf4j-android", Versions.SLF4J)
}
}
val androidTest by getting {
Expand All @@ -110,7 +110,7 @@ kotlin {
// Javascript is commented for now - I don't know how this actually works and how to test it
// val jsMain by getting {
// dependencies {
// implementation(dependency("io.ktor", "ktor-client-json-js", "$versions.ktor"))
// implementation("io.ktor", "ktor-client-json-js", "$versions.ktor")
// }
// }
// val jsTest by getting {
Expand All @@ -121,15 +121,15 @@ kotlin {

val macosMain by getting {
dependencies {
implementation(dependency("io.ktor", "ktor-client-curl", Versions.KTOR))
implementation("io.ktor", "ktor-client-curl", Versions.KTOR)
}
}
val macosTest by getting {
}

val iosMain by getting {
dependencies {
implementation(dependency("io.ktor", "ktor-client-ios", Versions.KTOR))
implementation("io.ktor", "ktor-client-ios", Versions.KTOR)
}
}
val iosTest by getting {
Expand Down
2 changes: 1 addition & 1 deletion samples/sample-jvm/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ tasks.withType<KotlinCompile> {
dependencies {
// Kotlin
implementation(kotlin("stdlib-jdk8", Versions.KOTLIN))
implementation(dependency("org.jetbrains.kotlinx", "kotlinx-coroutines-jdk8", Versions.COROUTINES))
implementation("org.jetbrains.kotlinx", "kotlinx-coroutines-jdk8", Versions.COROUTINES)

// Library
implementation(project(":klibqonto"))
Expand Down

0 comments on commit f9a2474

Please sign in to comment.