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

Add all assembly metadata to AssemblyVersionInformation type #1392

Merged
merged 4 commits into from Oct 6, 2016
Merged

Add all assembly metadata to AssemblyVersionInformation type #1392

merged 4 commits into from Oct 6, 2016

Conversation

allykzam
Copy link
Contributor

@allykzam allykzam commented Oct 3, 2016

PR for #822 as requested by @dsyme

Replaces the Version and InformationalVersion values being generated with the AssemblyVersionInformation type with a value for every assembly attribute.

As the new values are named after their attribute type names, this is a breaking change for anyone expecting Version instead of AssemblyVersion and InformationalVersion instead of AssemblyInformationalVersion.

Likewise, the newly-named AssemblyVersion and AssemblyInformationalVersion values are no longer generated by default, and must be included in the collection of provided attributes.

Property names in the generated AssemblyVersionInformation types have
changed, and Version/InformationalVersion are no longer auto-populated.
Type names for these properties are also fully-qualified now.
Includes applicable changes for F#, C#, and VB AssemblyInfo files.
@forki
Copy link
Member

forki commented Oct 6, 2016

thx

@forki forki merged commit d5439ce into fsprojects:master Oct 6, 2016
@Ravadre
Copy link
Contributor

Ravadre commented Oct 10, 2016

Hi,

@amazingant - this PR seems to have broken generating AssemblyInfoVersion when Metadata attribute is used.

Before this PR generated code looked like this:

// <auto-generated/>
using System.Reflection;

[assembly: AssemblyMetadataAttribute("githash","cc5fd8")]
namespace System {
    internal static class AssemblyVersionInformation {
        internal const string Version = "LocalBuild";
        internal const string InformationalVersion = "LocalBuild";
    }
}

After the PR:

// <auto-generated/>
using System.Reflection;

[assembly: AssemblyMetadataAttribute("githash","cc5fd8")]
namespace System {
    internal static class AssemblyVersionInformation {
        internal const System.String AssemblyMetadata_githash = "githash","cc5fd8";
    }
}

Note, that string const has a value of "key","value" which is not valid code. Reason why this is the case seems to lie in L183:
fun x -> sprintf " internal const %s %s = %s;" x.StaticPropertyType x.StaticPropertyName x.StaticPropertyValue

x.StaticPropertyValue seems to have value that goes into attribute data, when using most attributes where value is a single string, this is OK, because the property will have value like "0.2", for Metadata though - it will contain 2 string values separated by comma.

@allykzam allykzam deleted the add-meta-to-AssemblyVersionInformation branch October 10, 2016 15:10
@allykzam
Copy link
Contributor Author

@Ravadre Sorry, forgot to supply a different StaticPropertyValue for metadata attributes. Fixed with #1399

@Ravadre
Copy link
Contributor

Ravadre commented Oct 10, 2016

@amazingant Hi, that's great, thanks a lot!

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.

None yet

3 participants