Skip to content

Commit

Permalink
[master] Update dependencies from dotnet/arcade Microsoft/vstest (dot…
Browse files Browse the repository at this point in the history
…net#398)

* Update dependencies from https://github.com/microsoft/vstest build 20191202-02

- Microsoft.NET.Test.Sdk - 16.5.0-preview-20191202-02

* Update dependencies from https://github.com/dotnet/arcade build 20191203.17

- Microsoft.DotNet.XUnitExtensions - 5.0.0-beta.19603.17
- Microsoft.DotNet.XUnitConsoleRunner - 2.5.1-beta.19603.17
- Microsoft.DotNet.VersionTools.Tasks - 5.0.0-beta.19603.17
- Microsoft.DotNet.ApiCompat - 5.0.0-beta.19603.17
- Microsoft.DotNet.Arcade.Sdk - 5.0.0-beta.19603.17
- Microsoft.DotNet.Build.Tasks.Configuration - 5.0.0-beta.19603.17
- Microsoft.DotNet.Build.Tasks.Feed - 5.0.0-beta.19603.17
- Microsoft.DotNet.Build.Tasks.Packaging - 5.0.0-beta.19603.17
- Microsoft.DotNet.Build.Tasks.SharedFramework.Sdk - 5.0.0-beta.19603.17
- Microsoft.DotNet.CodeAnalysis - 5.0.0-beta.19603.17
- Microsoft.DotNet.GenAPI - 5.0.0-beta.19603.17
- Microsoft.DotNet.GenFacades - 5.0.0-beta.19603.17
- Microsoft.DotNet.Helix.Sdk - 5.0.0-beta.19603.17
- Microsoft.DotNet.RemoteExecutor - 5.0.0-beta.19603.17

* Remove manually specified package test TFMs
  • Loading branch information
dotnet-maestro[bot] authored and ViktorHofer committed Dec 4, 2019
1 parent 743dc49 commit 35f9b8d
Show file tree
Hide file tree
Showing 10 changed files with 146 additions and 116 deletions.
62 changes: 31 additions & 31 deletions eng/Version.Details.xml
Original file line number Diff line number Diff line change
Expand Up @@ -58,61 +58,61 @@
</Dependency>
</ProductDependencies>
<ToolsetDependencies>
<Dependency Name="Microsoft.DotNet.Arcade.Sdk" Version="5.0.0-beta.19577.4">
<Dependency Name="Microsoft.DotNet.Arcade.Sdk" Version="5.0.0-beta.19603.17">
<Uri>https://github.com/dotnet/arcade</Uri>
<Sha>e103549927549c5b5b8cf02479f8e3b021037001</Sha>
<Sha>b902fd6b6948e689a5128fa6d94dc7de13e6af84</Sha>
</Dependency>
<Dependency Name="Microsoft.DotNet.Helix.Sdk" Version="5.0.0-beta.19577.4">
<Dependency Name="Microsoft.DotNet.Helix.Sdk" Version="5.0.0-beta.19603.17">
<Uri>https://github.com/dotnet/arcade</Uri>
<Sha>e103549927549c5b5b8cf02479f8e3b021037001</Sha>
<Sha>b902fd6b6948e689a5128fa6d94dc7de13e6af84</Sha>
</Dependency>
<Dependency Name="Microsoft.DotNet.ApiCompat" Version="5.0.0-beta.19577.4">
<Dependency Name="Microsoft.DotNet.ApiCompat" Version="5.0.0-beta.19603.17">
<Uri>https://github.com/dotnet/arcade</Uri>
<Sha>e103549927549c5b5b8cf02479f8e3b021037001</Sha>
<Sha>b902fd6b6948e689a5128fa6d94dc7de13e6af84</Sha>
</Dependency>
<Dependency Name="Microsoft.DotNet.GenAPI" Version="5.0.0-beta.19577.4">
<Dependency Name="Microsoft.DotNet.GenAPI" Version="5.0.0-beta.19603.17">
<Uri>https://github.com/dotnet/arcade</Uri>
<Sha>e103549927549c5b5b8cf02479f8e3b021037001</Sha>
<Sha>b902fd6b6948e689a5128fa6d94dc7de13e6af84</Sha>
</Dependency>
<Dependency Name="Microsoft.DotNet.GenFacades" Version="5.0.0-beta.19577.4">
<Dependency Name="Microsoft.DotNet.GenFacades" Version="5.0.0-beta.19603.17">
<Uri>https://github.com/dotnet/arcade</Uri>
<Sha>e103549927549c5b5b8cf02479f8e3b021037001</Sha>
<Sha>b902fd6b6948e689a5128fa6d94dc7de13e6af84</Sha>
</Dependency>
<Dependency Name="Microsoft.DotNet.XUnitExtensions" Version="5.0.0-beta.19577.4">
<Dependency Name="Microsoft.DotNet.XUnitExtensions" Version="5.0.0-beta.19603.17">
<Uri>https://github.com/dotnet/arcade</Uri>
<Sha>e103549927549c5b5b8cf02479f8e3b021037001</Sha>
<Sha>b902fd6b6948e689a5128fa6d94dc7de13e6af84</Sha>
</Dependency>
<Dependency Name="Microsoft.DotNet.XUnitConsoleRunner" Version="2.5.1-beta.19577.4">
<Dependency Name="Microsoft.DotNet.XUnitConsoleRunner" Version="2.5.1-beta.19603.17">
<Uri>https://github.com/dotnet/arcade</Uri>
<Sha>e103549927549c5b5b8cf02479f8e3b021037001</Sha>
<Sha>b902fd6b6948e689a5128fa6d94dc7de13e6af84</Sha>
</Dependency>
<Dependency Name="Microsoft.DotNet.Build.Tasks.Packaging" Version="5.0.0-beta.19577.4">
<Dependency Name="Microsoft.DotNet.Build.Tasks.Packaging" Version="5.0.0-beta.19603.17">
<Uri>https://github.com/dotnet/arcade</Uri>
<Sha>e103549927549c5b5b8cf02479f8e3b021037001</Sha>
<Sha>b902fd6b6948e689a5128fa6d94dc7de13e6af84</Sha>
</Dependency>
<Dependency Name="Microsoft.DotNet.CodeAnalysis" Version="5.0.0-beta.19577.4">
<Dependency Name="Microsoft.DotNet.CodeAnalysis" Version="5.0.0-beta.19603.17">
<Uri>https://github.com/dotnet/arcade</Uri>
<Sha>e103549927549c5b5b8cf02479f8e3b021037001</Sha>
<Sha>b902fd6b6948e689a5128fa6d94dc7de13e6af84</Sha>
</Dependency>
<Dependency Name="Microsoft.DotNet.RemoteExecutor" Version="5.0.0-beta.19577.4">
<Dependency Name="Microsoft.DotNet.RemoteExecutor" Version="5.0.0-beta.19603.17">
<Uri>https://github.com/dotnet/arcade</Uri>
<Sha>e103549927549c5b5b8cf02479f8e3b021037001</Sha>
<Sha>b902fd6b6948e689a5128fa6d94dc7de13e6af84</Sha>
</Dependency>
<Dependency Name="Microsoft.DotNet.Build.Tasks.Configuration" Version="5.0.0-beta.19577.4">
<Dependency Name="Microsoft.DotNet.Build.Tasks.Configuration" Version="5.0.0-beta.19603.17">
<Uri>https://github.com/dotnet/arcade</Uri>
<Sha>e103549927549c5b5b8cf02479f8e3b021037001</Sha>
<Sha>b902fd6b6948e689a5128fa6d94dc7de13e6af84</Sha>
</Dependency>
<Dependency Name="Microsoft.DotNet.Build.Tasks.Feed" Version="5.0.0-beta.19577.4">
<Dependency Name="Microsoft.DotNet.Build.Tasks.Feed" Version="5.0.0-beta.19603.17">
<Uri>https://github.com/dotnet/arcade</Uri>
<Sha>e103549927549c5b5b8cf02479f8e3b021037001</Sha>
<Sha>b902fd6b6948e689a5128fa6d94dc7de13e6af84</Sha>
</Dependency>
<Dependency Name="Microsoft.DotNet.VersionTools.Tasks" Version="5.0.0-beta.19577.4">
<Dependency Name="Microsoft.DotNet.VersionTools.Tasks" Version="5.0.0-beta.19603.17">
<Uri>https://github.com/dotnet/arcade</Uri>
<Sha>e103549927549c5b5b8cf02479f8e3b021037001</Sha>
<Sha>b902fd6b6948e689a5128fa6d94dc7de13e6af84</Sha>
</Dependency>
<Dependency Name="Microsoft.DotNet.Build.Tasks.SharedFramework.Sdk" Version="5.0.0-beta.19577.4">
<Dependency Name="Microsoft.DotNet.Build.Tasks.SharedFramework.Sdk" Version="5.0.0-beta.19603.17">
<Uri>https://github.com/dotnet/arcade</Uri>
<Sha>e103549927549c5b5b8cf02479f8e3b021037001</Sha>
<Sha>b902fd6b6948e689a5128fa6d94dc7de13e6af84</Sha>
</Dependency>
<Dependency Name="optimization.windows_nt-x64.IBC.CoreFx" Version="99.99.99-master-20190716.1">
<Uri>https://dev.azure.com/dnceng/internal/_git/dotnet-optimization</Uri>
Expand All @@ -126,9 +126,9 @@
<Uri>https://dev.azure.com/dnceng/internal/_git/dotnet-optimization</Uri>
<Sha>d0bb63d2ec7060714e63ee4082fac48f2e57f3e2</Sha>
</Dependency>
<Dependency Name="Microsoft.NET.Test.Sdk" Version="16.4.0">
<Uri>https://github.com/Microsoft/vstest</Uri>
<Sha>ca987de449d17284f8c9806df36f42276f13962a</Sha>
<Dependency Name="Microsoft.NET.Test.Sdk" Version="16.5.0-preview-20191202-02">
<Uri>https://github.com/microsoft/vstest</Uri>
<Sha>daf9b36c71391c47d4bebae35071a5e7ac2cdc5a</Sha>
</Dependency>
</ToolsetDependencies>
</Dependencies>
22 changes: 11 additions & 11 deletions eng/Versions.props
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,16 @@
</PropertyGroup>
<PropertyGroup>
<!-- Arcade dependencies -->
<MicrosoftDotNetApiCompatVersion>5.0.0-beta.19577.4</MicrosoftDotNetApiCompatVersion>
<MicrosoftDotNetBuildTasksFeedVersion>5.0.0-beta.19577.4</MicrosoftDotNetBuildTasksFeedVersion>
<MicrosoftDotNetCodeAnalysisVersion>5.0.0-beta.19577.4</MicrosoftDotNetCodeAnalysisVersion>
<MicrosoftDotNetGenAPIVersion>5.0.0-beta.19577.4</MicrosoftDotNetGenAPIVersion>
<MicrosoftDotNetGenFacadesVersion>5.0.0-beta.19577.4</MicrosoftDotNetGenFacadesVersion>
<MicrosoftDotNetXUnitExtensionsVersion>5.0.0-beta.19577.4</MicrosoftDotNetXUnitExtensionsVersion>
<MicrosoftDotNetXUnitConsoleRunnerVersion>2.5.1-beta.19577.4</MicrosoftDotNetXUnitConsoleRunnerVersion>
<MicrosoftDotNetBuildTasksPackagingVersion>5.0.0-beta.19577.4</MicrosoftDotNetBuildTasksPackagingVersion>
<MicrosoftDotNetRemoteExecutorVersion>5.0.0-beta.19577.4</MicrosoftDotNetRemoteExecutorVersion>
<MicrosoftDotNetVersionToolsTasksVersion>5.0.0-beta.19577.4</MicrosoftDotNetVersionToolsTasksVersion>
<MicrosoftDotNetApiCompatVersion>5.0.0-beta.19603.17</MicrosoftDotNetApiCompatVersion>
<MicrosoftDotNetBuildTasksFeedVersion>5.0.0-beta.19603.17</MicrosoftDotNetBuildTasksFeedVersion>
<MicrosoftDotNetCodeAnalysisVersion>5.0.0-beta.19603.17</MicrosoftDotNetCodeAnalysisVersion>
<MicrosoftDotNetGenAPIVersion>5.0.0-beta.19603.17</MicrosoftDotNetGenAPIVersion>
<MicrosoftDotNetGenFacadesVersion>5.0.0-beta.19603.17</MicrosoftDotNetGenFacadesVersion>
<MicrosoftDotNetXUnitExtensionsVersion>5.0.0-beta.19603.17</MicrosoftDotNetXUnitExtensionsVersion>
<MicrosoftDotNetXUnitConsoleRunnerVersion>2.5.1-beta.19603.17</MicrosoftDotNetXUnitConsoleRunnerVersion>
<MicrosoftDotNetBuildTasksPackagingVersion>5.0.0-beta.19603.17</MicrosoftDotNetBuildTasksPackagingVersion>
<MicrosoftDotNetRemoteExecutorVersion>5.0.0-beta.19603.17</MicrosoftDotNetRemoteExecutorVersion>
<MicrosoftDotNetVersionToolsTasksVersion>5.0.0-beta.19603.17</MicrosoftDotNetVersionToolsTasksVersion>
<!-- Installer dependencies -->
<MicrosoftNETCoreAppVersion>5.0.0-alpha.1.19562.8</MicrosoftNETCoreAppVersion>
<MicrosoftNETCoreDotNetHostVersion>5.0.0-alpha.1.19563.6</MicrosoftNETCoreDotNetHostVersion>
Expand Down Expand Up @@ -80,7 +80,7 @@
<!-- sni -->
<RuntimeWinX64RuntimeNativeSystemDataSqlClientSniVersion>4.4.0</RuntimeWinX64RuntimeNativeSystemDataSqlClientSniVersion>
<!-- Testing -->
<MicrosoftNETTestSdkVersion>16.4.0</MicrosoftNETTestSdkVersion>
<MicrosoftNETTestSdkVersion>16.5.0-preview-20191202-02</MicrosoftNETTestSdkVersion>
<XUnitVersion>2.4.1</XUnitVersion>
<TraceEventVersion>2.0.5</TraceEventVersion>
<NewtonsoftJsonVersion>12.0.3</NewtonsoftJsonVersion>
Expand Down
65 changes: 36 additions & 29 deletions eng/common/SetupNugetSources.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
# condition: eq(variables['Agent.OS'], 'Windows_NT')
# inputs:
# filePath: $(Build.SourcesDirectory)/eng/common/SetupNugetSources.ps1
# arguments: -ConfigFile ${Env:BUILD_SOURCESDIRECTORY}/NuGet.config -Password $Env:Token
# arguments: -ConfigFile $(Build.SourcesDirectory)/NuGet.config -Password $Env:Token
# env:
# Token: $(dn-bot-dnceng-artifact-feeds-rw)

Expand Down Expand Up @@ -94,41 +94,48 @@ function InsertMaestroPrivateFeedCredentials($Sources, $Creds, $Password) {
}
}

try {
if (!(Test-Path $ConfigFile -PathType Leaf)) {
Write-PipelineTelemetryError -Category 'Build' -Message "Couldn't find the file NuGet config file: $ConfigFile"
if (!(Test-Path $ConfigFile -PathType Leaf)) {
Write-PipelineTelemetryError -Category 'Build' -Message "Eng/common/SetupNugetSources.ps1 returned a non-zero exit code. Couldn't find the NuGet config file: $ConfigFile"
ExitWithExitCode 1
}

if (!$Password) {
Write-PipelineTelemetryError -Category 'Build' -Message 'Eng/common/SetupNugetSources.ps1 returned a non-zero exit code. Please supply a valid PAT'
ExitWithExitCode 1
}
}

# Load NuGet.config
$doc = New-Object System.Xml.XmlDocument
$filename = (Get-Item $ConfigFile).FullName
$doc.Load($filename)
# Load NuGet.config
$doc = New-Object System.Xml.XmlDocument
$filename = (Get-Item $ConfigFile).FullName
$doc.Load($filename)

# Get reference to <PackageSources> or create one if none exist already
$sources = $doc.DocumentElement.SelectSingleNode("packageSources")
if ($sources -eq $null) {
$sources = $doc.CreateElement("packageSources")
$doc.DocumentElement.AppendChild($sources) | Out-Null
}
# Get reference to <PackageSources> or create one if none exist already
$sources = $doc.DocumentElement.SelectSingleNode("packageSources")
if ($sources -eq $null) {
$sources = $doc.CreateElement("packageSources")
$doc.DocumentElement.AppendChild($sources) | Out-Null
}

# Looks for a <PackageSourceCredentials> node. Create it if none is found.
$creds = $doc.DocumentElement.SelectSingleNode("packageSourceCredentials")
if ($creds -eq $null) {
$creds = $doc.CreateElement("packageSourceCredentials")
$doc.DocumentElement.AppendChild($creds) | Out-Null
}
# Looks for a <PackageSourceCredentials> node. Create it if none is found.
$creds = $doc.DocumentElement.SelectSingleNode("packageSourceCredentials")
if ($creds -eq $null) {
$creds = $doc.CreateElement("packageSourceCredentials")
$doc.DocumentElement.AppendChild($creds) | Out-Null
}

# Insert credential nodes for Maestro's private feeds
InsertMaestroPrivateFeedCredentials -Sources $sources -Creds $creds -Password $Password
# Insert credential nodes for Maestro's private feeds
InsertMaestroPrivateFeedCredentials -Sources $sources -Creds $creds -Password $Password

$dotnet3Source = $sources.SelectSingleNode("add[@key='dotnet3']")
if ($dotnet3Source -ne $null) {
AddPackageSource -Sources $sources -SourceName "dotnet3-internal" -SourceEndPoint "https://pkgs.dev.azure.com/dnceng/_packaging/dotnet3-internal/nuget/v2" -Creds $creds -Username "dn-bot" -Password $Password
AddPackageSource -Sources $sources -SourceName "dotnet3-internal-transport" -SourceEndPoint "https://pkgs.dev.azure.com/dnceng/_packaging/dotnet3-internal-transport/nuget/v2" -Creds $creds -Username "dn-bot" -Password $Password

$doc.Save($filename)
}
catch {
Write-Host $_.ScriptStackTrace
Write-PipelineTelemetryError -Category 'InitializeToolset' -Message $_
ExitWithExitCode 1

$dotnet31Source = $sources.SelectSingleNode("add[@key='dotnet3.1']")
if ($dotnet31Source -ne $null) {
AddPackageSource -Sources $sources -SourceName "dotnet3.1-internal" -SourceEndPoint "https://pkgs.dev.azure.com/dnceng/_packaging/dotnet3.1-internal/nuget/v2" -Creds $creds -Username "dn-bot" -Password $Password
AddPackageSource -Sources $sources -SourceName "dotnet3.1-internal-transport" -SourceEndPoint "https://pkgs.dev.azure.com/dnceng/_packaging/dotnet3.1-internal-transport/nuget/v2" -Creds $creds -Username "dn-bot" -Password $Password
}

$doc.Save($filename)
78 changes: 55 additions & 23 deletions eng/common/SetupNugetSources.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
# displayName: Setup Private Feeds Credentials
# inputs:
# filePath: $(Build.SourcesDirectory)/eng/common/SetupNugetSources.sh
# arguments: $BUILD_SOURCESDIRECTORY/NuGet.config $Token
# arguments: $(Build.SourcesDirectory)/NuGet.config $Token
# condition: ne(variables['Agent.OS'], 'Windows_NT')
# env:
# Token: $(dn-bot-dnceng-artifact-feeds-rw)
Expand All @@ -42,7 +42,12 @@ scriptroot="$( cd -P "$( dirname "$source" )" && pwd )"
. "$scriptroot/tools.sh"

if [ ! -f "$ConfigFile" ]; then
Write-PipelineTelemetryError -Category 'Build' -Message "Couldn't find the file NuGet config file: $ConfigFile"
Write-PipelineTelemetryError -Category 'Build' "Error: Eng/common/SetupNugetSources.sh returned a non-zero exit code. Couldn't find the NuGet config file: $ConfigFile"
ExitWithExitCode 1
fi

if [ -z "$CredToken" ]; then
Write-PipelineTelemetryError -category 'Build' "Error: Eng/common/SetupNugetSources.sh returned a non-zero exit code. Please supply a valid PAT"
ExitWithExitCode 1
fi

Expand All @@ -52,7 +57,7 @@ if [[ `uname -s` == "Darwin" ]]; then
fi

# Ensure there is a <packageSources>...</packageSources> section.
grep -i "<packageSources>" $ConfigFile
grep -i "<packageSources>" $ConfigFile
if [ "$?" != "0" ]; then
echo "Adding <packageSources>...</packageSources> section."
ConfigNodeHeader="<configuration>"
Expand All @@ -62,7 +67,7 @@ if [ "$?" != "0" ]; then
fi

# Ensure there is a <packageSourceCredentials>...</packageSourceCredentials> section.
grep -i "<packageSourceCredentials>" $ConfigFile
grep -i "<packageSourceCredentials>" $ConfigFile
if [ "$?" != "0" ]; then
echo "Adding <packageSourceCredentials>...</packageSourceCredentials> section."

Expand All @@ -72,37 +77,64 @@ if [ "$?" != "0" ]; then
sed -i.bak "s|$PackageSourcesNodeFooter|$PackageSourcesNodeFooter${NL}$PackageSourceCredentialsTemplate|" NuGet.config
fi

# Ensure dotnet3-internal and dotnet3-internal-transport is in the packageSources
grep -i "<add key=\"dotnet3-internal\">" $ConfigFile
if [ "$?" != "0" ]; then
echo "Adding dotnet3-internal to the packageSources."
PackageSources=()

PackageSourcesNodeFooter="</packageSources>"
PackageSourceTemplate="${TB}<add key=\"dotnet3-internal\" value=\"https://pkgs.dev.azure.com/dnceng/_packaging/dotnet3-internal/nuget/v2\" />"
# Ensure dotnet3-internal and dotnet3-internal-transport are in the packageSources if the public dotnet3 feeds are present
grep -i "<add key=\"dotnet3\"" $ConfigFile

if [ "$?" == "0" ]; then
grep -i "<add key=\"dotnet3-internal\">" $ConfigFile
if [ "$?" != "0" ]; then
echo "Adding dotnet3-internal to the packageSources."
PackageSourcesNodeFooter="</packageSources>"
PackageSourceTemplate="${TB}<add key=\"dotnet3-internal\" value=\"https://pkgs.dev.azure.com/dnceng/_packaging/dotnet3-internal/nuget/v2\" />"

sed -i.bak "s|$PackageSourcesNodeFooter|$PackageSourceTemplate${NL}$PackageSourcesNodeFooter|" $ConfigFile
fi
PackageSources+=('dotnet3-internal')

grep -i "<add key=\"dotnet3-internal-transport\"" $ConfigFile
if [ "$?" != "0" ]; then
echo "Adding dotnet3-internal-transport to the packageSources."
PackageSourcesNodeFooter="</packageSources>"
PackageSourceTemplate="${TB}<add key=\"dotnet3-internal-transport\" value=\"https://pkgs.dev.azure.com/dnceng/_packaging/dotnet3-internal-transport/nuget/v2\" />"

sed -i.bak "s|$PackageSourcesNodeFooter|$PackageSourceTemplate${NL}$PackageSourcesNodeFooter|" NuGet.config
sed -i.bak "s|$PackageSourcesNodeFooter|$PackageSourceTemplate${NL}$PackageSourcesNodeFooter|" $ConfigFile
fi
PackageSources+=('dotnet3-internal-transport')
fi

# Ensure dotnet3-internal and dotnet3-internal-transport is in the packageSources
grep -i "<add key=\"dotnet3-internal-transport\">" $ConfigFile
if [ "$?" != "0" ]; then
echo "Adding dotnet3-internal-transport to the packageSources."
# Ensure dotnet3.1-internal and dotnet3.1-internal-transport are in the packageSources if the public dotnet3.1 feeds are present
grep -i "<add key=\"dotnet3.1\"" $ConfigFile
if [ "$?" == "0" ]; then
grep -i "<add key=\"dotnet3.1-internal\"" $ConfigFile
if [ "$?" != "0" ]; then
echo "Adding dotnet3.1-internal to the packageSources."
PackageSourcesNodeFooter="</packageSources>"
PackageSourceTemplate="${TB}<add key=\"dotnet3.1-internal\" value=\"https://pkgs.dev.azure.com/dnceng/_packaging/dotnet3.1-internal/nuget/v2\" />"

PackageSourcesNodeFooter="</packageSources>"
PackageSourceTemplate="${TB}<add key=\"dotnet3-internal-transport\" value=\"https://pkgs.dev.azure.com/dnceng/_packaging/dotnet3-internal-transport/nuget/v2\" />"
sed -i.bak "s|$PackageSourcesNodeFooter|$PackageSourceTemplate${NL}$PackageSourcesNodeFooter|" $ConfigFile
fi
PackageSources+=('dotnet3.1-internal')

grep -i "<add key=\"dotnet3.1-internal-transport\">" $ConfigFile
if [ "$?" != "0" ]; then
echo "Adding dotnet3.1-internal-transport to the packageSources."
PackageSourcesNodeFooter="</packageSources>"
PackageSourceTemplate="${TB}<add key=\"dotnet3.1-internal-transport\" value=\"https://pkgs.dev.azure.com/dnceng/_packaging/dotnet3.1-internal-transport/nuget/v2\" />"

sed -i.bak "s|$PackageSourcesNodeFooter|$PackageSourceTemplate${NL}$PackageSourcesNodeFooter|" NuGet.config
sed -i.bak "s|$PackageSourcesNodeFooter|$PackageSourceTemplate${NL}$PackageSourcesNodeFooter|" $ConfigFile
fi
PackageSources+=('dotnet3.1-internal-transport')
fi

# I want things split line by line
PrevIFS=$IFS
IFS=$'\n'
PackageSources=$(grep -oh '"darc-int-[^"]*"' $ConfigFile | tr -d '"')
PackageSources+="$IFS"
PackageSources+=$(grep -oh '"darc-int-[^"]*"' $ConfigFile | tr -d '"')
IFS=$PrevIFS

PackageSources+=('dotnet3-internal')
PackageSources+=('dotnet3-internal-transport')

for FeedName in ${PackageSources[@]} ; do
# Check if there is no existing credential for this FeedName
grep -i "<$FeedName>" $ConfigFile
Expand All @@ -112,6 +144,6 @@ for FeedName in ${PackageSources[@]} ; do
PackageSourceCredentialsNodeFooter="</packageSourceCredentials>"
NewCredential="${TB}${TB}<$FeedName>${NL}<add key=\"Username\" value=\"dn-bot\" />${NL}<add key=\"ClearTextPassword\" value=\"$CredToken\" />${NL}</$FeedName>"

sed -i.bak "s|$PackageSourceCredentialsNodeFooter|$NewCredential${NL}$PackageSourceCredentialsNodeFooter|" NuGet.config
sed -i.bak "s|$PackageSourceCredentialsNodeFooter|$NewCredential${NL}$PackageSourceCredentialsNodeFooter|" $ConfigFile
fi
done
Loading

0 comments on commit 35f9b8d

Please sign in to comment.