File tree Expand file tree Collapse file tree 19 files changed +226
-195
lines changed
integration/kotlinx-coroutines-play-services
reactive/kotlinx-coroutines-reactive
kotlinx-coroutines-android
kotlinx-coroutines-javafx Expand file tree Collapse file tree 19 files changed +226
-195
lines changed Original file line number Diff line number Diff line change 2
2
* Copyright 2016-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license.
3
3
*/
4
4
5
+ @file:Suppress(" UnstableApiUsage" )
6
+
5
7
import me.champeau.gradle.*
6
8
import org.jetbrains.kotlin.gradle.tasks.*
7
9
@@ -33,7 +35,7 @@ tasks.named<KotlinCompile>("compileJmhKotlin") {
33
35
* Due to a bug in the inliner it sometimes does not remove inlined symbols (that are later renamed) from unused code paths,
34
36
* and it breaks JMH that tries to post-process these symbols and fails because they are renamed.
35
37
*/
36
- val removeRedundantFiles = tasks.register< Delete >( " removeRedundantFiles " ) {
38
+ val removeRedundantFiles by tasks.registering( Delete :: class ) {
37
39
delete(" $buildDir /classes/kotlin/jmh/benchmarks/flow/scrabble/FlowPlaysScrabbleOpt\$ play\$ buildHistoOnScore\$ 1\$\$ special\$\$ inlined\$ filter\$ 1\$ 1.class" )
38
40
delete(" $buildDir /classes/kotlin/jmh/benchmarks/flow/scrabble/FlowPlaysScrabbleOpt\$ play\$ nBlanks\$ 1\$\$ special\$\$ inlined\$ map\$ 1\$ 1.class" )
39
41
delete(" $buildDir /classes/kotlin/jmh/benchmarks/flow/scrabble/FlowPlaysScrabbleOpt\$ play\$ score2\$ 1\$\$ special\$\$ inlined\$ map\$ 1\$ 1.class" )
@@ -71,10 +73,10 @@ extensions.configure<JMHPluginExtension>("jmh") {
71
73
}
72
74
73
75
tasks.named<Jar >(" jmhJar" ) {
74
- baseName = " benchmarks"
75
- classifier = null
76
- version = null
77
- destinationDir = file(" $rootDir " )
76
+ archiveBaseName by " benchmarks"
77
+ archiveClassifier by null
78
+ archiveVersion by null
79
+ destinationDirectory. file(" $rootDir " )
78
80
}
79
81
80
82
dependencies {
Original file line number Diff line number Diff line change @@ -252,7 +252,7 @@ configure(subprojects.findAll { it.name != coreModule && it.name != rootModule }
252
252
}
253
253
254
254
// Redefine source sets because we are not using 'kotlin/main/fqn' folder convention
255
- configure(subprojects. findAll { ! sourceless. contains(it. name) && it. name != " benchmarks" && it. name != coreModule }) {
255
+ configure(subprojects. findAll { ! sourceless. contains(it. name) && it. name != " benchmarks" && it. name != ' example-frontend-js ' && it . name != coreModule }) {
256
256
sourceSets {
257
257
main. kotlin. srcDirs = [' src' ]
258
258
test. kotlin. srcDirs = [' test' ]
Original file line number Diff line number Diff line change
1
+ import java.util.*
2
+
1
3
plugins {
2
4
`kotlin- dsl`
3
5
}
4
6
5
7
repositories {
6
8
gradlePluginPortal()
9
+ maven(" https://kotlin.bintray.com/kotlin-eap" )
10
+ maven(" https://kotlin.bintray.com/kotlin-dev" )
7
11
}
8
12
9
13
kotlinDslPluginOptions {
10
14
experimentalWarning.set(false )
11
15
}
16
+
17
+ val props = Properties ().apply {
18
+ file(" ../gradle.properties" ).inputStream().use { load(it) }
19
+ }
20
+
21
+ fun version (target : String ): String =
22
+ props.getProperty(" ${target} _version" )
23
+
24
+ dependencies {
25
+ implementation(kotlin(" gradle-plugin" , version(" kotlin" )))
26
+ implementation(" org.jetbrains.dokka:dokka-gradle-plugin:${version(" dokka" )} " )
27
+ }
Original file line number Diff line number Diff line change
1
+ /*
2
+ * Copyright 2016-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license.
3
+ */
4
+
5
+ import org.gradle.api.Project
6
+ import org.gradle.kotlin.dsl.delegateClosureOf
7
+ import org.gradle.kotlin.dsl.withType
8
+ import org.jetbrains.dokka.DokkaConfiguration.ExternalDocumentationLink.Builder
9
+ import org.jetbrains.dokka.gradle.DokkaTask
10
+ import java.io.File
11
+ import java.net.URL
12
+
13
+ fun Project.externalDocumentationLink (
14
+ url : String ,
15
+ packageList : File = projectDir.resolve("package.list")
16
+ ) {
17
+ tasks.withType<DokkaTask >().configureEach {
18
+ externalDocumentationLink(delegateClosureOf<Builder > {
19
+ this .url = URL (url)
20
+ packageListUrl = packageList.toPath().toUri().toURL()
21
+ })
22
+ }
23
+ }
Original file line number Diff line number Diff line change 5
5
@file:Suppress(" UnstableApiUsage" )
6
6
7
7
import org.gradle.api.Project
8
- import org.gradle.api.provider.Property
9
8
import org.gradle.api.publish.maven.MavenPom
10
9
11
10
// --------------- pom configuration ---------------
@@ -36,7 +35,3 @@ fun MavenPom.configureMavenCentralMetadata(project: Project) {
36
35
url by " https://github.com/Kotlin/kotlinx.coroutines"
37
36
}
38
37
}
39
-
40
- private infix fun <T > Property<T>.by (value : T ) {
41
- set(value)
42
- }
Original file line number Diff line number Diff line change
1
+ /*
2
+ * Copyright 2016-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license.
3
+ */
4
+
5
+ @file:Suppress(" UnstableApiUsage" )
6
+
7
+ import org.gradle.api.provider.*
8
+
9
+ infix fun <T > Property<T>.by (value : T ) {
10
+ set(value)
11
+ }
Original file line number Diff line number Diff line change
1
+ import org.gradle.api.tasks.InputFile
2
+ import org.gradle.api.tasks.InputFiles
3
+ import org.gradle.api.tasks.JavaExec
4
+ import org.gradle.api.tasks.OutputDirectory
5
+ import org.gradle.api.tasks.bundling.Zip
6
+ import org.gradle.kotlin.dsl.get
7
+ import org.gradle.kotlin.dsl.named
8
+ import java.io.File
9
+
10
+ open class RunR8 : JavaExec () {
11
+
12
+ @OutputDirectory
13
+ lateinit var outputDex: File
14
+
15
+ @InputFile
16
+ lateinit var inputConfig: File
17
+
18
+ @InputFile
19
+ val inputConfigCommon: File = File (" testdata/r8-test-common.pro" )
20
+
21
+ @InputFiles
22
+ val jarFile: File = project.tasks.named<Zip >(" jar" ).get().archivePath
23
+
24
+ init {
25
+ classpath = project.configurations[" r8" ]
26
+ main = " com.android.tools.r8.R8"
27
+ }
28
+
29
+ override fun exec () {
30
+ // Resolve classpath only during execution
31
+ val arguments = mutableListOf (
32
+ " --release" ,
33
+ " --no-desugaring" ,
34
+ " --output" , outputDex.absolutePath,
35
+ " --pg-conf" , inputConfig.absolutePath
36
+ )
37
+ arguments.addAll(project.configurations[" runtimeClasspath" ].files.map { it.absolutePath })
38
+ arguments.add(jarFile.absolutePath)
39
+
40
+ args = arguments
41
+
42
+ project.delete(outputDex)
43
+ outputDex.mkdirs()
44
+
45
+ super .exec()
46
+ }
47
+ }
Original file line number Diff line number Diff line change
1
+ import org.gradle.api.artifacts.transform.InputArtifact
2
+ import org.gradle.api.artifacts.transform.TransformAction
3
+ import org.gradle.api.artifacts.transform.TransformOutputs
4
+ import org.gradle.api.artifacts.transform.TransformParameters
5
+ import org.gradle.api.file.FileSystemLocation
6
+ import org.gradle.api.provider.Provider
7
+ import java.io.File
8
+ import java.nio.file.Files
9
+ import java.util.zip.ZipEntry
10
+ import java.util.zip.ZipFile
11
+
12
+ @Suppress(" UnstableApiUsage" )
13
+ abstract class UnpackAar : TransformAction <TransformParameters .None > {
14
+ @get:InputArtifact
15
+ abstract val inputArtifact: Provider <FileSystemLocation >
16
+
17
+ override fun transform (outputs : TransformOutputs ) {
18
+ ZipFile (inputArtifact.get().asFile).use { zip ->
19
+ zip.entries().asSequence()
20
+ .filter { ! it.isDirectory }
21
+ .filter { it.name.endsWith(" .jar" ) }
22
+ .forEach { zip.unzip(it, outputs.file(it.name)) }
23
+ }
24
+ }
25
+ }
26
+
27
+ private fun ZipFile.unzip (entry : ZipEntry , output : File ) {
28
+ getInputStream(entry).use {
29
+ Files .copy(it, output.toPath())
30
+ }
31
+ }
Original file line number Diff line number Diff line change 4
4
5
5
// Platform-specific configuration to compile JS modules
6
6
7
- apply plugin : ' kotlin2js'
7
+ apply plugin : ' org.jetbrains.kotlin.js'
8
+
9
+ kotlin. sourceSets {
10
+ main. kotlin. srcDirs = [' src' ]
11
+ test. kotlin. srcDirs = [' test' ]
12
+ main. resources. srcDirs = [' resources' ]
13
+ test. resources. srcDirs = [' test-resources' ]
14
+ }
8
15
9
16
dependencies {
10
17
compile " org.jetbrains.kotlin:kotlin-stdlib-js:$kotlin_version "
11
18
testCompile " org.jetbrains.kotlin:kotlin-test-js:$kotlin_version "
12
19
}
13
20
14
- tasks. withType(compileKotlin2Js . getClass()) {
21
+ tasks. withType(compileKotlinJs . getClass()) {
15
22
kotlinOptions {
16
23
moduleKind = " umd"
17
24
sourceMap = true
18
25
metaInfo = true
19
26
}
20
27
}
21
28
22
- compileKotlin2Js {
29
+ compileKotlinJs {
23
30
kotlinOptions {
24
31
// drop -js suffix from outputFile
25
32
def baseName = project. name - " -js"
Original file line number Diff line number Diff line change 5
5
sourceCompatibility = 1.6
6
6
targetCompatibility = 1.6
7
7
8
- repositories {
9
- maven { url " https://dl.bintray.com/devexperts/Maven/" }
10
- }
11
-
12
8
kotlin {
13
9
targets {
14
10
fromPreset(presets. jvm, ' jvm' )
You can’t perform that action at this time.
0 commit comments