Use restore with no --source for optdata proj feed
authorWes Haggard <Wes.Haggard@microsoft.com>
Tue, 24 Oct 2017 23:46:07 +0000 (16:46 -0700)
committerWes Haggard <Wes.Haggard@microsoft.com>
Mon, 30 Oct 2017 20:06:26 +0000 (13:06 -0700)
This lets dotnet pick up RestoreSources hierarchically rather than only use what's predefined in DotnetRestoreCommand (in dir.props).

build.proj
src/.nuget/optdata/optdata.csproj

index 3889d1c..465e49c 100644 (file)
   </Target>
 
   <Target Name="RestoreOptData">
-    <Exec Command="$(DotnetRestoreCommand) $(SourceDir).nuget/optdata/optdata.csproj"
-          StandardOutputImportance="Low" />
+    <PropertyGroup>
+      <OptDataRestoreCommand>"$(DotnetToolCommand)"</OptDataRestoreCommand>
+      <OptDataRestoreCommand>$(OptDataRestoreCommand) restore</OptDataRestoreCommand>
+      <OptDataRestoreCommand>$(OptDataRestoreCommand) --packages "$(PackagesDir.TrimEnd('/').TrimEnd('\'))"</OptDataRestoreCommand>
+    </PropertyGroup>
+    <Exec Command="$(OptDataRestoreCommand) $(SourceDir).nuget/optdata/optdata.csproj" 
+         StandardOutputImportance="Low" />
   </Target>
 
   <!--
index 20e2a40..76b5b97 100644 (file)
@@ -8,6 +8,14 @@
     <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)'!=''" />