Esempio n. 1
0
    public string GetAssemblyInfoText(VersionVariables vars, string assemblyName)
    {
        var v = vars.ToList();

        var assemblyInfo = string.Format(
        @"using System;
        using System.Reflection;

        [assembly: AssemblyVersion(""{0}"")]
        [assembly: AssemblyFileVersion(""{1}"")]
        [assembly: AssemblyInformationalVersion(""{2}"")]
        [assembly: {6}.ReleaseDate(""{3}"")]
        [assembly: {6}.GitVersionInformation()]

        namespace {6}
        {{
        [System.Runtime.CompilerServices.CompilerGenerated]
        [AttributeUsage(AttributeTargets.Assembly)]
        sealed class ReleaseDateAttribute : System.Attribute
        {{
        public string Date {{ get; private set; }}

        public ReleaseDateAttribute(string date)
        {{
            Date = date;
        }}
        }}

        [System.Runtime.CompilerServices.CompilerGenerated]
        static class GitVersionInformation
        {{
        {4}
        }}

        [System.Runtime.CompilerServices.CompilerGenerated]
        [AttributeUsage(AttributeTargets.Assembly)]
        sealed class GitVersionInformationAttribute : System.Attribute
        {{
        {5}
        }}
        }}
        ",
        vars.AssemblySemVer,
        vars.MajorMinorPatch + ".0",
        vars.InformationalVersion,
        vars.CommitDate,
        GenerateStaticVariableMembers(v),
        GenerateAttributeVariableMembers(v),
        assemblyName);

        return assemblyInfo;
    }
    public override string GetAssemblyInfoText(VersionVariables vars, string rootNamespace)
    {
        var v = vars.ToList();

        // TODO: Consolidate this with GitVersion.VersionAssemblyInfoResources.AssemblyVersionInfoTemplates. @asbjornu
        var assemblyInfo = string.Format(
        @"//------------------------------------------------------------------------------
        // <auto-generated>
        //     This code was generated by a tool.
        //     GitVersion
        //
        //     Changes to this file may cause incorrect behavior and will be lost if
        //     the code is regenerated.
        // </auto-generated>
        //------------------------------------------------------------------------------

        using System;
        using System.Reflection;

        [assembly: AssemblyVersion(""{0}"")]
        [assembly: AssemblyFileVersion(""{1}"")]
        [assembly: AssemblyInformationalVersion(""{2}"")]

        namespace {4}
        {{

        [global::System.Runtime.CompilerServices.CompilerGenerated]
        static class GitVersionInformation
        {{
        {3}
        }}

        }}
        ",
        vars.AssemblySemVer,
        vars.MajorMinorPatch + ".0",
        vars.InformationalVersion,
        GenerateStaticVariableMembers(v),
        rootNamespace);

        return assemblyInfo;
    }
Esempio n. 3
0
    public override string GetAssemblyInfoText(VersionVariables vars, string rootNamespace)
    {
        var v = vars.ToList();

        // TODO: Consolidate this with GitVersion.VersionAssemblyInfoResources.AssemblyVersionInfoTemplates. @asbjornu
        var assemblyInfo = string.Format(
            @"//------------------------------------------------------------------------------
// <auto-generated>
//     This code was generated by a tool.
//     GitVersion
//
//     Changes to this file may cause incorrect behavior and will be lost if
//     the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------

using System;
using System.Reflection;

[assembly: AssemblyVersion(""{0}"")]
[assembly: AssemblyFileVersion(""{1}"")]
[assembly: AssemblyInformationalVersion(""{2}"")]

namespace {4}
{{

    [global::System.Runtime.CompilerServices.CompilerGenerated]
    static class GitVersionInformation
    {{
{3}
    }}

}}
",
            vars.AssemblySemVer,
            vars.AssemblySemFileVer,
            vars.InformationalVersion,
            GenerateStaticVariableMembers(v),
            rootNamespace);

        return(assemblyInfo);
    }
    public string GetAssemblyInfoText(VersionVariables vars, string rootNamespace)
    {
        var v = vars.ToList();

        var assemblyInfo = string.Format(
            @"//------------------------------------------------------------------------------
// <auto-generated>
//     This code was generated by a tool.
//     GitVersion
//
//     Changes to this file may cause incorrect behavior and will be lost if
//     the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------

using System;
using System.Reflection;

[assembly: AssemblyVersion(""{0}"")]
[assembly: AssemblyFileVersion(""{1}"")]
[assembly: AssemblyInformationalVersion(""{2}"")]

namespace {4}
{{

    [System.Runtime.CompilerServices.CompilerGenerated]
    static class GitVersionInformation
    {{
{3}
    }}

}}
",
            vars.AssemblySemVer,
            vars.MajorMinorPatch + ".0",
            vars.InformationalVersion,
            GenerateStaticVariableMembers(v),
            rootNamespace);

        return(assemblyInfo);
    }
Esempio n. 5
0
    public override string GetAssemblyInfoText(VersionVariables vars, string rootNamespace)
    {
        var v = vars.ToList();

        // TODO: Consolidate this with GitVersion.VersionAssemblyInfoResources.AssemblyVersionInfoTemplates. @asbjornu
        var assemblyInfo = string.Format(
            @"//------------------------------------------------------------------------------
// <auto-generated>
//     This code was generated by a tool.
//     GitVersion
//
//     Changes to this file may cause incorrect behavior and will be lost if
//     the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------

namespace {4}

open System
open System.Reflection

[<assembly: AssemblyVersion(""{0}"")>]
[<assembly: AssemblyFileVersion(""{1}"")>]
[<assembly: AssemblyInformationalVersion(""{2}"")>]

do
    ()

[<AbstractClass; Sealed>]
[<global.System.Runtime.CompilerServices.CompilerGenerated>]
module GitVersionInformation =
{3}
",
            vars.AssemblySemVer,
            vars.MajorMinorPatch + ".0",
            vars.InformationalVersion,
            GenerateStaticVariableMembers(v),
            rootNamespace);

        return(assemblyInfo);
    }
    public override string GetAssemblyInfoText(VersionVariables vars, string rootNamespace)
    {
        var v = vars.ToList();

        // TODO: Consolidate this with GitVersion.VersionAssemblyInfoResources.AssemblyVersionInfoTemplates. @asbjornu
        var assemblyInfo = string.Format(
        @"'------------------------------------------------------------------------------
        ' <auto-generated>
        '     This code was generated by a tool.
        '     GitVersion
        '
        '     Changes to this file may cause incorrect behavior and will be lost if
        '     the code is regenerated.
        ' </auto-generated>
        '------------------------------------------------------------------------------

        Imports System
        Imports System.Reflection

        <Assembly: AssemblyVersion(""{0}"")>
        <Assembly: AssemblyFileVersion(""{1}"")>
        <Assembly: AssemblyInformationalVersion(""{2}"")>

        <Global.System.Runtime.CompilerServices.CompilerGenerated()> _
        NotInheritable Class GitVersionInformation
        Private Sub New()
        End Sub
        {3}
        End Class
        ",
        vars.AssemblySemVer,
        vars.MajorMinorPatch + ".0",
        vars.InformationalVersion,
        GenerateStaticVariableMembers(v));

        return assemblyInfo;
    }
    public override string GetAssemblyInfoText(VersionVariables vars, string rootNamespace)
    {
        var v = vars.ToList();

        // TODO: Consolidate this with GitVersion.VersionAssemblyInfoResources.AssemblyVersionInfoTemplates. @asbjornu
        var assemblyInfo = string.Format(
            @"'------------------------------------------------------------------------------
' <auto-generated>
'     This code was generated by a tool.
'     GitVersion
'
'     Changes to this file may cause incorrect behavior and will be lost if
'     the code is regenerated.
' </auto-generated>
'------------------------------------------------------------------------------

Imports System
Imports System.Reflection

<Assembly: AssemblyVersion(""{0}"")>
<Assembly: AssemblyFileVersion(""{1}"")>
<Assembly: AssemblyInformationalVersion(""{2}"")>

<Global.System.Runtime.CompilerServices.CompilerGenerated()> _
NotInheritable Class GitVersionInformation
    Private Sub New()
    End Sub
{3}
End Class
",
            vars.AssemblySemVer,
            vars.MajorMinorPatch + ".0",
            vars.InformationalVersion,
            GenerateStaticVariableMembers(v));

        return(assemblyInfo);
    }
    public string GetAssemblyInfoText(VersionVariables vars, string rootNamespace, ProjectType projectType)
    {
        string assemblyInfoFormat;
        if (projectType == ProjectType.CSharp)
        {
            assemblyInfoFormat = csharpAssemblyInfoFormat;
        }
        else if (projectType == ProjectType.FSharp)
        {
            assemblyInfoFormat = fsharpAssemblyInfoFormat;
        }
        else
        {
            throw new ArgumentException("ProjectType");
        }

        var v = vars.ToList();

        var assemblyInfo = string.Format(
        assemblyInfoFormat,
        vars.AssemblySemVer,
        vars.MajorMinorPatch + ".0",
        vars.InformationalVersion,
        GenerateStaticVariableMembers(v, projectType),
        rootNamespace);

        return assemblyInfo;
    }