-
Notifications
You must be signed in to change notification settings - Fork 301
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
Csproj format update, fixes #3944 #4383
Csproj format update, fixes #3944 #4383
Conversation
Just few questions....
Judging from other diff, the |
Re 1: That inspection had been removed from the csproj files, but not from the git working tree. It uses old API for inspections and refers to resources that have been removed. The move to the new csproj format (which uses globbing to include files) just surfaced that mishap. Re 2: EasyHook (as well as NLog.Schema and possibly other NuGet Packages) pushed parts of the content they should add to the Re 3: Good spot, I'll make sure to reinstate these error conditions |
Codecov Report
@@ Coverage Diff @@
## next #4383 +/- ##
=========================================
- Coverage 63.76% 56.86% -6.9%
=========================================
Files 933 944 +11
Lines 31299 32217 +918
=========================================
- Hits 19955 18318 -1637
- Misses 11344 13899 +2555
|
5bb7556
to
e8d3c07
Compare
13ac45e
to
e4b4c57
Compare
I believe I have discovered the source of instability in the build process. I think this section in the
With this setting, the I made the following changes:
With this change, the With the build troubles out of the way, I was able to properly test and verify that yes, we must have Please confirm if you'd like my commit to be added or if there's some other preference to merge the changes. |
// to COM components. If you need to access a type in this assembly from | ||
// COM, set the ComVisible attribute to true on that type. | ||
[assembly: ComVisible(false)] | ||
|
||
[assembly: CLSCompliant(false)] |
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 do not think we need this. From what I can tell, we don't emit any additional warnings without that setting. Because this impacts the project references (e.g. a CLS compliant project shouldn't reference a non-CLS compliant project), and this is the only time we have this, it's best to not have the attribute so we actually get warnings if this does become an issue.
<Resource Include="**\*.txt" /> | ||
<Resource Include="**\*.resx" /> | ||
<Resource Update="**\*.de.resx"> | ||
<DependentUpon>$([System.String]::Copy('%(Filename)').Replace('.de', '')).resx</DependentUpon> |
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.
This feels a bit more fragile. What if we add new language? Do we have to go and add this everywhere we need i18n? Couldn't we replace .??.resex
to .resx
?
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 not 100% clear on how wildcards work, but it might be worth a try to unify this, yea
RubberduckBaseProject.csproj
Outdated
@@ -0,0 +1,49 @@ | |||
<?xml version="1.0" encoding="utf-8"?> | |||
<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.
This is easily my favorite feature of the new csproj format -- ability to standardize all projects. Love that! 👍
RubberduckBaseProject.csproj
Outdated
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<Analyzer Condition=" '$(AssemblyName)' != 'RubberduckCodeAnalysis' " |
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 condition need to include RubberduckTests
and RubberduckCodeAnalysisTests
; makes no sense to run the analyzers there. (note: fixed in my commit that's not pushed yet)
aa75be5
to
966fc09
Compare
Reminder to self: check whether we can use some of the MSBuild community tasks to simplify our stuff even more: https://github.com/loresoft/msbuildtasks |
32777c7
to
26d6e18
Compare
As it stands, this PR will utterly and completely break the UI. That's because when we're initializing compoents based on XAML, we have a System.Uri that looks a bit like this: "/Rubberduck.Core;V2.2.*;[...]". The second part of that URI is parsed as a System.Version to determine the Assembly to load for the XAML. That's not possible because * is rather obviously not an integer. As such loading any XAML component will result in a FormatException. That means we either don't have a UI or even crash the host as it stands. That's what broke the test ignored in 9555bbb I'll need some help figuring out a proper fix for this. I assume that dotnet/project-system#1467 is closely realated to this. A symptomatic fix could be to explicitly specify a non-wildcard version for Rubberduck.Core. I don't know whether that will break COM Registration or the deployment process though. Opinions highly welcome. |
RubberduckBaseProject.csproj
Outdated
<Choose> | ||
<When Condition=" '$(AssemblyName)' == 'RubberduckTests' "> | ||
<ItemGroup> | ||
<Analyzer Include="$(SolutionDir)\RubberduckTestsCodeAnalysis\bin\RubberduckTestsCodeAnalysis.dll"/> |
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.
That does not make sense - it seems to be saying that if the project is RubberduckTests
, to add RubberduckTestsCodeAnalysis
as an analyzer for that project. But the RubberduckTestsCodeAnalysis
project is a test project testing the analzyer, not an analyzer project... Or am I misunderstanding?
Regarding the problem with the WPF URI -- this says the version is optional. Do we really need to have the version embedded in the URI? Seems to me that it'd simplify lot of things if we only cared about the resource name, regardless of the version? |
Reminder to self: get MSBump to put in versions: https://github.com/BalassaMarton/MSBump |
This moves all NuGet references from the packages.config format to the PackageReference format. This was done through the migration tool shipped with VisualStudio. The warnings around EasyHook have been ignored for now.
4159392
to
c93864c
Compare
This changes the PostBuildEvent and PreBuildEvent previously used to prepare the installer and the COM registration for dev build to proper MSBuild Target definitions that hook into the buildprocess
Update path to TestAssemblies to not contain Configuration
Apparently XAML generation generates a resource URI with a version specifier of 'V2.2.*'. This specifier cannot be parsed by System.Version resulting in an exception in the test. So long as XAML generation isn't fully supported, we can't really fix that aside from specifying a full version. For now ignoring the test is the easier workaround.
Drop XML preamble in shared project file to make sure the first line is the root "Project" declaration. Add Sdk to base project declaration, provoking MSB4011, but fixing version patching.
dc26ca3
to
d63a5ef
Compare
Okay I think I'm done now. For me locally running the BuildRegistry script still fails from within VisualStudio. I haven't attempted to run it in msbuild alone. If I run the exact command that VS should run in a powershell host it works as expected and correctly registers the build. As such I'm assuming that VS is somehow at fault. The problem with XAML has been symptomatically fixed, pending a more in-depth diagnosis of the underlying problem. I unfortunately am not remotely knowledgeable enough to find out where this goes wrong. I have not included MSBump (yet?). Currently we're patching versions through AppVeyor, which works fine for AV. Locally the wildcard just goes to a generated buildnumber which is dependent on the timestamp. That way builds will properly generate different versions. I have not verified that Fakes work as expected. Parsing, UnitTesting and similar things seem to work just as intended from cursory F5 testing. Unless there's something major, this is ready to merge from my side now. |
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.
Massive props for the massive work here, @Vogel612 - this diff is awesome (negative 46.3K!!) and we're clearly all going to benefit from a leaner .csproj format.
Just needs clarification w/rt the AppVeyor build versioning, though. Looks like the appveyor.yml
file handles it fine?
No description provided.