sajalverma17 / GitBranchDiffer

A Visual Studio Extension that displays source files Added/Modified/Renamed between a base branch you choose to diff against, and the current working branch in your Git repo. The diffed files are shown in the Solution Explorer using a Solution Explorer Filter
MIT License
6 stars 1 forks source link

Move code from GitBranchDiffer project to BranchDiffer.VS project #18

Closed sajalverma17 closed 3 years ago

sajalverma17 commented 3 years ago

Currently the project is divided into two projects:

It would be nice to make the GitBranchDiffer.csproj more slim, and move the namespaces FileDiff and Filter into a new project named BranchDiffer.VS.csproj.

Pre-requisites: Visual Studio 2019

Steps:

  1. Clone this repo
  2. Open GitBranchDiffer solution
  3. Create a new project of type C# library, named BranchDiffer.VS, .NET Framework version should be same as the main project I think...(.NET 4.7.2)
  4. Add two new namespaces in Visual Studio under this solution.
  5. Close Visual Studion. Since namespaces were added, folders will be created, just browse them via File Explorer.
  6. Move all the .cs files under {yourClonedFolder}\GitBranchDiffer\FileDiff and {yourClonedFolder}\GitBranchDiffer\Filter to {yourClonedFolder}\BranchDiffer.VS\FileDiff and {yourClonedFolder}\BranchDiffer.VS\Filter
  7. Open VS again, go to the namespaces you added under the new project. Right Click -> Add Existing Items -> Add all the files you just added to the folders on disk.
  8. Add below highlighted references. Some are Nuget packages you need to add by Right Click -> Manage Nuget Package for project. One of them is a .dll Microsoft.VisualStudio.Platform.WindowManagement which you will find under {yourClonedFolder}\libs. This is an external dll I added to this solution. image

Add a reference to this new project in the main project GitBranchDiffer. Just build and see if the solution compiles! I can test if all functionalities are working 👍

The idea is that the main startup project (GitBranchDiffer) should not contain business logic, but access the business logic in Git-specific and VS-specific project. The main startup should only contain code needed to build the plugin, like the manifest file, .vsct file etc.

If anybody wants this, just ask and I will assign it, this is a good first issue 😃