Workaround peculiar caching behaviors in NuGetSdkResovler when NUGET_PACKAGES is set
This commit is contained in:
Родитель
a1ff4a711a
Коммит
383f44bf9f
|
@ -7,7 +7,7 @@ branches:
|
|||
- /^release\/.*/
|
||||
- /^(.*\/)?ci-.*$/
|
||||
build_script:
|
||||
- ps: .\build.ps1
|
||||
- ps: .\build.ps1 -ci
|
||||
clone_depth: 1
|
||||
test: off
|
||||
deploy: off
|
||||
|
|
|
@ -25,3 +25,4 @@ global.json
|
|||
launchSettings.json
|
||||
korebuild-lock.txt
|
||||
*.binlog
|
||||
.dotnet/
|
||||
|
|
|
@ -18,4 +18,4 @@ branches:
|
|||
- /^release\/.*/
|
||||
- /^(.*\/)?ci-.*$/
|
||||
script:
|
||||
- ./build.sh
|
||||
- ./build.sh --ci
|
||||
|
|
|
@ -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 {
|
||||
|
|
7
build.sh
7
build.sh
|
@ -14,6 +14,7 @@ __usage() {
|
|||
echo " -v|--verbose Show verbose output."
|
||||
echo " -d|--dotnet-home <DIR> The directory where .NET Core tools will be stored. Defaults to '$DOTNET_HOME'."
|
||||
echo " -s|--tools-source <URL> 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" "$@"
|
||||
|
|
|
@ -23,21 +23,25 @@
|
|||
<BundledPackageRestorerContent>
|
||||
<![CDATA[
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<Sdk Name="Microsoft.DotNet.GlobalTools.Sdk" Version="$(Version)" />
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netcoreapp2.0</TargetFramework>
|
||||
<DisableImplicitFrameworkReferences>true</DisableImplicitFrameworkReferences>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Internal.AspNetCore.Sdk" Version="$(Version)" />
|
||||
<PackageReference Include="Microsoft.DotNet.GlobalTools.Sdk" Version="$(Version)" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
]]>
|
||||
</BundledPackageRestorerContent>
|
||||
</PropertyGroup>
|
||||
|
||||
<WriteLinesToFile File="$(PublishDir)BundledPackageRestorer.csproj" Lines="$(BundledPackageRestorerContent)" Overwrite="true" />
|
||||
<Copy SourceFiles="module.props;module.targets" DestinationFolder="$(PublishDir)" />
|
||||
<Copy SourceFiles="module.props;module.targets;NuGet.config" DestinationFolder="$(PublishDir)" />
|
||||
</Target>
|
||||
|
||||
</Project>
|
||||
|
|
|
@ -0,0 +1,7 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<configuration>
|
||||
<packageSources>
|
||||
<clear />
|
||||
<add key="LocalFolder" value="./" />
|
||||
</packageSources>
|
||||
</configuration>
|
|
@ -186,7 +186,7 @@ while [[ $# -gt 0 ]]; do
|
|||
--reinstall|-[Rr]einstall)
|
||||
reinstall=true
|
||||
;;
|
||||
--ci)
|
||||
--ci|-[Cc][Ii])
|
||||
ci=true
|
||||
;;
|
||||
--verbose|-Verbose)
|
||||
|
|
Загрузка…
Ссылка в новой задаче