Skip to content

Commit

Permalink
[mega-pipeline] Update folder nuget source when installing .net (#13003)
Browse files Browse the repository at this point in the history
* Update folder nuget source

* Ensure create folder when adding source to nuget.config
  • Loading branch information
rmarinho authored Jan 31, 2023
1 parent 94c794a commit 6b43399
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
12 changes: 12 additions & 0 deletions eng/cake/dotnet.cake
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,17 @@ Task("dotnet")
if (!localDotnet)
return;
//We are passing a nuget folder with nuget locations
if(!string.IsNullOrEmpty(nugetSource))
{
EnsureDirectoryExists(nugetSource);
var originalNuget = File("./NuGet.config");
ReplaceTextInFiles(
originalNuget,
$"<!-- <add key=\"local\" value=\"artifacts\" /> -->",
$"<add key=\"nuget-only\" value=\"{nugetSource}\" />");
}
DotNetCoreBuild("./src/DotNet/DotNet.csproj", new DotNetCoreBuildSettings
{
MSBuildSettings = new DotNetCoreMSBuildSettings()
Expand Down Expand Up @@ -259,6 +270,7 @@ Task("dotnet-pack-maui")
//We are passing a nuget folder with nuget locations
if(!string.IsNullOrEmpty(nugetSource))
{
EnsureDirectoryExists(nugetSource);
var originalNuget = File("./NuGet.config");
ReplaceTextInFiles(
originalNuget,
Expand Down
2 changes: 1 addition & 1 deletion eng/pipelines/common/pack.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ steps:
- ${{ each pair in step }}:
${{ pair.key }}: ${{ pair.value }}

- pwsh: ./build.ps1 --target=dotnet --configuration="Release" --verbosity=diagnostic
- pwsh: ./build.ps1 --target=dotnet --configuration="Release" --verbosity=diagnostic --nugetsource="${{ parameters.nugetFolder }}"
displayName: 'Install .NET'
retryCountOnTaskFailure: 3
env:
Expand Down

0 comments on commit 6b43399

Please sign in to comment.