Skip to content

Commit 4420a7d

Browse files
authored
Small fixes (#21982)
* Restore default "/bl" setting if `$BinaryLog` nits: - remove extra configure-toolset.ps1|sh imports - remove duplicate `/v:$verbosity` addition to `msbuild` command line from build.sh * Correct the feeds to match latest recommendations
1 parent 58cf230 commit 4420a7d

File tree

3 files changed

+27
-23
lines changed

3 files changed

+27
-23
lines changed

NuGet.config

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,12 @@
22
<configuration>
33
<packageSources>
44
<clear />
5-
<add key="dotnet-core" value="https://dotnetfeed.blob.core.windows.net/dotnet-core/index.json" />
65
<add key="dotnet-eng" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-eng/nuget/v3/index.json" />
6+
<add key="dotnet-tools" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools/nuget/v3/index.json" />
77
<add key="dotnet5" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet5/nuget/v3/index.json" />
88
<add key="dotnet5-transport" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet5-transport/nuget/v3/index.json" />
99
<add key="roslyn" value="https://dotnet.myget.org/F/roslyn/api/v3/index.json" />
1010
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" />
11-
<add key="aspnetcore-dev" value="https://dotnet.myget.org/F/aspnetcore-dev/api/v3/index.json" />
12-
<add key="aspnetcore-tools" value="https://dotnet.myget.org/F/aspnetcore-tools/api/v3/index.json" />
1311
<add key="roslyn-tools" value="https://dotnet.myget.org/F/roslyn-tools/api/v3/index.json" />
1412
<!-- Used for the SiteExtension 3.1 bits that are included in the 5.0 build -->
1513
<add key="dotnet31-transport" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet3.1-transport/nuget/v3/index.json" />

build.ps1

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -253,9 +253,7 @@ $RunRestore = if ($NoRestore) { $false }
253253
# Target selection
254254
$MSBuildArguments += "/p:Restore=$RunRestore"
255255
$MSBuildArguments += "/p:Build=$RunBuild"
256-
if (-not $RunBuild) {
257-
$MSBuildArguments += "/p:NoBuild=true"
258-
}
256+
if (-not $RunBuild) { $MSBuildArguments += "/p:NoBuild=true" }
259257
$MSBuildArguments += "/p:Pack=$Pack"
260258
$MSBuildArguments += "/p:Test=$Test"
261259
$MSBuildArguments += "/p:Sign=$Sign"
@@ -364,18 +362,20 @@ Remove-Item variable:global:_MSBuildExe -ea Ignore
364362
# Import Arcade
365363
. "$PSScriptRoot/eng/common/tools.ps1"
366364

365+
# Add default .binlog location if not already on the command line. tools.ps1 does not handle this; it just checks
366+
# $BinaryLog, $CI and $ExcludeCIBinarylog values for an error case. But tools.ps1 provides a nice function to help.
367+
if ($BinaryLog) {
368+
$bl = GetMSBuildBinaryLogCommandLineArgument($MSBuildArguments)
369+
if (-not $bl) {
370+
$MSBuildArguments += "/bl:" + (Join-Path $LogDir "Build.binlog")
371+
}
372+
}
373+
367374
# Capture MSBuild crash logs
368375
$env:MSBUILDDEBUGPATH = $LogDir
369376

370377
$local:exit_code = $null
371378
try {
372-
# Import custom tools configuration, if present in the repo.
373-
# Note: Import in global scope so that the script set top-level variables without qualification.
374-
$configureToolsetScript = Join-Path $EngRoot "configure-toolset.ps1"
375-
if (Test-Path $configureToolsetScript) {
376-
. $configureToolsetScript
377-
}
378-
379379
# Set this global property so Arcade will always initialize the toolset. The error message you get when you build on a clean machine
380380
# with -norestore is not obvious about what to do to fix it. As initialization takes very little time, we think always initializing
381381
# the toolset is a better default behavior.

build.sh

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -288,10 +288,6 @@ if [ -z "$configuration" ]; then
288288
fi
289289
msbuild_args[${#msbuild_args[*]}]="-p:Configuration=$configuration"
290290

291-
# Set verbosity
292-
echo "Setting msbuild verbosity to $verbosity"
293-
msbuild_args[${#msbuild_args[*]}]="-verbosity:$verbosity"
294-
295291
# Set up additional runtime args
296292
toolset_build_args=()
297293
if [ ! -z "$dotnet_runtime_source_feed$dotnet_runtime_source_feed_key" ]; then
@@ -328,15 +324,25 @@ fi
328324
# Import Arcade
329325
. "$DIR/eng/common/tools.sh"
330326

327+
# Add default .binlog location if not already on the command line. tools.sh does not handle this; it just checks
328+
# $binary_log, $ci and $exclude_ci_binary_log values for an error case.
329+
if [[ "$binary_log" == true ]]; then
330+
found=false
331+
for arg in "${msbuild_args[@]}"; do
332+
opt="$(echo "${arg/#--/-}" | awk '{print tolower($0)}')"
333+
if [[ "$opt" == [-/]bl:* || "$opt" == [-/]binarylogger:* ]]; then
334+
found=true
335+
break
336+
fi
337+
done
338+
if [[ "$found" == false ]]; then
339+
msbuild_args[${#msbuild_args[*]}]="/bl:$log_dir/Build.binlog"
340+
fi
341+
fi
342+
331343
# Capture MSBuild crash logs
332344
export MSBUILDDEBUGPATH="$log_dir"
333345

334-
# Import custom tools configuration, if present in the repo.
335-
configure_toolset_script="$eng_root/configure-toolset.sh"
336-
if [[ -a "$configure_toolset_script" ]]; then
337-
. "$configure_toolset_script"
338-
fi
339-
340346
# Set this global property so Arcade will always initialize the toolset. The error message you get when you build on a clean machine
341347
# with -norestore is not obvious about what to do to fix it. As initialization takes very little time, we think always initializing
342348
# the toolset is a better default behavior.

0 commit comments

Comments
 (0)