Roman Elizarov | 1f74a2d | 2018-06-29 19:19:45 +0300 | [diff] [blame] | 1 | /* |
Roman Elizarov | 660c2d7 | 2020-02-14 13:18:37 +0300 | [diff] [blame] | 2 | * Copyright 2016-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license. |
Roman Elizarov | 1f74a2d | 2018-06-29 19:19:45 +0300 | [diff] [blame] | 3 | */ |
Vsevolod Tolstopyatov | e50a0fa | 2019-01-28 11:34:24 +0300 | [diff] [blame] | 4 | import org.jetbrains.kotlin.konan.target.HostManager |
| 5 | |
Victor Turansky | e47cb35 | 2020-05-12 18:33:04 +0300 | [diff] [blame^] | 6 | apply plugin: 'jdk-convention' |
Vsevolod Tolstopyatov | e50a0fa | 2019-01-28 11:34:24 +0300 | [diff] [blame] | 7 | apply from: rootProject.file("gradle/experimental.gradle") |
| 8 | |
| 9 | def rootModule = "kotlinx.coroutines" |
| 10 | def coreModule = "kotlinx-coroutines-core" |
| 11 | // Not applicable for Kotlin plugin |
dkhalanskyjb | 02b403d | 2020-04-06 16:33:22 +0300 | [diff] [blame] | 12 | def sourceless = ['kotlinx.coroutines', 'site', 'kotlinx-coroutines-bom', 'integration-testing'] |
| 13 | def internal = ['kotlinx.coroutines', 'site', 'benchmarks', 'js-stub', 'stdlib-stubs', 'integration-testing'] |
Vsevolod Tolstopyatov | e50a0fa | 2019-01-28 11:34:24 +0300 | [diff] [blame] | 14 | // Not published |
Vsevolod Tolstopyatov | 5378b80 | 2019-09-19 17:39:08 +0300 | [diff] [blame] | 15 | def unpublished = internal + ['example-frontend-js', 'android-unit-tests'] |
Vsevolod Tolstopyatov | e50a0fa | 2019-01-28 11:34:24 +0300 | [diff] [blame] | 16 | |
Kirill Timofeev | a518696 | 2017-10-25 14:25:47 +0300 | [diff] [blame] | 17 | buildscript { |
Vsevolod Tolstopyatov | 585b766 | 2019-04-16 12:10:57 +0300 | [diff] [blame] | 18 | /* |
| 19 | * These property group is used to build kotlinx.coroutines against Kotlin compiler snapshot. |
| 20 | * How does it work: |
| 21 | * When build_snapshot_train is set to true, kotlin_version property is overridden with kotlin_snapshot_version, |
| 22 | * atomicfu_version is overwritten by TeamCity environment (AFU is built with snapshot and published to mavenLocal |
| 23 | * as previous step or the snapshot build). |
| 24 | * Additionally, mavenLocal and Sonatype snapshots are added to repository list and stress tests are disabled. |
| 25 | * DO NOT change the name of these properties without adapting kotlinx.train build chain. |
| 26 | */ |
| 27 | def prop = rootProject.properties['build_snapshot_train'] |
| 28 | ext.build_snapshot_train = prop != null && prop != "" |
| 29 | if (build_snapshot_train) { |
| 30 | ext.kotlin_version = rootProject.properties['kotlin_snapshot_version'] |
| 31 | if (kotlin_version == null) { |
| 32 | throw new IllegalArgumentException("'kotlin_snapshot_version' should be defined when building with snapshot compiler") |
| 33 | } |
Roman Elizarov | e1ac2e5 | 2019-04-19 18:51:05 +0300 | [diff] [blame] | 34 | } |
| 35 | |
Roman Elizarov | 660c2d7 | 2020-02-14 13:18:37 +0300 | [diff] [blame] | 36 | // Determine if any project dependency is using a snapshot version |
| 37 | ext.using_snapshot_version = build_snapshot_train |
| 38 | rootProject.properties.each { key, value -> |
| 39 | if (key.endsWith("_version") && value instanceof String && value.endsWith("-SNAPSHOT")) { |
| 40 | println("NOTE: USING SNAPSHOT VERSION: $key=$value") |
| 41 | ext.using_snapshot_version=true |
| 42 | } |
| 43 | } |
| 44 | |
| 45 | if (using_snapshot_version) { |
Roman Elizarov | 1f6b44d | 2017-10-26 17:51:52 +0300 | [diff] [blame] | 46 | repositories { |
Vsevolod Tolstopyatov | 585b766 | 2019-04-16 12:10:57 +0300 | [diff] [blame] | 47 | mavenLocal() |
Roman Elizarov | 1f6b44d | 2017-10-26 17:51:52 +0300 | [diff] [blame] | 48 | maven { url "https://oss.sonatype.org/content/repositories/snapshots" } |
| 49 | } |
| 50 | } |
Roman Elizarov | e1ac2e5 | 2019-04-19 18:51:05 +0300 | [diff] [blame] | 51 | |
Kirill Timofeev | a518696 | 2017-10-25 14:25:47 +0300 | [diff] [blame] | 52 | repositories { |
| 53 | jcenter() |
Roman Elizarov | 3145290 | 2018-04-11 13:58:19 +0300 | [diff] [blame] | 54 | maven { url "https://kotlin.bintray.com/kotlinx" } |
Michael Kuzmin | 476d6de | 2019-12-16 22:38:59 +0300 | [diff] [blame] | 55 | maven { |
| 56 | url "https://kotlin.bintray.com/kotlin-dev" |
| 57 | credentials { |
| 58 | username = project.hasProperty('bintrayUser') ? project.property('bintrayUser') : System.getenv('BINTRAY_USER') ?: "" |
| 59 | password = project.hasProperty('bintrayApiKey') ? project.property('bintrayApiKey') : System.getenv('BINTRAY_API_KEY') ?: "" |
| 60 | } |
| 61 | } |
Roman Elizarov | 0950dfa | 2018-07-13 10:33:25 +0300 | [diff] [blame] | 62 | maven { url "https://kotlin.bintray.com/kotlin-eap" } |
Roman Elizarov | 3145290 | 2018-04-11 13:58:19 +0300 | [diff] [blame] | 63 | maven { url "https://jetbrains.bintray.com/kotlin-native-dependencies" } |
Roman Elizarov | 65eff0b | 2017-12-20 15:51:31 +0300 | [diff] [blame] | 64 | maven { url "https://plugins.gradle.org/m2/" } |
Kirill Timofeev | a518696 | 2017-10-25 14:25:47 +0300 | [diff] [blame] | 65 | } |
Vsevolod Tolstopyatov | e50a0fa | 2019-01-28 11:34:24 +0300 | [diff] [blame] | 66 | |
Kirill Timofeev | a518696 | 2017-10-25 14:25:47 +0300 | [diff] [blame] | 67 | dependencies { |
| 68 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" |
| 69 | classpath "org.jetbrains.dokka:dokka-gradle-plugin:$dokka_version" |
Vsevolod Tolstopyatov | 585b766 | 2019-04-16 12:10:57 +0300 | [diff] [blame] | 70 | classpath "org.jetbrains.kotlinx:atomicfu-gradle-plugin:$atomicfu_version" |
Roman Elizarov | 660c2d7 | 2020-02-14 13:18:37 +0300 | [diff] [blame] | 71 | classpath "org.jetbrains.kotlinx:kotlinx-knit:$knit_version" |
Roman Elizarov | 65eff0b | 2017-12-20 15:51:31 +0300 | [diff] [blame] | 72 | classpath "com.moowork.gradle:gradle-node-plugin:$gradle_node_version" |
Vsevolod Tolstopyatov | e153863 | 2020-02-10 21:12:58 +0300 | [diff] [blame] | 73 | classpath "org.jetbrains.kotlinx:binary-compatibility-validator:$binary_compatibility_validator_version" |
Vsevolod Tolstopyatov | 305c66a | 2018-08-21 21:01:58 +0300 | [diff] [blame] | 74 | |
| 75 | // JMH plugins |
Vsevolod Tolstopyatov | bda9c79 | 2019-09-12 16:50:33 +0300 | [diff] [blame] | 76 | classpath "com.github.jengelman.gradle.plugins:shadow:5.1.0" |
Kirill Timofeev | a518696 | 2017-10-25 14:25:47 +0300 | [diff] [blame] | 77 | } |
| 78 | } |
| 79 | |
Roman Elizarov | d2f4b2b | 2019-09-02 17:22:39 +0300 | [diff] [blame] | 80 | import org.jetbrains.kotlin.gradle.plugin.KotlinPlatformType |
| 81 | |
| 82 | // todo:KLUDGE: This is needed to workaround dependency resolution between Java and MPP modules |
| 83 | def configureKotlinJvmPlatform(configuration) { |
| 84 | configuration.attributes.attribute(KotlinPlatformType.attribute, KotlinPlatformType.jvm) |
| 85 | } |
| 86 | |
Ilya Gorbunov | b1a07ee | 2018-04-16 21:51:55 +0300 | [diff] [blame] | 87 | allprojects { |
Vsevolod Tolstopyatov | e50a0fa | 2019-01-28 11:34:24 +0300 | [diff] [blame] | 88 | // the only place where HostManager could be instantiated |
| 89 | project.ext.hostManager = new HostManager() |
Vsevolod Tolstopyatov | 585b766 | 2019-04-16 12:10:57 +0300 | [diff] [blame] | 90 | def deployVersion = properties['DeployVersion'] |
| 91 | if (deployVersion != null) version = deployVersion |
| 92 | |
| 93 | if (build_snapshot_train) { |
| 94 | ext.kotlin_version = rootProject.properties['kotlin_snapshot_version'] |
| 95 | println "Using Kotlin $kotlin_version for project $it" |
| 96 | |
Vsevolod Tolstopyatov | 6ca6ed5 | 2019-08-21 17:08:34 +0300 | [diff] [blame] | 97 | def skipSnapshotChecks = rootProject.properties['skip_snapshot_checks'] != null |
| 98 | if (!skipSnapshotChecks && version != atomicfu_version) { |
Vsevolod Tolstopyatov | 585b766 | 2019-04-16 12:10:57 +0300 | [diff] [blame] | 99 | throw new IllegalStateException("Current deploy version is $version, but atomicfu version is not overridden ($atomicfu_version) for $it") |
| 100 | } |
| 101 | |
| 102 | kotlin_version = rootProject.properties['kotlin_snapshot_version'] |
Roman Elizarov | e1ac2e5 | 2019-04-19 18:51:05 +0300 | [diff] [blame] | 103 | } |
| 104 | |
Roman Elizarov | 660c2d7 | 2020-02-14 13:18:37 +0300 | [diff] [blame] | 105 | if (using_snapshot_version) { |
Vsevolod Tolstopyatov | 585b766 | 2019-04-16 12:10:57 +0300 | [diff] [blame] | 106 | repositories { |
| 107 | mavenLocal() |
| 108 | maven { url "https://oss.sonatype.org/content/repositories/snapshots" } |
| 109 | } |
| 110 | } |
Vsevolod Tolstopyatov | fe4e05c | 2019-07-19 12:28:15 +0300 | [diff] [blame] | 111 | |
| 112 | ext.unpublished = unpublished |
Roman Elizarov | 0b16abf | 2019-09-03 11:07:11 +0300 | [diff] [blame] | 113 | |
| 114 | // This project property is set during nightly stress test |
| 115 | def stressTest = project.properties['stressTest'] |
| 116 | |
| 117 | // Copy it to all test tasks |
| 118 | tasks.withType(Test) { |
| 119 | systemProperty 'stressTest', stressTest |
| 120 | } |
Vsevolod Tolstopyatov | e50a0fa | 2019-01-28 11:34:24 +0300 | [diff] [blame] | 121 | } |
| 122 | |
Vsevolod Tolstopyatov | e153863 | 2020-02-10 21:12:58 +0300 | [diff] [blame] | 123 | apply plugin: "binary-compatibility-validator" |
| 124 | apiValidation { |
dkhalanskyjb | 3651276 | 2020-02-21 17:31:05 +0300 | [diff] [blame] | 125 | ignoredProjects += unpublished + ["kotlinx-coroutines-bom"] |
Vsevolod Tolstopyatov | aff8202 | 2020-03-10 19:58:36 +0300 | [diff] [blame] | 126 | if (build_snapshot_train) { |
| 127 | ignoredProjects.remove("site") |
| 128 | ignoredProjects.remove("example-frontend-js") |
| 129 | } |
Vsevolod Tolstopyatov | e153863 | 2020-02-10 21:12:58 +0300 | [diff] [blame] | 130 | ignoredPackages += "kotlinx.coroutines.internal" |
| 131 | } |
| 132 | |
Roman Elizarov | bf9509d | 2020-02-14 15:52:10 +0300 | [diff] [blame] | 133 | // Configure repositories |
Vsevolod Tolstopyatov | e50a0fa | 2019-01-28 11:34:24 +0300 | [diff] [blame] | 134 | allprojects { |
Roman Elizarov | bf9509d | 2020-02-14 15:52:10 +0300 | [diff] [blame] | 135 | String projectName = it.name |
Roman Elizarov | 18fa116 | 2018-06-27 15:13:01 +0300 | [diff] [blame] | 136 | repositories { |
Vsevolod Tolstopyatov | 6f01c93 | 2018-10-23 19:40:48 +0300 | [diff] [blame] | 137 | /* |
| 138 | * google should be first in the repository list because some of the play services |
| 139 | * transitive dependencies was removed from jcenter, thus breaking gradle dependency resolution |
| 140 | */ |
Roman Elizarov | 660c2d7 | 2020-02-14 13:18:37 +0300 | [diff] [blame] | 141 | google() |
Roman Elizarov | 18fa116 | 2018-06-27 15:13:01 +0300 | [diff] [blame] | 142 | jcenter() |
Michael Kuzmin | 476d6de | 2019-12-16 22:38:59 +0300 | [diff] [blame] | 143 | maven { |
| 144 | url "https://kotlin.bintray.com/kotlin-dev" |
| 145 | credentials { |
| 146 | username = project.hasProperty('bintrayUser') ? project.property('bintrayUser') : System.getenv('BINTRAY_USER') ?: "" |
| 147 | password = project.hasProperty('bintrayApiKey') ? project.property('bintrayApiKey') : System.getenv('BINTRAY_API_KEY') ?: "" |
| 148 | } |
| 149 | } |
Roman Elizarov | 0950dfa | 2018-07-13 10:33:25 +0300 | [diff] [blame] | 150 | maven { url "https://kotlin.bintray.com/kotlin-eap" } |
Roman Elizarov | 18fa116 | 2018-06-27 15:13:01 +0300 | [diff] [blame] | 151 | maven { url "https://kotlin.bintray.com/kotlinx" } |
| 152 | } |
Roman Elizarov | bf9509d | 2020-02-14 15:52:10 +0300 | [diff] [blame] | 153 | } |
Ilya Gorbunov | b1a07ee | 2018-04-16 21:51:55 +0300 | [diff] [blame] | 154 | |
Roman Elizarov | bf9509d | 2020-02-14 15:52:10 +0300 | [diff] [blame] | 155 | // Add dependency to core source sets. Core is configured in kx-core/build.gradle |
| 156 | configure(subprojects.findAll { !sourceless.contains(it.name) && it.name != coreModule }) { |
Vsevolod Tolstopyatov | e50a0fa | 2019-01-28 11:34:24 +0300 | [diff] [blame] | 157 | evaluationDependsOn(":$coreModule") |
Victor Turansky | de38890 | 2020-05-02 14:22:30 +0300 | [diff] [blame] | 158 | def platform = PlatformKt.platformOf(it) |
Roman Elizarov | e1a5652 | 2018-04-04 10:31:08 +0300 | [diff] [blame] | 159 | apply from: rootProject.file("gradle/compile-${platform}.gradle") |
Vsevolod Tolstopyatov | e50a0fa | 2019-01-28 11:34:24 +0300 | [diff] [blame] | 160 | dependencies { |
| 161 | // See comment below for rationale, it will be replaced with "project" dependency |
| 162 | compile "org.jetbrains.kotlinx:kotlinx-coroutines-core:$version" |
Vsevolod Tolstopyatov | e50a0fa | 2019-01-28 11:34:24 +0300 | [diff] [blame] | 163 | // the only way IDEA can resolve test classes |
| 164 | testCompile project(":$coreModule").kotlin.targets.jvm.compilations.test.output.allOutputs |
| 165 | } |
Roman Elizarov | bf9509d | 2020-02-14 15:52:10 +0300 | [diff] [blame] | 166 | } |
Vsevolod Tolstopyatov | e50a0fa | 2019-01-28 11:34:24 +0300 | [diff] [blame] | 167 | |
Roman Elizarov | bf9509d | 2020-02-14 15:52:10 +0300 | [diff] [blame] | 168 | // Configure subprojects with Kotlin sources |
| 169 | configure(subprojects.findAll { !sourceless.contains(it.name) }) { |
| 170 | // Use atomicfu plugin, it also adds all the necessary dependencies |
| 171 | apply plugin: 'kotlinx-atomicfu' |
| 172 | |
| 173 | // Configure options for all Kotlin compilation tasks |
Vsevolod Tolstopyatov | e50a0fa | 2019-01-28 11:34:24 +0300 | [diff] [blame] | 174 | tasks.withType(org.jetbrains.kotlin.gradle.tasks.AbstractKotlinCompile).all { |
| 175 | kotlinOptions.freeCompilerArgs += experimentalAnnotations.collect { "-Xuse-experimental=" + it } |
| 176 | kotlinOptions.freeCompilerArgs += "-progressive" |
Vsevolod Tolstopyatov | a8904e2 | 2019-07-17 17:22:05 -0700 | [diff] [blame] | 177 | kotlinOptions.freeCompilerArgs += "-XXLanguage:+InlineClasses" |
Roman Elizarov | bf9509d | 2020-02-14 15:52:10 +0300 | [diff] [blame] | 178 | // Remove null assertions to get smaller bytecode on Android |
| 179 | kotlinOptions.freeCompilerArgs += ["-Xno-param-assertions", "-Xno-receiver-assertions", "-Xno-call-assertions"] |
Vsevolod Tolstopyatov | e50a0fa | 2019-01-28 11:34:24 +0300 | [diff] [blame] | 180 | } |
Kirill Timofeev | a518696 | 2017-10-25 14:25:47 +0300 | [diff] [blame] | 181 | } |
| 182 | |
Vsevolod Tolstopyatov | 585b766 | 2019-04-16 12:10:57 +0300 | [diff] [blame] | 183 | if (build_snapshot_train) { |
| 184 | println "Hacking test tasks, removing stress and flaky tests" |
| 185 | allprojects { |
| 186 | tasks.withType(Test).all { |
Vsevolod Tolstopyatov | dbe3f48 | 2019-04-17 17:51:13 +0300 | [diff] [blame] | 187 | exclude '**/*LinearizabilityTest*' |
| 188 | exclude '**/*LFTest*' |
| 189 | exclude '**/*StressTest*' |
| 190 | exclude '**/*scheduling*' |
| 191 | exclude '**/*Timeout*' |
Vsevolod Tolstopyatov | 1748ce1 | 2019-04-18 14:49:35 +0300 | [diff] [blame] | 192 | exclude '**/*definitely/not/kotlinx*' |
Vsevolod Tolstopyatov | 642989e | 2020-01-24 20:00:46 +0300 | [diff] [blame] | 193 | // Disable because of KT-11567 in 1.4 |
Vsevolod Tolstopyatov | fb990b0 | 2020-02-04 17:11:47 +0300 | [diff] [blame] | 194 | exclude '**/*CasesPublicAPITest*' |
Vsevolod Tolstopyatov | 1748ce1 | 2019-04-18 14:49:35 +0300 | [diff] [blame] | 195 | } |
| 196 | } |
| 197 | |
| 198 | println "Manifest of kotlin-compiler-embeddable.jar for coroutines" |
| 199 | configure(subprojects.findAll { it.name == "kotlinx-coroutines-core" }) { |
| 200 | configurations.matching { it.name == "kotlinCompilerClasspath" }.all { |
| 201 | resolvedConfiguration.getFiles().findAll { it.name.contains("kotlin-compiler-embeddable") }.each { |
| 202 | def manifest = zipTree(it).matching { |
| 203 | include 'META-INF/MANIFEST.MF' |
| 204 | }.getFiles().first() |
| 205 | |
| 206 | manifest.readLines().each { |
| 207 | println it |
| 208 | } |
| 209 | } |
Vsevolod Tolstopyatov | 585b766 | 2019-04-16 12:10:57 +0300 | [diff] [blame] | 210 | } |
| 211 | } |
| 212 | } |
| 213 | |
Vsevolod Tolstopyatov | e50a0fa | 2019-01-28 11:34:24 +0300 | [diff] [blame] | 214 | /* |
| 215 | * Hack to trick nmpp plugin: we are renaming artifacts in order to provide backward compatibility for dependencies, |
| 216 | * but publishing plugin does not re-read artifact names for kotlin-jvm projects, so renaming is not applied in pom files |
| 217 | * for JVM-only projects. |
| 218 | * |
Victor Turansky | a8f4b64 | 2020-04-28 14:30:02 +0300 | [diff] [blame] | 219 | * We artificially replace "project" dependency with "module" one to have proper names in pom files, but then substitute it |
Vsevolod Tolstopyatov | e50a0fa | 2019-01-28 11:34:24 +0300 | [diff] [blame] | 220 | * to have out "project" dependency back. |
| 221 | */ |
| 222 | configure(subprojects.findAll { it.name != coreModule && it.name != rootModule }) { |
| 223 | configurations.all { |
| 224 | resolutionStrategy.dependencySubstitution { |
| 225 | substitute module("org.jetbrains.kotlinx:kotlinx-coroutines-core:$version") with project(':kotlinx-coroutines-core') |
| 226 | } |
| 227 | } |
| 228 | } |
Kirill Timofeev | a518696 | 2017-10-25 14:25:47 +0300 | [diff] [blame] | 229 | |
Vsevolod Tolstopyatov | e50a0fa | 2019-01-28 11:34:24 +0300 | [diff] [blame] | 230 | // Redefine source sets because we are not using 'kotlin/main/fqn' folder convention |
| 231 | configure(subprojects.findAll { !sourceless.contains(it.name) && it.name != "benchmarks" && it.name != coreModule }) { |
Vsevolod Tolstopyatov | e1fa197 | 2018-06-19 15:54:58 +0300 | [diff] [blame] | 232 | sourceSets { |
Roman Elizarov | f9408f6 | 2018-06-29 20:12:52 +0300 | [diff] [blame] | 233 | main.kotlin.srcDirs = ['src'] |
| 234 | test.kotlin.srcDirs = ['test'] |
Vsevolod Tolstopyatov | e50a0fa | 2019-01-28 11:34:24 +0300 | [diff] [blame] | 235 | main.resources.srcDirs = ['resources'] |
| 236 | test.resources.srcDirs = ['test-resources'] |
Vsevolod Tolstopyatov | e1fa197 | 2018-06-19 15:54:58 +0300 | [diff] [blame] | 237 | } |
| 238 | } |
| 239 | |
Vsevolod Tolstopyatov | e50a0fa | 2019-01-28 11:34:24 +0300 | [diff] [blame] | 240 | def core_docs_url = "https://kotlin.github.io/kotlinx.coroutines/$coreModule/" |
| 241 | def core_docs_file = "$projectDir/kotlinx-coroutines-core/build/dokka/kotlinx-coroutines-core/package-list" |
Kirill Timofeev | a518696 | 2017-10-25 14:25:47 +0300 | [diff] [blame] | 242 | |
| 243 | configure(subprojects.findAll { !unpublished.contains(it.name) }) { |
Vsevolod Tolstopyatov | fe4e05c | 2019-07-19 12:28:15 +0300 | [diff] [blame] | 244 | if (it.name != 'kotlinx-coroutines-bom') { |
| 245 | apply from: rootProject.file('gradle/dokka.gradle') |
| 246 | } |
Roman Elizarov | 65eff0b | 2017-12-20 15:51:31 +0300 | [diff] [blame] | 247 | apply from: rootProject.file('gradle/publish-bintray.gradle') |
Kirill Timofeev | a518696 | 2017-10-25 14:25:47 +0300 | [diff] [blame] | 248 | } |
| 249 | |
Roman Elizarov | 65eff0b | 2017-12-20 15:51:31 +0300 | [diff] [blame] | 250 | configure(subprojects.findAll { !unpublished.contains(it.name) }) { |
Vsevolod Tolstopyatov | fe4e05c | 2019-07-19 12:28:15 +0300 | [diff] [blame] | 251 | if (it.name != "kotlinx-coroutines-bom") { |
| 252 | if (it.name != coreModule) { |
| 253 | dokka.dependsOn project(":$coreModule").dokka |
| 254 | tasks.withType(dokka.getClass()) { |
| 255 | externalDocumentationLink { |
| 256 | url = new URL(core_docs_url) |
Roman Elizarov | 660c2d7 | 2020-02-14 13:18:37 +0300 | [diff] [blame] | 257 | packageListUrl = new File(core_docs_file).toURI().toURL() |
Vsevolod Tolstopyatov | fe4e05c | 2019-07-19 12:28:15 +0300 | [diff] [blame] | 258 | } |
Roman Elizarov | 65eff0b | 2017-12-20 15:51:31 +0300 | [diff] [blame] | 259 | } |
| 260 | } |
Vsevolod Tolstopyatov | e6e8239 | 2018-10-09 19:06:29 +0300 | [diff] [blame] | 261 | } |
Kirill Timofeev | a518696 | 2017-10-25 14:25:47 +0300 | [diff] [blame] | 262 | } |
| 263 | |
Vsevolod Tolstopyatov | e50a0fa | 2019-01-28 11:34:24 +0300 | [diff] [blame] | 264 | // Report Kotlin compiler version when building project |
| 265 | println("Using Kotlin compiler version: $org.jetbrains.kotlin.config.KotlinCompilerVersion.VERSION") |
| 266 | |
| 267 | // --------------- Configure sub-projects that are published --------------- |
Roman Elizarov | 1ac3dc2 | 2020-02-14 15:39:09 +0300 | [diff] [blame] | 268 | def publishTasks = getTasksByName("publish", true) + getTasksByName("publishNpm", true) |
| 269 | |
Roman Elizarov | 1ac3dc2 | 2020-02-14 15:39:09 +0300 | [diff] [blame] | 270 | task deploy(dependsOn: publishTasks) |
Roman Elizarov | 94fb2a3 | 2018-03-05 17:32:59 +0300 | [diff] [blame] | 271 | |
Kirill Timofeev | a518696 | 2017-10-25 14:25:47 +0300 | [diff] [blame] | 272 | apply plugin: 'base' |
| 273 | |
| 274 | clean.dependsOn gradle.includedBuilds.collect { it.task(':clean') } |
Roman Elizarov | 660c2d7 | 2020-02-14 13:18:37 +0300 | [diff] [blame] | 275 | |
| 276 | // --------------- Knit configuration --------------- |
| 277 | |
| 278 | apply plugin: 'kotlinx-knit' |
| 279 | |
| 280 | knit { |
| 281 | siteRoot = "https://kotlin.github.io/kotlinx.coroutines" |
| 282 | moduleRoots = [".", "integration", "reactive", "ui"] |
| 283 | } |
| 284 | |
Vsevolod Tolstopyatov | aff8202 | 2020-03-10 19:58:36 +0300 | [diff] [blame] | 285 | knitPrepare.dependsOn getTasksByName("dokka", true) |