Skip to content

Commit

Permalink
Added missing js(IR) module names
Browse files Browse the repository at this point in the history
  • Loading branch information
LachlanMcKee committed Sep 1, 2023
1 parent b26eec1 commit ea1b538
Show file tree
Hide file tree
Showing 21 changed files with 42 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ plugins {

kotlin {
js(IR) {
moduleName = "appyx-components-experimental-puzzle15-web"
browser()
binaries.executable()
}
Expand Down
1 change: 1 addition & 0 deletions demos/appyx-interactions/web/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ plugins {

kotlin {
js(IR) {
moduleName = "appyx-demos-interactions-web"
browser()
binaries.executable()
}
Expand Down
1 change: 1 addition & 0 deletions demos/appyx-navigation/web/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ plugins {

kotlin {
js(IR) {
moduleName = "appyx-demos-navigation-web"
browser()
binaries.executable()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ plugins {

kotlin {
js(IR) {
moduleName = "appyx-demos-backstack-fader-web"
browser()
binaries.executable()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ plugins {

kotlin {
js(IR) {
moduleName = "appyx-demos-backstack-parallax-web"
browser()
binaries.executable()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ plugins {

kotlin {
js(IR) {
moduleName = "appyx-demos-backstack-slider-web"
browser()
binaries.executable()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ plugins {

kotlin {
js(IR) {
moduleName = "appyx-demos-backstack-stack3d-web"
browser()
binaries.executable()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ plugins {

kotlin {
js(IR) {
moduleName = "appyx-demos-experimental-datingcards-web"
browser()
binaries.executable()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ plugins {

kotlin {
js(IR) {
moduleName = "appyx-demos-experimental-puzzle15-web"
browser()
binaries.executable()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ plugins {

kotlin {
js(IR) {
moduleName = "appyx-components-spotlight-fader-web"
browser()
binaries.executable()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ plugins {

kotlin {
js(IR) {
moduleName = "appyx-components-spotlight-slider-web"
browser()
binaries.executable()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ plugins {

kotlin {
js(IR) {
moduleName = "appyx-components-spotlight-slider-rotation-web"
browser()
binaries.executable()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ plugins {

kotlin {
js(IR) {
moduleName = "appyx-components-spotlight-slider-scale-web"
browser()
binaries.executable()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ plugins {

kotlin {
js(IR) {
moduleName = "appyx-components-spotlight-stack3d-web"
browser()
binaries.executable()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ plugins {

kotlin {
js(IR) {
moduleName = "appyx-interactions-gestures-dragpredication-web"
browser()
binaries.executable()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ plugins {

kotlin {
js(IR) {
moduleName = "appyx-interactions-gestures-incompletedrag-web"
browser()
binaries.executable()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ plugins {

kotlin {
js(IR) {
moduleName = "appyx-interactions-observemp-web"
browser()
binaries.executable()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ plugins {

kotlin {
js(IR) {
moduleName = "appyx-interactions-sample1-web"
browser()
binaries.executable()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ plugins {

kotlin {
js(IR) {
moduleName = "appyx-interactions-sample2-web"
browser()
binaries.executable()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ plugins {

kotlin {
js(IR) {
moduleName = "appyx-interactions-sample3-web"
browser()
binaries.executable()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,15 @@ package com.bumble.appyx.multiplatform
import com.android.build.api.variant.LibraryAndroidComponentsExtension
import com.bumble.appyx.versionCatalog
import io.gitlab.arturbosch.detekt.extensions.DetektExtension
import org.gradle.api.GradleException
import org.gradle.api.JavaVersion
import org.gradle.api.Plugin
import org.gradle.api.Project
import org.gradle.api.artifacts.VersionCatalogsExtension
import org.gradle.kotlin.dsl.configure
import org.gradle.kotlin.dsl.get
import org.gradle.kotlin.dsl.getByType
import org.jetbrains.kotlin.gradle.dsl.KotlinMultiplatformExtension
import org.jetbrains.kotlin.gradle.targets.js.dsl.KotlinJsTargetDsl

class MultiplatformConventionPlugin : Plugin<Project> {
override fun apply(project: Project) {
Expand All @@ -32,6 +34,14 @@ class MultiplatformConventionPlugin : Plugin<Project> {
)
}

project.afterEvaluate {
project.plugins.withId("kotlin-multiplatform") {
project.extensions
.getByType<KotlinMultiplatformExtension>()
.configure(project)
}
}

project.plugins.withId("com.android.library") {
project.extensions
.getByType<LibraryAndroidComponentsExtension>()
Expand All @@ -56,4 +66,15 @@ class MultiplatformConventionPlugin : Plugin<Project> {
}
}
}

private fun KotlinMultiplatformExtension.configure(project: Project) {
targets {
val jsTarget = findByName("js") as? KotlinJsTargetDsl
if (jsTarget != null) {
if (jsTarget.moduleName == null) {
throw GradleException("${project.path}: 'js' module name was not set")
}
}
}
}
}

0 comments on commit ea1b538

Please sign in to comment.