dotnet: proto tool refactor (staging) - #1
Open
Wtiben wants to merge 78 commits into
Open
Conversation
…ts (moonrepo#182) Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
New `dotnet_toolchain` WASM plugin covering tiers 1 through 3 for SDK-style C#, F# and VB projects. - tier1: register_toolchain (csproj/fsproj/vbproj, sln/slnx, global.json, Directory.Build.*, Directory.Packages.props, nuget.config, packages.*.lock.json), define_toolchain_config, initialize_toolchain, define_docker_metadata with restore-layer scaffold globs, prune_docker. - tier2: locate_dependencies_root (nearest solution, then lock file, then project file), install_dependencies (dotnet restore, with --locked-mode when a lock file is present), setup_environment (dotnet tool restore for local tool manifests), extend_task_command (DOTNET_ROOT and PATH), extend_project_graph (dependency and task inference, AssemblyName aliases), parse_lock, parse_manifest, hash_task_contents. - tier3: setup_toolchain, installing the SDK via the official dotnet-install scripts when `version` is configured. Dependencies and tasks come from a real MSBuild evaluation rather than from parsing project XML, so Directory.Build.targets imports, MSBuild properties such as $(SolutionDir), conditional references and Central Package Management resolve the way the SDK resolves them. There is no parser to maintain. Every project in the workspace is evaluated in one batched traversal invocation rather than one process per project, and the evaluated package sets are cached on disk so task hashing reuses them instead of re-evaluating. Registers dotnet-toolchain in .moon/workspace.yml, and adds actions/setup-dotnet to CI because the integration tests evaluate their fixtures with a real dotnet msbuild.
Evaluation runs with the SDK's default property values, so a reference or package behind a condition lands in the graph even in a workspace whose real builds never enable it. `msbuildProperties` sets MSBuild global properties for evaluation only, applied to both the batched traversal and the per-project fallback. The properties form part of the evaluation cache digest, because a conditional PackageReference resolves differently under different values and a cached package set must not be served across configurations. Inferred task commands and `dotnet restore` do not receive them, so `moon run` builds stay exactly what the project defines.
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.
Staging PR for iterating on moonrepo#169 without touching the upstream PR.
Base is the PR branch rebased onto current upstream master, so the diff shows only new work.
— verified: wasm build + 114 tests green
tools/dotnetproto tool plugin