Skip to content

Commit

Permalink
Fixed the Cake build packaging
Browse files Browse the repository at this point in the history
  • Loading branch information
rprouse committed Mar 5, 2016
1 parent ed571e6 commit c19d23c
Showing 1 changed file with 33 additions and 33 deletions.
66 changes: 33 additions & 33 deletions build.cake
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ var LinuxFrameworks = new string[] {
"net-4.5", "net-4.0", "net-2.0" };

var AllFrameworks = IsRunningOnWindows() ? WindowsFrameworks : LinuxFrameworks;

//////////////////////////////////////////////////////////////////////
// DEFINE RUN CONSTANTS
//////////////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -161,7 +161,7 @@ Task("BuildCppTestFiles")
.SetNodeReuse(false)
);
});

//////////////////////////////////////////////////////////////////////
// TEST
//////////////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -197,8 +197,8 @@ Task("TestFramework")
{
ErrorDetail.Add(exception.Message);
})
.Does(() =>
{
.Does(() =>
{
RunTest(BIN_DIR + File(framework + "/" + NUNITLITE_RUNNER), BIN_DIR + "/" + framework, FRAMEWORK_TESTS, framework, ref ErrorDetail);
});

Expand All @@ -208,8 +208,8 @@ Task("TestNUnitLite")
{
ErrorDetail.Add(exception.Message);
})
.Does(() =>
{
.Does(() =>
{
if (framework == "sl-5.0")
RunTest(BIN_DIR + File(framework + "/" + NUNITLITE_RUNNER), BIN_DIR + "/" + framework, "nunitlite.tests.dll", framework, ref ErrorDetail);
else
Expand All @@ -222,16 +222,16 @@ Task("TestEngine")
{
ErrorDetail.Add(exception.Message);
})
.Does(() =>
{
.Does(() =>
{
RunTest(NUNIT3_CONSOLE, BIN_DIR, ENGINE_TESTS, "TestEngine", ref ErrorDetail);
});

Task("TestDriver")
.IsDependentOn("Build")
.WithCriteria(IsRunningOnWindows)
.Does(() =>
{
.Does(() =>
{
RunTest(NUNIT3_CONSOLE, BIN_DIR, PORTABLE_AGENT_TESTS, ref ErrorDetail);
});

Expand All @@ -241,9 +241,9 @@ Task("TestAddins")
ErrorDetail.Add(exception.Message);
})
.IsDependentOn("Build")
.Does(() =>
.Does(() =>
{
RunTest(NUNIT3_CONSOLE, BIN_DIR, ADDIN_TESTS,"TestAddins", ref ErrorDetail);
RunTest(NUNIT3_CONSOLE, BIN_DIR, ADDIN_TESTS,"TestAddins", ref ErrorDetail);
});

Task("TestV2Driver")
Expand All @@ -252,8 +252,8 @@ Task("TestV2Driver")
{
ErrorDetail.Add(exception.Message);
})
.Does(() =>
{
.Does(() =>
{
RunTest(NUNIT3_CONSOLE, BIN_DIR, V2_PORTABLE_AGENT_TESTS,"TestV2Driver", ref ErrorDetail);
});

Expand All @@ -263,8 +263,8 @@ Task("TestConsole")
{
ErrorDetail.Add(exception.Message);
})
.Does(() =>
{
.Does(() =>
{
RunTest(NUNIT3_CONSOLE, BIN_DIR, CONSOLE_TESTS, "TestConsole", ref ErrorDetail);
});

Expand All @@ -276,15 +276,15 @@ var RootFiles = new FilePath[]
{
"LICENSE.txt",
"NOTICES.txt",
"CHANGES.txt",
"CHANGES.txt",
"nunit.ico"
};

var BinFiles = new FilePath[]
{
"ConsoleTests.nunit",
"EngineTests.nunit",
"mock-nunit-assembly.exe",
"mock-assembly.exe",
"Mono.Cecil.dll",
"nunit-agent-x86.exe",
"nunit-agent-x86.exe.config",
Expand Down Expand Up @@ -369,7 +369,7 @@ Task("CreateImage")
CreateDirectory(imageBinDir + file.GetDirectory());
CopyFile(BIN_DIR + file, imageBinDir + file);
}
}
}
foreach (var runtime in AllFrameworks)
{
Expand All @@ -393,7 +393,7 @@ Task("PackageZip")
var currentImageDir = IMAGE_DIR + "NUnit-" + packageVersion + "/";
var zipFiles =
var zipFiles =
GetFiles(currentImageDir + "*.*") +
GetFiles(currentImageDir + "bin/*.*") +
GetFiles(currentImageDir + "bin/addins/*.*") +
Expand Down Expand Up @@ -542,7 +542,7 @@ Task("PackageCF")
var currentImageDir = IMAGE_DIR + "NUnit-" + packageVersion + "/";
var zipFiles =
var zipFiles =
GetFiles(currentImageDir + "*.*") +
GetFiles(currentImageDir + "bin/netcf-3.5/*.*");
Expand Down Expand Up @@ -581,12 +581,12 @@ Teardown(() =>

void CheckForError(ref List<string> errorDetail)
{
if(errorDetail.Count != 0)
if(errorDetail.Count != 0)
{
var copyError = new List<string>();
copyError = errorDetail.Select(s => s).ToList();
errorDetail.Clear();
throw new Exception("One or more unit test failed, breaking the build.\n"
throw new Exception("One or more unit test failed, breaking the build.\n"
+ copyError.Aggregate((x,y) => x + "\n" + y));
}
}
Expand Down Expand Up @@ -637,9 +637,9 @@ void BuildEngine(string configuration)
BuildProject("./src/NUnitEngine/nunit.engine/nunit.engine.csproj", configuration);
BuildProject("./src/NUnitEngine/nunit-agent/nunit-agent.csproj", configuration);
BuildProject("./src/NUnitEngine/nunit-agent/nunit-agent-x86.csproj", configuration);

// Engine tests
BuildProject("./src/NUnitEngine/nunit.engine.tests/nunit.engine.tests.csproj", configuration);
BuildProject("./src/NUnitEngine/nunit.engine.tests/nunit.engine.tests.csproj", configuration);

// Driver and tests
if(IsRunningOnWindows())
Expand All @@ -649,8 +649,8 @@ void BuildEngine(string configuration)
}

// Addins
BuildProject("./src/NUnitEngine/Addins/nunit-project-loader/nunit-project-loader.csproj", configuration);
BuildProject("./src/NUnitEngine/Addins/vs-project-loader/vs-project-loader.csproj", configuration);
BuildProject("./src/NUnitEngine/Addins/nunit-project-loader/nunit-project-loader.csproj", configuration);
BuildProject("./src/NUnitEngine/Addins/vs-project-loader/vs-project-loader.csproj", configuration);
BuildProject("./src/NUnitEngine/Addins/nunit-v2-result-writer/nunit-v2-result-writer.csproj", configuration);
BuildProject("./src/NUnitEngine/Addins/nunit.v2.driver/nunit.v2.driver.csproj", configuration);

Expand Down Expand Up @@ -692,16 +692,16 @@ void BuildProject(string projectPath, string configuration, MSBuildPlatform buil
);
}
}

void RunTest(FilePath exePath, DirectoryPath workingDir, string framework, ref List<string> errorDetail)
{
int rc = StartProcess(
MakeAbsolute(exePath),
MakeAbsolute(exePath),
new ProcessSettings()
{
WorkingDirectory = workingDir
});

if (rc > 0)
errorDetail.Add(string.Format("{0}: {1} tests failed",framework, rc));
else if (rc < 0)
Expand All @@ -711,13 +711,13 @@ void RunTest(FilePath exePath, DirectoryPath workingDir, string framework, ref L
void RunTest(FilePath exePath, DirectoryPath workingDir, string arguments, string framework, ref List<string> errorDetail)
{
int rc = StartProcess(
MakeAbsolute(exePath),
MakeAbsolute(exePath),
new ProcessSettings()
{
Arguments = arguments,
WorkingDirectory = workingDir
});

if (rc > 0)
errorDetail.Add(string.Format("{0}: {1} tests failed",framework, rc));
else if (rc < 0)
Expand All @@ -740,7 +740,7 @@ Task("Build")
.IsDependentOn("BuildAllFrameworks")
.IsDependentOn("BuildEngine")
.IsDependentOn("BuildConsole");

Task("Rebuild")
.IsDependentOn("Clean")
.IsDependentOn("Build");
Expand Down

0 comments on commit c19d23c

Please sign in to comment.