Коммит
291b4012e5
|
@ -162,8 +162,9 @@ $RECYCLE.BIN/
|
|||
|
||||
distribution/
|
||||
image/
|
||||
packages/
|
||||
extension-packages/
|
||||
runner-packages/
|
||||
tools/*
|
||||
!tools/packages.config
|
||||
nunit/bin
|
||||
nunit/obj
|
||||
nunit/obj
|
||||
|
|
|
@ -2,4 +2,5 @@ build_script:
|
|||
- ps: .\build.ps1 -Target "Appveyor"
|
||||
|
||||
artifacts:
|
||||
- path: distribution\*.msi
|
||||
- path: distribution\*.msi
|
||||
- path: distribution\*.zip
|
||||
|
|
84
build.cake
84
build.cake
|
@ -16,9 +16,13 @@ var displayVersion = "3.5.0";
|
|||
// NUGET PACKAGES
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
var NUGET_PACKAGES = new []
|
||||
var CONSOLE_PACKAGES = new []
|
||||
{
|
||||
"NUnit.ConsoleRunner"
|
||||
};
|
||||
|
||||
var EXTENSION_PACKAGES = new []
|
||||
{
|
||||
"NUnit.ConsoleRunner",
|
||||
"NUnit.Extension.VSProjectLoader",
|
||||
"NUnit.Extension.NUnitProjectLoader",
|
||||
"NUnit.Extension.NUnitV2Driver",
|
||||
|
@ -33,48 +37,57 @@ var NUGET_PACKAGES = new []
|
|||
var ROOT_DIR = Context.Environment.WorkingDirectory.FullPath + "/";
|
||||
var WIX_PROJ = ROOT_DIR + "nunit/nunit.wixproj";
|
||||
var RESOURCES_DIR = ROOT_DIR + "resources/";
|
||||
var PACKAGES_DIR = ROOT_DIR + "packages/";
|
||||
var RUNNER_PACKAGES_DIR = ROOT_DIR + "runner-packages/";
|
||||
var EXTENSION_PACKAGES_DIR = ROOT_DIR + "extension-packages/";
|
||||
var DISTRIBUTION_DIR = ROOT_DIR + "distribution/";
|
||||
var IMAGE_DIR = ROOT_DIR + "image/";
|
||||
var IMAGE_ADDINS_DIR = IMAGE_DIR + "addins/";
|
||||
var ZIP_FILE = string.Format("{0}NUnit.{1}.zip", DISTRIBUTION_DIR, version);
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// TASK
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
Task("FetchPackages")
|
||||
Task("Clean")
|
||||
.Does(() =>
|
||||
{
|
||||
CleanDirectory(PACKAGES_DIR);
|
||||
CleanDirectory(RUNNER_PACKAGES_DIR);
|
||||
CleanDirectory(EXTENSION_PACKAGES_DIR);
|
||||
CleanDirectory(IMAGE_DIR);
|
||||
CleanDirectory(DISTRIBUTION_DIR);
|
||||
});
|
||||
|
||||
var settings = new NuGetInstallSettings
|
||||
Task("FetchPackages")
|
||||
.IsDependentOn("Clean")
|
||||
.Does(() =>
|
||||
{
|
||||
foreach(var package in CONSOLE_PACKAGES)
|
||||
{
|
||||
OutputDirectory = PACKAGES_DIR
|
||||
};
|
||||
NuGetInstall(package, new NuGetInstallSettings {
|
||||
OutputDirectory = RUNNER_PACKAGES_DIR
|
||||
});
|
||||
}
|
||||
|
||||
foreach(var package in NUGET_PACKAGES)
|
||||
foreach(var package in EXTENSION_PACKAGES)
|
||||
{
|
||||
NuGetInstall(package, settings);
|
||||
NuGetInstall(package, new NuGetInstallSettings {
|
||||
OutputDirectory = EXTENSION_PACKAGES_DIR
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
Task("CreateImage")
|
||||
.IsDependentOn("Clean")
|
||||
.IsDependentOn("FetchPackages")
|
||||
.Does(() =>
|
||||
{
|
||||
CleanDirectory(IMAGE_DIR);
|
||||
CopyDirectory(RESOURCES_DIR, IMAGE_DIR);
|
||||
|
||||
foreach(var directory in System.IO.Directory.GetDirectories(PACKAGES_DIR))
|
||||
{
|
||||
var lib = directory + "/lib";
|
||||
var tools = directory + "/tools";
|
||||
foreach(var packageDir in GetAllDirectories(RUNNER_PACKAGES_DIR))
|
||||
CopyPackageContents(packageDir, IMAGE_DIR);
|
||||
|
||||
if (DirectoryExists(lib))
|
||||
CopyDirectory(lib, IMAGE_DIR);
|
||||
|
||||
if (DirectoryExists(tools))
|
||||
CopyDirectory(tools, IMAGE_DIR);
|
||||
}
|
||||
foreach(var packageDir in GetAllDirectories(EXTENSION_PACKAGES_DIR))
|
||||
CopyPackageContents(packageDir, IMAGE_ADDINS_DIR);
|
||||
});
|
||||
|
||||
Task("PackageMsi")
|
||||
|
@ -93,12 +106,37 @@ Task("PackageMsi")
|
|||
);
|
||||
});
|
||||
|
||||
Task("PackageZip")
|
||||
.IsDependentOn("CreateImage")
|
||||
.Does(() =>
|
||||
{
|
||||
Zip(IMAGE_DIR, ZIP_FILE);
|
||||
});
|
||||
|
||||
Task("PackageAll")
|
||||
.IsDependentOn("PackageMsi")
|
||||
.IsDependentOn("PackageZip");
|
||||
|
||||
Task("Appveyor")
|
||||
.IsDependentOn("PackageMsi");
|
||||
.IsDependentOn("PackageAll");
|
||||
|
||||
Task("Default")
|
||||
.IsDependentOn("PackageMsi");
|
||||
.IsDependentOn("PackageAll");
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// HELPER METHODS
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
public string[] GetAllDirectories(string dirPath)
|
||||
{
|
||||
return System.IO.Directory.GetDirectories(dirPath);
|
||||
}
|
||||
|
||||
public void CopyPackageContents(DirectoryPath packageDir, DirectoryPath outDir)
|
||||
{
|
||||
var tools = packageDir + "/tools";
|
||||
CopyDirectory(tools, outDir);
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// EXECUTION
|
||||
|
|
|
@ -4,43 +4,43 @@
|
|||
<ComponentGroup Id="ADDINS.NUNIT.PROJECT.LOADER" Directory="ADDINS">
|
||||
<Component Id="ADDINS.NUNIT.PROJECT.LOADER" Location="local" Guid="294BEC17-144D-403B-A08C-E524BE8F3FA3">
|
||||
<File Id="nunit_project_loader.dll"
|
||||
Source="$(var.InstallImage)\nunit-project-loader.dll" />
|
||||
Source="$(var.InstallImage)addins\nunit-project-loader.dll" />
|
||||
</Component>
|
||||
</ComponentGroup>
|
||||
|
||||
<ComponentGroup Id="ADDINS.VS.PROJECT.LOADER" Directory="ADDINS">
|
||||
<Component Id="ADDINS.VS.PROJECT.LOADER" Location="local" Guid="98CB680E-EAFA-4DC6-A0C1-030734A4C949">
|
||||
<File Id="vs_project_loader.dll"
|
||||
Source="$(var.InstallImage)\vs-project-loader.dll" />
|
||||
Source="$(var.InstallImage)addins\vs-project-loader.dll" />
|
||||
</Component>
|
||||
</ComponentGroup>
|
||||
|
||||
<ComponentGroup Id="ADDINS.NUNIT.V2.WRITER" Directory="ADDINS">
|
||||
<Component Id="ADDINS.NUNIT.V2.WRITER" Location="local" Guid="9CD93A4A-A499-4DC9-9E07-A95D9743D06F">
|
||||
<File Id="nunit_v2_result_writer.dll"
|
||||
Source="$(var.InstallImage)\nunit-v2-result-writer.dll" />
|
||||
Source="$(var.InstallImage)addins\nunit-v2-result-writer.dll" />
|
||||
</Component>
|
||||
</ComponentGroup>
|
||||
|
||||
<ComponentGroup Id="TEAMCITY.EVENT.LISTENER" Directory="ADDINS">
|
||||
<Component Id="TEAMCITY.EVENT.LISTENER" Location="local" Guid="F7A37F5B-2D83-4B82-83E9-5A4EC0CBEB2F">
|
||||
<File Id="teamcity_event_listener.dll"
|
||||
Source="$(var.InstallImage)\teamcity-event-listener.dll" />
|
||||
Source="$(var.InstallImage)addins\teamcity-event-listener.dll" />
|
||||
</Component>
|
||||
</ComponentGroup>
|
||||
|
||||
<ComponentGroup Id="NUNIT.V2.DRIVER" Directory="ADDINS">
|
||||
<Component Id="NUNIT.V2.DRIVER" Location="local" Guid="4A55D836-7719-40A2-BDFF-CE3980FE3B42">
|
||||
<File Id="nunit.v2.driver.dll"
|
||||
Source="$(var.InstallImage)\nunit.v2.driver.dll" />
|
||||
Source="$(var.InstallImage)addins\nunit.v2.driver.dll" />
|
||||
</Component>
|
||||
<Component Id="NUNIT.2.CORE" Location="local" Guid="3D13540C-83E0-463A-8FD1-BE2A3248E2EC">
|
||||
<File Id="nunit.core.dll"
|
||||
Source="$(var.InstallImage)\nunit.core.dll" />
|
||||
Source="$(var.InstallImage)addins\nunit.core.dll" />
|
||||
</Component>
|
||||
<Component Id="NUNIT.2.CORE.INTERFACES" Location="local" Guid="A09CA3D7-1D35-436C-A899-E1364B1E7AFD">
|
||||
<File Id="nunit.core.interfaces.dll"
|
||||
Source="$(var.InstallImage)\nunit.core.interfaces.dll" />
|
||||
Source="$(var.InstallImage)addins\nunit.core.interfaces.dll" />
|
||||
</Component>
|
||||
</ComponentGroup>
|
||||
</Fragment>
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="Cake" version="0.15.2" />
|
||||
<package id="Cake" version="0.16.1" />
|
||||
</packages>
|
||||
|
|
Загрузка…
Ссылка в новой задаче