Skip to content
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

Change xml formatting for store artifacts xml #1487

Merged
merged 2 commits into from
Aug 18, 2017

Conversation

dasMulli
Copy link
Contributor

@dasMulli dasMulli commented Aug 15, 2017

@dasMulli
Copy link
Contributor Author

Credit to @mikkelbu pointing out that line.

@guardrex
Copy link
Contributor

guardrex commented Aug 15, 2017

@dasMulli What's the story on the casing of the package names? Is that one difficult/impossible to address?

[EDIT] I just realized those props are of the build. The list comes from the TargetOutputs.

@dasMulli
Copy link
Contributor Author

I'm not sure what can be done about the package id casing. As far as I can tell it originates from the ResolvePublishAssemblies task which affects more code paths than just composing a store:

item.SetMetadata(MetadataKeys.PackageName, resolvedAssembly.Package.Id.ToString().ToLower());

@guardrex
Copy link
Contributor

Excellent find. What about setting a new metadata item (for use later)?

item.SetMetadata(MetadataKeys.FriendlyPackageName, resolvedAssembly.Package.Id.ToString());

@guardrex
Copy link
Contributor

guardrex commented Aug 15, 2017

Add one here: https://github.com/dotnet/sdk/blob/cd25d6bbfc2aac61cc790c511900427ac64fdaa8/src/Tasks/Common/src/MetadataKeys.cs

public const string FriendlyPackageName = "FriendlyPackageName";

[EDIT] btw--- What is stored in

public const string Name = "Name";

... that's not the friendly package name, is it?

@dasMulli
Copy link
Contributor Author

Turns out the metadata in ResolvePublishAssemblies was only added for the store logic in the first place, the chained FilterResolvedFiles task then uses NuGet's PackageIdentity type which matches case-insensitive anyway.
I removed the ToLower() from ResolvePublishAssemblies . As long as any-cased package names in the file are valid, this should work 🤞

@guardrex
Copy link
Contributor

🎉 Awesome @dasMulli!!!!

hannibalsmith

"I love it when a plan comes together!" - John "Hannibal" Smith (George Peppard), The A-Team, ©1983-87 Universal Television Stephen J. Cannell

@@ -83,7 +83,7 @@ protected override void ExecuteCore()
TaskItem item = new TaskItem(resolvedAssembly.SourcePath);
item.SetMetadata("DestinationSubPath", resolvedAssembly.DestinationSubPath);
item.SetMetadata("AssetType", resolvedAssembly.Asset.ToString().ToLower());
item.SetMetadata(MetadataKeys.PackageName, resolvedAssembly.Package.Id.ToString().ToLower());
item.SetMetadata(MetadataKeys.PackageName, resolvedAssembly.Package.Id.ToString());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@eerhardt Will removing this ToLower() break anything?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Package Ids are supposed to be case insensitive, so in theory it is fine to make this change. If it does break something, that something should be fixed to use a case insensitive comparison.

I did a quick look at where this is used, and the only place I found was it gets passed into FilterResolvedFiles, which then uses it to create a PackageIdentity, which does case insensitive comparisons. So this should be fine.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool ... It's a UX issue if the files have lowercase package names. Some devs are bound to wonder: Do they always need to be lowercase in the artifact.xml file? This will fix that prob.

Copy link
Contributor

@nguerrera nguerrera left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Waiting to get input from @eerhardt on casing.

Copy link
Member

@eerhardt eerhardt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for the delay in reviewing, I've been out of the office.

Looks good to me. Thanks for the contribution.

@nguerrera nguerrera merged commit b5aa4a2 into dotnet:master Aug 18, 2017
mairaw pushed a commit to dotnet/docs that referenced this pull request Oct 19, 2017
mmitche pushed a commit to mmitche/sdk that referenced this pull request Jun 5, 2020
GangWang01 pushed a commit to GangWang01/sdk that referenced this pull request Jun 7, 2022
GangWang01 pushed a commit to GangWang01/sdk that referenced this pull request Jul 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants