Skip to content

Use Arcade's DownloadFiles task #46039

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Jan 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions eng/Versions.props
Original file line number Diff line number Diff line change
Expand Up @@ -305,10 +305,4 @@
<DotnetServeVersion>1.10.93</DotnetServeVersion>
<MicrosoftPlaywrightCLIVersion>1.2.3</MicrosoftPlaywrightCLIVersion>
</PropertyGroup>
<!-- Restore feeds -->
<PropertyGroup Label="Restore feeds">
<!-- In an orchestrated build, this may be overridden to other Azure feeds. -->
<DotNetAssetRootUrl Condition="'$(DotNetAssetRootUrl)'==''">https://dotnetbuilds.azureedge.net/public/</DotNetAssetRootUrl>
<DotNetPrivateAssetRootUrl Condition="'$(DotNetPrivateAssetRootUrl)'==''">https://dotnetclimsrc.blob.core.windows.net/dotnet/</DotNetPrivateAssetRootUrl>
</PropertyGroup>
</Project>
148 changes: 0 additions & 148 deletions eng/tools/RepoTasks/DownloadFile.cs

This file was deleted.

2 changes: 1 addition & 1 deletion eng/tools/RepoTasks/RepoTasks.tasks
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@
<UsingTask TaskName="RepoTasks.GenerateSharedFrameworkDepsFile" AssemblyFile="$(_RepoTaskAssembly)" />
<UsingTask TaskName="RepoTasks.CreateFrameworkListFile" AssemblyFile="$(_RepoTaskAssembly)" />
<UsingTask TaskName="RepoTasks.RemoveSharedFrameworkDependencies" AssemblyFile="$(_RepoTaskAssembly)" />
<UsingTask TaskName="RepoTasks.DownloadFile" AssemblyFile="$(_RepoTaskAssembly)" />
<UsingTask TaskName="DownloadFile" AssemblyFile="$(ArcadeSdkBuildTasksAssembly)" />
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,7 @@ This package is an internal implementation of the .NET Core SDK and is not meant

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

<!-- Setting this suppresses getting documentation .xml files in the shared runtime output. -->
Expand Down Expand Up @@ -514,11 +513,21 @@ This package is an internal implementation of the .NET Core SDK and is not meant
#########################################
-->
<Target Name="_DownloadAndExtractDotNetRuntime" Condition="'$(DotNetBuildFromSource)' != 'true'">
<DownloadFile Condition=" ! Exists('$(DotNetRuntimeArchive)')"
Uri="$(DotNetRuntimeDownloadUrl)"
PrivateUri="$(DotNetRuntimePrivateDownloadUrl)"
PrivateUriSuffix="$(DotNetAssetRootAccessTokenSuffix)"
DestinationPath="$(DotNetRuntimeArchive)" />
<!-- Try various places to find the runtime. It's either released (use official version),
public but un-released (use dotnetbuilds/public), or internal and unreleased (use dotnetbuilds/internal) -->
<ItemGroup>
<UrisToDownload Include="https://dotnetcli.azureedge.net/dotnet/$(DotNetRuntimeDownloadPath)" />
<UrisToDownload Include="https://dotnetbuilds.azureedge.net/public/$(DotNetRuntimeDownloadPath)" />
<UrisToDownload Include="https://dotnetbuilds.azureedge.net/internal/$(DotNetRuntimeDownloadPath)"
Condition=" '$(DotnetRuntimeSourceFeedKey)' != '' ">
<token>$(DotnetRuntimeSourceFeedKey)</token>
</UrisToDownload>
</ItemGroup>

<DownloadFile Condition=" !Exists('$(DotNetRuntimeArchive)') "
Uris="@(UrisToDownload)"
DestinationPath="$(DotNetRuntimeArchive)" />

<RemoveDir Directories="$(RedistSharedFrameworkLayoutRoot)" />
<MakeDir Directories="$(RedistSharedFrameworkLayoutRoot)" />

Expand Down
46 changes: 29 additions & 17 deletions src/Installers/Windows/WindowsHostingBundle/Product.targets
Original file line number Diff line number Diff line change
Expand Up @@ -25,37 +25,49 @@
</RuntimeInstallers>
</ItemGroup>

<Target Name="FetchDependencies" BeforeTargets="Restore;CollectPackageReferences">
<PropertyGroup>
<DotNetAssetRootUrl Condition=" '$(DotNetAssetRootUrl)' == '' ">https://dotnetcli.azureedge.net/dotnet/</DotNetAssetRootUrl>
<DotNetAssetRootUrl Condition=" ! $(DotNetAssetRootUrl.EndsWith('/'))">$(DotNetAssetRootUrl)/</DotNetAssetRootUrl>
<DotNetPrivateAssetRootUrl Condition=" '$(DotNetPrivateAssetRootUrl)' == '' ">https://dotnetclimsrc.azureedge.net/dotnet/</DotNetPrivateAssetRootUrl>
<DotNetPrivateAssetRootUrl Condition=" ! $(DotNetPrivateAssetRootUrl.EndsWith('/'))">$(DotNetPrivateAssetRootUrl)/</DotNetPrivateAssetRootUrl>
</PropertyGroup>

<!--
Runs before FetchDependencies but can't be depended up because this sets up the item group that target
uses for batching.
-->
<Target Name="CollectDependencies" BeforeTargets="Restore;CollectPackageReferences">
<!-- Use the BrowserDebugHost as a sentinel for the nonshipping version for NETCoreApp. -->
<ItemGroup>
<RemoteAsset Include="Runtime/$(MicrosoftNETCoreBrowserDebugHostTransportVersion)/dotnet-runtime-$(MicrosoftNETCoreAppRuntimeVersion)-win-x64.exe">
<RemoteAsset Include="$(MicrosoftNETCoreBrowserDebugHostTransportVersion)/dotnet-runtime-$(MicrosoftNETCoreAppRuntimeVersion)-win-x64.exe">
<TargetFileName>dotnet-runtime-$(MicrosoftNETCoreAppRuntimeVersion)-win-x64.exe</TargetFileName>
</RemoteAsset>
<RemoteAsset Include="Runtime/$(MicrosoftNETCoreBrowserDebugHostTransportVersion)/dotnet-runtime-$(MicrosoftNETCoreAppRuntimeVersion)-win-x86.exe">
<RemoteAsset Include="$(MicrosoftNETCoreBrowserDebugHostTransportVersion)/dotnet-runtime-$(MicrosoftNETCoreAppRuntimeVersion)-win-x86.exe">
<TargetFileName>dotnet-runtime-$(MicrosoftNETCoreAppRuntimeVersion)-win-x86.exe</TargetFileName>
</RemoteAsset>
<RemoteAsset Include="Runtime/$(MicrosoftNETCoreBrowserDebugHostTransportVersion)/dotnet-runtime-$(MicrosoftNETCoreAppRuntimeVersion)-win-arm64.exe">
<RemoteAsset Include="$(MicrosoftNETCoreBrowserDebugHostTransportVersion)/dotnet-runtime-$(MicrosoftNETCoreAppRuntimeVersion)-win-arm64.exe">
<TargetFileName>dotnet-runtime-$(MicrosoftNETCoreAppRuntimeVersion)-win-arm64.exe</TargetFileName>
</RemoteAsset>
</ItemGroup>

<MakeDir Directories="$(DepsPath)" />
</Target>

<Target Name="FetchDependencies" BeforeTargets="Restore;CollectPackageReferences"
Outputs="$(DepsPath)%(RemoteAsset.TargetFilename)">
<!--
Try various places to find the runtime. It's either released (use official version), public but
unreleased (use dotnetbuilds/public), or internal and unreleased (use dotnetbuilds/internal).
-->
<ItemGroup>
<UrisToDownload Remove="@(UrisToDownload)" />
<UrisToDownload Include="https://dotnetcli.azureedge.net/dotnet/Runtime/%(RemoteAsset.Identity)" />
<UrisToDownload Include="https://dotnetbuilds.azureedge.net/public/Runtime/%(RemoteAsset.Identity)" />
<UrisToDownload Include="https://dotnetbuilds.azureedge.net/internal/Runtime/%(RemoteAsset.Identity)"
Condition=" '$(DotnetRuntimeSourceFeedKey)' != '' ">
<token>$(DotnetRuntimeSourceFeedKey)</token>
</UrisToDownload>
</ItemGroup>

<DownloadFile Condition=" ! Exists('$(DepsPath)%(RemoteAsset.TargetFileName)') "
Uri="$(DotNetAssetRootUrl)%(RemoteAsset.Identity)"
PrivateUri="$(DotNetPrivateAssetRootUrl)%(RemoteAsset.Identity)"
PrivateUriSuffix="$(DotNetAssetRootAccessTokenSuffix)"
DestinationPath="$(DepsPath)%(RemoteAsset.TargetFileName)" />
<DownloadFile Condition=" ! Exists('$(DepsPath)%(RemoteAsset.TargetFilename)') "
Uris="@(UrisToDownload)"
DestinationPath="$(DepsPath)%(RemoteAsset.TargetFilename)" />
</Target>

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