Skip to content

Commit

Permalink
Add the disabled k/wasm target to the rest of necessary modules (JetB…
Browse files Browse the repository at this point in the history
…rains#544)

* Add the disabled k/wasm target to the rest of necessary modules

* Revert not relevant import changes
  • Loading branch information
eymar authored May 5, 2023
1 parent bf0db27 commit 53a53c0
Show file tree
Hide file tree
Showing 33 changed files with 159 additions and 33 deletions.
19 changes: 18 additions & 1 deletion animation/animation-core/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ if (AndroidXComposePlugin.isMultiplatformEnabled(project)) {
desktop()
darwin()
js()
wasm()
}

kotlin {
Expand Down Expand Up @@ -106,8 +107,24 @@ if (AndroidXComposePlugin.isMultiplatformEnabled(project)) {
}
}
jsNativeMain.dependsOn(commonMain)
jsMain.dependsOn(jsNativeMain)
nativeMain.dependsOn(jsNativeMain)
jsWasmMain.dependsOn(jsNativeMain)

jsMain {
dependsOn(jsWasmMain)
dependencies {
implementation(kotlin("stdlib-js"))
}
}

if (project.kotlinWasmEnabled.toBoolean()) {
wasmMain {
dependsOn(jsWasmMain)
dependencies {
implementation(kotlin("stdlib-wasm"))
}
}
}

// TODO(b/214407011): These dependencies leak into instrumented tests as well. If you
// need to add Robolectric (which must be kept out of androidAndroidTest), use a top
Expand Down
19 changes: 19 additions & 0 deletions animation/animation-graphics/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ if(AndroidXComposePlugin.isMultiplatformEnabled(project)) {
desktop()
darwin()
js()
wasm()
}

kotlin {
Expand Down Expand Up @@ -96,6 +97,24 @@ if(AndroidXComposePlugin.isMultiplatformEnabled(project)) {
implementation(libs.kotlinStdlib)
}

jsWasmMain.dependsOn(commonMain)

jsMain {
dependsOn(jsWasmMain)
dependencies {
implementation(kotlin("stdlib-js"))
}
}

if (project.kotlinWasmEnabled.toBoolean()) {
wasmMain {
dependsOn(jsWasmMain)
dependencies {
implementation(kotlin("stdlib-wasm"))
}
}
}

// TODO(b/214407011): These dependencies leak into instrumented tests as well. If you
// need to add Robolectric (which must be kept out of androidAndroidTest), use a top
// level dependencies block instead:
Expand Down
19 changes: 18 additions & 1 deletion animation/animation/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ if(AndroidXComposePlugin.isMultiplatformEnabled(project)) {
desktop()
darwin()
js()
wasm()
}

kotlin {
Expand Down Expand Up @@ -96,8 +97,24 @@ if(AndroidXComposePlugin.isMultiplatformEnabled(project)) {
implementation(libs.kotlinStdlib)
}
jsNativeMain.dependsOn(commonMain)
jsMain.dependsOn(jsNativeMain)
nativeMain.dependsOn(jsNativeMain)
jsWasmMain.dependsOn(jsNativeMain)

jsMain {
dependsOn(jsWasmMain)
dependencies {
implementation(kotlin("stdlib-js"))
}
}

if (project.kotlinWasmEnabled.toBoolean()) {
wasmMain {
dependsOn(jsWasmMain)
dependencies {
implementation(kotlin("stdlib-wasm"))
}
}
}

// TODO(b/214407011): These dependencies leak into instrumented tests as well. If you
// need to add Robolectric (which must be kept out of androidAndroidTest), use a top
Expand Down
20 changes: 19 additions & 1 deletion foundation/foundation-layout/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ if(AndroidXComposePlugin.isMultiplatformEnabled(project)) {
desktop()
darwin()
js()
wasm()
}

kotlin {
Expand Down Expand Up @@ -101,9 +102,26 @@ if(AndroidXComposePlugin.isMultiplatformEnabled(project)) {
}

jsNativeMain.dependsOn(commonMain)
jsMain.dependsOn(jsNativeMain)
nativeMain.dependsOn(jsNativeMain)

jsWasmMain.dependsOn(jsNativeMain)

jsMain {
dependsOn(jsWasmMain)
dependencies {
implementation(kotlin("stdlib-js"))
}
}

if (project.kotlinWasmEnabled.toBoolean()) {
wasmMain {
dependsOn(jsWasmMain)
dependencies {
implementation(kotlin("stdlib-wasm"))
}
}
}

// TODO(b/214407011): These dependencies leak into instrumented tests as well. If you
// need to add Robolectric (which must be kept out of androidAndroidTest), use a top
// level dependencies block instead:
Expand Down
22 changes: 21 additions & 1 deletion foundation/foundation/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ if (AndroidXComposePlugin.isMultiplatformEnabled(project)) {
desktop()
darwin()
js()
wasm()

configureDarwinFlags()
}
Expand Down Expand Up @@ -127,8 +128,27 @@ if (AndroidXComposePlugin.isMultiplatformEnabled(project)) {
}
}
jsNativeMain.dependsOn(skikoMain)
jsMain.dependsOn(jsNativeMain)
nativeMain.dependsOn(jsNativeMain)
jsWasmMain.dependsOn(jsNativeMain)

jsMain {
dependsOn(jsWasmMain)
dependencies {
implementation(kotlin("stdlib-js"))
api(libs.skikoCommon)
}
}

if (project.kotlinWasmEnabled.toBoolean()) {
wasmMain {
dependsOn(jsWasmMain)
dependencies {
implementation(kotlin("stdlib-wasm"))
implementation(libs.create("skikoWasm"))
implementation(libs.create("skikoWasmWasm"))
}
}
}

commonTest {
dependencies {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2020 The Android Open Source Project
* Copyright 2023 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2020 The Android Open Source Project
* Copyright 2023 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -18,13 +18,11 @@

package androidx.compose.foundation.gestures

import androidx.compose.foundation.fastFold
import androidx.compose.runtime.Composable
import androidx.compose.ui.geometry.Offset
import androidx.compose.ui.input.pointer.PointerEvent
import androidx.compose.ui.unit.Density
import androidx.compose.ui.unit.IntSize
import androidx.compose.ui.unit.dp
import org.jetbrains.skiko.SkikoPointerEvent
import org.jetbrains.skiko.SkikoPointerEventKind

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2022 The Android Open Source Project
* Copyright 2023 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -16,10 +16,6 @@

package androidx.compose.foundation.lazy.layout

import androidx.compose.runtime.Composable
import androidx.compose.runtime.State
import androidx.compose.ui.layout.SubcomposeLayoutState

actual fun getDefaultLazyLayoutKey(index: Int): Any = DefaultLazyKey(index)

private data class DefaultLazyKey(private val index: Int)
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2021 The Android Open Source Project
* Copyright 2023 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2021 The Android Open Source Project
* Copyright 2023 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2022 The Android Open Source Project
* Copyright 2023 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -16,4 +16,7 @@

package androidx.compose.foundation.text

import androidx.compose.foundation.text.KeyMapping
import androidx.compose.foundation.text.defaultKeyMapping

internal actual val platformDefaultKeyMapping: KeyMapping = defaultKeyMapping
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2021 The Android Open Source Project
* Copyright 2023 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2022 The Android Open Source Project
* Copyright 2023 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2022 The Android Open Source Project
* Copyright 2023 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2021 The Android Open Source Project
* Copyright 2023 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2021 The Android Open Source Project
* Copyright 2023 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2021 The Android Open Source Project
* Copyright 2023 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2022 The Android Open Source Project
* Copyright 2023 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2021 The Android Open Source Project
* Copyright 2023 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -17,11 +17,7 @@
package androidx.compose.foundation.text.selection

import androidx.compose.ui.Modifier
import androidx.compose.ui.input.key.Key
import androidx.compose.ui.input.key.KeyEvent
import androidx.compose.ui.input.key.isCtrlPressed
import androidx.compose.ui.input.key.isMetaPressed
import androidx.compose.ui.input.key.key

// this doesn't sounds very sustainable
// it would end up being a function for any conceptual keyevent (selectall, cut, copy, paste)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2021 The Android Open Source Project
* Copyright 2023 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -16,7 +16,6 @@

package androidx.compose.foundation.text.selection

import androidx.compose.ui.input.pointer.PointerEvent
import androidx.compose.ui.Modifier

internal actual fun Modifier.textFieldMagnifier(manager: TextFieldSelectionManager): Modifier =
Expand Down
21 changes: 21 additions & 0 deletions material/material-ripple/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ if(AndroidXComposePlugin.isMultiplatformEnabled(project)) {
desktop()
darwin()
js()
wasm()
}

kotlin {
Expand Down Expand Up @@ -95,6 +96,26 @@ if(AndroidXComposePlugin.isMultiplatformEnabled(project)) {
implementation(libs.junit)
implementation(libs.truth)
}

jsWasmMain {
dependsOn(commonMain)
}

jsMain {
dependsOn(jsWasmMain)
dependencies {
implementation(kotlin("stdlib-js"))
}
}

if (project.kotlinWasmEnabled.toBoolean()) {
wasmMain {
dependsOn(jsWasmMain)
dependencies {
implementation(kotlin("stdlib-wasm"))
}
}
}
}
}
}
Expand Down
Loading

0 comments on commit 53a53c0

Please sign in to comment.