зеркало из
1
0
Форкнуть 0

Merge pull request #1612 from nunit/issue-1605

Issue 1605
This commit is contained in:
Rob Prouse 2016-06-23 22:03:21 -04:00 коммит произвёл GitHub
Родитель dddc004957 6918c393e1
Коммит 284d74a396
3 изменённых файлов: 38 добавлений и 21 удалений

Просмотреть файл

@ -19,6 +19,10 @@ var ErrorDetail = new List<string>();
var version = "3.3.0";
var modifier = "";
//For now, set teamcity extension verson and modifier separately
var tcVersion = "1.0.0";
var tcModifier = "";
var isCompactFrameworkInstalled = FileExists(Environment.GetEnvironmentVariable("windir") + "\\Microsoft.NET\\Framework\\v3.5\\Microsoft.CompactFramework.CSharp.targets");
//Find program files on 32-bit or 64-bit Windows
@ -28,6 +32,7 @@ var isSilverlightSDKInstalled = FileExists(programFiles + "\\MSBuild\\Microsoft
var isAppveyor = BuildSystem.IsRunningOnAppVeyor;
var dbgSuffix = configuration == "Debug" ? "-dbg" : "";
var packageVersion = version + modifier + dbgSuffix;
var teamcityVersion = tcVersion + tcModifier + dbgSuffix;
//////////////////////////////////////////////////////////////////////
// SUPPORTED FRAMEWORKS
@ -111,17 +116,23 @@ Task("InitializeBuild")
if (tag.IsTag)
{
packageVersion = tag.Name;
// NOTE: tag doesn't currently change the TeamCity version
}
else
{
var buildNumber = AppVeyor.Environment.Build.Number;
packageVersion = version + "-CI-" + buildNumber + dbgSuffix;
var suffix = "-CI-" + buildNumber + dbgSuffix;
if (AppVeyor.Environment.PullRequest.IsPullRequest)
packageVersion += "-PR-" + AppVeyor.Environment.PullRequest.Number;
suffix += "-PR-" + AppVeyor.Environment.PullRequest.Number;
else if (AppVeyor.Environment.Repository.Branch.StartsWith("release", StringComparison.OrdinalIgnoreCase))
packageVersion += "-PRE-" + buildNumber;
suffix += "-PRE-" + buildNumber;
else
packageVersion += "-" + AppVeyor.Environment.Repository.Branch;
suffix += "-" + AppVeyor.Environment.Repository.Branch;
packageVersion = version + suffix;
teamcityVersion = tcVersion + suffix;
}
AppVeyor.UpdateBuildVersion(packageVersion);
@ -618,20 +629,12 @@ Task("PackageNuGet")
OutputDirectory = PACKAGE_DIR,
NoPackageAnalysis = true
});
NuGetPack("nuget/runners/nunit.console-runner-with-extensions.nuspec", new NuGetPackSettings()
{
Version = packageVersion,
BasePath = currentImageDir,
OutputDirectory = PACKAGE_DIR,
NoPackageAnalysis = true
});
NuGetPack("nuget/runners/nunit.runners.nuspec", new NuGetPackSettings()
{
Version = packageVersion,
BasePath = currentImageDir,
OutputDirectory = PACKAGE_DIR,
NoPackageAnalysis = true
});
// NOTE: We can't use NuGetPack for these because our current version
// of Cake doesn't support the Properties option.
PackageRunnerWithExtensions("nuget/runners/nunit.console-runner-with-extensions.nuspec", packageVersion, teamcityVersion, currentImageDir, PACKAGE_DIR);
PackageRunnerWithExtensions("nuget/runners/nunit.runners.nuspec", packageVersion, teamcityVersion, currentImageDir, PACKAGE_DIR);
// Package engine
NuGetPack("nuget/engine/nunit.engine.nuspec", new NuGetPackSettings()
@ -681,7 +684,7 @@ Task("PackageNuGet")
NuGetPack("nuget/extensions/teamcity-event-listener.nuspec", new NuGetPackSettings()
{
// The teamcity-event-listener extension uses its own versioning
Version = "1.0.0" + dbgSuffix,
Version = teamcityVersion,
BasePath = currentImageDir,
OutputDirectory = PACKAGE_DIR,
NoPackageAnalysis = true
@ -853,6 +856,20 @@ void RunTest(FilePath exePath, DirectoryPath workingDir, string arguments, strin
errorDetail.Add(string.Format("{0} returned rc = {1}", exePath, rc));
}
//////////////////////////////////////////////////////////////////////
// HELPER METHODS - PACKAGING
//////////////////////////////////////////////////////////////////////
void PackageRunnerWithExtensions(string package, string version, string tcVersion, string imageDir, string packageDir)
{
var arguments = string.Format(
"pack {0} -Version {1} -Properties teamcityVersion={2} -BasePath {3} -OutputDirectory {4} -NoPackageAnalysis",
package, version, tcVersion, imageDir, packageDir);
var nugetPath = File("tools/nuget.exe");
StartProcess(nugetPath, arguments);
}
//////////////////////////////////////////////////////////////////////
// TASK TARGETS
//////////////////////////////////////////////////////////////////////

Просмотреть файл

@ -33,7 +33,7 @@
<dependency id="NUnit.Extension.VSProjectLoader" version="[$version$]" />
<dependency id="NUnit.Extension.NUnitV2ResultWriter" version="[$version$]" />
<dependency id="NUnit.Extension.NUnitV2Driver" version="[$version$]" />
<dependency id="NUnit.Extension.TeamCityEventListener" version="[$version$]" />
<dependency id="NUnit.Extension.TeamCityEventListener" version="[$teamcityVersion$]" />
</group>
</dependencies>
</metadata>

Просмотреть файл

@ -27,7 +27,7 @@ Users may update their projects to use the NUnit.Console package directly if des
<dependency id="NUnit.Extension.VSProjectLoader" version="[$version$]" />
<dependency id="NUnit.Extension.NUnitV2ResultWriter" version="[$version$]" />
<dependency id="NUnit.Extension.NUnitV2Driver" version="[$version$]" />
<dependency id="NUnit.Extension.TeamCityEventListener" version="[$version$]" />
<dependency id="NUnit.Extension.TeamCityEventListener" version="[$teamcityVersion$]" />
</group>
</dependencies>
</metadata>