File tree 3 files changed +37
-10
lines changed
3 files changed +37
-10
lines changed Original file line number Diff line number Diff line change 2
2
* Copyright 2016-2021 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license.
3
3
*/
4
4
5
+
5
6
import org.jetbrains.kotlin.gradle.plugin.KotlinPlatformType
6
7
import org.jetbrains.kotlin.konan.target.HostManager
7
8
import org.jetbrains.dokka.gradle.DokkaTaskPartial
8
9
9
- apply plugin : ' jdk-convention '
10
+ import static Projects.*
10
11
11
- def coreModule = " kotlinx-coroutines-core"
12
- def testModule = " kotlinx-coroutines-test"
13
- def multiplatform = [coreModule, testModule]
14
- // Not applicable for Kotlin plugin
15
- def sourceless = [' kotlinx.coroutines' , ' kotlinx-coroutines-bom' , ' integration-testing' ]
16
- def internal = [' kotlinx.coroutines' , ' benchmarks' , ' integration-testing' ]
17
- // Not published
18
- def unpublished = internal + [' example-frontend-js' , ' android-unit-tests' ]
12
+ apply plugin : ' jdk-convention'
19
13
20
14
buildscript {
21
15
/*
@@ -160,6 +154,8 @@ configure(subprojects.findAll { !sourceless.contains(it.name) && it.name != core
160
154
}
161
155
}
162
156
157
+ apply plugin : " bom-conventions"
158
+
163
159
// Configure subprojects with Kotlin sources
164
160
configure(subprojects. findAll { ! sourceless. contains(it. name) }) {
165
161
// Use atomicfu plugin, it also adds all the necessary dependencies
Original file line number Diff line number Diff line change 1
1
/*
2
2
* Copyright 2016-2021 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license.
3
3
*/
4
-
4
+ @file:JvmName( " Projects " )
5
5
import org.gradle.api.Project
6
6
7
7
fun Project.version (target : String ): String =
8
8
property(" ${target} _version" ) as String
9
+
10
+ val coreModule = " kotlinx-coroutines-core"
11
+ val testModule = " kotlinx-coroutines-test"
12
+
13
+ val multiplatform = setOf (coreModule, testModule)
14
+ // Not applicable for Kotlin plugin
15
+ val sourceless = setOf (" kotlinx.coroutines" , " kotlinx-coroutines-bom" , " integration-testing" )
16
+ val internal = setOf (" kotlinx.coroutines" , " benchmarks" , " integration-testing" )
17
+ // Not published
18
+ val unpublished = internal + setOf (" example-frontend-js" , " android-unit-tests" )
19
+
20
+ val Project .isMultiplatform: Boolean get() = name in multiplatform
Original file line number Diff line number Diff line change
1
+ /*
2
+ * Copyright 2016-2021 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license.
3
+ */
4
+ import org.gradle.kotlin.dsl.*
5
+ import org.jetbrains.kotlin.gradle.dsl.*
6
+
7
+
8
+ configure(subprojects.filter { it.name !in unpublished }) {
9
+ if (name == " kotlinx-coroutines-bom" || name == " kotlinx.coroutines" ) return @configure
10
+ if (isMultiplatform) {
11
+ kotlinExtension.sourceSets.getByName(" jvmMain" ).dependencies {
12
+ api(project.dependencies.platform(project(" :kotlinx-coroutines-bom" )))
13
+ }
14
+ } else {
15
+ dependencies {
16
+ " api" (platform(project(" :kotlinx-coroutines-bom" )))
17
+ }
18
+ }
19
+ }
You can’t perform that action at this time.
0 commit comments