-
Notifications
You must be signed in to change notification settings - Fork 44
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
Feedback changes on #80 #84
Conversation
Fix Local Build Fix NuSpec less packaging Upstream (build env) patches - SourceControlInformation fix - Add some Labels
User Facing Properties:
Every other property that is changed and not mentioned above is not supposed to be user facing. I propose we keep the new names instead of renaming all over the place. I tested at the best of my ability to know that these new names don't interfere with the build process. But to be sure we can test some more with the projects like windows toolkit, package explorer, msbuild log viewer, any other projects etc... to find any issues during the course of this PR. And not to break other user's builds we can provide a shim properties until a major version (say 2.0) and an optional warning to use the new names. |
No Longer needed since we need VS/MSBuild 15 and above Silverlight and WP targets are not affected!
So that we won't clash with other names that matches these!
upstream patch for Identifier check comments clean up
upstream patch: fixed EmbeddedResource Added section comments
Some people really need it!!! And no, they don't want to update to net472
After this, are there other changes, or does this mostly complete your updates for now? |
@@ -6,6 +6,7 @@ root = true | |||
|
|||
# Don't use tabs for indentation. | |||
[*] | |||
charset = utf-8 |
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 think this should be utf-8-bom
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.
It caused some problems on my machine, so I made sure all the files would be utf-8
using these tools.
</When> | ||
|
||
<!-- Check for _*_wpftmp.*proj files --> | ||
<When Condition="$([System.Text.RegularExpressions.Regex]::IsMatch('$(MSBuildProjectName)', '$(_GeneratedProjectSuffixPattern)%24'))"> |
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.
Why use a regex here instead of checking/using the presence _TargetAssemblyProjectName
. What does that gain?
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.
Can we know for sure that the generated project use only _TargetAssemblyProjectName
and it is only present in the generated project? If that's so I can remove the RegEx check.
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 property is defined only in the WPF generation task, so it's a safe bet for now that it's only there in the 2nd pass compile.
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, then, I'll remove them
@@ -16,10 +16,10 @@ | |||
--> | |||
<Target Name="_CheckAndFixupRootNamespaceWithGeneratedSuffix" | |||
BeforeTargets="_CompileTemporaryAssembly;CoreCompile" | |||
Condition="('$(IsGeneratedProject)' == 'true') AND $([System.Text.RegularExpressions.Regex]::IsMatch('$(RootNamespace)', '$(GeneratedProjectSuffixPattern)'))"> | |||
Condition="'$(IsGeneratedProject)' == 'true' AND $([System.Text.RegularExpressions.Regex]::IsMatch('$(RootNamespace)', '$(_GeneratedProjectSuffixPattern)'))"> |
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.
If we need a regex, can we store the result so we don't have to evaluate it multiple times. That's likely expensive.
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.
How do I do it? Is it possible to store RegEx object in a MSBuild property?
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 store the results of a regex by storing the result in a property instead of using directly in a condition.
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.
Outside of the target right?
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.
Right, I think that would work. but you may not need 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.
If we don't set the RootNamespace
it defaults to MSBuildProjectName
. If it contains invalid chars or suffix for generated projects and if we dynamically transform existing RootNamespace
(i.e. MSBuildProjectName
) to the correct one, the suffix flows through. From there all hell breaks loose! Believe me I've had my fair share.
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 feel like this is better off as a StartsWith string comparison rather than a RegEx? Namespaces/Project Filenames contain "." characters which match any character in Regex plus this isn't using the "^" Start of String anchor, each potentially matching false positives. For example "My.Project.Name" would match "This.IsNot.My_Project_Namespace" in this scenario, which wouldn't be desired whereas "^My.Project.Name" would match things like "My.Project.Name.Sub.Namespace" (though it would also match "My.Project.Namespace").
I have asked @GeertvanHorrik for checking his multitarget template with the latest code #43. Once he confirms it's working without any issues we can merge this. Can we remove |
What does We should have both shims and release notes since we don't want to break people. |
Ok. then I'll get right on it! Again I'm so sorry to force such large change to you. I know this breaks git flow. I assure you this will be the last large change. |
Sounds like |
Seems like it's not working properly, will skip this for now! |
upstream patches: Added Nesting and Dependent files support Workaround for CodeAnalysis, Intellisense, etc...
Move packaging related props
Use '_TargetAssemblyProjectName' Generalize Fixup target Drop '_Sdk' for user facing properties.
Take 2: DynamicDependentFile not working, keep static evaluation for now! Include missing ProjectSystem.targets file
I am having a bit more time now. What's the easiest way to test this PR? |
Since, IsGeneratedProject is not supposed to be a user facing property!
You can do this:
|
Steps taken:
Without the debug lines, it doesn't seem to work:
Anything specific I have to do to make sure I am using the latest stuff? |
Ok, just read your guide, I didn't build your version first. Let me do that real quick. |
Final steps:
Then I checked out your examples, and found that I need to define this:
Questions: A. Would it be possible to make this work out of the box? One option is to add it to the wpf only targets in the implicit targets file in the root of the template. Just tested that and that works great :-) |
|
Excellent, here is the commit with the changes: |
Not sure I understand point 4, maybe you can explain that one? |
The problem is enabling different type of projects (for a single framework) needs some intervention, like setting up default items, implicit references, some property overrides etc...
No. That's why the explicit properties. |
Some of the Generators like |
@Nirmal4G When do you think you'll have the compat shims and docs updated so we can close this PR out? |
Remove Test Hooks Give a common property
just like every other custom tool so that we can keep track of it!
@onovotny The changes are done, but adding shims and the warnings make Extras SDK a little bit noticeably slower. Is this OK? |
Why would adding shims slow things down, they're additional variables? We cannot break people on upgrade. |
for projects that require full MSBuild!
Issue a warning when using those properties
</PropertyGroup> | ||
|
||
<!-- Check to see if we are using msbuild core! --> | ||
<Target Name="_WarnWhenUsingMSBuildCore" |
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 slowing the build down!
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.
How are you measuring the timings?
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.
msbuild /bl /DetailedSummary
and .binlog
too!
<Target | ||
Name="_WarnWhenUsingObsoleteProperties" | ||
BeforeTargets="_CheckForInvalidConfigurationAndPlatform" | ||
Condition="'$(_IgnoreObsoletePropertyWarnings)' != 'true'"> |
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 target is also slowing the build a bit!
For now it only includes migration path from old SDK version.
As a general rule, we should not be using |
I'm not good at writing docs as English is not my first language. Any help with docs is much appreciated. |
Since we're dealing with multiple platforms, I've reduced them to platform wise and made comparisons and this is much faster than checking If you know anyone who can give Perf review for these patches, reel'em in, that'd be very much helpful. |
Both the targets add approximately 150ms each to the Build! |
I think |
Will work once the PR is merged
the binlog in msbuildlog may have more detailed evaluation numbers |
I did that version too, It takes about 350ms. I don't know how, but got reduced to 150ms for the above version!
This is from that but just those targets! |
Just a little fix
I think that's just about it. You can merge anytime. |
Why do the sample projects have |
See... |
</PropertyGroup> | ||
|
||
<PropertyGroup> | ||
<_SdkLanguageTargets Condition="'$(_LanguageSourceName)' != 'FSharp'">$(MSBuildToolsPath)\Microsoft.$(_LanguageSourceName).targets</_SdkLanguageTargets> |
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.
Why are we looking for the F# Targets this way instead of the VS directory?
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.
Why are these being set to a private variable and imported below instead of using LanguageTargets
?
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 don't know how to explain it (in writing) but I can show you.
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.
Still not following... I can see that you may want to add a second import, but I don't think we should be overriding the base language targets if they're the same? At least use the LanguageTargets
value that's provided by default?
I know there was one specific issue around WPF builds that needed to use the VS's version, but that was already handled? So I'm not really sure why stuff is being searched for via MicrosoftNETSdkTargetsPath
?
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.
You were talking about this?
Why are we looking for the F# Targets this way instead of the VS directory?
I wanted to make sure F# would have the same behaviour when under .NET SDK in this SDK 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.
We were already doing that here:
So why do we need the more complex logic here 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.
No, we're not doing that there! We're not importing from Microsoft.NET.Sdk
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 don't understand what the issue is -- I thought we had to explicitly import the Visual Studio version for this scenario, not import from the SDK. If all we're doing is importing from the SDK, then we don't need anything and can fall back to the default LanguageTargets
?
Also, why are the VB defines treated differently, with the =-1?
|
That's a Q for the language team! VB is different for historical reasons!! |
When I looked at what the main SDK does, I don't see it setting things to |
Ok, I get what you're asking, I should've the property named |
Compat with the old code
Documenting renames and functional changes from the versions < 1.5
Issues Resolved
that's all folks