Skip to content

Commit a4abfe3

Browse files
committed
make versioning scheme configurable
-moved the scheme logic into the task since it isnt a core concern (perhaps the exe should make use of this in the future)
1 parent 1764ad1 commit a4abfe3

39 files changed

+325
-424
lines changed

AcceptanceTests/AcceptanceTests.csproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
1313
<FileAlignment>512</FileAlignment>
1414
<TargetFrameworkProfile />
15-
<NuGetPackageImportStamp>96cab2e5</NuGetPackageImportStamp>
15+
<NuGetPackageImportStamp>c2203629</NuGetPackageImportStamp>
1616
</PropertyGroup>
1717
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
1818
<DebugSymbols>true</DebugSymbols>
@@ -118,11 +118,11 @@ xcopy /s /y /d "$(SolutionDir)packages\LibGit2Sharp.0.19.0.0\lib\net40\NativeBin
118118
if not exist "$(TargetDir)NativeBinaries\amd64" md "$(TargetDir)NativeBinaries\amd64"
119119
xcopy /s /y /d "$(SolutionDir)packages\LibGit2Sharp.0.19.0.0\lib\net40\NativeBinaries\amd64\*.*" "$(TargetDir)NativeBinaries\amd64"</PostBuildEvent>
120120
</PropertyGroup>
121-
<Import Project="..\packages\Fody.1.24.0\build\Fody.targets" Condition="Exists('..\packages\Fody.1.24.0\build\Fody.targets')" />
121+
<Import Project="..\packages\Fody.1.25.0\build\Fody.targets" Condition="Exists('..\packages\Fody.1.25.0\build\Fody.targets')" />
122122
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
123123
<PropertyGroup>
124124
<ErrorText>This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
125125
</PropertyGroup>
126-
<Error Condition="!Exists('..\packages\Fody.1.24.0\build\Fody.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Fody.1.24.0\build\Fody.targets'))" />
126+
<Error Condition="!Exists('..\packages\Fody.1.25.0\build\Fody.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Fody.1.25.0\build\Fody.targets'))" />
127127
</Target>
128128
</Project>

AcceptanceTests/packages.config

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<packages>
33
<package id="ApprovalTests" version="3.0.7" targetFramework="net45" />
44
<package id="ApprovalUtilities" version="3.0.7" targetFramework="net45" />
5-
<package id="Fody" version="1.24.0" targetFramework="net40" developmentDependency="true" />
5+
<package id="Fody" version="1.25.0" targetFramework="net45" developmentDependency="true" />
66
<package id="LibGit2Sharp" version="0.19.0.0" targetFramework="net45" />
77
<package id="Shouldly" version="2.2.0" targetFramework="net45" />
88
<package id="xunit" version="1.9.2" targetFramework="net35" />

GitVersionCore/AssemblyMetaData.cs

Lines changed: 0 additions & 14 deletions
This file was deleted.

GitVersionCore/AssemblyVersioningScheme.cs

Lines changed: 0 additions & 10 deletions
This file was deleted.

GitVersionCore/AssemblyVersionsGenerator.cs

Lines changed: 0 additions & 53 deletions
This file was deleted.

GitVersionCore/GitVersionCore.csproj

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
<AssemblyName>GitVersionCore</AssemblyName>
1212
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
1313
<FileAlignment>512</FileAlignment>
14-
<NuGetPackageImportStamp>cdee7e67</NuGetPackageImportStamp>
14+
<NuGetPackageImportStamp>1359e437</NuGetPackageImportStamp>
1515
</PropertyGroup>
1616
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
1717
<DebugSymbols>true</DebugSymbols>
@@ -49,14 +49,12 @@
4949
<Reference Include="Microsoft.CSharp" />
5050
<Reference Include="System.Data" />
5151
<Reference Include="System.Xml" />
52-
<Reference Include="Visualize">
53-
<HintPath>..\packages\Visualize.Fody.0.4.0.0\Lib\portable-net4+sl4+wp7+win8+MonoAndroid16+MonoTouch40\Visualize.dll</HintPath>
52+
<Reference Include="Visualize, Version=0.4.0.0, Culture=neutral, processorArchitecture=MSIL">
53+
<SpecificVersion>False</SpecificVersion>
54+
<HintPath>..\Packages\Visualize.Fody.0.4.0.0\Lib\portable-net4+sl4+wp7+win8+MonoAndroid16+MonoTouch40\Visualize.dll</HintPath>
5455
</Reference>
5556
</ItemGroup>
5657
<ItemGroup>
57-
<Compile Include="AssemblyMetaData.cs" />
58-
<Compile Include="AssemblyVersionsGenerator.cs" />
59-
<Compile Include="AssemblyVersioningScheme.cs" />
6058
<Compile Include="Authentication.cs" />
6159
<Compile Include="BuildServers\AppVeyor.cs" />
6260
<Compile Include="BuildServers\BuildServerBase.cs" />
@@ -131,8 +129,8 @@
131129
<PropertyGroup>
132130
<ErrorText>This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
133131
</PropertyGroup>
134-
<Error Condition="!Exists('..\packages\Fody.1.24.0\build\Fody.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Fody.1.24.0\build\Fody.targets'))" />
135132
<Error Condition="!Exists('..\packages\PepitaPackage.1.21.3\build\PepitaPackage.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\PepitaPackage.1.21.3\build\PepitaPackage.targets'))" />
133+
<Error Condition="!Exists('..\packages\Fody.1.25.0\build\Fody.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Fody.1.25.0\build\Fody.targets'))" />
136134
</Target>
137135
<PropertyGroup>
138136
<PostBuildEvent>
@@ -157,6 +155,6 @@ xcopy /s /y /d "$(SolutionDir)packages\LibGit2Sharp.0.19.0.0\lib\net40\NativeBin
157155
<Copy SourceFiles="$(ProjectDir)NugetAssets\GitVersion.nuspec" DestinationFolder="$(SolutionDir)NuGetRefBuild" />
158156
<PepitaPackage.CreatePackageTask NuGetBuildDirectory="$(SolutionDir)NuGetRefBuild" MetadataAssembly="$(OutputPath)GitVersionCore.dll" />
159157
</Target>
160-
<Import Project="..\packages\Fody.1.24.0\build\Fody.targets" Condition="Exists('..\packages\Fody.1.24.0\build\Fody.targets')" />
161158
<Import Project="..\packages\PepitaPackage.1.21.3\build\PepitaPackage.targets" Condition="Exists('..\packages\PepitaPackage.1.21.3\build\PepitaPackage.targets')" />
159+
<Import Project="..\packages\Fody.1.25.0\build\Fody.targets" Condition="Exists('..\packages\Fody.1.25.0\build\Fody.targets')" />
162160
</Project>

GitVersionCore/OutputVariables/VariableProvider.cs

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,6 @@ public static class VariableProvider
2323
public const string PreReleaseTag = "PreReleaseTag";
2424
public const string PreReleaseTagWithDash = "PreReleaseTagWithDash";
2525
public const string InformationalVersion = "InformationalVersion";
26-
public const string AssemblyVersion = "AssemblyVersion";
27-
public const string AssemblyFileVersion = "AssemblyFileVersion";
2826
public const string OriginalRelease = "OriginalRelease";
2927

3028
// Synonyms
@@ -33,16 +31,11 @@ public static class VariableProvider
3331
public const string NuGetVersion = "NuGetVersion";
3432

3533
public static Dictionary<string, string> GetVariablesFor(
36-
SemanticVersion semanticVersion,
37-
AssemblyVersioningScheme assemblyVersioningScheme = AssemblyVersioningScheme.MajorMinorPatch,
38-
bool addNumberOfCommitsSinceTagOnMasterBranchToFileVersion = true)
34+
SemanticVersion semanticVersion)
3935
{
4036
var bmd = semanticVersion.BuildMetaData;
4137
var formatter = bmd.Branch == "develop" ? new CiFeedFormatter() : null;
42-
43-
var assemblyMetaData = AssemblyVersionsGenerator.Process(
44-
semanticVersion, assemblyVersioningScheme, addNumberOfCommitsSinceTagOnMasterBranchToFileVersion);
45-
38+
4639
var variables = new Dictionary<string, string>(StringComparer.InvariantCultureIgnoreCase)
4740
{
4841
{Major, semanticVersion.Major.ToString()},
@@ -65,8 +58,6 @@ public static Dictionary<string, string> GetVariablesFor(
6558
semanticVersion.PreReleaseTag.HasTag() ? "-" + semanticVersion.PreReleaseTag : null)},
6659
{BranchName, bmd.Branch},
6760
{Sha, bmd.Sha},
68-
{AssemblyVersion, assemblyMetaData.Version},
69-
{AssemblyFileVersion, assemblyMetaData.FileVersion},
7061
{OriginalRelease, string.Format("{0}.{1}",
7162
bmd.ReleaseDate.OriginalCommitSha,
7263
bmd.ReleaseDate.OriginalDate.UtcDateTime.ToString("u"))},

GitVersionCore/packages.config

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<packages>
33
<package id="Caseless.Fody" version="1.3.3.0" targetFramework="net40" developmentDependency="true" />
4-
<package id="Fody" version="1.24.0" targetFramework="net40" developmentDependency="true" />
4+
<package id="Fody" version="1.25.0" targetFramework="net40" developmentDependency="true" />
55
<package id="JetBrainsAnnotations.Fody" version="1.0.2" targetFramework="net40" developmentDependency="true" />
66
<package id="LibGit2Sharp" version="0.19.0.0" targetFramework="net40" />
77
<package id="PepitaPackage" version="1.21.3" targetFramework="net40" developmentDependency="true" />

GitVersionExe/GitVersionExe.csproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
<AssemblyName>GitVersion</AssemblyName>
1212
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
1313
<FileAlignment>512</FileAlignment>
14-
<NuGetPackageImportStamp>6d308bee</NuGetPackageImportStamp>
14+
<NuGetPackageImportStamp>5d287010</NuGetPackageImportStamp>
1515
</PropertyGroup>
1616
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
1717
<DebugSymbols>true</DebugSymbols>
@@ -157,8 +157,8 @@
157157
<PropertyGroup>
158158
<ErrorText>This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
159159
</PropertyGroup>
160-
<Error Condition="!Exists('..\packages\Fody.1.24.0\build\Fody.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Fody.1.24.0\build\Fody.targets'))" />
161160
<Error Condition="!Exists('..\packages\PepitaPackage.1.21.3\build\PepitaPackage.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\PepitaPackage.1.21.3\build\PepitaPackage.targets'))" />
161+
<Error Condition="!Exists('..\packages\Fody.1.25.0\build\Fody.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Fody.1.25.0\build\Fody.targets'))" />
162162
</Target>
163163
<UsingTask TaskName="CosturaCleanup" AssemblyFile="$(MSBuildToolsPath)\Microsoft.Build.Tasks.v4.0.dll" TaskFactory="CodeTaskFactory">
164164
<ParameterGroup>
@@ -204,6 +204,6 @@ xcopy /s /y /d "$(SolutionDir)packages\LibGit2Sharp.0.19.0.0\lib\net40\NativeBin
204204
if not exist "$(TargetDir)NativeBinaries\amd64" md "$(TargetDir)NativeBinaries\amd64"
205205
xcopy /s /y /d "$(SolutionDir)packages\LibGit2Sharp.0.19.0.0\lib\net40\NativeBinaries\amd64\*.*" "$(TargetDir)NativeBinaries\amd64"</PostBuildEvent>
206206
</PropertyGroup>
207-
<Import Project="..\packages\Fody.1.24.0\build\Fody.targets" Condition="Exists('..\packages\Fody.1.24.0\build\Fody.targets')" />
208207
<Import Project="..\packages\PepitaPackage.1.21.3\build\PepitaPackage.targets" Condition="Exists('..\packages\PepitaPackage.1.21.3\build\PepitaPackage.targets')" />
208+
<Import Project="..\packages\Fody.1.25.0\build\Fody.targets" Condition="Exists('..\packages\Fody.1.25.0\build\Fody.targets')" />
209209
</Project>

GitVersionExe/packages.config

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<packages>
33
<package id="Caseless.Fody" version="1.3.3.0" targetFramework="net40" developmentDependency="true" />
44
<package id="Costura.Fody" version="1.1.0.0" targetFramework="net40" developmentDependency="true" />
5-
<package id="Fody" version="1.24.0" targetFramework="net40" developmentDependency="true" />
5+
<package id="Fody" version="1.25.0" targetFramework="net40" developmentDependency="true" />
66
<package id="JetBrainsAnnotations.Fody" version="1.0.2" targetFramework="net40" developmentDependency="true" />
77
<package id="LibGit2Sharp" version="0.19.0.0" targetFramework="net40" />
88
<package id="PepitaPackage" version="1.21.3" targetFramework="net40" developmentDependency="true" />

0 commit comments

Comments
 (0)