Repository navigation
Release: the developer modes only in a build that asks for them - #127
Merged
Merged
Conversation
--overlay-demo and --screenshots, with their companion flags, now compile only under PLADDER_DEV_MODES. scripts/make-screenshots.sh sets it through bundle.sh --dev-modes, scripts/overlay-demo.sh directly, both in .build/dev-modes; every other build, the release included, has neither. CI builds and runs the tests with the define, and a new test covers the flag parsing. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The problem
The fix
The two modes are opt-in:
OverlayDemo.swift,Screenshots.swiftand the branch ofPladderApp.initthat reads them compile only with-Xswiftc -DPLADDER_DEV_MODES.swift build,swift run,swift test, Xcode, a plainscripts/bundle.shandbundle.sh --releasehave neither mode and read no argument of their own. Only the two scripts that need the modes set the define:make-screenshots.shthrough a newbundle.sh --dev-modes, andoverlay-demo.shin its ownswift build. Both build in.build/dev-modes, because a changed define recompiles every module.--dev-modesrefuses--releaseand--install.Opt-in rather than opt-out, so a lost flag shows in the two scripts instead of in a shipped app. Not
#if DEBUG, becausemake-screenshots.shshoots the release-configuration bundle with its Info.plist, German strings and no Echo engine. CI's build-and-test action builds and tests as before, without the define, then rebuilds with it, checks its warnings and runs the newDeveloperModeTests, so the modes' code cannot rot unbuilt. CLAUDE.md gets a Decisions row and--dev-modesin Commands.Nothing between
recordingStoppedandinsertedchanges, so no benchmark.How it was proved
scripts/bundle.sh --release, Developer ID signed:nmfinds 0OverlayDemo/Screenshotssymbols (3,208 other Pladder symbols). The bare binary, with a scratchPLADDER_SETTINGS_PATHand another chord, launched with--overlay-demoand with--screenshots <dir> --settings-scene --managed, ran as the normal app for over a minute and wrote nothing. Stopped withpkill -f "$PWD/dist/Pladder.app".scripts/make-screenshots.shwrotestyles-light.pngandstyles-dark.png(looked at), andscripts/overlay-demo.shwrotedemo.logand six contact sheets (sheet-plain.pnglooked at). The dev-modes binary has 118 mode symbols.swift build --build-testswith no source warnings andswift testpass without the define; with it, no source warnings andDeveloperModeTests4/4.shellcheck,actionlint,check-doc-pointers.shclean..build/dev-modes115 s; a plainbundle.shright after it 0.55 s of compiling, so the two builds never rebuild each other.Review loop
Round 1's finding: CI built only with the define, so a pull request never compiled the configuration that ships. Fixed with the separate step above; two nits fixed too.
Not in this PR
The seams only the modes use (
SettingsLocation.scratch,SettingsView.requestedTab,AppModel.reviewShowsGetStarted, thereadPolicy:parameter) stay unguarded; nothing reaches them without the entry point. The[--speed …]onoverlay-demo.sh's Commands line is stale from before; #123 fixes it.Closes #124
🤖 Generated with Claude Code