summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWes Haggard <Wes.Haggard@microsoft.com>2018-03-26 11:02:53 -0700
committerWes Haggard <Wes.Haggard@microsoft.com>2018-03-26 11:02:53 -0700
commitaf6715e91b241bfe09bfde3842f325429a35913a (patch)
treec813e68ef5365578484400c0361e78c401f2ddaf
parentb5f4d2df2e087401f2c3aab2c37021e326707915 (diff)
downloadcoreclr-af6715e91b241bfe09bfde3842f325429a35913a.tar.gz
coreclr-af6715e91b241bfe09bfde3842f325429a35913a.tar.bz2
coreclr-af6715e91b241bfe09bfde3842f325429a35913a.zip
Merge various restore tasks into one Sync target
There were various restore targets happening independently when they should all be combined so the sync step can be independent from the build step. This change merges them together under the Sync target. In particular this moves RestoreOptData and RestoreNETCorePlatforms to be part of the sync step instead of being individually ran. Pass BuildType to sync commands so optdata gets restored correctly
-rw-r--r--build.cmd2
-rw-r--r--build.proj19
-rwxr-xr-xbuild.sh2
-rw-r--r--buildpipeline/DotNet-CoreClr-Trusted-Linux-Crossbuild.json2
-rw-r--r--buildpipeline/DotNet-CoreClr-Trusted-Linux.json2
-rw-r--r--buildpipeline/DotNet-CoreClr-Trusted-Mac.json2
-rw-r--r--buildpipeline/DotNet-CoreClr-Trusted-Windows-x86.json2
-rw-r--r--buildpipeline/DotNet-CoreClr-Trusted-Windows.json2
-rw-r--r--config.json33
9 files changed, 33 insertions, 33 deletions
diff --git a/build.cmd b/build.cmd
index a9062f6083..ff1e28e565 100644
--- a/build.cmd
+++ b/build.cmd
@@ -320,7 +320,7 @@ REM ============================================================================
if %__RestoreOptData% EQU 1 if %__BuildTypeRelease% EQU 1 (
echo %__MsgPrefix%Restoring the OptimizationData Package
- @call %__ProjectDir%\run.cmd sync -optdata %__UnprocessedBuildArgs%
+ @call %__ProjectDir%\run.cmd build -optdata %__RunArgs% %__UnprocessedBuildArgs%
if not !errorlevel! == 0 (
echo %__MsgPrefix%Error: Failed to restore the optimization data package.
exit /b 1
diff --git a/build.proj b/build.proj
index bbec18785b..1a633a65b4 100644
--- a/build.proj
+++ b/build.proj
@@ -26,7 +26,15 @@
<Delete Files="$(BinDir)System.Private.CoreLib.*" />
</Target>
- <Target Name="RestoreOptData">
+ <!--
+ BuildTools will conditionally restore additional packages, including IBC tools, using the "RestoreOptionalToolingPackages"
+ target, which runs automatically before "Sync". Since no "Sync" target actually exists, go ahead and define one now so that
+ the tools are fetched before "Build".
+ -->
+ <Target Name="Sync" BeforeTargets="Build"
+ DependsOnTargets="RestoreOptData;RestoreNETCorePlatforms" />
+
+ <Target Name="RestoreOptData" Condition="'$(RestoreDuringBuild)'=='true' and '$(BuildType)'=='Release'">
<PropertyGroup>
<_OptimizationDataFeed Condition="'$(DotNetBuildOffline)' != 'true'">--source https://dotnet.myget.org/F/dotnet-core-optimization-data/api/v3/index.json</_OptimizationDataFeed>
</PropertyGroup>
@@ -35,14 +43,7 @@
StandardOutputImportance="Low" />
</Target>
- <!--
- BuildTools will conditionally restore additional packages, including IBC tools, using the "RestoreOptionalToolingPackages"
- target, which runs automatically before "Sync". Since no "Sync" target actually exists, go ahead and define one now so that
- the tools are fetched before "Build".
- -->
- <Target Name="Sync" BeforeTargets="Build" />
-
- <Target Name="RestoreNETCorePlatforms" AfterTargets="Build" Condition="'$(RestoreDuringBuild)'=='true'">
+ <Target Name="RestoreNETCorePlatforms" Condition="'$(RestoreDuringBuild)'=='true'">
<Exec Command="$(DotnetRestoreCommand) $(SourceDir).nuget/init/init.csproj"
StandardOutputImportance="Low" />
</Target>
diff --git a/build.sh b/build.sh
index d6c1be547c..9ea292eaa8 100755
--- a/build.sh
+++ b/build.sh
@@ -164,7 +164,7 @@ restore_optdata()
if [[ ( $__SkipRestoreOptData == 0 ) && ( $__isMSBuildOnNETCoreSupported == 1 ) ]]; then
echo "Restoring the OptimizationData package"
- "$__ProjectRoot/run.sh" sync -optdata $__UnprocessedBuildArgs
+ "$__ProjectRoot/run.sh" build -optdata $__RunArgs $__UnprocessedBuildArgs
if [ $? != 0 ]; then
echo "Failed to restore the optimization data package."
exit 1
diff --git a/buildpipeline/DotNet-CoreClr-Trusted-Linux-Crossbuild.json b/buildpipeline/DotNet-CoreClr-Trusted-Linux-Crossbuild.json
index db9d38d121..78d4710c7b 100644
--- a/buildpipeline/DotNet-CoreClr-Trusted-Linux-Crossbuild.json
+++ b/buildpipeline/DotNet-CoreClr-Trusted-Linux-Crossbuild.json
@@ -115,7 +115,7 @@
},
"inputs": {
"filename": "docker",
- "arguments": "run --rm $(DockerCommonRunArgs) ./sync.sh",
+ "arguments": "run --rm $(DockerCommonRunArgs) ./sync.sh -- /p:BuildType=$(PB_BuildType)",
"workingFolder": "",
"failOnStandardError": "false"
}
diff --git a/buildpipeline/DotNet-CoreClr-Trusted-Linux.json b/buildpipeline/DotNet-CoreClr-Trusted-Linux.json
index 76ac582f52..1b13a3c743 100644
--- a/buildpipeline/DotNet-CoreClr-Trusted-Linux.json
+++ b/buildpipeline/DotNet-CoreClr-Trusted-Linux.json
@@ -115,7 +115,7 @@
},
"inputs": {
"filename": "docker",
- "arguments": "run --rm $(DockerCommonRunArgs) ./sync.sh",
+ "arguments": "run --rm $(DockerCommonRunArgs) ./sync.sh -- /p:BuildType=$(PB_BuildType)",
"workingFolder": "",
"failOnStandardError": "false"
}
diff --git a/buildpipeline/DotNet-CoreClr-Trusted-Mac.json b/buildpipeline/DotNet-CoreClr-Trusted-Mac.json
index 7e7c993080..a9dffd94ce 100644
--- a/buildpipeline/DotNet-CoreClr-Trusted-Mac.json
+++ b/buildpipeline/DotNet-CoreClr-Trusted-Mac.json
@@ -35,7 +35,7 @@
},
"inputs": {
"filename": "$(Agent.BuildDirectory)/s/sync.sh",
- "arguments": "",
+ "arguments": " -- /p:BuildType=$(PB_BuildType)",
"workingFolder": "",
"failOnStandardError": "false"
}
diff --git a/buildpipeline/DotNet-CoreClr-Trusted-Windows-x86.json b/buildpipeline/DotNet-CoreClr-Trusted-Windows-x86.json
index d6584c0406..ad596adde4 100644
--- a/buildpipeline/DotNet-CoreClr-Trusted-Windows-x86.json
+++ b/buildpipeline/DotNet-CoreClr-Trusted-Windows-x86.json
@@ -77,7 +77,7 @@
},
"inputs": {
"filename": "sync.cmd",
- "arguments": "-p",
+ "arguments": "-p -- /p:BuildType=$(PB_BuildType)",
"workingFolder": "",
"failOnStandardError": "false"
}
diff --git a/buildpipeline/DotNet-CoreClr-Trusted-Windows.json b/buildpipeline/DotNet-CoreClr-Trusted-Windows.json
index ec19bea986..39b4e2a293 100644
--- a/buildpipeline/DotNet-CoreClr-Trusted-Windows.json
+++ b/buildpipeline/DotNet-CoreClr-Trusted-Windows.json
@@ -77,7 +77,7 @@
},
"inputs": {
"filename": "sync.cmd",
- "arguments": "-p",
+ "arguments": "-p -- /p:BuildType=$(PB_BuildType)",
"workingFolder": "",
"failOnStandardError": "false"
}
diff --git a/config.json b/config.json
index 915c31807c..49a5575451 100644
--- a/config.json
+++ b/config.json
@@ -84,8 +84,8 @@
"values": [ "Windows_NT", "Linux", "Unix", "OSX", "Android" ],
"defaultValue": "${OSName}"
},
- "RestoreNETCorePlatforms": {
- "description": "MsBuild target that restores the NETCore packages.",
+ "Sync": {
+ "description": "MsBuild target that restores the packages.",
"valueType": "target",
"values": [],
"defaultValue": ""
@@ -527,6 +527,13 @@
"settings": {
"Build": "default"
}
+ },
+ "optdata": {
+ "description": "Restores optimization profile data for the repository.",
+ "settings": {
+ "Project": "./build.proj",
+ "RestoreOptData": "default"
+ }
}
},
"defaultValues": {
@@ -578,21 +585,7 @@
"settings": {
"Project": "./build.proj",
"RestoreDuringBuild": true,
- "RestoreNETCorePlatforms": "default"
- }
- },
- "optdata": {
- "description": "Restores optimization profile data for the repository.",
- "settings": {
- "Project": "./build.proj",
- "RestoreDuringBuild": true,
- "RestoreOptData": "default"
- }
- },
- "priority": {
- "description": "Sets CLRTestPriorityToBuild property.",
- "settings": {
- "CLRTestPriorityToBuild": "default"
+ "Sync": "default"
}
},
"ab": {
@@ -655,6 +648,12 @@
"settings": {
"BuildNumberMinor": "default"
}
+ },
+ "buildType": {
+ "description": "Sets buildtype.",
+ "settings": {
+ "__BuildType": "default"
+ }
}
},
"defaultValues": {