Skip to content

Commit

Permalink
Merge branch 'jb/wasm' into jb/wasm-disable-windows-ci
Browse files Browse the repository at this point in the history
# Conflicts:
#	kermit-core/build.gradle.kts
#	kermit-simple/build.gradle.kts
#	kermit-test/build.gradle.kts
#	kermit/build.gradle.kts
  • Loading branch information
findjigar committed Oct 10, 2023
2 parents 713bfff + 061761e commit aff7c63
Show file tree
Hide file tree
Showing 18 changed files with 36 additions and 51 deletions.
13 changes: 8 additions & 5 deletions convention-plugins/src/main/kotlin/wasm-setup.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,17 @@
*
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
*/

import org.jetbrains.kotlin.gradle.targets.js.dsl.ExperimentalWasmDsl

plugins {
kotlin("multiplatform")
}

kotlin {
val wasmEnabled = project.findProperty("enableWasm") == "true"
if (wasmEnabled) {
@Suppress("OPT_IN_USAGE")
@OptIn(ExperimentalWasmDsl::class)
wasm {
browser()
nodejs()
Expand All @@ -23,15 +26,15 @@ kotlin {
}
}
sourceSets {
val jsWasmMain by creating
val jsWasmTest by creating
val jsAndWasmMain by creating
val jsAndWasmTest by creating
if (wasmEnabled) {
val wasmMain by getting {
dependsOn(jsWasmMain)
dependsOn(jsAndWasmMain)
}

val wasmTest by getting {
dependsOn(jsWasmTest)
dependsOn(jsAndWasmTest)
}
}
}
Expand Down
3 changes: 2 additions & 1 deletion extensions/kermit-bugsnag/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
* the License.
*/

import org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApi
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

plugins {
Expand All @@ -21,7 +22,7 @@ plugins {

apply(from = "../../gradle/configure-crash-logger.gradle")
kotlin {
@Suppress("OPT_IN_USAGE")
@OptIn(ExperimentalKotlinGradlePluginApi::class)
targetHierarchy.default()
androidTarget {
publishAllLibraryVariants()
Expand Down
3 changes: 2 additions & 1 deletion extensions/kermit-crashlytics/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
* the License.
*/

import org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApi
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

plugins {
Expand All @@ -22,7 +23,7 @@ plugins {
apply(from = "../../gradle/configure-crash-logger.gradle")

kotlin {
@Suppress("OPT_IN_USAGE")
@OptIn(ExperimentalKotlinGradlePluginApi::class)
targetHierarchy.default()
androidTarget {
publishAllLibraryVariants()
Expand Down
3 changes: 2 additions & 1 deletion extensions/kermit-koin/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
* the License.
*/

import org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApi
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

plugins {
Expand All @@ -20,7 +21,7 @@ plugins {
}

kotlin {
@Suppress("OPT_IN_USAGE")
@OptIn(ExperimentalKotlinGradlePluginApi::class)
targetHierarchy.default()
androidTarget {
publishAllLibraryVariants()
Expand Down
9 changes: 5 additions & 4 deletions kermit-core/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
* the License.
*/

import org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApi
import org.jetbrains.kotlin.gradle.targets.js.nodejs.NodeJsRootExtension
import org.jetbrains.kotlin.gradle.targets.js.testing.KotlinJsTest
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

plugins {
Expand All @@ -23,7 +23,7 @@ plugins {
}

kotlin {
@Suppress("OPT_IN_USAGE")
@OptIn(ExperimentalKotlinGradlePluginApi::class)
targetHierarchy.default()
androidTarget {
publishAllLibraryVariants()
Expand Down Expand Up @@ -110,11 +110,12 @@ kotlin {
dependsOn(nativeTest)
}

val jsWasmMain by getting {
val jsAndWasmMain by getting {
dependsOn(commonMain)
getByName("jsMain").dependsOn(this)
}
val jsWasmTest by getting {

val jsAndWasmTest by getting {
dependsOn(commonTest)
getByName("jsTest").dependsOn(this)
}
Expand Down

This file was deleted.

7 changes: 4 additions & 3 deletions kermit-simple/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApi
import org.jetbrains.kotlin.gradle.targets.js.nodejs.NodeJsRootExtension

/*
Expand All @@ -20,7 +21,7 @@ plugins {
}

kotlin {
@Suppress("OPT_IN_USAGE")
@OptIn(ExperimentalKotlinGradlePluginApi::class)
targetHierarchy.default()
js {
browser()
Expand Down Expand Up @@ -70,11 +71,11 @@ kotlin {
dependsOn(getByName("commonTest"))
}

val jsWasmMain by getting {
val jsAndWasmMain by getting {
dependsOn(nonKotlinMain)
getByName("jsMain").dependsOn(this)
}
val jsWasmTest by getting {
val jsAndWasmTest by getting {
dependsOn(nonKotlinTest)
getByName("jsTest").dependsOn(this)
}
Expand Down
3 changes: 2 additions & 1 deletion kermit-test/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
* the License.
*/

import org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApi
import org.jetbrains.kotlin.gradle.targets.js.nodejs.NodeJsRootExtension
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

Expand All @@ -22,7 +23,7 @@ plugins {
}

kotlin {
@Suppress("OPT_IN_USAGE")
@OptIn(ExperimentalKotlinGradlePluginApi::class)
targetHierarchy.default()
androidTarget {
publishAllLibraryVariants()
Expand Down
11 changes: 5 additions & 6 deletions kermit/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,9 @@
* the License.
*/

import org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApi
import org.jetbrains.kotlin.gradle.targets.js.nodejs.NodeJsRootExtension
import org.jetbrains.kotlin.gradle.targets.js.testing.KotlinJsTest
import org.jetbrains.kotlin.gradle.targets.js.webpack.KotlinWebpackConfig
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
import java.time.Duration

plugins {
id("com.android.library")
Expand All @@ -25,7 +23,7 @@ plugins {
}

kotlin {
@Suppress("OPT_IN_USAGE")
@OptIn(ExperimentalKotlinGradlePluginApi::class)
targetHierarchy.default()
androidTarget {
publishAllLibraryVariants()
Expand Down Expand Up @@ -65,6 +63,7 @@ kotlin {
api(project(":kermit-core"))
}
}

val commonTest by getting {
dependencies {
implementation(kotlin("test"))
Expand All @@ -85,12 +84,12 @@ kotlin {
dependsOn(nonKotlinMain)
}

val jsWasmMain by getting {
val jsAndWasmMain by getting {
dependsOn(nonKotlinMain)
getByName("jsMain").dependsOn(this)
}

val jsWasmTest by getting {
val jsAndWasmTest by getting {
dependsOn(nonKotlinTest)
getByName("jsTest").dependsOn(this)
}
Expand Down
2 changes: 2 additions & 0 deletions samples/sample-production/shared/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
*/

import org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApi
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

plugins {
Expand Down Expand Up @@ -37,6 +38,7 @@ val KERMIT_VERSION: String by project
version = "0.0.1"

kotlin {
@OptIn(ExperimentalKotlinGradlePluginApi::class)
targetHierarchy.default()
androidTarget()
ios()
Expand Down
4 changes: 4 additions & 0 deletions samples/sample/shared/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
*/

import org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApi
import org.jetbrains.kotlin.gradle.targets.js.dsl.ExperimentalWasmDsl
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

plugins {
Expand Down Expand Up @@ -37,13 +39,15 @@ val KERMIT_VERSION: String by project
version = "0.0.1"

kotlin {
@OptIn(ExperimentalKotlinGradlePluginApi::class)
targetHierarchy.default()
androidTarget()
ios()
iosSimulatorArm64()
js {
browser()
}
@OptIn(ExperimentalWasmDsl::class)
wasm {
browser()
}
Expand Down

0 comments on commit aff7c63

Please sign in to comment.