-
Notifications
You must be signed in to change notification settings - Fork 181
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Split analyzers into separate directories #1419
Split analyzers into separate directories #1419
Conversation
<PropertyGroup> | ||
<TargetFramework>netstandard1.1</TargetFramework> | ||
<AssemblyName>FakeItEasy.Analyzer.CSharp</AssemblyName> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Implicit
<RootNamespace>FakeItEasy.Analyzer</RootNamespace> | ||
<AppDesignerFolder>Properties</AppDesignerFolder> | ||
<GenerateAssemblyInfo>false</GenerateAssemblyInfo> | ||
<FileAlignment>512</FileAlignment> | ||
<SignAssembly>true</SignAssembly> | ||
<DefineConstants>$(DefineConstants);CSHARP</DefineConstants> | ||
<PackageTargetFallback>portable45-net45+win8</PackageTargetFallback> | ||
<BaseIntermediateOutputPath>objcs\</BaseIntermediateOutputPath> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No longer necessary
<Compile Remove="objvb\**" /> | ||
<EmbeddedResource Remove="objvb\**" /> | ||
<None Remove="objvb\**" /> | ||
</ItemGroup> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No longer necessary
|
||
<PropertyGroup Condition="'$(Configuration)' == 'Release'"> | ||
<DebugType>pdbonly</DebugType> | ||
</PropertyGroup> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moved to ../FakeItEasy.Analyzer.Shared/Directory.Build.props
private const string ResourceBaseName = "FakeItEasy.Analyzer.CSharp.Resources"; | ||
#elif VISUAL_BASIC | ||
private const string ResourceBaseName = "FakeItEasy.Analyzer.VisualBasic.Resources"; | ||
#endif |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The CSharp/VisualBasic subfolders are no longer necessary
<Content Include="$(MSBuildThisFileDirectory)tools/*.ps1" Pack="true" PackagePath="tools/%(Filename)%(Extension)" /> | ||
</ItemGroup> | ||
|
||
</Project> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While I was at it, I extracted some common bits to this file.
The file name might be misleading, though, since it's not a "real" Directory.Build.props (in the sense that it's not implicitly imported). Maybe we should rename it to something else, e.g. FakeItEasy.Analyzers.Shared.proj
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm happy as is, or if you'd prefer another name, that's fine too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd like to try something. Currently it's difficult to add new files to the projects, because there's no place to do it in the solution explorer. Introducing a shared project might make things easier (I'm not sure it works with the .NET Core SDK though, I need to try it)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, it works with a shared project, but it's not perfect. Shared projects don't have all the nice features of SDK-style projects, so the files are listed explicitly in the .projitems
file (we can manually add glob patterns, but VS doesn't really support it so new files are added explicitly, which causes them to be included twice in the build). But at least we can now add files to the right place from Visual Studio.
Let me know what you think.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, @thomaslevesque. That warning was annoying, and I've never loved the objcs/objvb dirs. You've some conflicts to resolve, but other than that, and whatever you prefer for the Directory.Build.props file name, I'm content!
f2e06d8
to
12d4740
Compare
@thomaslevesque, sorry, I'm a little behind. First, I don't really have any strong opinions about the organization of the projects. If you're happy with things, and think I worry too much, we can merge it up. But… You've made some compromises around the Directory.Bulid.props and the shared project (with the .projitems file) and so on. I think you're unhappy with them. |
Well, the problem is that most of the code is apparently identical, but with types that are actually in different namespaces ( I'm not super happy with the shared project solution, mostly because it's an old-style project where source files are explicitly listed, but I can live with it. I opened dotnet/sdk#2511, hopefully a future version of the SDK will make things a bit better. Anyway, I'm content to merge as is if you have no remarks. Even if it's not perfect, it's going to solve a few issues (e.g. being able to upgrade to a newer SDK, maybe used |
ee8e152
to
0309c77
Compare
rebased, and removed [WIP] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, @thomaslevesque. I agree that it's worth merging this on its own merits, and unblocking other issues makes it even more worthwhile. If we decide to adjust later, so be it!
Thanks @blairconrad! |
This change has been released as part of FakeItEasy 4.8.1. |
This gets rid of two warnings that had been annoying me for a while:
And it's cleaner anyway. Having two projects in the same directory forced us to jump through hoops, like specifying a different intermediate output path (objcs/objvb instead of obj), and explicitly excluding files from the other project's intermediate output path.