diff --git a/index.html b/index.html index d561f41..e9e009d 100644 --- a/index.html +++ b/index.html @@ -62,6 +62,12 @@
++NOTE: you may need to close and reopen the solution in order +for Visual Studio to refresh intellisense and show the +ThisAssembly type.
+
With 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:
C#:
diff --git a/params.json b/params.json index 021700f..30b84c0 100644 --- a/params.json +++ b/params.json @@ -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