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

Allow netstandard to install contentFiles under the any tfm #755

Closed
wants to merge 2 commits into from

Conversation

emgarten
Copy link
Member

This change removes the any -> dotnet for contentFiles, unlike lib and other folders contentFiles does supports the any framework.

ContentModel previously defined token replacements such as any -> dotnet on a per pattern basis. All patterns that contained {tfm} would apply this replacement. This change moves the replacement table to the pattern which contains the folder name to allow fine grained control over it.

Fixes NuGet/Home#3118

//cc @joelverhagen @alpaix @jainaashish @rohit21agrawal @rrelyea @drewgil

By default ContentModel translates 'any' to 'dotnet', this works for the lib folder but for scenarios such as contentFiles any does refer to all frameworks. This change updates contentModel to allow per pattern token replacement tables.

Fixes NuGet/Home#3118
var collection = new ContentItemCollection();
collection.Load(new string[]
{
"contentFiles/any/any/config1.xml",
Copy link
Member

Choose a reason for hiding this comment

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

What is the first any?

Copy link
Member Author

Choose a reason for hiding this comment

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

codeLanguage


// Assert
Assert.Equal(1, groups.Count);
Assert.Equal(".NETPlatform,Version=v5.0", groups[0].Properties["tfm"].ToString());
Copy link
Member

Choose a reason for hiding this comment

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

Compare to FrameworkIdentifiers.CommonFrameworks.DotNet? This seems like a "truer" test since the string ".NETPlatform,Version=v5.0" would also allow this to pass.

Copy link
Member Author

@emgarten emgarten Jul 15, 2016

Choose a reason for hiding this comment

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

I can update that, the type here is Object, and apparently Assert.Equal(FrameworkIdentifiers.CommonFrameworks.DotNet, groups[0].Properties["tfm"]) is false, even though it is that exact framework

@joelverhagen
Copy link
Member

Thanks for the background information on this one. Address/ignore my last comment then :shipit:.

@emgarten emgarten closed this Jul 15, 2016
@emgarten emgarten deleted the emgarten/contentFilesNetStandard branch July 15, 2016 01:13
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.

3 participants