Fix RestoreSources for optdata packages
authorWes Haggard <Wes.Haggard@microsoft.com>
Wed, 21 Mar 2018 23:40:34 +0000 (16:40 -0700)
committerWes Haggard <Wes.Haggard@microsoft.com>
Tue, 27 Mar 2018 20:07:02 +0000 (13:07 -0700)
Pass unprocessed args to restore optdata step so it
can override the sources when doing restore

Handle prority as an unprocessed arg for the sync alias

build.cmd
build.proj
build.sh
config.json
src/.nuget/optdata/nuget.config [deleted file]
src/.nuget/optdata/optdata.csproj

index 889a196..a83e111 100644 (file)
--- a/build.cmd
+++ b/build.cmd
@@ -337,7 +337,7 @@ REM ============================================================================
 
 if %__RestoreOptData% EQU 1 if %__BuildTypeRelease% EQU 1 (
     echo %__MsgPrefix%Restoring the OptimizationData Package
-    @call %__ProjectDir%\run.cmd sync -optdata
+    @call %__ProjectDir%\run.cmd sync -optdata %__UnprocessedBuildArgs%
     if not !errorlevel! == 0 (
         echo %__MsgPrefix%Error: Failed to restore the optimization data package.
         exit /b 1
index eabe0e5..bbec187 100644 (file)
 
   <Target Name="RestoreOptData">
     <PropertyGroup>
-      <OptDataRestoreCommand>"$(DotnetToolCommand)"</OptDataRestoreCommand>
-      <OptDataRestoreCommand>$(OptDataRestoreCommand) restore</OptDataRestoreCommand>
-      <OptDataRestoreCommand>$(OptDataRestoreCommand) --packages "$(PackagesDir.TrimEnd('/').TrimEnd('\'))"</OptDataRestoreCommand>
+      <_OptimizationDataFeed Condition="'$(DotNetBuildOffline)' != 'true'">--source https://dotnet.myget.org/F/dotnet-core-optimization-data/api/v3/index.json</_OptimizationDataFeed>
     </PropertyGroup>
-    <Exec Command="$(OptDataRestoreCommand) $(SourceDir).nuget/optdata/optdata.csproj" 
-         StandardOutputImportance="Low" />
+
+    <Exec Command="$(DotnetRestoreCommand) $(_OptimizationDataFeed) $(SourceDir).nuget/optdata/optdata.csproj"
+          StandardOutputImportance="Low" />
   </Target>
 
   <!--
@@ -52,5 +51,5 @@
     <Message Condition="Exists($(RootBinDir))" Importance="High" Text="Removing $(RootBinDir)"/>
     <RemoveDir Directories="$(RootBinDir)" />
   </Target>
-  
+
 </Project>
index 43502bf..8516894 100755 (executable)
--- 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
+        "$__ProjectRoot/run.sh" sync -optdata $__UnprocessedBuildArgs
         if [ $? != 0 ]; then
             echo "Failed to restore the optimization data package."
             exit 1
index 1725bc0..915c318 100644 (file)
@@ -53,7 +53,7 @@
       "valueType": "target",
       "values": [],
       "defaultValue": ""
-    },    
+    },
     "ContainerName": {
       "description": "Container name for Azure upload.",
       "valueType": "property",
             "RestoreOptData": "default"
           }
         },
+        "priority": {
+          "description": "Sets CLRTestPriorityToBuild property.",
+          "settings": {
+            "CLRTestPriorityToBuild": "default"
+          }
+        },
         "ab": {
           "description": "Downloads the latests product packages from Azure. The values for '-AzureAccount' and '-AzureToken' are required",
           "settings": {
diff --git a/src/.nuget/optdata/nuget.config b/src/.nuget/optdata/nuget.config
deleted file mode 100644 (file)
index e747f7e..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<configuration>
- <packageSources>
-    <add key="myget.org dotnet-core-optimization-data" value="https://dotnet.myget.org/F/dotnet-core-optimization-data/api/v3/index.json" />
- </packageSources>
-</configuration>
index 76b5b97..20e2a40 100644 (file)
@@ -8,14 +8,6 @@
     <RuntimeIdentifiers>win7-x64;win7-x86;linux-x64</RuntimeIdentifiers>
   </PropertyGroup>
 
-  <!-- Add optimization data package restore source. -->
-  <PropertyGroup>
-    <RestoreSources Condition="'$(DotNetBuildOffline)' != 'true'">
-      https://dotnet.myget.org/F/dotnet-core-optimization-data/api/v3/index.json;
-      $(RestoreSources)
-    </RestoreSources>
-  </PropertyGroup>
-
   <ItemGroup>
     <PackageReference Include="optimization.PGO.CoreCLR" Version="$(PgoDataPackageVersion)" Condition="'$(PgoDataPackageVersion)'!=''" />
     <PackageReference Include="optimization.IBC.CoreCLR" Version="$(IbcDataPackageVersion)" Condition="'$(IbcDataPackageVersion)'!=''" />