diff --git a/buildSrc/build.gradle.kts b/buildSrc/build.gradle.kts index 65213e22fd..96b17a3d99 100644 --- a/buildSrc/build.gradle.kts +++ b/buildSrc/build.gradle.kts @@ -4,22 +4,6 @@ import java.util.* -buildscript { - val cacheRedirectorEnabled = System.getenv("CACHE_REDIRECTOR")?.toBoolean() == true - - if (cacheRedirectorEnabled) { - println("Redirecting repositories for buildSrc buildscript") - } - - repositories { - if (cacheRedirectorEnabled) { - maven("https://cache-redirector.jetbrains.com/plugins.gradle.org/m2") - } else { - maven("https://plugins.gradle.org/m2") - } - } -} - plugins { `kotlin-dsl` } @@ -42,7 +26,7 @@ kotlinDslPluginOptions { experimentalWarning.set(false) } -private val props = Properties().apply { +val props = Properties().apply { file("../gradle.properties").inputStream().use { load(it) } } diff --git a/buildSrc/settings.gradle.kts b/buildSrc/settings.gradle.kts new file mode 100644 index 0000000000..e5267ea3e2 --- /dev/null +++ b/buildSrc/settings.gradle.kts @@ -0,0 +1,17 @@ +/* + * Copyright 2016-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license. + */ + +pluginManagement { + repositories { + val cacheRedirectorEnabled = System.getenv("CACHE_REDIRECTOR")?.toBoolean() == true + + if (cacheRedirectorEnabled) { + println("Redirecting repositories for buildSrc buildscript") + + maven("https://cache-redirector.jetbrains.com/plugins.gradle.org/m2") + } else { + maven("https://plugins.gradle.org/m2") + } + } +} diff --git a/gradle/compile-common.gradle b/gradle/compile-common.gradle index bee61429df..0dc1b5c014 100644 --- a/gradle/compile-common.gradle +++ b/gradle/compile-common.gradle @@ -3,10 +3,6 @@ */ kotlin.sourceSets { - commonMain.dependencies { - api "org.jetbrains.kotlin:kotlin-stdlib-common:$kotlin_version" - } - commonTest.dependencies { api "org.jetbrains.kotlin:kotlin-test-common:$kotlin_version" api "org.jetbrains.kotlin:kotlin-test-annotations-common:$kotlin_version" diff --git a/gradle/compile-js-multiplatform.gradle b/gradle/compile-js-multiplatform.gradle index 93d371a21f..b52cfc5230 100644 --- a/gradle/compile-js-multiplatform.gradle +++ b/gradle/compile-js-multiplatform.gradle @@ -26,10 +26,6 @@ kotlin { } sourceSets { - jsMain.dependencies { - api "org.jetbrains.kotlin:kotlin-stdlib-js:$kotlin_version" - } - jsTest.dependencies { api "org.jetbrains.kotlin:kotlin-test-js:$kotlin_version" } diff --git a/gradle/compile-js.gradle b/gradle/compile-js.gradle index 523380df01..55c81fe56e 100644 --- a/gradle/compile-js.gradle +++ b/gradle/compile-js.gradle @@ -7,7 +7,6 @@ apply plugin: 'org.jetbrains.kotlin.js' dependencies { - implementation "org.jetbrains.kotlin:kotlin-stdlib-js:$kotlin_version" testImplementation "org.jetbrains.kotlin:kotlin-test-js:$kotlin_version" } diff --git a/gradle/compile-jvm-multiplatform.gradle b/gradle/compile-jvm-multiplatform.gradle index 74495ba1dc..e72d30511e 100644 --- a/gradle/compile-jvm-multiplatform.gradle +++ b/gradle/compile-jvm-multiplatform.gradle @@ -10,10 +10,6 @@ kotlin { fromPreset(presets.jvm, 'jvm') } sourceSets { - jvmMain.dependencies { - api 'org.jetbrains.kotlin:kotlin-stdlib' - } - jvmTest.dependencies { api "org.jetbrains.kotlin:kotlin-test:$kotlin_version" // Workaround to make addSuppressed work in tests diff --git a/gradle/compile-jvm.gradle b/gradle/compile-jvm.gradle index 4ed0f840cd..caa5c45f60 100644 --- a/gradle/compile-jvm.gradle +++ b/gradle/compile-jvm.gradle @@ -10,7 +10,6 @@ sourceCompatibility = 1.6 targetCompatibility = 1.6 dependencies { - compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" testCompile "org.jetbrains.kotlin:kotlin-test:$kotlin_version" // Workaround to make addSuppressed work in tests testCompile "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version" diff --git a/integration/kotlinx-coroutines-guava/build.gradle b/integration/kotlinx-coroutines-guava/build.gradle deleted file mode 100644 index 16bdea50fd..0000000000 --- a/integration/kotlinx-coroutines-guava/build.gradle +++ /dev/null @@ -1,16 +0,0 @@ -/* - * Copyright 2016-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license. - */ - -ext.guava_version = '28.0-jre' - -dependencies { - compile "com.google.guava:guava:$guava_version" -} - -tasks.withType(dokka.getClass()) { - externalDocumentationLink { - url = new URL("https://google.github.io/guava/releases/$guava_version/api/docs/") - packageListUrl = projectDir.toPath().resolve("package.list").toUri().toURL() - } -} diff --git a/integration/kotlinx-coroutines-guava/build.gradle.kts b/integration/kotlinx-coroutines-guava/build.gradle.kts new file mode 100644 index 0000000000..53e91add44 --- /dev/null +++ b/integration/kotlinx-coroutines-guava/build.gradle.kts @@ -0,0 +1,13 @@ +/* + * Copyright 2016-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license. + */ + +val guavaVersion = "28.0-jre" + +dependencies { + compile("com.google.guava:guava:$guavaVersion") +} + +externalDocumentationLink( + url = "https://google.github.io/guava/releases/$guavaVersion/api/docs/" +) diff --git a/integration/kotlinx-coroutines-slf4j/build.gradle b/integration/kotlinx-coroutines-slf4j/build.gradle deleted file mode 100644 index 05accb75d3..0000000000 --- a/integration/kotlinx-coroutines-slf4j/build.gradle +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Copyright 2016-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license. - */ - -dependencies { - compile 'org.slf4j:slf4j-api:1.7.25' - testCompile 'io.github.microutils:kotlin-logging:1.5.4' - testRuntime 'ch.qos.logback:logback-classic:1.2.3' - testRuntime 'ch.qos.logback:logback-core:1.2.3' -} - -tasks.withType(dokka.getClass()) { - externalDocumentationLink { - packageListUrl = projectDir.toPath().resolve("package.list").toUri().toURL() - url = new URL("https://www.slf4j.org/apidocs/") - } -} diff --git a/integration/kotlinx-coroutines-slf4j/build.gradle.kts b/integration/kotlinx-coroutines-slf4j/build.gradle.kts new file mode 100644 index 0000000000..c7d0d82d62 --- /dev/null +++ b/integration/kotlinx-coroutines-slf4j/build.gradle.kts @@ -0,0 +1,14 @@ +/* + * Copyright 2016-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license. + */ + +dependencies { + compile("org.slf4j:slf4j-api:1.7.25") + testCompile("io.github.microutils:kotlin-logging:1.5.4") + testRuntime("ch.qos.logback:logback-classic:1.2.3") + testRuntime("ch.qos.logback:logback-core:1.2.3") +} + +externalDocumentationLink( + url = "https://www.slf4j.org/apidocs/" +) diff --git a/reactive/kotlinx-coroutines-jdk9/build.gradle b/reactive/kotlinx-coroutines-jdk9/build.gradle deleted file mode 100644 index 8737e8ed6d..0000000000 --- a/reactive/kotlinx-coroutines-jdk9/build.gradle +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright 2016-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license. - */ -targetCompatibility = 9 - -dependencies { - compile project(":kotlinx-coroutines-reactive") - compile "org.reactivestreams:reactive-streams-flow-adapters:$reactive_streams_version" -} - -compileTestKotlin { - kotlinOptions.jvmTarget = "9" -} - -compileKotlin { - kotlinOptions.jvmTarget = "9" -} - -tasks.withType(dokka.getClass()) { - externalDocumentationLink { - url = new URL("https://docs.oracle.com/javase/9/docs/api/java/util/concurrent/Flow.html") - packageListUrl = projectDir.toPath().resolve("package.list").toUri().toURL() - } -} diff --git a/reactive/kotlinx-coroutines-jdk9/build.gradle.kts b/reactive/kotlinx-coroutines-jdk9/build.gradle.kts new file mode 100644 index 0000000000..c721746f3b --- /dev/null +++ b/reactive/kotlinx-coroutines-jdk9/build.gradle.kts @@ -0,0 +1,22 @@ +/* + * Copyright 2016-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license. + */ + +dependencies { + compile(project(":kotlinx-coroutines-reactive")) + compile("org.reactivestreams:reactive-streams-flow-adapters:${version("reactive_streams")}") +} + +tasks { + compileKotlin { + kotlinOptions.jvmTarget = "9" + } + + compileTestKotlin { + kotlinOptions.jvmTarget = "9" + } +} + +externalDocumentationLink( + url = "https://docs.oracle.com/javase/9/docs/api/java/util/concurrent/Flow.html" +) diff --git a/reactive/kotlinx-coroutines-reactor/build.gradle b/reactive/kotlinx-coroutines-reactor/build.gradle deleted file mode 100644 index 3b640bd5cc..0000000000 --- a/reactive/kotlinx-coroutines-reactor/build.gradle +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright 2016-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license. - */ - -dependencies { - compile "io.projectreactor:reactor-core:$reactor_version" - compile project(':kotlinx-coroutines-reactive') -} - -tasks.withType(dokka.getClass()) { - externalDocumentationLink { - url = new URL("https://projectreactor.io/docs/core/$reactor_version/api/") - packageListUrl = projectDir.toPath().resolve("package.list").toUri().toURL() - } -} - -compileTestKotlin { - kotlinOptions.jvmTarget = "1.8" -} - -compileKotlin { - kotlinOptions.jvmTarget = "1.8" -} diff --git a/reactive/kotlinx-coroutines-reactor/build.gradle.kts b/reactive/kotlinx-coroutines-reactor/build.gradle.kts new file mode 100644 index 0000000000..d5fd208a27 --- /dev/null +++ b/reactive/kotlinx-coroutines-reactor/build.gradle.kts @@ -0,0 +1,25 @@ +/* + * Copyright 2016-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license. + */ + +val reactorVersion = version("reactor") + +dependencies { + compile("io.projectreactor:reactor-core:$reactorVersion") + compile(project(":kotlinx-coroutines-reactive")) +} + + +tasks { + compileKotlin { + kotlinOptions.jvmTarget = "1.8" + } + + compileTestKotlin { + kotlinOptions.jvmTarget = "1.8" + } +} + +externalDocumentationLink( + url = "https://projectreactor.io/docs/core/$reactorVersion/api/" +)