diff --git a/web/build.gradle.kts b/web/build.gradle.kts index 4978092a1b..68601ca824 100644 --- a/web/build.gradle.kts +++ b/web/build.gradle.kts @@ -1,8 +1,9 @@ val COMPOSE_WEB_VERSION: String by project val COMPOSE_REPO_USERNAME: String? by project val COMPOSE_REPO_KEY: String? by project +val COMPOSE_WEB_BUILD_WITH_EXAMPLES = project.property("COMPOSE_WEB_BUILD_WITH_EXAMPLES")!!.toString()?.toBoolean() -subprojects { +subprojects { apply(plugin = "maven-publish") group = "org.jetbrains.compose.web" @@ -23,6 +24,20 @@ subprojects { } } + if (COMPOSE_WEB_BUILD_WITH_EXAMPLES) { + println("substituting published artifacts with projects ones in project $name") + configurations.all { + resolutionStrategy.dependencySubstitution { + substitute(module("org.jetbrains.compose.web:web-widgets")).apply { + with(project(":web-widgets")) + } + substitute(module("org.jetbrains.compose.web:web-core")).apply { + with(project(":web-core")) + } + } + } + } + repositories { gradlePluginPortal() mavenCentral() diff --git a/web/gradle.properties b/web/gradle.properties index d0ebc02beb..159e3b6529 100644 --- a/web/gradle.properties +++ b/web/gradle.properties @@ -1,2 +1,3 @@ COMPOSE_CORE_VERSION=0.0.12-SNAPSHOT COMPOSE_WEB_VERSION=0.0.12-SNAPSHOT +COMPOSE_BUILD_WITH_EXAMPLES=false diff --git a/web/settings.gradle.kts b/web/settings.gradle.kts index de4efd679c..5214ec4faa 100644 --- a/web/settings.gradle.kts +++ b/web/settings.gradle.kts @@ -12,7 +12,6 @@ pluginManagement { resolutionStrategy { eachPlugin { - println("REQ ${requested.id.id}") if (requested.id.id == "org.jetbrains.compose") { println("[build] compose core version: ${extra["COMPOSE_CORE_VERSION"]}") useModule("org.jetbrains.compose:org.jetbrains.compose.gradle.plugin:${extra["COMPOSE_CORE_VERSION"]}") @@ -32,3 +31,8 @@ module(":web-core", "$rootDir/core") module(":web-widgets", "$rootDir/widgets") module(":web-integration-core", "$rootDir/integration-core") module(":web-integration-widgets", "$rootDir/integration-widgets") + +if (extra["COMPOSE_WEB_BUILD_WITH_EXAMPLES"]!!.toString().toBoolean() == true) { + println("building with examples") + module(":examples:falling_balls_with_web", "../examples/falling_balls_with_web") +}