From a83061099bbfde0d13908909a50c7129f8a30bac Mon Sep 17 00:00:00 2001 From: Aditya Patwardhan Date: Wed, 31 Oct 2018 16:38:29 -0700 Subject: [PATCH 1/3] Add function to create a nuget config file --- build.psm1 | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/build.psm1 b/build.psm1 index 1330f1bd6f6..cab491d8f43 100644 --- a/build.psm1 +++ b/build.psm1 @@ -3053,3 +3053,35 @@ function New-TestPackage [System.IO.Compression.ZipFile]::CreateFromDirectory($packageRoot, $packagePath) } + +function New-NugetConfigFile +{ + param( + [Parameter(Mandatory=$true)] [string] $NugetFeedUrl, + [Parameter(Mandatory=$true)] [string] $FeedName, + [Parameter(Mandatory=$true)] [string] $UserName, + [Parameter(Mandatory=$true)] [string] $ClearTextPAT, + [Parameter(Mandatory=$true)] [string] $Destination + ) + + $nugetConfigTemplate = @' + + + + + + + + + <[FEEDNAME]> + + + + + +'@ + + $content = $nugetConfigTemplate.Replace('[FEED]', $NugetFeedUrl).Replace('[FEEDNAME]', $FeedName).Replace('[USERNAME]', $UserName).Replace('[PASSWORD]', $ClearTextPAT) + + Set-Content -Path (Join-Path $Destination 'nuget.config') -Value $content -Force +} From 80a8be2973a856a02ad8b8a31b993f02c17e55bc Mon Sep 17 00:00:00 2001 From: Aditya Patwardhan Date: Wed, 31 Oct 2018 17:21:13 -0700 Subject: [PATCH 2/3] Add the nuget.config file to git clean exclude --- build.psm1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.psm1 b/build.psm1 index cab491d8f43..005e16ccbd2 100644 --- a/build.psm1 +++ b/build.psm1 @@ -271,7 +271,7 @@ function Start-PSBuild { Push-Location $PSScriptRoot try { # Excluded sqlite3 folder is due to this Roslyn issue: https://github.com/dotnet/roslyn/issues/23060 - git clean -fdx --exclude .vs/PowerShell/v15/Server/sqlite3 + git clean -fdx --exclude .vs/PowerShell/v15/Server/sqlite3 --exclude src/Modules/nuget.config } finally { Pop-Location } From 43ca19229523edd4aca7336c1dd6b6cd1fa160da Mon Sep 17 00:00:00 2001 From: Aditya Patwardhan Date: Mon, 5 Nov 2018 10:01:40 -0800 Subject: [PATCH 3/3] Added comment --- build.psm1 | 1 + 1 file changed, 1 insertion(+) diff --git a/build.psm1 b/build.psm1 index 005e16ccbd2..a4fcd3aa486 100644 --- a/build.psm1 +++ b/build.psm1 @@ -271,6 +271,7 @@ function Start-PSBuild { Push-Location $PSScriptRoot try { # Excluded sqlite3 folder is due to this Roslyn issue: https://github.com/dotnet/roslyn/issues/23060 + # Excluded src/Modules/nuget.config as this is required for release build. git clean -fdx --exclude .vs/PowerShell/v15/Server/sqlite3 --exclude src/Modules/nuget.config } finally { Pop-Location