-
-
Notifications
You must be signed in to change notification settings - Fork 172
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #171 from clcrutch/feature/cake.addin
Cake Addin for getting Nerdbank.GitVersioning VersionOracle.
- Loading branch information
Showing
9 changed files
with
125 additions
and
2 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[submodule "wiki"] | ||
path = wiki | ||
url = https://github.com/AArnott/Nerdbank.GitVersioning.wiki.git |
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 |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# Cake Build | ||
Add `#addin Cake.GitVersioning` to the top of your Cake Build script. See [here](Cake/GitVersioning/GitVersioningAliases.md) for usage. See [here](Nerdbank/GitVersioning/VersionOracle.md) for the VersionOracle usage. | ||
|
||
## Example | ||
~~~~csharp | ||
Task("GetVersion") | ||
.Does(() => | ||
{ | ||
Information(GetVersioningGetVersion().SemVer2) | ||
}); | ||
~~~~ |
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 |
---|---|---|
@@ -0,0 +1,59 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<TargetFramework>net461</TargetFramework> | ||
<GeneratePackageOnBuild>true</GeneratePackageOnBuild> | ||
<Authors>Chris Crutchfield, Andrew Arnott</Authors> | ||
<Company>andarno</Company> | ||
<Description>Cake wrapper for Nerdbank.GitVersioning. Stamps your assemblies with semver 2.0 compliant git commit specific version information and provides NuGet versioning information as well.</Description> | ||
<Copyright>Copyright © Andrew Arnott</Copyright> | ||
<PackageTags>git commit versioning version assemblyinfo</PackageTags> | ||
<PackageProjectUrl>http://github.com/aarnott/Nerdbank.GitVersioning</PackageProjectUrl> | ||
<SignAssembly>false</SignAssembly> | ||
<!-- We include the whole OutputPath in this tools package. --> | ||
<IncludeBuildOutput>false</IncludeBuildOutput> | ||
<TargetsForTfmSpecificContentInPackage>$(TargetsForTfmSpecificContentInPackage);PackBuildOutputs</TargetsForTfmSpecificContentInPackage> | ||
</PropertyGroup> | ||
|
||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'"> | ||
<DocumentationFile>C:\git\Nerdbank.GitVersioning\src\..\bin\Cake.GitVersioning\Debug\net461\Cake.GitVersioning.xml</DocumentationFile> | ||
</PropertyGroup> | ||
|
||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'"> | ||
<DocumentationFile>C:\git\Nerdbank.GitVersioning\src\..\bin\Cake.GitVersioning\Release\net461\Cake.GitVersioning.xml</DocumentationFile> | ||
</PropertyGroup> | ||
|
||
<!-- This is a tools package and should express no dependencies. --> | ||
<ItemDefinitionGroup> | ||
<ProjectReference> | ||
<PrivateAssets>all</PrivateAssets> | ||
</ProjectReference> | ||
<PackageReference> | ||
<PrivateAssets>all</PrivateAssets> | ||
</PackageReference> | ||
</ItemDefinitionGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="Cake.Core" Version="0.26.0" /> | ||
<PackageReference Include="DotNetMDDocs" Version="0.111.0" Condition=" '$(GenerateMarkdownApiDocs)' == 'true' " /> | ||
<PackageReference Include="Nerdbank.GitVersioning.LKG" Version="1.6.20-beta-gfea83a8c9e" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<ProjectReference Include="..\NerdBank.GitVersioning\NerdBank.GitVersioning.csproj" /> | ||
</ItemGroup> | ||
|
||
<Target Name="PackBuildOutputs" DependsOnTargets="SatelliteDllsProjectOutputGroup;DebugSymbolsProjectOutputGroup"> | ||
<ItemGroup> | ||
<TfmSpecificPackageFile Include="$(OutputPath)\**\*" Exclude="$(OutputPath)\**\*.xml;$(OutputPath)\**\*.pdb;$(OutputPath)\**\Cake.Core.dll"> | ||
<PackagePath>lib\$(TargetFramework)\</PackagePath> | ||
</TfmSpecificPackageFile> | ||
</ItemGroup> | ||
</Target> | ||
|
||
<Target Name="SetNuSpecProperties" BeforeTargets="GenerateNuspec" DependsOnTargets="GetBuildVersion"> | ||
<PropertyGroup> | ||
<PackageLicenseUrl>https://raw.githubusercontent.com/AArnott/Nerdbank.GitVersioning/$(GitCommitIdShort)/LICENSE.txt</PackageLicenseUrl> | ||
</PropertyGroup> | ||
</Target> | ||
</Project> |
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 |
---|---|---|
@@ -0,0 +1,38 @@ | ||
using System.IO; | ||
using System.Reflection; | ||
using Cake.Core; | ||
using Cake.Core.Annotations; | ||
using Nerdbank.GitVersioning; | ||
|
||
namespace Cake.GitVersioning | ||
{ | ||
/// <summary> | ||
/// Contains functionality for using Nerdbank.GitVersioning. | ||
/// </summary> | ||
[CakeAliasCategory("Git Versioning")] | ||
public static class GitVersioningAliases | ||
{ | ||
/// <summary> | ||
/// Gets the Git Versioning version from the current repo. | ||
/// </summary> | ||
/// <example> | ||
/// Task("GetVersion") | ||
/// .Does(() => | ||
/// { | ||
/// Information(GetVersioningGetVersion().SemVer2) | ||
/// }); | ||
/// </example> | ||
/// <param name="context">The context.</param> | ||
/// <param name="projectDirectory">Directory to start the search for version.json.</param> | ||
/// <returns>The version information from Git Versioning.</returns> | ||
[CakeMethodAlias] | ||
public static VersionOracle GitVersioningGetVersion(this ICakeContext context, string projectDirectory = ".") | ||
{ | ||
var fullProjectDirectory = (new DirectoryInfo(projectDirectory)).FullName; | ||
|
||
GitExtensions.HelpFindLibGit2NativeBinaries(Path.GetDirectoryName(Assembly.GetAssembly(typeof(GitVersioningAliases)).Location)); | ||
|
||
return VersionOracle.Create(fullProjectDirectory, null, CloudBuild.Active); | ||
} | ||
} | ||
} |
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
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