Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Commit 13dfb52

Browse files
authored
Merge pull request #17226 from weshaggard/MergeRestoreTargets
Merge various restore tasks into one Sync target
2 parents b6fa213 + ee5c25a commit 13dfb52

9 files changed

+34
-33
lines changed

build.cmd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,7 @@ REM ============================================================================
325325

326326
if %__RestoreOptData% EQU 1 if %__BuildTypeRelease% EQU 1 (
327327
echo %__MsgPrefix%Restoring the OptimizationData Package
328-
@call %__ProjectDir%\run.cmd sync -optdata %__UnprocessedBuildArgs%
328+
@call %__ProjectDir%\run.cmd build -optdata %__RunArgs% %__UnprocessedBuildArgs%
329329
if not !errorlevel! == 0 (
330330
echo %__MsgPrefix%Error: Failed to restore the optimization data package.
331331
exit /b 1

build.proj

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,15 @@
2626
<Delete Files="$(BinDir)System.Private.CoreLib.*" />
2727
</Target>
2828

29-
<Target Name="RestoreOptData">
29+
<!--
30+
BuildTools will conditionally restore additional packages, including IBC tools, using the "RestoreOptionalToolingPackages"
31+
target, which runs automatically before "Sync". Since no "Sync" target actually exists, go ahead and define one now so that
32+
the tools are fetched before "Build".
33+
-->
34+
<Target Name="Sync" BeforeTargets="Build"
35+
DependsOnTargets="RestoreOptData;RestoreNETCorePlatforms" />
36+
37+
<Target Name="RestoreOptData" Condition="'$(RestoreDuringBuild)'=='true' and '$(BuildType)'=='Release'">
3038
<PropertyGroup>
3139
<_OptimizationDataFeed Condition="'$(DotNetBuildOffline)' != 'true'">--source https://dotnet.myget.org/F/dotnet-core-optimization-data/api/v3/index.json</_OptimizationDataFeed>
3240
</PropertyGroup>
@@ -35,14 +43,7 @@
3543
StandardOutputImportance="Low" />
3644
</Target>
3745

38-
<!--
39-
BuildTools will conditionally restore additional packages, including IBC tools, using the "RestoreOptionalToolingPackages"
40-
target, which runs automatically before "Sync". Since no "Sync" target actually exists, go ahead and define one now so that
41-
the tools are fetched before "Build".
42-
-->
43-
<Target Name="Sync" BeforeTargets="Build" />
44-
45-
<Target Name="RestoreNETCorePlatforms" AfterTargets="Build" Condition="'$(RestoreDuringBuild)'=='true'">
46+
<Target Name="RestoreNETCorePlatforms" Condition="'$(RestoreDuringBuild)'=='true'">
4647
<Exec Command="$(DotnetRestoreCommand) $(SourceDir).nuget/init/init.csproj"
4748
StandardOutputImportance="Low" />
4849
</Target>

build.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ restore_optdata()
169169

170170
if [[ ( $__SkipRestoreOptData == 0 ) && ( $__isMSBuildOnNETCoreSupported == 1 ) ]]; then
171171
echo "Restoring the OptimizationData package"
172-
"$__ProjectRoot/run.sh" sync -optdata $__UnprocessedBuildArgs
172+
"$__ProjectRoot/run.sh" build -optdata $__RunArgs $__UnprocessedBuildArgs
173173
if [ $? != 0 ]; then
174174
echo "Failed to restore the optimization data package."
175175
exit 1

buildpipeline/DotNet-CoreClr-Trusted-Linux-Crossbuild.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@
115115
},
116116
"inputs": {
117117
"filename": "docker",
118-
"arguments": "run --rm $(DockerCommonRunArgs) ./sync.sh",
118+
"arguments": "run --rm $(DockerCommonRunArgs) ./sync.sh -- /p:BuildType=$(PB_BuildType)",
119119
"workingFolder": "",
120120
"failOnStandardError": "false"
121121
}

buildpipeline/DotNet-CoreClr-Trusted-Linux.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@
115115
},
116116
"inputs": {
117117
"filename": "docker",
118-
"arguments": "run --rm $(DockerCommonRunArgs) ./sync.sh",
118+
"arguments": "run --rm $(DockerCommonRunArgs) ./sync.sh -- /p:BuildType=$(PB_BuildType)",
119119
"workingFolder": "",
120120
"failOnStandardError": "false"
121121
}

buildpipeline/DotNet-CoreClr-Trusted-Mac.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
},
3636
"inputs": {
3737
"filename": "$(Agent.BuildDirectory)/s/sync.sh",
38-
"arguments": "",
38+
"arguments": " -- /p:BuildType=$(PB_BuildType)",
3939
"workingFolder": "",
4040
"failOnStandardError": "false"
4141
}

buildpipeline/DotNet-CoreClr-Trusted-Windows-x86.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@
7777
},
7878
"inputs": {
7979
"filename": "sync.cmd",
80-
"arguments": "-p",
80+
"arguments": "-p -- /p:BuildType=$(PB_BuildType)",
8181
"workingFolder": "",
8282
"failOnStandardError": "false"
8383
}

buildpipeline/DotNet-CoreClr-Trusted-Windows.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@
7777
},
7878
"inputs": {
7979
"filename": "sync.cmd",
80-
"arguments": "-p",
80+
"arguments": "-p -- /p:BuildType=$(PB_BuildType)",
8181
"workingFolder": "",
8282
"failOnStandardError": "false"
8383
}

config.json

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,8 @@
8484
"values": [ "Windows_NT", "Linux", "Unix", "OSX", "Android" ],
8585
"defaultValue": "${OSName}"
8686
},
87-
"RestoreNETCorePlatforms": {
88-
"description": "MsBuild target that restores the NETCore packages.",
87+
"Sync": {
88+
"description": "MsBuild target that restores the packages.",
8989
"valueType": "target",
9090
"values": [],
9191
"defaultValue": ""
@@ -527,6 +527,14 @@
527527
"settings": {
528528
"Build": "default"
529529
}
530+
},
531+
"optdata": {
532+
"description": "Restores optimization profile data for the repository.",
533+
"settings": {
534+
"Project": "./build.proj",
535+
"RestoreOptData": "default",
536+
"MsBuildEventLogging": " ",
537+
}
530538
}
531539
},
532540
"defaultValues": {
@@ -578,21 +586,7 @@
578586
"settings": {
579587
"Project": "./build.proj",
580588
"RestoreDuringBuild": true,
581-
"RestoreNETCorePlatforms": "default"
582-
}
583-
},
584-
"optdata": {
585-
"description": "Restores optimization profile data for the repository.",
586-
"settings": {
587-
"Project": "./build.proj",
588-
"RestoreDuringBuild": true,
589-
"RestoreOptData": "default"
590-
}
591-
},
592-
"priority": {
593-
"description": "Sets CLRTestPriorityToBuild property.",
594-
"settings": {
595-
"CLRTestPriorityToBuild": "default"
589+
"Sync": "default"
596590
}
597591
},
598592
"ab": {
@@ -655,6 +649,12 @@
655649
"settings": {
656650
"BuildNumberMinor": "default"
657651
}
652+
},
653+
"buildType": {
654+
"description": "Sets buildtype.",
655+
"settings": {
656+
"__BuildType": "default"
657+
}
658658
}
659659
},
660660
"defaultValues": {

0 commit comments

Comments
 (0)