Browse Source

Optionally building web examples along with the rest of web modules

pull/735/merge
Shagen Ogandzhanian 4 years ago
parent
commit
65f47c8a82
  1. 17
      web/build.gradle.kts
  2. 1
      web/gradle.properties
  3. 6
      web/settings.gradle.kts

17
web/build.gradle.kts

@ -1,8 +1,9 @@
val COMPOSE_WEB_VERSION: String by project val COMPOSE_WEB_VERSION: String by project
val COMPOSE_REPO_USERNAME: String? by project val COMPOSE_REPO_USERNAME: String? by project
val COMPOSE_REPO_KEY: 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") apply(plugin = "maven-publish")
group = "org.jetbrains.compose.web" 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 { repositories {
gradlePluginPortal() gradlePluginPortal()
mavenCentral() mavenCentral()

1
web/gradle.properties

@ -1,2 +1,3 @@
COMPOSE_CORE_VERSION=0.0.12-SNAPSHOT COMPOSE_CORE_VERSION=0.0.12-SNAPSHOT
COMPOSE_WEB_VERSION=0.0.12-SNAPSHOT COMPOSE_WEB_VERSION=0.0.12-SNAPSHOT
COMPOSE_BUILD_WITH_EXAMPLES=false

6
web/settings.gradle.kts

@ -12,7 +12,6 @@ pluginManagement {
resolutionStrategy { resolutionStrategy {
eachPlugin { eachPlugin {
println("REQ ${requested.id.id}")
if (requested.id.id == "org.jetbrains.compose") { if (requested.id.id == "org.jetbrains.compose") {
println("[build] compose core version: ${extra["COMPOSE_CORE_VERSION"]}") println("[build] compose core version: ${extra["COMPOSE_CORE_VERSION"]}")
useModule("org.jetbrains.compose:org.jetbrains.compose.gradle.plugin:${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-widgets", "$rootDir/widgets")
module(":web-integration-core", "$rootDir/integration-core") module(":web-integration-core", "$rootDir/integration-core")
module(":web-integration-widgets", "$rootDir/integration-widgets") 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")
}

Loading…
Cancel
Save