|
|
|
@ -6,6 +6,14 @@ val COMPOSE_WEB_BUILD_WITH_SAMPLES = project.property("compose.web.buildSamples"
|
|
|
|
|
|
|
|
|
|
apply<jetbrains.compose.web.gradle.SeleniumDriverPlugin>() |
|
|
|
|
|
|
|
|
|
fun Project.isSampleProject() = projectDir.parentFile.name == "examples" |
|
|
|
|
|
|
|
|
|
tasks.register("printBundleSize") { |
|
|
|
|
dependsOn( |
|
|
|
|
subprojects.filter { it.isSampleProject() }.map { ":examples:${it.name}:printBundleSize" } |
|
|
|
|
) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
subprojects { |
|
|
|
|
apply(plugin = "maven-publish") |
|
|
|
|
|
|
|
|
@ -27,6 +35,21 @@ subprojects {
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (isSampleProject()) { |
|
|
|
|
val printBundleSize by tasks.registering { |
|
|
|
|
dependsOn(tasks.named("jsBrowserDistribution")) |
|
|
|
|
doLast { |
|
|
|
|
val jsFile = buildDir.resolve("distributions/${project.name}.js") |
|
|
|
|
val size = jsFile.length() |
|
|
|
|
println("##teamcity[buildStatisticValue key='bundleSize::${project.name}' value='$size']") |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
afterEvaluate { |
|
|
|
|
tasks.named("build") { finalizedBy(printBundleSize) } |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (COMPOSE_WEB_BUILD_WITH_SAMPLES) { |
|
|
|
|
println("substituting published artifacts with projects ones in project $name") |
|
|
|
|
configurations.all { |
|
|
|
|