Skip to content

Commit 4605cde

Browse files
authored
Merge branch 'master' into features/supportspaceintfstask
2 parents 51e4ec6 + 49b2f3a commit 4605cde

File tree

55 files changed

+330
-223
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+330
-223
lines changed

.vscode/launch.json

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"version": "0.2.0",
3+
"configurations": [
4+
{
5+
"name": ".NET Core Launch (console)",
6+
"type": "coreclr",
7+
"request": "launch",
8+
"program": "${workspaceRoot}/tools/Cake.CoreCLR/Cake.dll",
9+
"args": [
10+
"${workspaceRoot}/build.cake",
11+
"--debug",
12+
"--verbosity=diagnostic"
13+
],
14+
"cwd": "${workspaceRoot}",
15+
"stopAtEntry": true,
16+
"externalConsole": false
17+
}
18+
]
19+
}

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,13 @@ Versioning when using git, solved. GitVersion looks at your git history and work
1515
|NuGet (GitVersion.CommandLine)|[![NuGet](https://img.shields.io/nuget/v/GitVersion.CommandLine.svg)](https://www.nuget.org/packages/GitVersion.CommandLine)|[![NuGet](https://img.shields.io/nuget/vpre/GitVersion.CommandLine.svg)](https://www.nuget.org/packages/GitVersion.CommandLine)|
1616
|Gem|[![Gem](https://img.shields.io/gem/v/gitversion.svg)](https://rubygems.org/gems/gitversion)|[![Gem](https://img.shields.io/gem/v/gitversion.svg)](https://rubygems.org/gems/gitversion)|
1717

18+
## Compatibility
19+
GitVersion works on Mac, Linux with Mono and Windows.
20+
21+
Tip: If you get `System.TypeInitializationException: The type initializer for 'LibGit2Sharp.Core.NativeMethods' threw an exception. ---> System.DllNotFoundException: lib/linux/x86_64/libgit2-baa87df.so`
22+
23+
You likely need to install `libcurl3`. Run `sudo get-get install libcurl3`
24+
1825
## Quick Links
1926
- [Documentation](http://gitversion.readthedocs.org/en/latest)
2027
- [Contributing](https://github.com/GitTools/GitVersion/blob/master/CONTRIBUTING.md)

build.cake

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ bool IsTagged = (BuildSystem.AppVeyor.Environment.Repository.Tag.IsTag &&
1414
!string.IsNullOrWhiteSpace(BuildSystem.AppVeyor.Environment.Repository.Tag.Name));
1515
bool IsMainGitVersionRepo = StringComparer.OrdinalIgnoreCase.Equals("gittools/gitversion", BuildSystem.AppVeyor.Environment.Repository.Name);
1616
bool IsPullRequest = BuildSystem.AppVeyor.Environment.PullRequest.IsPullRequest;
17+
bool IsMainGitVersionBranch = StringComparer.OrdinalIgnoreCase.Equals("master", BuildSystem.AppVeyor.Environment.Repository.Branch);
1718

1819
void Build(string configuration, string nugetVersion, string semVersion, string version, string preReleaseTag)
1920
{
@@ -120,6 +121,7 @@ Task("Zip-Files")
120121

121122
Task("Create-Release-Notes")
122123
.IsDependentOn("Build")
124+
.WithCriteria(() => IsMainGitVersionRepo && IsMainGitVersionBranch && !IsPullRequest)
123125
.Does(() =>
124126
{
125127
var githubToken = EnvironmentVariable("GitHubToken");
@@ -160,8 +162,7 @@ Task("Upload-AppVeyor-Artifacts")
160162
"NuGetTaskBuild:GitVersionTask." + nugetVersion +".nupkg",
161163
"GitVersionTfsTaskBuild:gittools.gitversion-" + semVersion +".vsix",
162164
"GemBuild:" + gem,
163-
"zip:GitVersion_" + nugetVersion + ".zip",
164-
"releaseNotes:releasenotes.md"
165+
"zip:GitVersion_" + nugetVersion + ".zip"
165166
});
166167

167168
AppVeyor.UploadArtifact("build/NuGetExeBuild/GitVersion.Portable." + nugetVersion +".nupkg");
@@ -171,8 +172,15 @@ Task("Upload-AppVeyor-Artifacts")
171172
AppVeyor.UploadArtifact("build/GitVersionTfsTaskBuild/gittools.gitversion-" + semVersion + ".vsix");
172173
AppVeyor.UploadArtifact("build/GitVersion_" + nugetVersion + ".zip");
173174
AppVeyor.UploadArtifact("build/GemBuild/" + gem);
174-
AppVeyor.UploadArtifact("build/releasenotes.md");
175175
AppVeyor.UploadArtifact("build/artifacts");
176+
177+
if(IsMainGitVersionRepo && IsMainGitVersionBranch && !IsPullRequest)
178+
{
179+
if(FileExists("build/releasenotes.md"))
180+
{
181+
AppVeyor.UploadArtifact("build/releasenotes.md");
182+
}
183+
}
176184
});
177185

178186

docs/index.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,13 @@ GitVersion is a tool to help you achieve *Semantic Versioning* on your project.
33

44
This influences many of the decisions GitVersion has made, please read and understand this page as it will help you start using GitVersion effectively!
55

6+
## Compatibility
7+
GitVersion works on Mac, Linux with Mono and Windows.
8+
9+
Tip: If you get `System.TypeInitializationException: The type initializer for 'LibGit2Sharp.Core.NativeMethods' threw an exception. ---> System.DllNotFoundException: lib/linux/x86_64/libgit2-baa87df.so`
10+
11+
You likely need to install `libcurl3`. Run `sudo get-get install libcurl3`
12+
613
## Assumptions/Rules
714
### Tags override other rules
815
If a commit is tagged, then GitVersion will *always* use that version over any calculated versions. This is so if you rebuild a tag then the same version will be produced.

docs/usage/command-line.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,4 +64,7 @@ At the moment only `tag-prefix` option is supported. Read more about [Configurat
6464
It will not change config file 'GitVersion.yml'.
6565

6666
### Example: How to override configuration option 'tag-prefix' to use prefix 'custom'
67-
`GitVersion.exe /output json /overrideconfig tag-prefix=custom`
67+
`GitVersion.exe /output json /overrideconfig tag-prefix=custom`
68+
69+
## Mono
70+
To use on mac or linux, install `mono-complete` then just run `mono GitVersion.exe`

src/GitVersionCore.Tests/BuildServers/GitLabCiMessageGenerationTest.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
using GitVersionCore.Tests;
66
using NUnit.Framework;
77
using Shouldly;
8+
using System.Reflection;
89

910
[TestFixture]
1011
public class GitLabCiMessageGenerationTests
@@ -29,8 +30,8 @@ public void GenerateMessageTest()
2930
[Test]
3031
public void WriteAllVariablesToTheTextWriter()
3132
{
32-
// this test method writes to disc, hence marked explicit
33-
var f = "this_file_should_be_deleted.properties";
33+
var assemblyLocation = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
34+
var f = Path.Combine(assemblyLocation, "this_file_should_be_deleted.properties");
3435

3536
try
3637
{

src/GitVersionCore.Tests/BuildServers/JenkinsMessageGenerationTests.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
using GitVersionCore.Tests;
66
using NUnit.Framework;
77
using Shouldly;
8+
using System.Reflection;
89

910
[TestFixture]
1011
public class JenkinsMessageGenerationTests
@@ -29,8 +30,8 @@ public void GenerateMessageTest()
2930
[Test]
3031
public void WriteAllVariablesToTheTextWriter()
3132
{
32-
// this test method writes to disc, hence marked explicit
33-
var f = "this_file_should_be_deleted.properties";
33+
var assemblyLocation = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
34+
var f = Path.Combine(assemblyLocation, "this_file_should_be_deleted.properties");
3435

3536
try
3637
{

src/GitVersionCore.Tests/GitVersionContextTests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,10 +77,10 @@ public void CanFindParentBranchForInheritingIncrementStrategy()
7777
using (var repo = new EmptyRepositoryFixture())
7878
{
7979
repo.Repository.MakeACommit();
80-
repo.Repository.Checkout(repo.Repository.CreateBranch("develop"));
80+
Commands.Checkout(repo.Repository, repo.Repository.CreateBranch("develop"));
8181
repo.Repository.MakeACommit();
8282
var featureBranch = repo.Repository.CreateBranch("feature/foo");
83-
repo.Repository.Checkout(featureBranch);
83+
Commands.Checkout(repo.Repository, featureBranch);
8484
repo.Repository.MakeACommit();
8585

8686
var context = new GitVersionContext(repo.Repository, config);

src/GitVersionCore.Tests/GitVersionCore.Tests.csproj

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3-
<Import Project="..\packages\LibGit2Sharp.NativeBinaries.1.0.137\build\LibGit2Sharp.NativeBinaries.props" Condition="Exists('..\packages\LibGit2Sharp.NativeBinaries.1.0.137\build\LibGit2Sharp.NativeBinaries.props')" />
3+
<Import Project="..\packages\LibGit2Sharp.NativeBinaries.1.0.160\build\LibGit2Sharp.NativeBinaries.props" Condition="Exists('..\packages\LibGit2Sharp.NativeBinaries.1.0.160\build\LibGit2Sharp.NativeBinaries.props')" />
44
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
55
<PropertyGroup>
66
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
@@ -42,16 +42,16 @@
4242
<HintPath>..\packages\FluentDateTime.1.13.0\lib\NET35\FluentDateTime.dll</HintPath>
4343
<Private>True</Private>
4444
</Reference>
45-
<Reference Include="GitTools.Core, Version=1.2.0.0, Culture=neutral, processorArchitecture=MSIL">
46-
<HintPath>..\packages\GitTools.Core.1.2.0\lib\net45\GitTools.Core.dll</HintPath>
45+
<Reference Include="GitTools.Core, Version=1.2.1.0, Culture=neutral, processorArchitecture=MSIL">
46+
<HintPath>..\packages\GitTools.Core.1.2.1-beta0001\lib\net45\GitTools.Core.dll</HintPath>
4747
<Private>True</Private>
4848
</Reference>
4949
<Reference Include="GitTools.Testing, Version=1.1.1.0, Culture=neutral, processorArchitecture=MSIL">
5050
<HintPath>..\packages\GitTools.Testing.1.1.1-beta0001\lib\net4\GitTools.Testing.dll</HintPath>
5151
<Private>True</Private>
5252
</Reference>
5353
<Reference Include="LibGit2Sharp, Version=0.23.0.0, Culture=neutral, PublicKeyToken=7cbde695407f0333, processorArchitecture=MSIL">
54-
<HintPath>..\packages\LibGit2Sharp.0.23.0-pre20150419160303\lib\net40\LibGit2Sharp.dll</HintPath>
54+
<HintPath>..\packages\LibGit2Sharp.0.23.0-pre20160922233542\lib\net40\LibGit2Sharp.dll</HintPath>
5555
<Private>True</Private>
5656
</Reference>
5757
<Reference Include="Mono.Cecil, Version=0.9.6.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756, processorArchitecture=MSIL">
@@ -212,7 +212,7 @@
212212
<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>
213213
</PropertyGroup>
214214
<Error Condition="!Exists('..\packages\Fody.1.29.4\build\dotnet\Fody.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Fody.1.29.4\build\dotnet\Fody.targets'))" />
215-
<Error Condition="!Exists('..\packages\LibGit2Sharp.NativeBinaries.1.0.137\build\LibGit2Sharp.NativeBinaries.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\LibGit2Sharp.NativeBinaries.1.0.137\build\LibGit2Sharp.NativeBinaries.props'))" />
215+
<Error Condition="!Exists('..\packages\LibGit2Sharp.NativeBinaries.1.0.160\build\LibGit2Sharp.NativeBinaries.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\LibGit2Sharp.NativeBinaries.1.0.160\build\LibGit2Sharp.NativeBinaries.props'))" />
216216
</Target>
217217
<Import Project="..\packages\Fody.1.29.4\build\dotnet\Fody.targets" Condition="Exists('..\packages\Fody.1.29.4\build\dotnet\Fody.targets')" />
218218
</Project>

src/GitVersionCore.Tests/IntegrationTests/DevelopScenarios.cs

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ public void WhenDevelopHasMultipleCommits_SpecifyExistingCommitId()
1313
using (var fixture = new EmptyRepositoryFixture())
1414
{
1515
fixture.Repository.MakeATaggedCommit("1.0.0");
16-
fixture.Repository.Checkout(fixture.Repository.CreateBranch("develop"));
16+
Commands.Checkout(fixture.Repository, fixture.Repository.CreateBranch("develop"));
1717

1818
fixture.Repository.MakeACommit();
1919
fixture.Repository.MakeACommit();
@@ -31,7 +31,7 @@ public void WhenDevelopHasMultipleCommits_SpecifyNonExistingCommitId()
3131
using (var fixture = new EmptyRepositoryFixture())
3232
{
3333
fixture.Repository.MakeATaggedCommit("1.0.0");
34-
fixture.Repository.Checkout(fixture.Repository.CreateBranch("develop"));
34+
Commands.Checkout(fixture.Repository, fixture.Repository.CreateBranch("develop"));
3535

3636
fixture.Repository.MakeACommit();
3737
fixture.Repository.MakeACommit();
@@ -49,7 +49,7 @@ public void WhenDevelopBranchedFromTaggedCommitOnMasterVersionDoesNotChange()
4949
using (var fixture = new EmptyRepositoryFixture())
5050
{
5151
fixture.Repository.MakeATaggedCommit("1.0.0");
52-
fixture.Repository.Checkout(fixture.Repository.CreateBranch("develop"));
52+
Commands.Checkout(fixture.Repository, fixture.Repository.CreateBranch("develop"));
5353
fixture.AssertFullSemver("1.0.0");
5454
}
5555
}
@@ -72,7 +72,7 @@ public void CanChangeDevelopTagViaConfig()
7272
using (var fixture = new EmptyRepositoryFixture())
7373
{
7474
fixture.Repository.MakeATaggedCommit("1.0.0");
75-
fixture.Repository.Checkout(fixture.Repository.CreateBranch("develop"));
75+
Commands.Checkout(fixture.Repository, fixture.Repository.CreateBranch("develop"));
7676
fixture.Repository.MakeACommit();
7777
fixture.AssertFullSemver(config, "1.1.0-alpha.1");
7878
}
@@ -84,7 +84,7 @@ public void WhenDeveloperBranchExistsDontTreatAsDevelop()
8484
using (var fixture = new EmptyRepositoryFixture())
8585
{
8686
fixture.Repository.MakeATaggedCommit("1.0.0");
87-
fixture.Repository.Checkout(fixture.Repository.CreateBranch("developer"));
87+
Commands.Checkout(fixture.Repository, fixture.Repository.CreateBranch("developer"));
8888
fixture.Repository.MakeACommit();
8989
fixture.AssertFullSemver("1.0.1-developer.1+1"); // this tag should be the branch name by default, not unstable
9090
}
@@ -96,7 +96,7 @@ public void WhenDevelopBranchedFromMaster_MinorIsIncreased()
9696
using (var fixture = new EmptyRepositoryFixture())
9797
{
9898
fixture.Repository.MakeATaggedCommit("1.0.0");
99-
fixture.Repository.Checkout(fixture.Repository.CreateBranch("develop"));
99+
Commands.Checkout(fixture.Repository, fixture.Repository.CreateBranch("develop"));
100100
fixture.Repository.MakeACommit();
101101
fixture.AssertFullSemver("1.1.0-alpha.1");
102102
}
@@ -108,14 +108,14 @@ public void MergingReleaseBranchBackIntoDevelopWithMergingToMaster_DoesBumpDevel
108108
using (var fixture = new EmptyRepositoryFixture())
109109
{
110110
fixture.Repository.MakeATaggedCommit("1.0.0");
111-
fixture.Repository.Checkout(fixture.Repository.CreateBranch("develop"));
111+
Commands.Checkout(fixture.Repository, fixture.Repository.CreateBranch("develop"));
112112
fixture.Repository.MakeACommit();
113-
fixture.Repository.Checkout(fixture.Repository.CreateBranch("release-2.0.0"));
113+
Commands.Checkout(fixture.Repository, fixture.Repository.CreateBranch("release-2.0.0"));
114114
fixture.Repository.MakeACommit();
115-
fixture.Repository.Checkout("master");
115+
Commands.Checkout(fixture.Repository, "master");
116116
fixture.Repository.MergeNoFF("release-2.0.0", Generate.SignatureNow());
117117

118-
fixture.Repository.Checkout("develop");
118+
Commands.Checkout(fixture.Repository, "develop");
119119
fixture.Repository.MergeNoFF("release-2.0.0", Generate.SignatureNow());
120120
fixture.AssertFullSemver("2.1.0-alpha.2");
121121
}
@@ -138,7 +138,7 @@ public void CanHandleContinuousDelivery()
138138
using (var fixture = new EmptyRepositoryFixture())
139139
{
140140
fixture.Repository.MakeATaggedCommit("1.0.0");
141-
fixture.Repository.Checkout(fixture.Repository.CreateBranch("develop"));
141+
Commands.Checkout(fixture.Repository, fixture.Repository.CreateBranch("develop"));
142142
fixture.Repository.MakeATaggedCommit("1.1.0-alpha7");
143143
fixture.AssertFullSemver(config, "1.1.0-alpha.7");
144144
}
@@ -150,11 +150,11 @@ public void WhenDevelopBranchedFromMasterDetachedHead_MinorIsIncreased()
150150
using (var fixture = new EmptyRepositoryFixture())
151151
{
152152
fixture.Repository.MakeATaggedCommit("1.0.0");
153-
fixture.Repository.Checkout(fixture.Repository.CreateBranch("develop"));
153+
Commands.Checkout(fixture.Repository, fixture.Repository.CreateBranch("develop"));
154154
fixture.Repository.MakeACommit();
155155
var commit = fixture.Repository.Head.Tip;
156156
fixture.Repository.MakeACommit();
157-
fixture.Repository.Checkout(commit);
157+
Commands.Checkout(fixture.Repository, commit);
158158
fixture.AssertFullSemver("1.1.0-alpha.1");
159159
}
160160
}

0 commit comments

Comments
 (0)