Skip to content

Migrate play-services and example-frontend-js to Gradle kts #2543

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Feb 19, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 0 additions & 45 deletions integration/kotlinx-coroutines-play-services/build.gradle

This file was deleted.

41 changes: 41 additions & 0 deletions integration/kotlinx-coroutines-play-services/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
/*
* Copyright 2016-2021 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license.
*/

val tasksVersion = "16.0.1"

val artifactType = Attribute.of("artifactType", String::class.java)
val unpackedAar = Attribute.of("unpackedAar", Boolean::class.javaObjectType)

configurations.configureEach {
afterEvaluate {
if (isCanBeResolved) {
attributes.attribute(unpackedAar, true) // request all AARs to be unpacked
}
}
}

dependencies {
attributesSchema {
attribute(unpackedAar)
}

artifactTypes {
create("aar") {
attributes.attribute(unpackedAar, false)
}
}

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:$tasksVersion") {
exclude(group="com.android.support")
}
}

externalDocumentationLink(
url = "https://developers.google.com/android/reference/"
)
33 changes: 0 additions & 33 deletions js/example-frontend-js/build.gradle

This file was deleted.

27 changes: 27 additions & 0 deletions js/example-frontend-js/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/*
* Copyright 2016-2021 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license.
*/

kotlin {
js(LEGACY) {
binaries.executable()
browser {
distribution {
directory = directory.parentFile.resolve("dist")
}
commonWebpackConfig {
cssSupport.enabled = true
}
testTask {
useKarma {
useChromeHeadless()
}
}
}
}
}

dependencies {
implementation("org.jetbrains.kotlinx:kotlinx-html-js:${version("html")}")
implementation(devNpm("html-webpack-plugin", "3.2.0"))
}