Skip to content

Commit

Permalink
fix: Restore with MSBuild settings
Browse files Browse the repository at this point in the history
Otherwise, consecutive builds of different target runtimes would fail
due to the currently built target not being included in
`project.assets.json`.
  • Loading branch information
trungnt2910 authored Jan 5, 2024
1 parent a325fcb commit 50cd8a7
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions build.cake
Original file line number Diff line number Diff line change
Expand Up @@ -73,20 +73,25 @@ Task("Restore")
.IsDependentOn("Clean")
.Does(() =>
{
var settings = new DotNetRestoreSettings
{
MSBuildSettings = msbuildsettings,
};

foreach (var name in coreLibraryNames)
{
DotNetRestore($"src/{name}/{name}.csproj");
DotNetRestore($"src/{name}/{name}.csproj", settings);
}

foreach (var name in packNames)
{
DotNetRestore($"workload/{name}/{name}.csproj");
DotNetRestore($"workload/{name}/{name}.csproj", settings);
}

DotNetRestore("workload/Haiku.Templates/Haiku.Templates.csproj");
DotNetRestore("workload/Trungnt2910.NET.Sdk.Haiku/Trungnt2910.NET.Sdk.Haiku.csproj");
DotNetRestore("generator/HaikuApiGenerator/HaikuApiGenerator.csproj");
DotNetRestore("generator/HaikuApiGenerator.PostProcessing/HaikuApiGenerator.PostProcessing.csproj");
DotNetRestore("workload/Haiku.Templates/Haiku.Templates.csproj", settings);
DotNetRestore("workload/Trungnt2910.NET.Sdk.Haiku/Trungnt2910.NET.Sdk.Haiku.csproj", settings);
DotNetRestore("generator/HaikuApiGenerator/HaikuApiGenerator.csproj", settings);
DotNetRestore("generator/HaikuApiGenerator.PostProcessing/HaikuApiGenerator.PostProcessing.csproj", settings);
});

Task("Clean")
Expand Down

0 comments on commit 50cd8a7

Please sign in to comment.