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

Leverage AssemblyMetadata attribute for nuspec token replacements #2851

Closed
kzu opened this Issue May 26, 2016 · 4 comments

Comments

Projects
None yet
4 participants
@kzu

kzu commented May 26, 2016

Currently there are a fixed number of attributes that are taken from a project's AssemblyInfo to be used as replacement tokens in a nuspec file when generating a package for a project.

Additional replacement values must be specified via the nuget command line only, in order to be usable as replacement tokens.

AssemblyMetadataAttribute (see http://msdn.microsoft.com/en-us/library/system.reflection.assemblymetadataattribute(v=vs.110).aspx) could be used to automatically extend the replacement tokens in a very convenient way.

This would allow easy replacement of an $authors$ or $owners$ tokens in the .nuspec by simply having the following in a common assemblyinfo.cs:

[assembly: AssemblyMetadata("authors", "foo, bar")]
[assembly: AssemblyMetadata("owners", "Outercurve")]

Note: this brings back this issue that was reported, PR'ed and merged at codeplex, but apparently lost in the migration :(. See http://nuget.codeplex.com/workitem/4248

@kzu

This comment has been minimized.

Show comment
Hide comment
@kzu

kzu May 26, 2016

I'm in the process of migrating the original PR changes over. Will submit it soon.

kzu commented May 26, 2016

I'm in the process of migrating the original PR changes over. Will submit it soon.

@kzu

This comment has been minimized.

Show comment
Hide comment
@kzu

kzu May 26, 2016

@emgarten I see you merged it back in Codeplex, so I'll nag you for this merge ;)

kzu commented May 26, 2016

@emgarten I see you merged it back in Codeplex, so I'll nag you for this merge ;)

@rrelyea rrelyea added this to the 3.5 RC milestone May 31, 2016

@rrelyea rrelyea added the Area: Pack label May 31, 2016

@rrelyea rrelyea assigned toddm and unassigned emgarten May 31, 2016

toddm added a commit to NuGet/NuGet.Client that referenced this issue Jun 21, 2016

Add support for specifying additional metadata via AssemblyMetadataAt…
…tribute (#622)

Currently the only way to augment the $replacement$ tokens is by passing
additional values from the command line.

Just like for other assembly-level attributes, it's very convenient to be
able to specify these additional key-value pairs using the AssemblyMetadataAttribute.
The command line arguments should always take precedence to those assembly
attributes, so that behavior was added too. Also, the package Id seemed an
important property to be able to override also both as an AssemblyMetadataAttribute
and a cmd line paramenter, so that was added too. Maybe it should be done for
all manifest properties?

Fixes NuGet/Home#2851
@kzu

This comment has been minimized.

Show comment
Hide comment
@kzu

kzu Jun 21, 2016

Do the issues get assigned a milestone so we can track when it ships? (I'm eager to drop my custom build ;))

kzu commented Jun 21, 2016

Do the issues get assigned a milestone so we can track when it ships? (I'm eager to drop my custom build ;))

@rrelyea rrelyea modified the milestones: 3.5 RTM, 3.6 Beta Jun 21, 2016

@rrelyea

This comment has been minimized.

Show comment
Hide comment
@rrelyea

rrelyea Jun 21, 2016

Contributor

Yes, if this just got merged today, should make 3.5 rtm, per current plans.

Contributor

rrelyea commented Jun 21, 2016

Yes, if this just got merged today, should make 3.5 rtm, per current plans.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment