Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions init.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ try {
& "$toolsPath\Restore-NuGetPackages.ps1" -Path $_ -Verbosity Quiet
}

& dotnet restore "$PSScriptRoot\src\Cake.GitVersioning\Cake.GitVersioning.csproj"

# Restore VS2017 style to get the rest of the projects.
msbuild "$PSScriptRoot\src\NerdBank.GitVersioning.Tests\NerdBank.GitVersioning.Tests.csproj" /t:restore /v:minimal /m /nologo

Expand Down
52 changes: 52 additions & 0 deletions src/Cake.GitVersioning/Cake.GitVersioning.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
<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>
<PackageLicenseUrl>https://raw.githubusercontent.com/AArnott/Nerdbank.GitVersioning/39ac76891c/LICENSE.txt</PackageLicenseUrl>
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
<PackageProjectUrl>http://github.com/aarnott/Nerdbank.GitVersioning</PackageProjectUrl>
<SignAssembly>false</SignAssembly>
Copy link
Collaborator

@AArnott AArnott Jun 2, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did signing mess anything up? Otherwise, I'd prefer we sign it. #Closed

Copy link
Collaborator

@AArnott AArnott Jun 2, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see... Cake.Core itself isn't strong name signed. #Closed

Copy link
Contributor Author

@clcrutch clcrutch Jun 2, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I initially attempted to sign the assembly, but also discovered that Cake.Core was not signed. I would be willing to submit an issue to the Cake team to see if they'd be willing to strong name sign Cake.Core. I am unsure if that would affect anything down stream of them though. #Closed

Copy link
Collaborator

@AArnott AArnott Jun 2, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It probably would impact their existing users. And my guess for a package that popular is that if they're not signed, they probably are opposed to the idea. It's OK. We can fall in line for the cake plugin. #Closed

</PropertyGroup>

<ItemGroup>
<PackageReference Include="Cake.Core" Version="0.26.0" />
<PackageReference Include="Nerdbank.GitVersioning.LKG" Version="1.6.20-beta-gfea83a8c9e" />
Copy link
Collaborator

@AArnott AArnott Jun 2, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've modified both of these to suppress the dependency #Closed

</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\NerdBank.GitVersioning\NerdBank.GitVersioning.csproj" PrivateAssets="true" />
</ItemGroup>

<ItemGroup>
<Content Include="$(OutputPath)\NerdBank.GitVersioning.dll">
<PackagePath>lib\$(TargetFramework)\</PackagePath>
<Pack>true</Pack>
</Content>

<Content Include="$(OutputPath)\LibGit2Sharp.dll">
<PackagePath>lib\$(TargetFramework)</PackagePath>
<Pack>true</Pack>
</Content>
<Content Include="$(OutputPath)\lib\**\*">
<PackagePath>lib\$(TargetFramework)\lib</PackagePath>
<Pack>true</Pack>
</Content>

<Content Include="$(OutputPath)\Newtonsoft.Json.dll">
<PackagePath>lib\$(TargetFramework)</PackagePath>
<Pack>true</Pack>
</Content>

<Content Include="$(OutputPath)\Validation.dll">
<PackagePath>lib\$(TargetFramework)</PackagePath>
<Pack>true</Pack>
</Content>
</ItemGroup>

</Project>
38 changes: 38 additions & 0 deletions src/Cake.GitVersioning/GitVersioningAliases.cs
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);
}
}
}
19 changes: 18 additions & 1 deletion src/Nerdbank.GitVersioning.sln
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.26228.9
VisualStudioVersion = 15.0.27130.2010
MinimumVisualStudioVersion = 10.0.40219.1
Project("{5DD5E4FA-CB73-4610-85AB-557B54E96AA9}") = "Nerdbank.GitVersioning.NuGet", "Nerdbank.GitVersioning.NuGet\Nerdbank.GitVersioning.NuGet.nuproj", "{B7DE4122-9E90-43DE-BE44-454315CFAE99}"
EndProject
Expand All @@ -27,6 +27,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Nerdbank.GitVersioning.Task
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MSBuildExtensionTask", "MSBuildExtensionTask\MSBuildExtensionTask.csproj", "{568CD02D-49C4-49DB-A34D-2DE9D7A0FE85}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Cake.GitVersioning", "Cake.GitVersioning\Cake.GitVersioning.csproj", "{1F267A97-DFE3-4166-83B1-9D236B7A09BD}"
EndProject
Copy link
Collaborator

@AArnott AArnott Aug 20, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like you resolved a merge conflict by blowing away the competing addition. I need nbgv to stick around. :) #Closed

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I fixed this.


In reply to: 211299223 [](ancestors = 211299223)

Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -99,8 +101,23 @@ Global
{568CD02D-49C4-49DB-A34D-2DE9D7A0FE85}.Release|x64.Build.0 = Release|Any CPU
{568CD02D-49C4-49DB-A34D-2DE9D7A0FE85}.Release|x86.ActiveCfg = Release|Any CPU
{568CD02D-49C4-49DB-A34D-2DE9D7A0FE85}.Release|x86.Build.0 = Release|Any CPU
{1F267A97-DFE3-4166-83B1-9D236B7A09BD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{1F267A97-DFE3-4166-83B1-9D236B7A09BD}.Debug|Any CPU.Build.0 = Debug|Any CPU
{1F267A97-DFE3-4166-83B1-9D236B7A09BD}.Debug|x64.ActiveCfg = Debug|Any CPU
{1F267A97-DFE3-4166-83B1-9D236B7A09BD}.Debug|x64.Build.0 = Debug|Any CPU
{1F267A97-DFE3-4166-83B1-9D236B7A09BD}.Debug|x86.ActiveCfg = Debug|Any CPU
{1F267A97-DFE3-4166-83B1-9D236B7A09BD}.Debug|x86.Build.0 = Debug|Any CPU
{1F267A97-DFE3-4166-83B1-9D236B7A09BD}.Release|Any CPU.ActiveCfg = Release|Any CPU
{1F267A97-DFE3-4166-83B1-9D236B7A09BD}.Release|Any CPU.Build.0 = Release|Any CPU
{1F267A97-DFE3-4166-83B1-9D236B7A09BD}.Release|x64.ActiveCfg = Release|Any CPU
{1F267A97-DFE3-4166-83B1-9D236B7A09BD}.Release|x64.Build.0 = Release|Any CPU
{1F267A97-DFE3-4166-83B1-9D236B7A09BD}.Release|x86.ActiveCfg = Release|Any CPU
{1F267A97-DFE3-4166-83B1-9D236B7A09BD}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {03CE16EE-A939-43FB-B846-92EB3A797ECF}
EndGlobalSection
EndGlobal