Skip to content

Commit

Permalink
Convert .cake to use DotNetCore* instead of MSBuild
Browse files Browse the repository at this point in the history
Update GitVersionTask to 5.3.7 because of issue with dotnet build GitTools/GitVersion#2063
  • Loading branch information
Jared Oelderink-Wale committed Sep 2, 2020
1 parent c1128d2 commit c50f627
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 22 deletions.
28 changes: 10 additions & 18 deletions build.cake
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand All @@ -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 <IsPackable> to false)
MSBuild(solutionFile, settings);
DotNetCorePack(solutionFile, new DotNetCorePackSettings
{
Configuration = configuration,
OutputDirectory = artifactDirectory
});
});

//////////////////////////////////////////////////////////////////////
Expand Down
4 changes: 2 additions & 2 deletions src/FileCache.Signed/FileCache.Signed.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@

<ItemGroup>
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0-*" PrivateAssets="All" />
<PackageReference Include="GitVersionTask" Version="5.1.2">
<PackageReference Include="GitVersionTask" Version="5.3.7">
<PrivateAssets>All</PrivateAssets>
</PackageReference>
</ItemGroup>
Expand All @@ -57,6 +57,6 @@
<PackageReference Include="System.Runtime.Caching" Version="4.5.0" />
</ItemGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'netstandard2.1' ">
<PackageReference Include="System.Runtime.Caching" Version="4.7.0" />
<PackageReference Include="System.Runtime.Caching" Version="4.5.0" />
</ItemGroup>
</Project>
4 changes: 2 additions & 2 deletions src/FileCache/FileCache.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

<ItemGroup>
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0-*" PrivateAssets="All" />
<PackageReference Include="GitVersionTask" Version="5.1.2">
<PackageReference Include="GitVersionTask" Version="5.3.7">
<PrivateAssets>All</PrivateAssets>
</PackageReference>
</ItemGroup>
Expand All @@ -47,6 +47,6 @@
<PackageReference Include="System.Runtime.Caching" Version="4.5.0" />
</ItemGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'netstandard2.1' ">
<PackageReference Include="System.Runtime.Caching" Version="4.7.0" />
<PackageReference Include="System.Runtime.Caching" Version="4.5.0" />
</ItemGroup>
</Project>

0 comments on commit c50f627

Please sign in to comment.