Add config file support - #10
Merged
Ben McMorran (benmcmorran) merged 3 commits intoJul 20, 2026
Merged
Conversation
…actor.json) Options can now be supplied from a JSON file so the extractor can run with no command-line parameters. A msbuild-extractor.json in the current directory is used automatically; otherwise pass one with --config <path>. Command-line options override file values, which override built-in defaults. - Config.cs: a single config type whose instance Load(args) discovers the file (--config or ./msbuild-extractor.json), reads it, validates enum values, and resolves relative paths - CommandLineOptions.cs: seed option defaults from the config, add --config, merge msbuild property/env maps, expose ConfigPath - Program.cs: report the config file in use
Ben McMorran (benmcmorran)
approved these changes
Jul 20, 2026
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.
Add JSON config-file support
Summary
Adds an optional JSON config file so the extractor can supply its options from a file instead of (or alongside) the command line. This lets the tool run with no arguments when a config is present.
Behavior
• --config flag to point at a config file explicitly (also supports --config= ).
• Auto-detection: when --config is omitted, a msbuild-extractor.json in the current directory is loaded automatically if present.
• Precedence: command line > config file > built-in defaults. Config values are wired as each option's default, so any flag passed on the command line still wins.
• Input requirement: at least one projects or solutions entry must come from the config file or the command line. projects and solutions are additive — both may be set and are extracted together.
• Path resolution: relative paths in the config resolve from the config file's own directory.
Notes
• The example is named msbuild-extractor.example.json (not msbuild-extractor.json ) so it isn't auto-loaded when running from the repo root.