Repository navigation
Build against the sibling library repos when the local workspace exists - #2
Merged
Merged
Conversation
While ../DotNetBoost.Workspace.slnx exists, Directory.Build.targets turns every DotNetBoost.* PackageReference whose project is in a sibling repo's src/ folder (dotnetboost-settings, -media, -multilingual, -auditing) into a ProjectReference to it. A library whose folder is missing stays a package. Package ids equal project names in all four repos, which is what the swap relies on. It keys on the workspace file existing rather than $(SolutionFileName), so `dotnet run --project` and the IDE behave the same as building the workspace. CI checks out this repo alone, never has the file, and keeps building against the packages pinned in Directory.Packages.props. One build can opt out with -p:UseLocalDotNetBoost=false; deleting the workspace file turns it off for good. Verified: in the workspace, every DotNetBoost library (including the transitive ones) resolves as a project and the tests (160) pass; with the opt-out they resolve as the nuget.org packages and still pass; and a copy of the repo outside the workspace evaluates with the switch off and all seven Infrastructure package references intact. 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.
Summary
Lets this sample build against the DotNetBoost libraries' source on a machine that has the local workspace, and against nuget.org everywhere else.
Directory.Build.targetsturns on only while../DotNetBoost.Workspace.slnxexists. When it's on, eachDotNetBoost.*package whose project is in a sibling repo'ssrc/folder (dotnetboost-settings,-media,-multilingual,-auditing) becomes a project reference. A library whose folder is missing stays a package.Directory.Packages.props.dotnet build,dotnet runanddotnet test, because it checks for the file rather than which solution is being built.-p:UseLocalDotNetBoost=false. Delete the workspace file to turn it off for good.Verification
-p:UseLocalDotNetBoost=false, they resolve as the nuget.org packages, and the tests still pass.🤖 Generated with Claude Code