From 6a8c869b46cec16b9b9489930b7c141fd8c8f63e Mon Sep 17 00:00:00 2001 From: Igor Demin Date: Thu, 30 Sep 2021 14:52:32 +0300 Subject: [PATCH] Change Compose build scripts --- ...(without Android Layout Inspector).run.xml | 23 ------------------- compose/.run/test (web).run.xml | 2 +- compose/README.md | 6 ++--- compose/build.gradle.kts | 21 +++++++++-------- compose/scripts/prepare | 2 +- compose/scripts/publishWithoutInspector | 12 ---------- 6 files changed, 16 insertions(+), 50 deletions(-) delete mode 100644 compose/.run/publish (without Android Layout Inspector).run.xml delete mode 100755 compose/scripts/publishWithoutInspector diff --git a/compose/.run/publish (without Android Layout Inspector).run.xml b/compose/.run/publish (without Android Layout Inspector).run.xml deleted file mode 100644 index 3583bc2f45..0000000000 --- a/compose/.run/publish (without Android Layout Inspector).run.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - true - true - false - - - \ No newline at end of file diff --git a/compose/.run/test (web).run.xml b/compose/.run/test (web).run.xml index e62219247d..ae0c09cecd 100644 --- a/compose/.run/test (web).run.xml +++ b/compose/.run/test (web).run.xml @@ -4,7 +4,7 @@ diff --git a/compose/README.md b/compose/README.md index 259ec5f615..dfa9f5dde2 100644 --- a/compose/README.md +++ b/compose/README.md @@ -43,10 +43,8 @@ Publish artifacts to the local directory `out/androidx/build/support_repo/org/je ``` ./scripts/publish ``` -Publish artifacts without Android Layout Inspector (use it on Windows): -``` -./scripts/publishWithoutInspector -``` +(on Windows it doesn't build at the moment, the issue is in the line `packageInspector(project, project(":compose:ui:ui-inspection")` in `compose/frameworks/support/compose/ui/ui/build.gradle`) + Publish extended icons: ``` ./scripts/publishExtendedIcons diff --git a/compose/build.gradle.kts b/compose/build.gradle.kts index 1d2de0a52b..3bf1f3c738 100644 --- a/compose/build.gradle.kts +++ b/compose/build.gradle.kts @@ -1,8 +1,7 @@ val composeBuild = gradle.includedBuild("support") fun Task.dependsOnComposeTask(name: String) = dependsOn(composeBuild.task(name)) -gradle.startParameter.excludedTaskNames.add(":support:compose:ui:ui-inspection:assembleInspectorJarRelease") -gradle.startParameter.excludedTaskNames.add(":support:compose:ui:ui-inspection:dexInspectorRelease") +val isWebExists = composeBuild.projectDir.resolve(".jbWebBranchMergedMarker").exists() // To show all projects which use `xxx` task, run: // ./gradlew -p frameworks/support help --task xxx @@ -47,10 +46,12 @@ tasks.register("publishComposeJb") { dependsOnComposeTask("$it:publishAndroidReleasePublicationToMavenRepository") } - listOf( - ":compose:runtime:runtime", - ).forEach { - dependsOnComposeTask("$it:publishJsPublicationToMavenRepository") + if (isWebExists) { + listOf( + ":compose:runtime:runtime", + ).forEach { + dependsOnComposeTask("$it:publishJsPublicationToMavenRepository") + } } } @@ -82,9 +83,11 @@ tasks.register("testComposeJbDesktop") { dependsOnComposeTask(":compose:runtime:runtime-saveable:desktopTest") } -tasks.register("testComposeJbWeb") { - dependsOnComposeTask(":compose:runtime:runtime:jsTest") - dependsOnComposeTask(":compose:runtime:runtime:test") +if (isWebExists) { + tasks.register("testComposeJbWeb") { + dependsOnComposeTask(":compose:runtime:runtime:jsTest") + dependsOnComposeTask(":compose:runtime:runtime:test") + } } tasks.register("buildNativeDemo") { diff --git a/compose/scripts/prepare b/compose/scripts/prepare index 57dec964e5..c109ddad05 100755 --- a/compose/scripts/prepare +++ b/compose/scripts/prepare @@ -6,4 +6,4 @@ export ALLOW_PUBLIC_REPOS=1 export JAVA_TOOLS_JAR=$SCRIPT_DIR/../external/tools.jar export ANDROIDX_PROJECTS=COMPOSE export COMPOSE_CUSTOM_GROUP=org.jetbrains.compose -export COMPOSE_DEFAULT_GRADLE_ARGS="-Pandroidx.compose.multiplatformEnabled=true -Pandroidx.versionExtraCheckEnabled=false -Pandroidx.alternativeProjectUrl=https://github.com/JetBrains/compose-jb -Pandroidx.compose.jsCompilerTestsEnabled=true -Pandroidx.validateProjectStructure=false" \ No newline at end of file +export COMPOSE_DEFAULT_GRADLE_ARGS="-Pandroidx.compose.multiplatformEnabled=true -Pandroidx.versionExtraCheckEnabled=false -Pandroidx.alternativeProjectUrl=https://github.com/JetBrains/compose-jb -Pjetbrains.compose.jsCompilerTestsEnabled=true -Pandroidx.validateProjectStructure=false" \ No newline at end of file diff --git a/compose/scripts/publishWithoutInspector b/compose/scripts/publishWithoutInspector deleted file mode 100755 index d1fd6e8f5b..0000000000 --- a/compose/scripts/publishWithoutInspector +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/bash - -# Publish artifact without Android Layout Inspector -# Should be used is there are errors building it (on Windows, for example) -# Shouldn't be used for publishing release artifacts - -cd "$(dirname "$0")" -. ./prepare - -pushd .. -./gradlew publishComposeJb $COMPOSE_DEFAULT_GRADLE_ARGS -x :support:compose:ui:ui-inspection:assembleInspectorJarRelease -x :support:compose:ui:ui-inspection:dexInspectorRelease "$@" || exit 1 -popd \ No newline at end of file