Browse Source

Fix off-by-one error in appveyor-install.ps1 and use branch name from APPVEYOR_REPO_BRANCH in case of AppVeyor build in UpdateAssemblyInfo.

pull/863/head
Siegfried Pammer 8 years ago
parent
commit
2c1cab350b
  1. 7
      BuildTools/UpdateAssemblyInfo/Main.cs
  2. 2
      BuildTools/appveyor-install.ps1

7
BuildTools/UpdateAssemblyInfo/Main.cs

@ -197,7 +197,12 @@ namespace UpdateAssemblyInfo @@ -197,7 +197,12 @@ namespace UpdateAssemblyInfo
if (Directory.Exists(".git")) {
try {
ReadRevisionNumberFromGit();
ReadBranchNameFromGit();
string appVeyorBranch = Environment.GetEnvironmentVariable("APPVEYOR_REPO_BRANCH");
// AppVeyor uses a repository with detached head.
if (string.IsNullOrWhiteSpace(appVeyorBranch))
ReadBranchNameFromGit();
else
gitBranchName = appVeyorBranch;
} catch (Exception ex) {
Console.WriteLine(ex.ToString());
}

2
BuildTools/appveyor-install.ps1

@ -9,7 +9,7 @@ if ($env:APPVEYOR_REPO_BRANCH -ne 'master') { @@ -9,7 +9,7 @@ if ($env:APPVEYOR_REPO_BRANCH -ne 'master') {
$branch = "";
}
$build = git rev-list --count "$baseCommitHash..HEAD";
$build = [Int32]::Parse((git rev-list --count "$baseCommitHash..HEAD")) + 1;
$newVersion="$majorVersion.$minorVersion.$revision.$build";
$env:ilspy_version_number=$newVersion;

Loading…
Cancel
Save