Skip to content

Commit da9fa21

Browse files
committed
Merge pull request #481 from JakeGinnivan/AppVeyorBuild
Adding appveyor build config
2 parents 6491237 + 4f838b6 commit da9fa21

File tree

3 files changed

+37
-3
lines changed

3 files changed

+37
-3
lines changed

GitVersionCore/Helpers/ProcessHelper.cs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public static Process Start(ProcessStartInfo startInfo)
3636
startInfo.FileName,
3737
exception);
3838
}
39-
39+
4040
throw;
4141
}
4242
}
@@ -70,8 +70,14 @@ public static int Run(Action<string> output, Action<string> errorOutput, TextRea
7070
};
7171
foreach (var environmentalVariable in environmentalVariables)
7272
{
73-
if (!psi.EnvironmentVariables.ContainsKey(environmentalVariable.Key) && environmentalVariable.Value != null)
73+
if (psi.EnvironmentVariables.ContainsKey(environmentalVariable.Key))
74+
{
75+
psi.EnvironmentVariables[environmentalVariable.Key] = environmentalVariable.Value;
76+
}
77+
else
78+
{
7479
psi.EnvironmentVariables.Add(environmentalVariable.Key, environmentalVariable.Value);
80+
}
7581
if (psi.EnvironmentVariables.ContainsKey(environmentalVariable.Key) && environmentalVariable.Value == null)
7682
psi.EnvironmentVariables.Remove(environmentalVariable.Key);
7783
}

GitVersionExe.Tests/GitVersionHelper.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@ static ExecutionResults ExecuteIn(ArgumentBuilder arguments)
3232
var environmentalVariables =
3333
new[]
3434
{
35-
new KeyValuePair<string, string>("TEAMCITY_VERSION", arguments.IsTeamCity ? "8.0.0" : null)
35+
new KeyValuePair<string, string>("TEAMCITY_VERSION", arguments.IsTeamCity ? "8.0.0" : null),
36+
new KeyValuePair<string, string>("APPVEYOR", null)
3637
};
3738

3839
var exitCode = ProcessHelper.Run(

appveyor.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
assembly_info:
2+
patch: false
3+
4+
platform:
5+
- Any CPU
6+
7+
configuration:
8+
- Debug
9+
10+
build_script:
11+
- cmd: nuget restore
12+
13+
- cmd: msbuild GitVersion.sln "/p:Configuration=%CONFIGURATION%;Platform=%PLATFORM%"
14+
- ps: .\NuGetCommandLineBuild\Tools\GitVersion.exe /l console /output buildserver /updateAssemblyInfo
15+
- cmd: msbuild GitVersion.sln "/p:Configuration=%CONFIGURATION%;Platform=%PLATFORM%"
16+
17+
- cmd: appveyor PushArtifact "NuGetExeBuild/GitVersion.Portable.%GitVersion_NuGetVersion%.nupkg"
18+
19+
- cmd: appveyor PushArtifact "NuGetCommandLineBuild/GitVersion.CommandLine.%GitVersion_NuGetVersion%.nupkg"
20+
- cmd: appveyor PushArtifact "NuGetRefBuild/GitVersion.%GitVersion_NuGetVersion%.nupkg"
21+
- cmd: appveyor PushArtifact "NuGetTaskBuild/GitVersionTask.%GitVersion_NuGetVersion%.nupkg"
22+
23+
- cmd: 7z a "GitVersion_%GitVersion_NuGetVersion%.zip" .\NuGetCommandLineBuild\Tools\*.*
24+
- cmd: appveyor PushArtifact "GitVersion_%GitVersion_NuGetVersion%.zip"
25+
26+
test_script:
27+
- nunit-console "GitVersionTask.Tests\bin\%CONFIGURATION%\GitVersionTask.Tests.dll" "GitVersionExe.Tests\bin\%CONFIGURATION%\GitVersionExe.Tests.dll" "GitVersionCore.Tests\bin\%CONFIGURATION%\GitVersionCore.Tests.dll" /noshadow

0 commit comments

Comments
 (0)