Skip to content

Commit 383f44b

Browse files
author
Nate McMaster
committed
Workaround peculiar caching behaviors in NuGetSdkResovler when NUGET_PACKAGES is set
1 parent a1ff4a7 commit 383f44b

File tree

8 files changed

+27
-7
lines changed

8 files changed

+27
-7
lines changed

Diff for: .appveyor.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ branches:
77
- /^release\/.*/
88
- /^(.*\/)?ci-.*$/
99
build_script:
10-
- ps: .\build.ps1
10+
- ps: .\build.ps1 -ci
1111
clone_depth: 1
1212
test: off
1313
deploy: off

Diff for: .gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,4 @@ global.json
2525
launchSettings.json
2626
korebuild-lock.txt
2727
*.binlog
28+
.dotnet/

Diff for: .travis.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,4 @@ branches:
1818
- /^release\/.*/
1919
- /^(.*\/)?ci-.*$/
2020
script:
21-
- ./build.sh
21+
- ./build.sh --ci

Diff for: build.ps1

+4-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
<#
55
.DESCRIPTION
66
Builds this repository
7+
.PARAMETER CI
8+
Treat build as a CI build
79
.PARAMETER SkipTests
810
Skip tests
911
.PARAMETER DotNetHome
@@ -21,6 +23,7 @@
2123
#>
2224
[CmdletBinding(PositionalBinding = $false)]
2325
param(
26+
[switch]$CI,
2427
[switch]$SkipTests,
2528
[string]$DotNetHome = $null,
2629
[string]$ToolsSource = 'https://aspnetcore.blob.core.windows.net/buildtools',
@@ -62,7 +65,7 @@ try {
6265
$MSBuildArguments += "-p:DotNetRestoreSources=$RestoreSources"
6366
}
6467

65-
Set-KoreBuildSettings -ToolsSource $ToolsSource -DotNetHome $DotNetHome -RepoPath $PSScriptRoot -ConfigFile $ConfigFile
68+
Set-KoreBuildSettings -ToolsSource $ToolsSource -DotNetHome $DotNetHome -RepoPath $PSScriptRoot -ConfigFile $ConfigFile -CI:$CI
6669
Invoke-KoreBuildCommand "default-build" @MSBuildArguments
6770
}
6871
finally {

Diff for: build.sh

+6-1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ __usage() {
1414
echo " -v|--verbose Show verbose output."
1515
echo " -d|--dotnet-home <DIR> The directory where .NET Core tools will be stored. Defaults to '$DOTNET_HOME'."
1616
echo " -s|--tools-source <URL> The base url where build tools can be downloaded. Defaults to '$tools_source'."
17+
echo " --ci Apply CI specific settings and environment variables."
1718
exit 2
1819
}
1920

@@ -25,6 +26,7 @@ __usage() {
2526
config_file="$DIR/korebuild.json"
2627
tools_source='https://aspnetcore.blob.core.windows.net/buildtools'
2728
verbose=false
29+
ci=false
2830
while [[ $# -gt 0 ]]; do
2931
case $1 in
3032
-\?|-h|--help)
@@ -43,6 +45,9 @@ while [[ $# -gt 0 ]]; do
4345
-v|--verbose)
4446
verbose=true
4547
;;
48+
--ci|-[Cc][Ii])
49+
ci=true
50+
;;
4651
--)
4752
shift
4853
break
@@ -54,6 +59,6 @@ while [[ $# -gt 0 ]]; do
5459
shift
5560
done
5661

57-
set_korebuildsettings "$tools_source" "$DOTNET_HOME" "$DIR" "$config_file"
62+
set_korebuildsettings "$tools_source" "$DOTNET_HOME" "$DIR" "$config_file" "$ci"
5863

5964
invoke_korebuild_command "default-build" "$@"

Diff for: modules/BundledPackages/BundledPackages.proj

+6-2
Original file line numberDiff line numberDiff line change
@@ -23,21 +23,25 @@
2323
<BundledPackageRestorerContent>
2424
<![CDATA[
2525
<Project Sdk="Microsoft.NET.Sdk">
26+
27+
<Sdk Name="Microsoft.DotNet.GlobalTools.Sdk" Version="$(Version)" />
28+
2629
<PropertyGroup>
2730
<TargetFramework>netcoreapp2.0</TargetFramework>
2831
<DisableImplicitFrameworkReferences>true</DisableImplicitFrameworkReferences>
2932
</PropertyGroup>
33+
3034
<ItemGroup>
3135
<PackageReference Include="Internal.AspNetCore.Sdk" Version="$(Version)" />
32-
<PackageReference Include="Microsoft.DotNet.GlobalTools.Sdk" Version="$(Version)" />
3336
</ItemGroup>
37+
3438
</Project>
3539
]]>
3640
</BundledPackageRestorerContent>
3741
</PropertyGroup>
3842

3943
<WriteLinesToFile File="$(PublishDir)BundledPackageRestorer.csproj" Lines="$(BundledPackageRestorerContent)" Overwrite="true" />
40-
<Copy SourceFiles="module.props;module.targets" DestinationFolder="$(PublishDir)" />
44+
<Copy SourceFiles="module.props;module.targets;NuGet.config" DestinationFolder="$(PublishDir)" />
4145
</Target>
4246

4347
</Project>

Diff for: modules/BundledPackages/NuGet.config

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<configuration>
3+
<packageSources>
4+
<clear />
5+
<add key="LocalFolder" value="./" />
6+
</packageSources>
7+
</configuration>

Diff for: scripts/bootstrapper/run.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ while [[ $# -gt 0 ]]; do
186186
--reinstall|-[Rr]einstall)
187187
reinstall=true
188188
;;
189-
--ci)
189+
--ci|-[Cc][Ii])
190190
ci=true
191191
;;
192192
--verbose|-Verbose)

0 commit comments

Comments
 (0)