-
-
Notifications
You must be signed in to change notification settings - Fork 71
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
7 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
{"name":"GitInfo","tagline":"Git and SemVer Info from MSBuild, C# and VB","body":"# GitInfo\r\n> A fresh and transparent approach to Git information retrieval from MSBuild without using any custom tasks or compiled code and tools, obscure settings, format strings, etc. \r\n\r\n## Goals\r\n\r\n- No compiled code or tools -> 100% transparency\r\n- Trivially added/installed via [a NuGet package](https://www.nuget.org/packages/GitInfo)\r\n- No format strings or settings to learn\r\n- Single well-structured [.targets file](https://github.com/kzu/GitInfo/blob/master/src/build/GitInfo.targets) with plain MSBuild\r\n- [Optional embedding](https://github.com/kzu/GitInfo/blob/master/src/build/GitInfo.targets#L53) of Git info in assembly [as metadata](https://github.com/kzu/GitInfo/blob/master/src/build/GitInfo.cs#L3)\r\n- Optional use of Git info to build arbitrary assembly/file version information, both [in C#](https://github.com/kzu/GitInfoDemo/blob/master/GitInfoDemo/Properties/AssemblyInfo.cs#L10) as well [as VB](https://github.com/kzu/GitInfoDemo/blob/master/GitInfoDemoVB/My%20Project/AssemblyInfo.vb#L8).\r\n- Trivially modified/improved generated code by just adjusting a [C#/VB template file](https://github.com/kzu/GitInfo/blob/master/src/build/GitInfo.cs) included in the [NuGet package](https://www.nuget.org/packages/GitInfo)\r\n- Easily modified/improved by just adjusting a [single .targets file](https://github.com/kzu/GitInfo/blob/master/src/build/GitInfo.targets) \r\n- 100% incremental build-friendly and high-performing (all proper Inputs/Outputs in place, smart caching of Git info, etc.)\r\n\r\n## Overview\r\n\r\nAfter installing via [NuGet](https://www.nuget.org/packages/GitInfo):\r\n\r\n\tPM> Install-Package GitInfo\r\n\r\nBy default, if the containing project is a C# or VB project, a compile-time generated source file will contain all the git information as metadata that can be accessed from anywhere within the assembly, as constants in a `ThisAssembly` (partial) class and its nested `Git` static class:\r\n\r\n\tConsole.WriteLine(ThisAssembly.Git.Commit);\r\n\r\nAll generated constants also have a Summary documentation tag that shows the current value in the intellisense tooltip, making it easier to see what the different values contain:\r\n\r\n![](https://raw.github.com/kzu/GitInfo/master/img/tooltip.png)\r\n\r\nWith this information at your fingertips, you can build any versioning attributes you want, with whatever information you want, without resorting to settings, format strings or anything, just plain code:\r\n\r\nC#:\r\n```\r\n[assembly: AssemblyVersion (ThisAssembly.Git.BaseVersion.Major + \".\" + ThisAssembly.Git.BaseVersion.Minor + \".\" + ThisAssembly.Git.BaseVersion.Patch)]\r\n\r\n[assembly: AssemblyFileVersion (ThisAssembly.Git.SemVer.Major + \".\" + ThisAssembly.Git.SemVer.Minor + \".\" + ThisAssembly.Git.SemVer.Patch)]\r\n\r\n[assembly: AssemblyInformationalVersion (\r\n\tThisAssembly.Git.SemVer.Major + \".\" + \r\n\tThisAssembly.Git.SemVer.Minor + \".\" + \r\n\tThisAssembly.Git.Commits + \"-\" + \r\n\tThisAssembly.Git.Branch + \"+\" + \r\n\tThisAssembly.Git.Commit)]\r\n```\r\n\r\nVB:\r\n```\r\n<Assembly: AssemblyVersion(ThisAssembly.Git.BaseVersion.Major + \".\" + ThisAssembly.Git.BaseVersion.Minor + \".\" + ThisAssembly.Git.BaseVersion.Patch)>\r\n<Assembly: AssemblyFileVersion(ThisAssembly.Git.SemVer.Major + \".\" + ThisAssembly.Git.SemVer.Minor + \".\" + ThisAssembly.Git.SemVer.Patch)>\r\n<Assembly: AssemblyInformationalVersion(\r\n ThisAssembly.Git.SemVer.Major + \".\" +\r\n ThisAssembly.Git.SemVer.Minor + \".\" +\r\n ThisAssembly.Git.Commits + \"-\" +\r\n ThisAssembly.Git.Branch + \"+\" +\r\n ThisAssembly.Git.Commit)>\r\n```\r\n\r\n","google":"","note":"Don't delete this file! It's used internally to help with page regeneration."} | ||
{"name":"GitInfo","tagline":"Git and SemVer Info from MSBuild, C# and VB","body":"# GitInfo\r\n> A fresh and transparent approach to Git information retrieval from MSBuild without using any custom tasks or compiled code and tools, obscure settings, format strings, etc. \r\n\r\n## Goals\r\n\r\n- No compiled code or tools -> 100% transparency\r\n- Trivially added/installed via [a NuGet package](https://www.nuget.org/packages/GitInfo)\r\n- No format strings or settings to learn\r\n- Single well-structured [.targets file](https://github.com/kzu/GitInfo/blob/master/src/build/GitInfo.targets) with plain MSBuild\r\n- [Optional embedding](https://github.com/kzu/GitInfo/blob/master/src/build/GitInfo.targets#L53) of Git info in assembly [as metadata](https://github.com/kzu/GitInfo/blob/master/src/build/GitInfo.cs#L3)\r\n- Optional use of Git info to build arbitrary assembly/file version information, both [in C#](https://github.com/kzu/GitInfoDemo/blob/master/GitInfoDemo/Properties/AssemblyInfo.cs#L10) as well [as VB](https://github.com/kzu/GitInfoDemo/blob/master/GitInfoDemoVB/My%20Project/AssemblyInfo.vb#L8).\r\n- Trivially modified/improved generated code by just adjusting a [C#/VB template file](https://github.com/kzu/GitInfo/blob/master/src/build/GitInfo.cs) included in the [NuGet package](https://www.nuget.org/packages/GitInfo)\r\n- Easily modified/improved by just adjusting a [single .targets file](https://github.com/kzu/GitInfo/blob/master/src/build/GitInfo.targets) \r\n- 100% incremental build-friendly and high-performing (all proper Inputs/Outputs in place, smart caching of Git info, etc.)\r\n\r\n## Overview\r\n\r\nAfter installing via [NuGet](https://www.nuget.org/packages/GitInfo):\r\n\r\n\tPM> Install-Package GitInfo\r\n\r\nBy default, if the containing project is a C# or VB project, a compile-time generated source file will contain all the git information as metadata that can be accessed from anywhere within the assembly, as constants in a `ThisAssembly` (partial) class and its nested `Git` static class:\r\n\r\n\tConsole.WriteLine(ThisAssembly.Git.Commit);\r\n\r\nAll generated constants also have a Summary documentation tag that shows the current value in the intellisense tooltip, making it easier to see what the different values contain:\r\n\r\n![](https://raw.github.com/kzu/GitInfo/master/img/tooltip.png)\r\n\r\n> NOTE: you may need to close and reopen the solution in order \r\n> for Visual Studio to refresh intellisense and show the \r\n> ThisAssembly type.\r\n\r\nWith this information at your fingertips, you can build any versioning attributes you want, with whatever information you want, without resorting to settings, format strings or anything, just plain code:\r\n\r\nC#:\r\n```\r\n[assembly: AssemblyVersion (ThisAssembly.Git.BaseVersion.Major + \".\" + ThisAssembly.Git.BaseVersion.Minor + \".\" + ThisAssembly.Git.BaseVersion.Patch)]\r\n\r\n[assembly: AssemblyFileVersion (ThisAssembly.Git.SemVer.Major + \".\" + ThisAssembly.Git.SemVer.Minor + \".\" + ThisAssembly.Git.SemVer.Patch)]\r\n\r\n[assembly: AssemblyInformationalVersion (\r\n\tThisAssembly.Git.SemVer.Major + \".\" + \r\n\tThisAssembly.Git.SemVer.Minor + \".\" + \r\n\tThisAssembly.Git.Commits + \"-\" + \r\n\tThisAssembly.Git.Branch + \"+\" + \r\n\tThisAssembly.Git.Commit)]\r\n```\r\n\r\nVB:\r\n```\r\n<Assembly: AssemblyVersion(ThisAssembly.Git.BaseVersion.Major + \".\" + ThisAssembly.Git.BaseVersion.Minor + \".\" + ThisAssembly.Git.BaseVersion.Patch)>\r\n<Assembly: AssemblyFileVersion(ThisAssembly.Git.SemVer.Major + \".\" + ThisAssembly.Git.SemVer.Minor + \".\" + ThisAssembly.Git.SemVer.Patch)>\r\n<Assembly: AssemblyInformationalVersion(\r\n ThisAssembly.Git.SemVer.Major + \".\" +\r\n ThisAssembly.Git.SemVer.Minor + \".\" +\r\n ThisAssembly.Git.Commits + \"-\" +\r\n ThisAssembly.Git.Branch + \"+\" +\r\n ThisAssembly.Git.Commit)>\r\n```","google":"","note":"Don't delete this file! It's used internally to help with page regeneration."} |