Skip to content

Commit

Permalink
Use dotnet in Cake
Browse files Browse the repository at this point in the history
(cherry picked from commit 29f993e)
  • Loading branch information
ltrzesniewski committed Jan 21, 2019
1 parent 465af71 commit 46b0179
Showing 1 changed file with 6 additions and 16 deletions.
22 changes: 6 additions & 16 deletions build/build.cake
Expand Up @@ -7,7 +7,6 @@ var target = Argument("target", "Default");
var paths = new {
src = MakeAbsolute(Directory("./../src")).FullPath,
solution = MakeAbsolute(File("./../src/Abc.Zebus.sln")).FullPath,
props = MakeAbsolute(File("./../src/Directory.Build.props")).FullPath,
nugetOutput = MakeAbsolute(Directory("./../output/nuget")).FullPath,
};

Expand All @@ -21,12 +20,13 @@ Task("Clean").Does(() =>
CleanDirectory(paths.nugetOutput);
});

Task("Restore-NuGet-Packages").Does(() => NuGetRestore(paths.solution));

Task("MSBuild").Does(() => MSBuild(paths.solution, settings => settings
Task("Compile").Does(() => DotNetCoreMSBuild(paths.solution, new DotNetCoreMSBuildSettings()
.WithTarget("Restore")
.WithTarget("Rebuild")
.WithTarget("Pack")
.SetConfiguration("Release")
.SetVerbosity(Verbosity.Minimal)
.WithProperty("PackageOutputPath", paths.nugetOutput)
.SetMaxCpuCount(0)
));

Task("Run-Unit-Tests").Does(() =>
Expand All @@ -44,23 +44,13 @@ Task("Run-Unit-Tests").Does(() =>
}
});

Task("NuGet-Pack").Does(() => MSBuild(paths.solution, settings => settings
.WithTarget("Pack")
.SetConfiguration("Release")
.SetPlatformTarget(PlatformTarget.MSIL)
.SetVerbosity(Verbosity.Minimal)
.WithProperty("PackageOutputPath", paths.nugetOutput)
));

//////////////////////////////////////////////////////////////////////
// TASK TARGETS
//////////////////////////////////////////////////////////////////////

Task("Build")
.IsDependentOn("Clean")
.IsDependentOn("Restore-NuGet-Packages")
.IsDependentOn("MSBuild")
.IsDependentOn("NuGet-Pack");
.IsDependentOn("Compile");

Task("Test")
.IsDependentOn("Build")
Expand Down

0 comments on commit 46b0179

Please sign in to comment.