Skip to content

Commit e25f627

Browse files
qwwdfsadturansky
andauthored
Migrate play-services and example-frontend-js to Gradle kts (#2543)
* Kotlin DSL - rename "example-frontend-js" build script * Kotlin DSL - 'example-frontend-js' * Kotlin DSL - rename "play-services" build script * Kotlin DSL - 'play-services' Co-authored-by: Victor Turansky <[email protected]>
1 parent a11e185 commit e25f627

File tree

4 files changed

+68
-78
lines changed

4 files changed

+68
-78
lines changed

integration/kotlinx-coroutines-play-services/build.gradle

-45
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
/*
2+
* Copyright 2016-2021 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license.
3+
*/
4+
5+
val tasksVersion = "16.0.1"
6+
7+
val artifactType = Attribute.of("artifactType", String::class.java)
8+
val unpackedAar = Attribute.of("unpackedAar", Boolean::class.javaObjectType)
9+
10+
configurations.configureEach {
11+
afterEvaluate {
12+
if (isCanBeResolved) {
13+
attributes.attribute(unpackedAar, true) // request all AARs to be unpacked
14+
}
15+
}
16+
}
17+
18+
dependencies {
19+
attributesSchema {
20+
attribute(unpackedAar)
21+
}
22+
23+
artifactTypes {
24+
create("aar") {
25+
attributes.attribute(unpackedAar, false)
26+
}
27+
}
28+
29+
registerTransform(UnpackAar::class.java) {
30+
from.attribute(unpackedAar, false).attribute(artifactType, "aar")
31+
to.attribute(unpackedAar, true).attribute(artifactType, "jar")
32+
}
33+
34+
api("com.google.android.gms:play-services-tasks:$tasksVersion") {
35+
exclude(group="com.android.support")
36+
}
37+
}
38+
39+
externalDocumentationLink(
40+
url = "https://developers.google.com/android/reference/"
41+
)

js/example-frontend-js/build.gradle

-33
This file was deleted.
+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
/*
2+
* Copyright 2016-2021 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license.
3+
*/
4+
5+
kotlin {
6+
js(LEGACY) {
7+
binaries.executable()
8+
browser {
9+
distribution {
10+
directory = directory.parentFile.resolve("dist")
11+
}
12+
commonWebpackConfig {
13+
cssSupport.enabled = true
14+
}
15+
testTask {
16+
useKarma {
17+
useChromeHeadless()
18+
}
19+
}
20+
}
21+
}
22+
}
23+
24+
dependencies {
25+
implementation("org.jetbrains.kotlinx:kotlinx-html-js:${version("html")}")
26+
implementation(devNpm("html-webpack-plugin", "3.2.0"))
27+
}

0 commit comments

Comments
 (0)