From ef40d8b849dbabf4ccd41f39c6e6cb8087a72709 Mon Sep 17 00:00:00 2001 From: Alex Abashev Date: Thu, 3 Dec 2026 21:41:02 +0300 Subject: [PATCH] Set up a new worktree: trust mise.toml, install the JDK and compile once .bb-env-setup.sh trusts mise.toml, installs Temurin 21 and runs compileJava, so a fresh worktree starts with a warm build. .worktreeinclude lists the untracked local files (mise.local.toml, .env) copied into it. --- .bb-env-setup.sh | 15 +++++++++++++++ .worktreeinclude | 6 ++++++ 2 files changed, 21 insertions(+) create mode 100755 .bb-env-setup.sh create mode 100644 .worktreeinclude diff --git a/.bb-env-setup.sh b/.bb-env-setup.sh new file mode 100755 index 00000000..cd897e8b --- /dev/null +++ b/.bb-env-setup.sh @@ -0,0 +1,15 @@ +#!/usr/bin/env bash +# Sets up a fresh worktree: trusts mise.toml, installs the pinned JDK, and compiles everything once so the +# first real Gradle run starts from a warm build. +# +# bb runs this for worktrees it creates itself; for worktrees made with `git worktree add` (see .bb/AGENTS.md +# of the workspace) the agent runs it by hand from the worktree root. +set -euo pipefail + +# mise refuses to read a mise.toml it has not been told to trust, and a new worktree is a new path. +mise trust +# Temurin 21, which Gradle finds through its asdf provider (see gradle.properties). +mise install + +# Compiles every module's main classes, no tests. A failure here should not stop the worktree from opening. +./gradlew --console=plain compileJava || echo "warning: ./gradlew compileJava failed, the worktree is still usable" >&2 diff --git a/.worktreeinclude b/.worktreeinclude new file mode 100644 index 00000000..192430ed --- /dev/null +++ b/.worktreeinclude @@ -0,0 +1,6 @@ +# Untracked files copied from the source checkout into a new worktree (gitignore syntax). +# Nothing is needed today; add local-only files here, for example: +mise.local.toml +.env +.env.* +!.env.example