diff --git a/eng/cake/dotnet.cake b/eng/cake/dotnet.cake index 4a095ecd2d0a..98169355b392 100644 --- a/eng/cake/dotnet.cake +++ b/eng/cake/dotnet.cake @@ -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, + $"", + $""); + } + DotNetCoreBuild("./src/DotNet/DotNet.csproj", new DotNetCoreBuildSettings { MSBuildSettings = new DotNetCoreMSBuildSettings() @@ -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, diff --git a/eng/pipelines/common/pack.yml b/eng/pipelines/common/pack.yml index 659c8fbc1f50..ac30423b4c28 100644 --- a/eng/pipelines/common/pack.yml +++ b/eng/pipelines/common/pack.yml @@ -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: