From e303461ab69e539615c38157b1c54f5b6378b55d Mon Sep 17 00:00:00 2001 From: John Beisner Date: Mon, 27 Nov 2017 13:10:53 -0800 Subject: [PATCH 1/8] Changing the commit count. --- NuGet.Config | 2 -- 1 file changed, 2 deletions(-) diff --git a/NuGet.Config b/NuGet.Config index 09a1c2c1e..f2f0337f6 100644 --- a/NuGet.Config +++ b/NuGet.Config @@ -6,8 +6,6 @@ - - From e7f4fb001bebd38954cac94f75c81f9ec285ce2d Mon Sep 17 00:00:00 2001 From: John Beisner Date: Tue, 28 Nov 2017 12:54:32 -0800 Subject: [PATCH 2/8] Writing a NuGet.config as part of the preparatory steps. --- NuGet.Config | 20 ------------ build.proj | 6 ++-- build/InitRepo.props | 2 ++ build/InitRepo.targets | 3 +- build/NugetConfigFile.targets | 58 +++++++++++++++++++++++++++++++++++ run-build.ps1 | 2 +- 6 files changed, 67 insertions(+), 24 deletions(-) delete mode 100644 NuGet.Config create mode 100644 build/NugetConfigFile.targets diff --git a/NuGet.Config b/NuGet.Config deleted file mode 100644 index f2f0337f6..000000000 --- a/NuGet.Config +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - - - - - - - - - - - - - - diff --git a/build.proj b/build.proj index bac606d59..85de07477 100644 --- a/build.proj +++ b/build.proj @@ -29,10 +29,11 @@ - + + Outputs="@(RestoreDotnetCliBuildFrameworkOutputs)" + DependsOnTargets="WriteNugetConfigFile"> $(ExtraRestoreArgs) /p:GeneratePropsFile=$(GeneratePropsFile) @@ -48,6 +49,7 @@ + diff --git a/build/InitRepo.props b/build/InitRepo.props index 3a17534a9..e5ce81287 100644 --- a/build/InitRepo.props +++ b/build/InitRepo.props @@ -4,5 +4,7 @@ $(GeneratedPropsDir)/GitCommitInfo.props $(GeneratedPropsDir)/HostInfo.props $(GeneratedPropsDir)/BuildInfo.props + $(GeneratedPropsDir)/BuildInfo.props + $(RepoRoot)/NuGet.Config diff --git a/build/InitRepo.targets b/build/InitRepo.targets index be227551e..078923dec 100644 --- a/build/InitRepo.targets +++ b/build/InitRepo.targets @@ -1,6 +1,7 @@ + + + + + <?xml version="1.0" encoding="utf-8"?> + <configuration> + <packageSources> + <!--To inherit the global NuGet package sources remove the <clear/> line below --> + <clear /> + + + + <add key="PrivateBlobFeed" value="$(ExternalRestoreSources)" /> + + + + <add key="BlobFeed" value="https://dotnetfeed.blob.core.windows.net/dotnet-core/index.json" /> + <add key="templating" value="https://dotnet.myget.org/F/templating/api/v3/index.json" /> + <add key="aspnet" value="https://dotnet.myget.org/F/aspnetcore-release/api/v3/index.json" /> + <add key="websdkfeed" value="https://dotnet.myget.org/F/dotnet-web/api/v3/index.json" /> + <add key="cli-deps" value="https://dotnet.myget.org/F/cli-deps/api/v3/index.json" /> + <add key="roslyn" value="https://dotnet.myget.org/f/roslyn/api/v3/index.json" /> + <add key="symreader-native" value="https://dotnet.myget.org/f/symreader-native/api/v3/index.json" /> + <add key="xunit" value="https://www.myget.org/F/xunit/api/v3/index.json" /> + <add key="api.nuget.org" value="https://api.nuget.org/v3/index.json" /> + <add key="vstest" value="https://dotnet.myget.org/F/vstest/api/v3/index.json" /> + <add key="web-api" value="https://dotnet.myget.org/F/dotnet-web/api/v3/index.json" /> + <add key="symreader-native" value="https://dotnet.myget.org/F/symreader-native/api/v3/index.json" /> + <add key="AspNetMaster" value="https://dotnet.myget.org/F/aspnetcore-master/api/v3/index.json" /> + + + + </packageSources> + </configuration> + + + + + + + + + + + + + diff --git a/run-build.ps1 b/run-build.ps1 index 17a46a335..510f953a9 100644 --- a/run-build.ps1 +++ b/run-build.ps1 @@ -106,7 +106,7 @@ if ($NoBuild) } else { - dotnet msbuild build.proj /p:Architecture=$Architecture /p:GeneratePropsFile=true /t:WriteDynamicPropsToStaticPropsFiles + dotnet msbuild build.proj /p:Architecture=$Architecture /p:GeneratePropsFile=true /t:WriteDynamicPropsToStaticPropsFiles $ExtraParameters dotnet msbuild build.proj /m /v:normal /fl /flp:v=diag /p:Architecture=$Architecture $ExtraParameters if($LASTEXITCODE -ne 0) { throw "Failed to build" } } From 8b74ecd99b8d93ac5b56f59a3fb832a7f162e79a Mon Sep 17 00:00:00 2001 From: John Beisner Date: Tue, 28 Nov 2017 12:58:13 -0800 Subject: [PATCH 3/8] Fixing a typo... --- build/InitRepo.props | 1 - 1 file changed, 1 deletion(-) diff --git a/build/InitRepo.props b/build/InitRepo.props index e5ce81287..bc7d7e630 100644 --- a/build/InitRepo.props +++ b/build/InitRepo.props @@ -4,7 +4,6 @@ $(GeneratedPropsDir)/GitCommitInfo.props $(GeneratedPropsDir)/HostInfo.props $(GeneratedPropsDir)/BuildInfo.props - $(GeneratedPropsDir)/BuildInfo.props $(RepoRoot)/NuGet.Config From 57a2ccfb2ca035aab1b03f8bc83c1315cbda313f Mon Sep 17 00:00:00 2001 From: John Beisner Date: Tue, 28 Nov 2017 17:12:44 -0800 Subject: [PATCH 4/8] Changes per code review... --- build/NugetConfigFile.targets | 56 +++++++++++++++++++---------------- 1 file changed, 31 insertions(+), 25 deletions(-) diff --git a/build/NugetConfigFile.targets b/build/NugetConfigFile.targets index ef8c1617b..4a06d327d 100644 --- a/build/NugetConfigFile.targets +++ b/build/NugetConfigFile.targets @@ -1,38 +1,44 @@ + + + + - <?xml version="1.0" encoding="utf-8"?> - <configuration> - <packageSources> - <!--To inherit the global NuGet package sources remove the <clear/> line below --> - <clear /> + + + + + + ]]> - - <add key="PrivateBlobFeed" value="$(ExternalRestoreSources)" /> - - - <add key="BlobFeed" value="https://dotnetfeed.blob.core.windows.net/dotnet-core/index.json" /> - <add key="templating" value="https://dotnet.myget.org/F/templating/api/v3/index.json" /> - <add key="aspnet" value="https://dotnet.myget.org/F/aspnetcore-release/api/v3/index.json" /> - <add key="websdkfeed" value="https://dotnet.myget.org/F/dotnet-web/api/v3/index.json" /> - <add key="cli-deps" value="https://dotnet.myget.org/F/cli-deps/api/v3/index.json" /> - <add key="roslyn" value="https://dotnet.myget.org/f/roslyn/api/v3/index.json" /> - <add key="symreader-native" value="https://dotnet.myget.org/f/symreader-native/api/v3/index.json" /> - <add key="xunit" value="https://www.myget.org/F/xunit/api/v3/index.json" /> - <add key="api.nuget.org" value="https://api.nuget.org/v3/index.json" /> - <add key="vstest" value="https://dotnet.myget.org/F/vstest/api/v3/index.json" /> - <add key="web-api" value="https://dotnet.myget.org/F/dotnet-web/api/v3/index.json" /> - <add key="symreader-native" value="https://dotnet.myget.org/F/symreader-native/api/v3/index.json" /> - <add key="AspNetMaster" value="https://dotnet.myget.org/F/aspnetcore-master/api/v3/index.json" /> + + + + + + + + + + + + + + ]]> - </packageSources> - </configuration> + + + ]]> @@ -42,7 +48,7 @@ Date: Tue, 28 Nov 2017 17:39:35 -0800 Subject: [PATCH 5/8] Handling the possible semi-colon(s) in the property parameters. --- build.cmd | 2 +- run-build.ps1 | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/build.cmd b/build.cmd index ce681438b..da03a8be8 100644 --- a/build.cmd +++ b/build.cmd @@ -3,5 +3,5 @@ REM Copyright (c) .NET Foundation and contributors. All rights reserved. REM Licensed under the MIT license. See LICENSE file in the project root for full license information. -powershell -ExecutionPolicy Bypass -NoProfile -NoLogo -Command "& \"%~dp0run-build.ps1\" %*; exit $LastExitCode;" +powershell -ExecutionPolicy Bypass -NoProfile -NoLogo -Command "& \"%~dp0run-build.ps1\" '%*'; exit $LastExitCode;" if %errorlevel% neq 0 exit /b %errorlevel% diff --git a/run-build.ps1 b/run-build.ps1 index 510f953a9..366267f3e 100644 --- a/run-build.ps1 +++ b/run-build.ps1 @@ -80,16 +80,16 @@ $env:VSTEST_TRACE_BUILD=1 # install a stage0 $dotnetInstallPath = Join-Path $RepoRoot "scripts\obtain\dotnet-install.ps1" -Write-Output "$dotnetInstallPath -Channel ""release/2.0.0"" -InstallDir $env:DOTNET_INSTALL_DIR -Architecture ""$Architecture""" -Invoke-Expression "$dotnetInstallPath -Channel ""release/2.0.0"" -InstallDir $env:DOTNET_INSTALL_DIR -Architecture ""$Architecture""" +Write-Output "$dotnetInstallPath -InstallDir $env:DOTNET_INSTALL_DIR -Architecture ""$Architecture"" -Channel ""release/2.0.0""" +Invoke-Expression "$dotnetInstallPath -InstallDir $env:DOTNET_INSTALL_DIR -Architecture ""$Architecture"" -Channel ""release/2.0.0""" if ($LastExitCode -ne 0) { Write-Output "The .NET CLI installation failed with exit code $LastExitCode" exit $LastExitCode } -Write-Output "$dotnetInstallPath -Channel ""master"" -InstallDir $env:DOTNET_INSTALL_DIR_PJ -Architecture ""$Architecture"" -Version 1.0.0-preview2-1-003177" -Invoke-Expression "$dotnetInstallPath -Channel ""master"" -InstallDir $env:DOTNET_INSTALL_DIR_PJ -Architecture ""$Architecture"" -Version 1.0.0-preview2-1-003177" +Write-Output "$dotnetInstallPath -InstallDir $env:DOTNET_INSTALL_DIR_PJ -Architecture ""$Architecture"" -Version 1.0.0-preview2-1-003177" +Invoke-Expression "$dotnetInstallPath -InstallDir $env:DOTNET_INSTALL_DIR_PJ -Architecture ""$Architecture"" -Version 1.0.0-preview2-1-003177" if ($LastExitCode -ne 0) { Write-Output "The .NET CLI installation failed with exit code $LastExitCode" From 76dc4a510e1a3a15acf6bab7a55392c9f94899b1 Mon Sep 17 00:00:00 2001 From: John Beisner Date: Tue, 28 Nov 2017 19:00:51 -0800 Subject: [PATCH 6/8] The modification to build.cmd did not have the desired effect. --- build.cmd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.cmd b/build.cmd index da03a8be8..ce681438b 100644 --- a/build.cmd +++ b/build.cmd @@ -3,5 +3,5 @@ REM Copyright (c) .NET Foundation and contributors. All rights reserved. REM Licensed under the MIT license. See LICENSE file in the project root for full license information. -powershell -ExecutionPolicy Bypass -NoProfile -NoLogo -Command "& \"%~dp0run-build.ps1\" '%*'; exit $LastExitCode;" +powershell -ExecutionPolicy Bypass -NoProfile -NoLogo -Command "& \"%~dp0run-build.ps1\" %*; exit $LastExitCode;" if %errorlevel% neq 0 exit /b %errorlevel% From 34351d6f1eaf4b8ea09f1f23a72df677540df94f Mon Sep 17 00:00:00 2001 From: John Beisner Date: Wed, 29 Nov 2017 09:31:25 -0800 Subject: [PATCH 7/8] Ignore the NuGet.Config at the root as a source file; it is dynamically generated. --- .gitignore | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.gitignore b/.gitignore index 7bed92752..19e5af704 100644 --- a/.gitignore +++ b/.gitignore @@ -15,6 +15,9 @@ Library/ # local nuget cache .nuget/ +# NuGet.Config at the root +/NuGet.Config + # NuGet v3 restore drops these even though we don't use MSBuild :( *.nuget.targets *.nuget.props From f29acd3153386d64761f8b6f34761b6a44a4afe6 Mon Sep 17 00:00:00 2001 From: John Beisner Date: Wed, 29 Nov 2017 10:22:27 -0800 Subject: [PATCH 8/8] If the build is a 'DotNetBuildOffline'; do not write any feed lines. --- build/NugetConfigFile.targets | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/build/NugetConfigFile.targets b/build/NugetConfigFile.targets index 4a06d327d..8aba7ac72 100644 --- a/build/NugetConfigFile.targets +++ b/build/NugetConfigFile.targets @@ -16,7 +16,7 @@ ]]> - + @@ -32,7 +32,7 @@ ]]> - + ]]> - + + -