Skip to content

Commit

Permalink
Migrate play-services and example-frontend-js to Gradle kts (#2543)
Browse files Browse the repository at this point in the history
* 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 <victor.turansky@gmail.com>
  • Loading branch information
qwwdfsad and turansky authored Feb 19, 2021
1 parent a11e185 commit e25f627
Show file tree
Hide file tree
Showing 4 changed files with 68 additions and 78 deletions.
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"))
}

0 comments on commit e25f627

Please sign in to comment.