From 8769c86577a8d3e920c74faaca481f6213eaabb0 Mon Sep 17 00:00:00 2001 From: Victor Turansky Date: Mon, 25 Jan 2021 04:10:59 +0300 Subject: [PATCH 1/4] Kotlin DSL - rename "example-frontend-js" build script --- js/example-frontend-js/{build.gradle => build.gradle.kts} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename js/example-frontend-js/{build.gradle => build.gradle.kts} (100%) diff --git a/js/example-frontend-js/build.gradle b/js/example-frontend-js/build.gradle.kts similarity index 100% rename from js/example-frontend-js/build.gradle rename to js/example-frontend-js/build.gradle.kts From ea9eb61900bd027ac5faa6daad5887c81804404c Mon Sep 17 00:00:00 2001 From: Victor Turansky Date: Mon, 25 Jan 2021 04:25:58 +0300 Subject: [PATCH 2/4] Kotlin DSL - 'example-frontend-js' --- js/example-frontend-js/build.gradle.kts | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/js/example-frontend-js/build.gradle.kts b/js/example-frontend-js/build.gradle.kts index 213674e10b..5b18966fcd 100644 --- a/js/example-frontend-js/build.gradle.kts +++ b/js/example-frontend-js/build.gradle.kts @@ -2,32 +2,26 @@ * Copyright 2016-2021 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license. */ -project.kotlin { +kotlin { js(LEGACY) { binaries.executable() browser { distribution { - directory = new File(directory.parentFile, "dist") + directory = directory.parentFile.resolve("dist") } - webpackTask { - cssSupport.enabled = true - } - runTask { + commonWebpackConfig { cssSupport.enabled = true } testTask { useKarma { useChromeHeadless() - webpackConfig.cssSupport.enabled = true } } } } +} - sourceSets { - main.dependencies { - implementation "org.jetbrains.kotlinx:kotlinx-html-js:$html_version" - implementation(npm("html-webpack-plugin", "3.2.0")) - } - } +dependencies { + implementation("org.jetbrains.kotlinx:kotlinx-html-js:${version("html")}") + implementation(devNpm("html-webpack-plugin", "3.2.0")) } From 5c59329675a2d8c8318d72c55ec8ba3e8b8bca0b Mon Sep 17 00:00:00 2001 From: Victor Turansky Date: Mon, 25 Jan 2021 04:55:06 +0300 Subject: [PATCH 3/4] Kotlin DSL - rename "play-services" build script --- .../{build.gradle => build.gradle.kts} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename integration/kotlinx-coroutines-play-services/{build.gradle => build.gradle.kts} (100%) diff --git a/integration/kotlinx-coroutines-play-services/build.gradle b/integration/kotlinx-coroutines-play-services/build.gradle.kts similarity index 100% rename from integration/kotlinx-coroutines-play-services/build.gradle rename to integration/kotlinx-coroutines-play-services/build.gradle.kts From a1a550e5dd14c3f2e05c7b885ab7b56881cc725c Mon Sep 17 00:00:00 2001 From: Victor Turansky Date: Mon, 25 Jan 2021 05:44:33 +0300 Subject: [PATCH 4/4] Kotlin DSL - 'play-services' --- .../build.gradle.kts | 28 ++++++++----------- 1 file changed, 12 insertions(+), 16 deletions(-) diff --git a/integration/kotlinx-coroutines-play-services/build.gradle.kts b/integration/kotlinx-coroutines-play-services/build.gradle.kts index beb11b2c06..59f3b0bd5a 100644 --- a/integration/kotlinx-coroutines-play-services/build.gradle.kts +++ b/integration/kotlinx-coroutines-play-services/build.gradle.kts @@ -2,14 +2,14 @@ * Copyright 2016-2021 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license. */ -ext.tasks_version = '16.0.1' +val tasksVersion = "16.0.1" -def artifactType = Attribute.of("artifactType", String) -def unpackedAar = Attribute.of("unpackedAar", Boolean) +val artifactType = Attribute.of("artifactType", String::class.java) +val unpackedAar = Attribute.of("unpackedAar", Boolean::class.javaObjectType) -configurations.all { +configurations.configureEach { afterEvaluate { - if (canBeResolved) { + if (isCanBeResolved) { attributes.attribute(unpackedAar, true) // request all AARs to be unpacked } } @@ -21,25 +21,21 @@ dependencies { } artifactTypes { - aar { + create("aar") { attributes.attribute(unpackedAar, false) } } - registerTransform(UnpackAar) { + registerTransform(UnpackAar::class.java) { from.attribute(unpackedAar, false).attribute(artifactType, "aar") to.attribute(unpackedAar, true).attribute(artifactType, "jar") } - api("com.google.android.gms:play-services-tasks:$tasks_version") { - exclude group: 'com.android.support' + api("com.google.android.gms:play-services-tasks:$tasksVersion") { + exclude(group="com.android.support") } } -tasks.withType(dokka.getClass()) { - externalDocumentationLink { - url = new URL("https://developers.google.com/android/reference/") - // This is workaround for missing package list in Google API - packageListUrl = projectDir.toPath().resolve("package.list").toUri().toURL() - } -} +externalDocumentationLink( + url = "https://developers.google.com/android/reference/" +)