Skip to content

Emit build-graph.json for editor tooling - #486

Merged
ChrisonSimtian merged 5 commits into
Fallout-build:mainfrom
ChrisonSimtian:emit-build-graph-json
Jul 13, 2026
Merged

Emit build-graph.json for editor tooling#486
ChrisonSimtian merged 5 commits into
Fallout-build:mainfrom
ChrisonSimtian:emit-build-graph-json

Conversation

@ChrisonSimtian

Copy link
Copy Markdown
Collaborator

Adds SerializeBuildGraphAttribute (priority 20, ahead of --plan/--help) that writes <temp>/build-graph.json on build initialization — a machine-readable projection of the target graph for editor tooling (the VS Code extension's targets view + dependency graph).

  • Schema v1: { version, falloutVersion, targets[] }; each target carries name, description, declaredIn, default, listed, and dependsOn/after/triggeredBy/triggers.
  • Best-effort: wrapped in try/catch — never fails a build, only writes a temp file.
  • Reuses the same graph data as the --plan renderer; deterministic output (targets and relation lists sorted).

Restores an emitter that previously existed (a stale .fallout/temp/build-graph.json was still checked into the tree) but was no longer in source. Verified by dogfooding: regenerated output matches the prior file except for the advanced build height and a since-removed target.

🤖 Generated with Claude Code

Add SerializeBuildGraphAttribute, which writes a machine-readable
projection of the target graph to <temp>/build-graph.json on every build
init: target names, descriptions, declaring type, default/listed flags,
and the four relation kinds (dependsOn/after/triggeredBy/triggers).

Reuses the same graph data as the --plan renderer. Runs at priority 20
so --plan and --help runs also refresh it. Best-effort: wrapped so a
serialization failure can never fail a build. Consumed by the VS Code
extension's targets view and dependency graph.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@ChrisonSimtian
ChrisonSimtian requested a review from a team as a code owner July 13, 2026 03:11
@ChrisonSimtian ChrisonSimtian added the target/vCurrent Targets the current version label Jul 13, 2026
Comment thread src/Fallout.Build/Execution/Extensions/SerializeBuildGraphAttribute.cs Outdated
Comment thread src/Fallout.Build/Execution/Extensions/SerializeBuildGraphAttribute.cs Outdated

@ITaluone ITaluone left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very cool! :)

Just these two little issues.

Comment thread src/Fallout.Build/Execution/Extensions/SerializeBuildGraphAttribute.cs Outdated
Comment thread src/Fallout.Build/Execution/Extensions/SerializeBuildGraphAttribute.cs Outdated
@ChrisonSimtian

Copy link
Copy Markdown
Collaborator Author

Very cool! :)

Just these two little issues.

been cooking this for a while, when we release 10.4 i also intend to release a set of IDE extensions starting with VS Code

ChrisonSimtian and others added 2 commits July 13, 2026 17:49
Co-authored-by: ITaluone <44049228+ITaluone@users.noreply.github.com>
Co-authored-by: ITaluone <44049228+ITaluone@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a build-initialization extension that emits a machine-readable build-graph.json into the build temporary directory so editor tooling can consume target metadata and relationships.

Changes:

  • Registers a new build extension ([SerializeBuildGraph(Priority = 20)]) ahead of --plan/--help.
  • Introduces SerializeBuildGraphAttribute to serialize a deterministic, sorted schema-v1 target graph model to <temp>/build-graph.json.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.

File Description
src/Fallout.Build/FalloutBuild.cs Registers the new build extension early in initialization.
src/Fallout.Build/Execution/Extensions/SerializeBuildGraphAttribute.cs Implements best-effort JSON emission of the target graph for tooling consumption.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/Fallout.Build/Execution/Extensions/SerializeBuildGraphAttribute.cs Outdated
Comment thread src/Fallout.Build/Execution/Extensions/SerializeBuildGraphAttribute.cs Outdated
Comment thread src/Fallout.Build/Execution/Extensions/SerializeBuildGraphAttribute.cs Outdated
Comment thread src/Fallout.Build/Execution/Extensions/SerializeBuildGraphAttribute.cs Outdated
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@ChrisonSimtian ChrisonSimtian self-assigned this Jul 13, 2026
Move the target-graph projection and JSON serialization out of
SerializeBuildGraphAttribute into a pure BuildGraphUtility, so the
build-graph.json contract the VS Code extension consumes can be
snapshot-tested without driving a full build. The attribute keeps only
the build-lifecycle hook and the file write.

Add BuildGraphUtilitySpecs: Verify snapshots that lock the emitted JSON
shape, plus unit coverage for target/dependency ordering, relation-kind
mapping, declaredIn, null handling, and version normalization.

Address review feedback: rename ResolveFalloutVersion -> FindFalloutVersion
(it can return null) and brace the null guard.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@ChrisonSimtian
ChrisonSimtian merged commit f407c7f into Fallout-build:main Jul 13, 2026
1 check passed
@ChrisonSimtian
ChrisonSimtian deleted the emit-build-graph-json branch July 13, 2026 08:09
@ChrisonSimtian ChrisonSimtian added the enhancement New feature or request label Jul 13, 2026
@ChrisonSimtian ChrisonSimtian added this to the v2026 milestone Jul 13, 2026
@ITaluone

Copy link
Copy Markdown
Contributor

been cooking this for a while, when we release 10.4 i also intend to release a set of IDE extensions starting with VS Code

Out of curiosity: do you have knowledge building Rider plugins? Would like to help with those, but cannot know where to start

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request target/vCurrent Targets the current version

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants