Add msi packaging
This commit is contained in:
Родитель
104ca9f1a6
Коммит
c3a6e31699
55
build.cake
55
build.cake
|
@ -34,9 +34,11 @@ var AllFrameworks = IsRunningOnWindows() ? WindowsFrameworks : LinuxFrameworks;
|
||||||
// DEFINE RUN CONSTANTS
|
// DEFINE RUN CONSTANTS
|
||||||
//////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
// Directories
|
// Directories - Use CWD since there seems to be no defined project dir in Cake
|
||||||
var PACKAGE_DIR = "package/";
|
var CWD = Context.Environment.WorkingDirectory.FullPath + "\\";
|
||||||
var BIN_DIR = "bin/" + configuration + "/";
|
var PACKAGE_DIR = CWD + "package\\";
|
||||||
|
var BIN_DIR = CWD + "bin\\" + configuration + "\\";
|
||||||
|
var IMAGE_DIR = CWD + "images\\";
|
||||||
|
|
||||||
// Test Runners
|
// Test Runners
|
||||||
var NUNIT3_CONSOLE = BIN_DIR + "nunit3-console.exe";
|
var NUNIT3_CONSOLE = BIN_DIR + "nunit3-console.exe";
|
||||||
|
@ -268,14 +270,15 @@ Task("PackageSource")
|
||||||
Task("CreateImage")
|
Task("CreateImage")
|
||||||
.Does(() =>
|
.Does(() =>
|
||||||
{
|
{
|
||||||
var imageDir = "images/NUnit-" + packageVersion + "/";
|
var currentImageDir = IMAGE_DIR + "NUnit-" + packageVersion + "/";
|
||||||
var imageBinDir = imageDir + "bin/";
|
var imageBinDir = currentImageDir + "bin\\";
|
||||||
|
|
||||||
CleanDirectory(imageDir);
|
CleanDirectory(currentImageDir);
|
||||||
|
|
||||||
CopyFiles(RootFiles, imageDir);
|
CopyFiles(RootFiles, currentImageDir);
|
||||||
|
|
||||||
CreateDirectory(imageBinDir);
|
CreateDirectory(imageBinDir);
|
||||||
|
Information("Created directory " + imageBinDir);
|
||||||
|
|
||||||
foreach(FilePath file in BinFiles)
|
foreach(FilePath file in BinFiles)
|
||||||
{
|
{
|
||||||
|
@ -304,65 +307,80 @@ Task("PackageZip")
|
||||||
.IsDependentOn("CreateImage")
|
.IsDependentOn("CreateImage")
|
||||||
.Does(() =>
|
.Does(() =>
|
||||||
{
|
{
|
||||||
var imageDir = "images/NUnit-" + packageVersion + "/";
|
var currentImageDir = IMAGE_DIR + "NUnit-" + packageVersion + "/";
|
||||||
CreateDirectory(PACKAGE_DIR);
|
CreateDirectory(PACKAGE_DIR);
|
||||||
Zip(MakeAbsolute(Directory(imageDir)), File(ZIP_PACKAGE));
|
Zip(MakeAbsolute(Directory(currentImageDir)), File(ZIP_PACKAGE));
|
||||||
});
|
});
|
||||||
|
|
||||||
Task("PackageNuGet")
|
Task("PackageNuGet")
|
||||||
.IsDependentOn("CreateImage")
|
.IsDependentOn("CreateImage")
|
||||||
.Does(() =>
|
.Does(() =>
|
||||||
{
|
{
|
||||||
var imageDir = "images/NUnit-" + packageVersion + "/";
|
var currentImageDir = IMAGE_DIR + "NUnit-" + packageVersion + "/";
|
||||||
|
|
||||||
CreateDirectory(PACKAGE_DIR);
|
CreateDirectory(PACKAGE_DIR);
|
||||||
NuGetPack("nuget/nunit.nuspec", new NuGetPackSettings()
|
NuGetPack("nuget/nunit.nuspec", new NuGetPackSettings()
|
||||||
{
|
{
|
||||||
Version = packageVersion,
|
Version = packageVersion,
|
||||||
BasePath = imageDir,
|
BasePath = currentImageDir,
|
||||||
OutputDirectory = PACKAGE_DIR
|
OutputDirectory = PACKAGE_DIR
|
||||||
});
|
});
|
||||||
NuGetPack("nuget/nunitSL.nuspec", new NuGetPackSettings()
|
NuGetPack("nuget/nunitSL.nuspec", new NuGetPackSettings()
|
||||||
{
|
{
|
||||||
Version = packageVersion,
|
Version = packageVersion,
|
||||||
BasePath = imageDir,
|
BasePath = currentImageDir,
|
||||||
OutputDirectory = PACKAGE_DIR
|
OutputDirectory = PACKAGE_DIR
|
||||||
});
|
});
|
||||||
NuGetPack("nuget/nunitlite.nuspec", new NuGetPackSettings()
|
NuGetPack("nuget/nunitlite.nuspec", new NuGetPackSettings()
|
||||||
{
|
{
|
||||||
Version = packageVersion,
|
Version = packageVersion,
|
||||||
BasePath = imageDir,
|
BasePath = currentImageDir,
|
||||||
OutputDirectory = PACKAGE_DIR
|
OutputDirectory = PACKAGE_DIR
|
||||||
});
|
});
|
||||||
NuGetPack("nuget/nunitliteSL.nuspec", new NuGetPackSettings()
|
NuGetPack("nuget/nunitliteSL.nuspec", new NuGetPackSettings()
|
||||||
{
|
{
|
||||||
Version = packageVersion,
|
Version = packageVersion,
|
||||||
BasePath = imageDir,
|
BasePath = currentImageDir,
|
||||||
OutputDirectory = PACKAGE_DIR
|
OutputDirectory = PACKAGE_DIR
|
||||||
});
|
});
|
||||||
NuGetPack("nuget/nunit.console.nuspec", new NuGetPackSettings()
|
NuGetPack("nuget/nunit.console.nuspec", new NuGetPackSettings()
|
||||||
{
|
{
|
||||||
Version = packageVersion,
|
Version = packageVersion,
|
||||||
BasePath = imageDir,
|
BasePath = currentImageDir,
|
||||||
OutputDirectory = PACKAGE_DIR,
|
OutputDirectory = PACKAGE_DIR,
|
||||||
NoPackageAnalysis = true
|
NoPackageAnalysis = true
|
||||||
});
|
});
|
||||||
NuGetPack("nuget/nunit.runners.nuspec", new NuGetPackSettings()
|
NuGetPack("nuget/nunit.runners.nuspec", new NuGetPackSettings()
|
||||||
{
|
{
|
||||||
Version = packageVersion,
|
Version = packageVersion,
|
||||||
BasePath = imageDir,
|
BasePath = currentImageDir,
|
||||||
OutputDirectory = PACKAGE_DIR,
|
OutputDirectory = PACKAGE_DIR,
|
||||||
NoPackageAnalysis = true
|
NoPackageAnalysis = true
|
||||||
});
|
});
|
||||||
NuGetPack("nuget/nunit.engine.nuspec", new NuGetPackSettings()
|
NuGetPack("nuget/nunit.engine.nuspec", new NuGetPackSettings()
|
||||||
{
|
{
|
||||||
Version = packageVersion,
|
Version = packageVersion,
|
||||||
BasePath = imageDir,
|
BasePath = currentImageDir,
|
||||||
OutputDirectory = PACKAGE_DIR,
|
OutputDirectory = PACKAGE_DIR,
|
||||||
NoPackageAnalysis = true
|
NoPackageAnalysis = true
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Task("PackageMsi")
|
||||||
|
.IsDependentOn("CreateImage")
|
||||||
|
.Does(() =>
|
||||||
|
{
|
||||||
|
MSBuild("install/master/nunit.wixproj", new MSBuildSettings()
|
||||||
|
.WithTarget("Rebuild")
|
||||||
|
.SetConfiguration(configuration)
|
||||||
|
.WithProperty("PackageVersion", packageVersion)
|
||||||
|
.WithProperty("DisplayVersion", version)
|
||||||
|
.WithProperty("OutDir", PACKAGE_DIR)
|
||||||
|
.WithProperty("InstallImage", IMAGE_DIR + "NUnit-" + packageVersion)
|
||||||
|
.SetMSBuildPlatform(MSBuildPlatform.x86)
|
||||||
|
.SetNodeReuse(false)
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////
|
||||||
// HELPER METHODS
|
// HELPER METHODS
|
||||||
|
@ -533,7 +551,8 @@ Task("Test")
|
||||||
Task("Package")
|
Task("Package")
|
||||||
.IsDependentOn("PackageSource")
|
.IsDependentOn("PackageSource")
|
||||||
.IsDependentOn("PackageZip")
|
.IsDependentOn("PackageZip")
|
||||||
.IsDependentOn("PackageNuGet");
|
.IsDependentOn("PackageNuGet")
|
||||||
|
.IsDependentOn("PackageMsi");
|
||||||
|
|
||||||
Task("Appveyor")
|
Task("Appveyor")
|
||||||
.IsDependentOn("Build")
|
.IsDependentOn("Build")
|
||||||
|
|
Загрузка…
Ссылка в новой задаче