From db7588bf71229fa0664b52e42d2f9339cd12b847 Mon Sep 17 00:00:00 2001 From: lcy Date: Sun, 18 Oct 2026 11:48:52 +0800 Subject: [PATCH 1/2] fix(build): keep spotless from walking into build/ so the release job builds again The release workflow checks termux-packages out under build/ before running spotlessCheck. targetExclude only filters after Spotless has walked the tree, and that walk fails on termux-packages' dangling symlinks (disabled-packages/protobuf-static/retain-linker-array.patch), so every release since 09a331be failed before building. Exclude build/, .gradle/ and .worktree/ from the file tree itself. --- build.gradle.kts | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index 13c83d332..b1ace8858 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -29,16 +29,22 @@ tasks.withType().configureEach { } } +// Build directories are excluded from the walk itself, not just filtered afterwards: the release +// job checks out termux-packages under build/, and following its dangling symlinks fails the task. +fun spotlessSources(pattern: String) = + fileTree(rootDir) { + include(pattern) + exclude("**/build/**", "**/.gradle/**", ".worktree/**") + } + spotless { kotlin { - target("**/*.kt") - targetExclude("**/build/**") + target(spotlessSources("**/*.kt")) ktlint("1.2.1") .setEditorConfigPath("$rootDir/.editorconfig") } kotlinGradle { - target("**/*.gradle.kts") - targetExclude("**/build/**") + target(spotlessSources("**/*.gradle.kts")) ktlint("1.2.1") } } From 8de301bb2bb397caf28ab41df4d8bb029fef6ceb Mon Sep 17 00:00:00 2001 From: lcy Date: Sun, 18 Oct 2026 11:53:40 +0800 Subject: [PATCH 2/2] docs(build): note why spotless targets are a pruned file tree --- build.gradle.kts | 1 + 1 file changed, 1 insertion(+) diff --git a/build.gradle.kts b/build.gradle.kts index b1ace8858..59a8eb3bb 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -31,6 +31,7 @@ tasks.withType().configureEach { // Build directories are excluded from the walk itself, not just filtered afterwards: the release // job checks out termux-packages under build/, and following its dangling symlinks fails the task. +// Going back to target("**/*.kt") + targetExclude would bring that failure back. fun spotlessSources(pattern: String) = fileTree(rootDir) { include(pattern)