From c50f627bcb066f280f8c224856ce1f9fd7092b91 Mon Sep 17 00:00:00 2001 From: Jared Oelderink-Wale Date: Wed, 2 Sep 2020 17:02:57 +1200 Subject: [PATCH] Convert .cake to use DotNetCore* instead of MSBuild Update GitVersionTask to 5.3.7 because of issue with dotnet build https://github.com/GitTools/GitVersion/issues/2063 --- build.cake | 28 +++++++------------- src/FileCache.Signed/FileCache.Signed.csproj | 4 +-- src/FileCache/FileCache.csproj | 4 +-- 3 files changed, 14 insertions(+), 22 deletions(-) diff --git a/build.cake b/build.cake index 159152f..4bb8a9d 100644 --- a/build.cake +++ b/build.cake @@ -37,23 +37,17 @@ Task("Clean") Task("Restore-NuGet-Packages") .Does(() => { - MSBuild(solutionFile, settings => - settings - .WithTarget("Restore") - .SetConfiguration(configuration) - ); + DotNetCoreRestore(solutionFile); }); Task("Build") .IsDependentOn("Restore-NuGet-Packages") .Does(() => { - // Use MSBuild for the Sln, but deploy - MSBuild(solutionFile, settings => - settings - .WithTarget("Build") - .SetConfiguration(configuration) - ); + DotNetCoreBuild(solutionFile, new DotNetCoreBuildSettings + { + Configuration = Argument("configuration", configuration) + }); }); Task("Test") @@ -73,13 +67,11 @@ Task("Create-NuGet-Packages") .IsDependentOn("Build") .Does(() => { - var settings = new MSBuildSettings() - .WithTarget("Pack") - .SetConfiguration(configuration) - .WithProperty("PackageOutputPath",artifactDirectory); - - // Pack the Sln (unit tests has the to false) - MSBuild(solutionFile, settings); + DotNetCorePack(solutionFile, new DotNetCorePackSettings + { + Configuration = configuration, + OutputDirectory = artifactDirectory + }); }); ////////////////////////////////////////////////////////////////////// diff --git a/src/FileCache.Signed/FileCache.Signed.csproj b/src/FileCache.Signed/FileCache.Signed.csproj index 7c3c442..05f23aa 100644 --- a/src/FileCache.Signed/FileCache.Signed.csproj +++ b/src/FileCache.Signed/FileCache.Signed.csproj @@ -39,7 +39,7 @@ - + All @@ -57,6 +57,6 @@ - + \ No newline at end of file diff --git a/src/FileCache/FileCache.csproj b/src/FileCache/FileCache.csproj index e63a6ad..f0b9dd1 100644 --- a/src/FileCache/FileCache.csproj +++ b/src/FileCache/FileCache.csproj @@ -29,7 +29,7 @@ - + All @@ -47,6 +47,6 @@ - + \ No newline at end of file