Skip to content

Commit 243f90d

Browse files
wtgodbemmitchedougbu
authored
Use Arcade's DownloadFiles task (#46039)
* Conflict * Archive this * Add the usingtask for DownloadFile * Use Arcade's `DownloadFile` in Windows hosting bundle - was still trying to use our version * !fixups! - don't try internal download location in public builds - use two targets to make Product.targets more readable Co-authored-by: Matt Mitchell <[email protected]> Co-authored-by: Doug Bunting <[email protected]>
1 parent 1dd6b05 commit 243f90d

File tree

5 files changed

+46
-179
lines changed

5 files changed

+46
-179
lines changed

eng/Versions.props

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -305,10 +305,4 @@
305305
<DotnetServeVersion>1.10.93</DotnetServeVersion>
306306
<MicrosoftPlaywrightCLIVersion>1.2.3</MicrosoftPlaywrightCLIVersion>
307307
</PropertyGroup>
308-
<!-- Restore feeds -->
309-
<PropertyGroup Label="Restore feeds">
310-
<!-- In an orchestrated build, this may be overridden to other Azure feeds. -->
311-
<DotNetAssetRootUrl Condition="'$(DotNetAssetRootUrl)'==''">https://dotnetbuilds.azureedge.net/public/</DotNetAssetRootUrl>
312-
<DotNetPrivateAssetRootUrl Condition="'$(DotNetPrivateAssetRootUrl)'==''">https://dotnetclimsrc.blob.core.windows.net/dotnet/</DotNetPrivateAssetRootUrl>
313-
</PropertyGroup>
314308
</Project>

eng/tools/RepoTasks/DownloadFile.cs

Lines changed: 0 additions & 148 deletions
This file was deleted.

eng/tools/RepoTasks/RepoTasks.tasks

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,5 @@
1010
<UsingTask TaskName="RepoTasks.GenerateSharedFrameworkDepsFile" AssemblyFile="$(_RepoTaskAssembly)" />
1111
<UsingTask TaskName="RepoTasks.CreateFrameworkListFile" AssemblyFile="$(_RepoTaskAssembly)" />
1212
<UsingTask TaskName="RepoTasks.RemoveSharedFrameworkDependencies" AssemblyFile="$(_RepoTaskAssembly)" />
13-
<UsingTask TaskName="RepoTasks.DownloadFile" AssemblyFile="$(_RepoTaskAssembly)" />
13+
<UsingTask TaskName="DownloadFile" AssemblyFile="$(ArcadeSdkBuildTasksAssembly)" />
1414
</Project>

src/Framework/App.Runtime/src/Microsoft.AspNetCore.App.Runtime.csproj

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,7 @@ This package is an internal implementation of the .NET Core SDK and is not meant
3232

3333
<!-- Use the BrowserDebugHost as a sentinel for the nonshipping version for .NETCoreApp -->
3434
<DotNetRuntimeArchiveFileName>dotnet-runtime-$(MicrosoftNETCoreAppRuntimeVersion)-$(TargetRuntimeIdentifier)$(ArchiveExtension)</DotNetRuntimeArchiveFileName>
35-
<DotNetRuntimeDownloadUrl>$(DotNetAssetRootUrl)Runtime/$(MicrosoftNETCoreBrowserDebugHostTransportVersion)/$(DotNetRuntimeArchiveFileName)</DotNetRuntimeDownloadUrl>
36-
<DotNetRuntimePrivateDownloadUrl>$(DotNetPrivateAssetRootUrl)Runtime/$(MicrosoftNETCoreBrowserDebugHostTransportVersion)/$(DotNetRuntimeArchiveFileName)</DotNetRuntimePrivateDownloadUrl>
35+
<DotNetRuntimeDownloadPath>Runtime/$(MicrosoftNETCoreBrowserDebugHostTransportVersion)/$(DotNetRuntimeArchiveFileName)</DotNetRuntimeDownloadPath>
3736
<DotNetRuntimeArchive>$(BaseIntermediateOutputPath)$(DotNetRuntimeArchiveFileName)</DotNetRuntimeArchive>
3837

3938
<!-- Setting this suppresses getting documentation .xml files in the shared runtime output. -->
@@ -514,11 +513,21 @@ This package is an internal implementation of the .NET Core SDK and is not meant
514513
#########################################
515514
-->
516515
<Target Name="_DownloadAndExtractDotNetRuntime" Condition="'$(DotNetBuildFromSource)' != 'true'">
517-
<DownloadFile Condition=" ! Exists('$(DotNetRuntimeArchive)')"
518-
Uri="$(DotNetRuntimeDownloadUrl)"
519-
PrivateUri="$(DotNetRuntimePrivateDownloadUrl)"
520-
PrivateUriSuffix="$(DotNetAssetRootAccessTokenSuffix)"
521-
DestinationPath="$(DotNetRuntimeArchive)" />
516+
<!-- Try various places to find the runtime. It's either released (use official version),
517+
public but un-released (use dotnetbuilds/public), or internal and unreleased (use dotnetbuilds/internal) -->
518+
<ItemGroup>
519+
<UrisToDownload Include="https://dotnetcli.azureedge.net/dotnet/$(DotNetRuntimeDownloadPath)" />
520+
<UrisToDownload Include="https://dotnetbuilds.azureedge.net/public/$(DotNetRuntimeDownloadPath)" />
521+
<UrisToDownload Include="https://dotnetbuilds.azureedge.net/internal/$(DotNetRuntimeDownloadPath)"
522+
Condition=" '$(DotnetRuntimeSourceFeedKey)' != '' ">
523+
<token>$(DotnetRuntimeSourceFeedKey)</token>
524+
</UrisToDownload>
525+
</ItemGroup>
526+
527+
<DownloadFile Condition=" !Exists('$(DotNetRuntimeArchive)') "
528+
Uris="@(UrisToDownload)"
529+
DestinationPath="$(DotNetRuntimeArchive)" />
530+
522531
<RemoveDir Directories="$(RedistSharedFrameworkLayoutRoot)" />
523532
<MakeDir Directories="$(RedistSharedFrameworkLayoutRoot)" />
524533

src/Installers/Windows/WindowsHostingBundle/Product.targets

Lines changed: 29 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -25,37 +25,49 @@
2525
</RuntimeInstallers>
2626
</ItemGroup>
2727

28-
<Target Name="FetchDependencies" BeforeTargets="Restore;CollectPackageReferences">
29-
<PropertyGroup>
30-
<DotNetAssetRootUrl Condition=" '$(DotNetAssetRootUrl)' == '' ">https://dotnetcli.azureedge.net/dotnet/</DotNetAssetRootUrl>
31-
<DotNetAssetRootUrl Condition=" ! $(DotNetAssetRootUrl.EndsWith('/'))">$(DotNetAssetRootUrl)/</DotNetAssetRootUrl>
32-
<DotNetPrivateAssetRootUrl Condition=" '$(DotNetPrivateAssetRootUrl)' == '' ">https://dotnetclimsrc.azureedge.net/dotnet/</DotNetPrivateAssetRootUrl>
33-
<DotNetPrivateAssetRootUrl Condition=" ! $(DotNetPrivateAssetRootUrl.EndsWith('/'))">$(DotNetPrivateAssetRootUrl)/</DotNetPrivateAssetRootUrl>
34-
</PropertyGroup>
35-
28+
<!--
29+
Runs before FetchDependencies but can't be depended up because this sets up the item group that target
30+
uses for batching.
31+
-->
32+
<Target Name="CollectDependencies" BeforeTargets="Restore;CollectPackageReferences">
3633
<!-- Use the BrowserDebugHost as a sentinel for the nonshipping version for NETCoreApp. -->
3734
<ItemGroup>
38-
<RemoteAsset Include="Runtime/$(MicrosoftNETCoreBrowserDebugHostTransportVersion)/dotnet-runtime-$(MicrosoftNETCoreAppRuntimeVersion)-win-x64.exe">
35+
<RemoteAsset Include="$(MicrosoftNETCoreBrowserDebugHostTransportVersion)/dotnet-runtime-$(MicrosoftNETCoreAppRuntimeVersion)-win-x64.exe">
3936
<TargetFileName>dotnet-runtime-$(MicrosoftNETCoreAppRuntimeVersion)-win-x64.exe</TargetFileName>
4037
</RemoteAsset>
41-
<RemoteAsset Include="Runtime/$(MicrosoftNETCoreBrowserDebugHostTransportVersion)/dotnet-runtime-$(MicrosoftNETCoreAppRuntimeVersion)-win-x86.exe">
38+
<RemoteAsset Include="$(MicrosoftNETCoreBrowserDebugHostTransportVersion)/dotnet-runtime-$(MicrosoftNETCoreAppRuntimeVersion)-win-x86.exe">
4239
<TargetFileName>dotnet-runtime-$(MicrosoftNETCoreAppRuntimeVersion)-win-x86.exe</TargetFileName>
4340
</RemoteAsset>
44-
<RemoteAsset Include="Runtime/$(MicrosoftNETCoreBrowserDebugHostTransportVersion)/dotnet-runtime-$(MicrosoftNETCoreAppRuntimeVersion)-win-arm64.exe">
41+
<RemoteAsset Include="$(MicrosoftNETCoreBrowserDebugHostTransportVersion)/dotnet-runtime-$(MicrosoftNETCoreAppRuntimeVersion)-win-arm64.exe">
4542
<TargetFileName>dotnet-runtime-$(MicrosoftNETCoreAppRuntimeVersion)-win-arm64.exe</TargetFileName>
4643
</RemoteAsset>
4744
</ItemGroup>
4845

4946
<MakeDir Directories="$(DepsPath)" />
47+
</Target>
48+
49+
<Target Name="FetchDependencies" BeforeTargets="Restore;CollectPackageReferences"
50+
Outputs="$(DepsPath)%(RemoteAsset.TargetFilename)">
51+
<!--
52+
Try various places to find the runtime. It's either released (use official version), public but
53+
unreleased (use dotnetbuilds/public), or internal and unreleased (use dotnetbuilds/internal).
54+
-->
55+
<ItemGroup>
56+
<UrisToDownload Remove="@(UrisToDownload)" />
57+
<UrisToDownload Include="https://dotnetcli.azureedge.net/dotnet/Runtime/%(RemoteAsset.Identity)" />
58+
<UrisToDownload Include="https://dotnetbuilds.azureedge.net/public/Runtime/%(RemoteAsset.Identity)" />
59+
<UrisToDownload Include="https://dotnetbuilds.azureedge.net/internal/Runtime/%(RemoteAsset.Identity)"
60+
Condition=" '$(DotnetRuntimeSourceFeedKey)' != '' ">
61+
<token>$(DotnetRuntimeSourceFeedKey)</token>
62+
</UrisToDownload>
63+
</ItemGroup>
5064

51-
<DownloadFile Condition=" ! Exists('$(DepsPath)%(RemoteAsset.TargetFileName)') "
52-
Uri="$(DotNetAssetRootUrl)%(RemoteAsset.Identity)"
53-
PrivateUri="$(DotNetPrivateAssetRootUrl)%(RemoteAsset.Identity)"
54-
PrivateUriSuffix="$(DotNetAssetRootAccessTokenSuffix)"
55-
DestinationPath="$(DepsPath)%(RemoteAsset.TargetFileName)" />
65+
<DownloadFile Condition=" ! Exists('$(DepsPath)%(RemoteAsset.TargetFilename)') "
66+
Uris="@(UrisToDownload)"
67+
DestinationPath="$(DepsPath)%(RemoteAsset.TargetFilename)" />
5668
</Target>
5769

58-
<Target Name="ExtractPropertiesFromDotNetMsi" DependsOnTargets="FetchDependencies" BeforeTargets="BeforeBuild">
70+
<Target Name="ExtractPropertiesFromDotNetMsi" DependsOnTargets="CollectDependencies;FetchDependencies" BeforeTargets="BeforeBuild">
5971
<!-- Create properties that holds the executable name. These are passed to the bundles so we can reference them as variables
6072
from inside the ExePackage authoring. -->
6173
<CreateProperty Value="%(RuntimeInstallers.Filename)%(Extension)">

0 commit comments

Comments
 (0)