项目作者: hieuxlu

项目描述 :
CLI helper for Visual Studio .sln & .csproj files
高级语言: C#
项目地址: git://github.com/hieuxlu/sln-tools.git
创建时间: 2019-04-19T01:42:51Z
项目社区:https://github.com/hieuxlu/sln-tools

开源协议:MIT License

下载


sln-tools - CLI helper for Visual Studio .sln & .csproj files

Introduction

Support the following operations

  1. usage: sln-tools COMMAND [OPTIONS]+
  2. switch switch dll reference to project reference in a
  3. solution
  4. merge merge solution files to a single solution
  5. remove-imports remove imports from project files
  6. remove-projects remove projects from solution files

switch - Switch DLL reference to project references

A lot of large legacy codebase use DLL reference for hundreds of projects to a single Assembly/Artifacts folder, without a single .sln file to contain or group these projects.
switch command will replace DLL reference with project reference.

  • Support replacing .csproj inside solutions
  • Support glob-matched projects outside solutions and automatically add them to .sln files.
  • Automatically resolve GUID conflicts. This is handy because a lot of developers just copy paste these .csproj files, not knowing VS Solution can not load projects with duplicate GUID
  1. sln-tools switch --help
  2. -s, --solution=VALUE the path to solution file.
  3. -p, --pattern=VALUE the path to project files
  4. -i, --in include only projects inside source solution file
  5. -w, --write overwrite project file(s)
  6. -h, --help show options

merge - Merge multiple solution files to a single solution

There’s a CLI tool (slntools) that handles merging solution files, but in a way that is not helpful to me. So merge command will add projects in child .sln files to a single .sln parent.

  • Support merging multiple .sln files using glob-pattern
  • Automatically resolve csproj duplicates, GUID conflicts.
  1. sln-tools merge --help
  2. -s, --source=VALUE the glob pattern to match solution files
  3. -t, --target=VALUE the target solution file
  4. -f, --add-folder add relative solution folder
  5. -g, --add-same-guid add projects with same guid by creating new guid
  6. -w, --write overwrite project file(s)
  7. -h, --help show options

remove-imports - Remove a specific import statement inside .csproj files matching a glob pattern

This can be useful when you want to remove an erroneous import statement in legacy codebase. MSBuild tool is simply unable to load .csproj with erroneous import statements.

  1. sln-tools remove-imports --help
  2. -f, --files=VALUE the glob pattern for project files.
  3. -p, --pattern=VALUE the regex pattern for import statement
  4. -w, --write overwrite project file(s)
  5. -h, --help show options

remove-proj - Remove regex-matched projects in solution files

Useful when you are tired of removing hundreds of, say UnitTest projects, from solution files.

  1. sln-tools remove-projects --help
  2. -s, --solution=VALUE the path to solution files.
  3. -p, --pattern=VALUE the regex pattern for project name
  4. -t, --target=VALUE the target solution file to write to
  5. -h, --help show options