diff --git a/.github/workflows/debug.yml b/.github/workflows/debug.yml index f10d2fe89d..7bc53c7a28 100644 --- a/.github/workflows/debug.yml +++ b/.github/workflows/debug.yml @@ -197,12 +197,22 @@ jobs: run: | flox activate -d flox/base -- ./gradlew :plugin-api:apiCheck --no-daemon - - name: Run spotlessCheck + # Combined with a compile task on purpose: spotlessCheck alone never pulls a + # source-tree-writing task into the graph, so the implicit-dependency failure ADFA-5244 fixed + # cannot reproduce in a standalone run. Without this step a regression of that exclude is + # invisible to CI and shows up only on a developer's machine at push time. + - name: Run spotlessCheck alongside a compile task run: | - flox activate -d flox/base -- ./gradlew spotlessCheck --no-daemon || { - echo "::error::Spotless found formatting violations in this branch. Run './gradlew spotlessApply' locally, then commit and push the formatted files." - exit 1 - } + # Two tasks, so two possible causes: the message must not name one of them. Blaming + # Spotless for a compile error is the exact misdiagnosis this step exists to catch. + set +e + flox activate -d flox/base -- ./gradlew :common:compileV8DebugKotlin spotlessCheck --no-daemon + status=$? + set -e + if [ "$status" -ne 0 ]; then + echo "::error::Gradle failed on ':common:compileV8DebugKotlin spotlessCheck'. If the output above shows formatting violations, run './gradlew spotlessApply' locally and commit the result; if it shows a compile error, spotlessApply will not help. The Gradle output says which." + exit "$status" + fi - name: Install advancecomp (advzip, used by recompressApk) run: | diff --git a/.gitignore b/.gitignore index 7bf2398743..8608572b0f 100755 --- a/.gitignore +++ b/.gitignore @@ -110,6 +110,12 @@ sentry.properties /app/google-services.json +# Written by the gradle-plugin tests, not by a Gradle task: writeInitScript() in +# gradle-plugin/src/test/.../utils.kt resolves FileProvider.testHomeDir() and creates +# .cg/init/androidide.init.gradle there on every run. ADFA-5263 deleted copyToTestDir, so the +# model.jar entry that used to sit beside this one is dead, but the directory still fills up. +tests/test-home + # Kotlin build files .kotlin/ diff --git a/build.gradle.kts b/build.gradle.kts index b0f6438ace..cd5c3f7120 100755 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -179,9 +179,12 @@ spotless { // Spotless's auto-prune of .git/.gradle/build, so restore them. flox is the // ADFA-4816 fix: its /nix/store symlinks (millions of files) made // spotlessCheck take 12+ minutes. - // Bare dir names required: Gradle prunes a subtree only when an exclude - // matches the dir node itself; `dir/**` matches contents and forces a - // descend-and-filter (no pruning). + // The pattern must match the directory node itself, because Gradle prunes a subtree only then; + // `dir/**` matches the contents instead and forces a descend-and-filter. Bare names are + // root-anchored: "flox" prunes only rootDir/flox, so anything that has to match at depth needs + // the `**/` prefix the three entries below carry. Dropping it -- reading "**/.gradle" as + // equivalent to ".gradle" -- would stop pruning every per-project cache dir and bring back the + // ADFA-4816 12-minute spotlessCheck. val traversalExcludes = arrayOf( "flox",