Skip to content

Commit bb9d4b9

Browse files
brettfobaronfel
authored andcommitted
add build telemetry for Linux/MacOS builds
1 parent 495dc77 commit bb9d4b9

File tree

1 file changed

+16
-4
lines changed

1 file changed

+16
-4
lines changed

eng/build.sh

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ function TestUsingNUnit() {
178178
args="test \"$testproject\" --no-restore --no-build -c $configuration -f $targetframework --test-adapter-path . --logger \"nunit;LogFilePath=$testlogpath\""
179179
"$DOTNET_INSTALL_DIR/dotnet" $args || {
180180
local exit_code=$?
181-
echo "dotnet test failed (exit code '$exit_code')." >&2
181+
Write-PipelineTelemetryError -category 'Test' "dotnet test failed for $testproject:$targetframework (exit code $exit_code)."
182182
ExitWithExitCode $exit_code
183183
}
184184
}
@@ -228,7 +228,11 @@ function BuildSolution {
228228
MSBuild "$repo_root/src/buildtools/buildtools.proj" \
229229
/restore \
230230
/p:Configuration=$bootstrap_config \
231-
/t:Publish
231+
/t:Publish || {
232+
local exit_code=$?
233+
Write-PipelineTelemetryError -category 'Build' "Error building buildtools (exit code '$exit_code')."
234+
ExitWithExitCode $exit_code
235+
}
232236

233237
mkdir -p "$bootstrap_dir"
234238
cp -pr $artifacts_dir/bin/fslex/$bootstrap_config/netcoreapp2.1/publish $bootstrap_dir/fslex
@@ -238,7 +242,11 @@ function BuildSolution {
238242
MSBuild "$repo_root/proto.proj" \
239243
/restore \
240244
/p:Configuration=$bootstrap_config \
241-
/t:Publish
245+
/t:Publish || {
246+
local exit_code=$?
247+
Write-PipelineTelemetryError -category 'Build' "Error building bootstrap compiler (exit code '$exit_code')."
248+
ExitWithExitCode $exit_code
249+
}
242250

243251
cp -pr $artifacts_dir/bin/fsc/$bootstrap_config/netcoreapp2.1/publish $bootstrap_dir/fsc
244252
fi
@@ -259,7 +267,11 @@ function BuildSolution {
259267
/p:ContinuousIntegrationBuild=$ci \
260268
/p:QuietRestore=$quiet_restore \
261269
/p:QuietRestoreBinaryLog="$binary_log" \
262-
$properties
270+
$properties || {
271+
local exit_code=$?
272+
Write-PipelineTelemetryError -category 'Build' "Error building solution (exit code '$exit_code')."
273+
ExitWithExitCode $exit_code
274+
}
263275
}
264276

265277
InitializeDotNetCli $restore

0 commit comments

Comments
 (0)