blob: c94b317f4f8986c9b20240deab74b54c04873691 [file] [log] [blame]
/*
* Copyright 2016-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license.
*/
apply from: rootProject.file("gradle/compile-jvm.gradle")
def coroutines_version = version // all modules share the same version
repositories {
mavenLocal()
mavenCentral()
}
dependencies {
testCompile "org.jetbrains.kotlin:kotlin-stdlib-jdk8"
testCompile 'junit:junit:4.12'
testCompile 'org.apache.commons:commons-compress:1.18'
testCompile 'com.google.code.gson:gson:2.8.5'
}
compileTestKotlin {
kotlinOptions.jvmTarget = "1.8"
}
def dryRunNpm = properties['dryRun']
test {
onlyIf { dryRunNpm == "true" } // so that we don't accidentally publish anything, especially before the test
doFirst {
println "Verifying publishing version $coroutines_version"
// we can't depend on the subprojects because we need to test the classfiles that are published in the end.
// also, we can't put this in the `dependencies` block because the resolution would happen before publication.
classpath += project.configurations.detachedConfiguration(
project.dependencies.create("org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutines_version"),
project.dependencies.create("org.jetbrains.kotlinx:kotlinx-coroutines-android:$coroutines_version"))
}
environment "projectRoot", project.rootDir
environment "deployVersion", version
if (dryRunNpm == "true") { // `onlyIf` only affects execution of the task, not the dependency subtree
dependsOn(project(':').getTasksByName("publishNpm", true) +
project(':').getTasksByName("publishToMavenLocal", true))
dependsOn.remove(project(':').getTasksByName("dokka", true))
}
}