From 383f44bf9fadab8f23fce5870044d27e03fbed10 Mon Sep 17 00:00:00 2001 From: Nate McMaster Date: Tue, 1 May 2018 15:41:24 -0700 Subject: [PATCH] Workaround peculiar caching behaviors in NuGetSdkResovler when NUGET_PACKAGES is set --- .appveyor.yml | 2 +- .gitignore | 1 + .travis.yml | 2 +- build.ps1 | 5 ++++- build.sh | 7 ++++++- modules/BundledPackages/BundledPackages.proj | 8 ++++++-- modules/BundledPackages/NuGet.config | 7 +++++++ scripts/bootstrapper/run.sh | 2 +- 8 files changed, 27 insertions(+), 7 deletions(-) create mode 100644 modules/BundledPackages/NuGet.config diff --git a/.appveyor.yml b/.appveyor.yml index c5c582b..8dc5d51 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -7,7 +7,7 @@ branches: - /^release\/.*/ - /^(.*\/)?ci-.*$/ build_script: - - ps: .\build.ps1 + - ps: .\build.ps1 -ci clone_depth: 1 test: off deploy: off diff --git a/.gitignore b/.gitignore index b634b57..523876b 100644 --- a/.gitignore +++ b/.gitignore @@ -25,3 +25,4 @@ global.json launchSettings.json korebuild-lock.txt *.binlog +.dotnet/ diff --git a/.travis.yml b/.travis.yml index 9c258ca..74d4407 100644 --- a/.travis.yml +++ b/.travis.yml @@ -18,4 +18,4 @@ branches: - /^release\/.*/ - /^(.*\/)?ci-.*$/ script: - - ./build.sh + - ./build.sh --ci diff --git a/build.ps1 b/build.ps1 index 046e274..39fecdc 100755 --- a/build.ps1 +++ b/build.ps1 @@ -4,6 +4,8 @@ <# .DESCRIPTION Builds this repository +.PARAMETER CI + Treat build as a CI build .PARAMETER SkipTests Skip tests .PARAMETER DotNetHome @@ -21,6 +23,7 @@ #> [CmdletBinding(PositionalBinding = $false)] param( + [switch]$CI, [switch]$SkipTests, [string]$DotNetHome = $null, [string]$ToolsSource = 'https://aspnetcore.blob.core.windows.net/buildtools', @@ -62,7 +65,7 @@ try { $MSBuildArguments += "-p:DotNetRestoreSources=$RestoreSources" } - Set-KoreBuildSettings -ToolsSource $ToolsSource -DotNetHome $DotNetHome -RepoPath $PSScriptRoot -ConfigFile $ConfigFile + Set-KoreBuildSettings -ToolsSource $ToolsSource -DotNetHome $DotNetHome -RepoPath $PSScriptRoot -ConfigFile $ConfigFile -CI:$CI Invoke-KoreBuildCommand "default-build" @MSBuildArguments } finally { diff --git a/build.sh b/build.sh index b64a5c5..3f2924e 100755 --- a/build.sh +++ b/build.sh @@ -14,6 +14,7 @@ __usage() { echo " -v|--verbose Show verbose output." echo " -d|--dotnet-home The directory where .NET Core tools will be stored. Defaults to '$DOTNET_HOME'." echo " -s|--tools-source The base url where build tools can be downloaded. Defaults to '$tools_source'." + echo " --ci Apply CI specific settings and environment variables." exit 2 } @@ -25,6 +26,7 @@ __usage() { config_file="$DIR/korebuild.json" tools_source='https://aspnetcore.blob.core.windows.net/buildtools' verbose=false +ci=false while [[ $# -gt 0 ]]; do case $1 in -\?|-h|--help) @@ -43,6 +45,9 @@ while [[ $# -gt 0 ]]; do -v|--verbose) verbose=true ;; + --ci|-[Cc][Ii]) + ci=true + ;; --) shift break @@ -54,6 +59,6 @@ while [[ $# -gt 0 ]]; do shift done -set_korebuildsettings "$tools_source" "$DOTNET_HOME" "$DIR" "$config_file" +set_korebuildsettings "$tools_source" "$DOTNET_HOME" "$DIR" "$config_file" "$ci" invoke_korebuild_command "default-build" "$@" diff --git a/modules/BundledPackages/BundledPackages.proj b/modules/BundledPackages/BundledPackages.proj index 5b04bc5..3c641f5 100644 --- a/modules/BundledPackages/BundledPackages.proj +++ b/modules/BundledPackages/BundledPackages.proj @@ -23,21 +23,25 @@ + + + netcoreapp2.0 true + - + ]]> - + diff --git a/modules/BundledPackages/NuGet.config b/modules/BundledPackages/NuGet.config new file mode 100644 index 0000000..b344265 --- /dev/null +++ b/modules/BundledPackages/NuGet.config @@ -0,0 +1,7 @@ + + + + + + + diff --git a/scripts/bootstrapper/run.sh b/scripts/bootstrapper/run.sh index 4606a42..27e7d7a 100755 --- a/scripts/bootstrapper/run.sh +++ b/scripts/bootstrapper/run.sh @@ -186,7 +186,7 @@ while [[ $# -gt 0 ]]; do --reinstall|-[Rr]einstall) reinstall=true ;; - --ci) + --ci|-[Cc][Ii]) ci=true ;; --verbose|-Verbose)