-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create a shared Common .projitems (#235)
This is another preparatory refactoring change. The intention is to make it easier to share both files and settings across the analyzers and code fixes by using a shared `Common.projitems` file. To make editing the common files easier, there's also a `Common.csproj` project, however that's marked as not packable / publishable. Visual Studio has its own `.shproj` format for these types of projects, but they have several disadvantages: 1. They aren't SDK-style 2. They don't work with modern refactoring motions (as experienced when using in them in SquiggleCop) 3. I haven't tried them in Rider? A simple project sidesteps all these issues at the expense of compiling an extra .dll that's unused.
- Loading branch information
1 parent
7053d96
commit bbb213d
Showing
43 changed files
with
82 additions
and
37 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains 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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<RootNamespace>Moq.CodeFixes</RootNamespace> | ||
<AssemblyName>Moq.CodeFixes</AssemblyName> | ||
<TargetFramework>netstandard2.0</TargetFramework> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Workspaces" PrivateAssets="all" /> | ||
</ItemGroup> | ||
|
||
<Import Project="$(RepoRoot)/src/Common/Common.projitems" Label="Shared" /> | ||
|
||
</Project> |
This file contains 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
File renamed without changes.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<!-- | ||
NOTE: This project is not intended to be referenced directly. The common components should instead be compiled | ||
directly into the consuming project to reduce the dependencies and assembly load costs. Instead, Import | ||
`Common.projitems` in your project file. | ||
This project _could_ be a NoTargets project, but then Navigate-To-Definition and other editor features don't work | ||
when viewing files in the context of the Common project (presumably because it sees them as loose files with no | ||
associated compilation). | ||
This is effectively a .shproj, however they tend to break refactoring tools (namely "Move to file") which don't | ||
understand which "context" they're operating in. | ||
--> | ||
|
||
<PropertyGroup> | ||
<TargetFramework>netstandard2.0</TargetFramework> | ||
<RootNamespace>Moq.Analyzers.Common</RootNamespace> | ||
<AssemblyName>$(RootNamespace)</AssemblyName> | ||
<IsPackable>false</IsPackable> | ||
<IsPublishable>false</IsPublishable> | ||
<SquiggleCop_Enabled>false</SquiggleCop_Enabled> | ||
</PropertyGroup> | ||
|
||
<PropertyGroup Label="Shared project settings"> | ||
<!-- Disable default behavior so we rely on the included props --> | ||
<EnableDefaultItems>false</EnableDefaultItems> | ||
<ShowCommonFiles>true</ShowCommonFiles> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" PrivateAssets="all" /> | ||
</ItemGroup> | ||
|
||
<Import Project="$(RepoRoot)/src/Common/Common.projitems" Label="Shared" /> | ||
</Project> |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<Project> | ||
<ItemGroup> | ||
<Compile Include="$(MSBuildThisFileDirectory)/**/*.cs" Visible=" '$(ShowCommonFiles)' == 'true' " /> | ||
</ItemGroup> | ||
</Project> |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
...Moq.Analyzers/MoqSetupMethodDescriptor.cs → src/Common/MoqSetupMethodDescriptor.cs
This file contains 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
File renamed without changes.
File renamed without changes.
This file was deleted.
Oops, something went wrong.
This file contains 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
This file contains 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
This file contains 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