Skip to content
This repository has been archived by the owner on Jan 12, 2024. It is now read-only.

Opt-in to transitive content flow #166

Merged
merged 4 commits into from
Sep 5, 2018
Merged

Conversation

azeno
Copy link
Contributor

@azeno azeno commented Aug 25, 2018

This PR enables the control of the Include attribute for a dependency with the IncludeAssets metadata. See https://github.com/NuGet/Home/wiki/%5BSpec%5D-Managing-dependency-package-assets#nuspec for details.

Consider ProjectA with
<ProjectReference Include="ProjectB" IncludeAssets="all" />
will result in a ProjectA.nuspec with
<dependency id="ProjectB" include="all" />
which when ProjectA.nuspec gets referenced will also pull in the content of ProjectB into the root project.

azeno added a commit to vvvv/NuGetAssemblyLoader that referenced this pull request Aug 26, 2018
@azeno
Copy link
Contributor Author

azeno commented Aug 26, 2018

I've added two tests for the previous commit.

@@ -34,6 +34,15 @@ public static string GetNullableMetadata(this ITaskItem taskItem, string metadat
return value;
}

public static string GetContentFileInclude(this ITaskItem taskItem)
Copy link
Contributor

Choose a reason for hiding this comment

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

this is mixed in in this PR, it belongs to a different one that likely won't get merged soon. It would be best to separate it.

{ MetadataName.Version, "8.0.0" },
// NOTE: AssignPackagePath takes care of converting TFM > short name
{ MetadataName.TargetFramework, "net45" },
{ MetadataName.IncludeAssets, "all" }
Copy link
Contributor

Choose a reason for hiding this comment

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

This should be quite useful indeed. I'd add support for ExcludeAssets too, to complete the feature.

@azeno
Copy link
Contributor Author

azeno commented Sep 4, 2018

Indeed - I'll rebase the branch.

@azeno azeno force-pushed the contentFiles-include branch from 464d29e to 101e293 Compare September 4, 2018 19:05
@@ -286,6 +289,16 @@ static VersionRange AggregateVersions(VersionRange aggregate, VersionRange next)
return versionSpec.ToVersionRange();
}

static List<string> AggregateIncludes(List<string> aggregate, string next)
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe rename to AggregateAssetsFlow? Since it now does Includes and Excludes?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Will do

@kzu kzu merged commit b44f3de into NuGet:dev Sep 5, 2018
@kzu
Copy link
Contributor

kzu commented Sep 5, 2018

thanks a lot for your contribution @azeno!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants