Skip to content

Commit

Permalink
StartProcess commands replaced with internal cake methods.
Browse files Browse the repository at this point in the history
  • Loading branch information
Blind-Striker committed Jul 18, 2018
1 parent ef6d490 commit 737c2a1
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 21 deletions.
2 changes: 0 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,5 @@ branches:
- /.*/
before_script:
- chmod +x ./build.sh
before_install:
- sudo apt install nuget
script:
- ./build.sh
37 changes: 19 additions & 18 deletions build.cake
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,11 @@ Task("Compile")
Arguments = "--info"
});
StartProcess("dotnet", new ProcessSettings {
Arguments = "restore ./src/Cake.Electron.Net.sln"
});
DotNetCoreBuildSettings settings = new DotNetCoreBuildSettings();
settings.Configuration = configuration;
StartProcess("dotnet", new ProcessSettings {
Arguments = $"build ./src/Tests/Cake.Electron.Net.Tests/Cake.Electron.Net.Tests.csproj -c {configuration}"
});
DotNetCoreRestore("./src/Cake.Electron.Net.sln");
DotNetCoreBuild($"./src/Tests/Cake.Electron.Net.Tests/Cake.Electron.Net.Tests.csproj", settings);
});

Task("Test")
Expand All @@ -34,27 +32,30 @@ Task("Test")
.Does(() =>
{
string appveyor = IsRunningOnUnix() ? string.Empty : " --test-adapter-path:. --logger:Appveyor";
string testProjectPath = "./src/Tests/Cake.Electron.Net.Tests/Cake.Electron.Net.Tests.csproj";
DotNetCoreTestSettings settings = new DotNetCoreTestSettings();
settings.Configuration = configuration;
settings.Framework = netCoreTarget;
settings.ArgumentCustomization = args => args.Append(appveyor);
Information($"Running {netCoreTarget.ToUpper()} Tests");
Information($"Running {fullFrameworkTarget.ToUpper()} Tests");
DotNetCoreTest(testProjectPath, settings);
if(!IsRunningOnUnix())
Information($"Running {fullFrameworkTarget.ToUpper()} Tests");
if(!IsRunningOnUnix()) //Appveyor
{
StartProcess("dotnet", new ProcessSettings {
Arguments = $"test ./src/Tests/Cake.Electron.Net.Tests/Cake.Electron.Net.Tests.csproj -c {configuration} -f {fullFrameworkTarget}{appveyor}"
});
settings.Framework = fullFrameworkTarget;
DotNetCoreTest(testProjectPath, settings);
}
else
else // Travis
{
StartProcess("mono", new ProcessSettings {
Arguments = $"./tools/xunit.runner.console/{fullFrameworkTarget}/xunit.console.exe ./src/Tests/Cake.Electron.Net.Tests/bin/Release/{fullFrameworkTarget}/Cake.Electron.Net.Tests.dll"
});
}
Information($"Running {netCoreTarget.ToUpper()} Tests");
StartProcess("dotnet", new ProcessSettings {
Arguments = $"test ./src/Tests/Cake.Electron.Net.Tests/Cake.Electron.Net.Tests.csproj -c {configuration} -f {netCoreTarget}{appveyor}"
});
});

Task("Init")
Expand Down
1 change: 0 additions & 1 deletion build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ $CAKE_VERSION="0.27.2"

$TOOLS_DIR = Join-Path $PSScriptRoot "tools"
$CAKE_EXE = Join-Path $TOOLS_DIR "/Cake.CoreCLR.$CAKE_VERSION/cake.coreclr/$CAKE_VERSION/Cake.dll"
$NUGET_URL = "https://dist.nuget.org/win-x86-commandline/latest/nuget.exe"

# Make sure tools folder exists
if ((Test-Path $PSScriptRoot) -and !(Test-Path $TOOLS_DIR)) {
Expand Down

0 comments on commit 737c2a1

Please sign in to comment.