https://github.com/lordmike/mbw.tools.elephantproject
Tool to create .NET solutions spanning multiple repositories
https://github.com/lordmike/mbw.tools.elephantproject
dotnet project-management
Last synced: 19 days ago
JSON representation
Tool to create .NET solutions spanning multiple repositories
- Host: GitHub
- URL: https://github.com/lordmike/mbw.tools.elephantproject
- Owner: LordMike
- License: mit
- Created: 2021-04-01T13:22:10.000Z (about 4 years ago)
- Default Branch: master
- Last Pushed: 2023-09-19T21:12:02.000Z (over 1 year ago)
- Last Synced: 2025-04-10T06:55:05.554Z (21 days ago)
- Topics: dotnet, project-management
- Language: C#
- Homepage:
- Size: 48.8 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# MBW.Tools.ElephantProject [](https://github.com/LordMike/MBW.Tools.ElephantProject/actions/workflows/dotnet.yml) [](https://www.nuget.org/packages/MBW.Tools.ElephantProject) [](https://github.com/LordMike/MBW.Tools.ElephantProject/packages/704608)
Dotnet tool to create an maintain solution files, optionally modifying projects to replace package references with project references. This enables you to perform tasks such as large-scale refactoring or to easier debug tricky bugs.
The tool works in two parts:
* Modifying package references to project references, enabling cross-repository references. It is not intended for these replacements to be committed to source control.
* Maintain solution files by following some spec. This will both add and remove projects from solution files, allowing you to easily maintain multiple solution files with each their own set of projects. This also ammends the previous point, by enabling you to create cross-repository solution files.## Installation
Run `dotnet tool install -g MBW.Tools.ElephantProject`. After this, `elephant-project` should be in your PATH.
Run `elephant-project --help` to get further details.
## Usage: Rewrite project files
> elephant-project rewrite -d C:\Root\Directory\
This command replaces `PackageReferences` in `csproj` files with `ProjectReferences`. The goal here is to enable compilation, linking and debugging between two (or more) distinct repositories that usually share code through nuget packages.
You can reverse the changes made during `rewrite`, by running `undo-rewrite` with the exact same arguments.
## Usage: Create combined solution file
> elephant-project sln -d C:\Root\Directory\ Full.sln
This command creates or modifies a solution file to contain the projects within the directory specified. You can further tweak the projects included using the globbing patterns for `--include` and `--exclude`. This could be to exclude certain projects, like test projects, or to only include some set of projects within the root directory.
Dependent projects are _always_ included in the resulting solution file - even if they are outside the root directory.
# Tips
Use `rewrite` first on the directory containing all your repositories. This replaces all nuget references with project references, between all repositories. Then use `sln` to create a new solution file that encompasses all projects in one go. Opening this solution file should now present you with all your projects in one common place.