Skip to content

Commit dc3490a

Browse files
committed
Centralize the asset download steps and set up an extensibility point for the VMR just like we have for dotnet/sdk
1 parent e6120d0 commit dc3490a

File tree

3 files changed

+30
-15
lines changed

3 files changed

+30
-15
lines changed

Directory.Build.props

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,33 @@
242242
<ArchiveExtension Condition="'$(TargetOsName)' == 'win'">.zip</ArchiveExtension>
243243
</PropertyGroup>
244244

245+
<PropertyGroup>
246+
<OfficialBaseURL>https://dotnetcli.azureedge.net/dotnet/</OfficialBaseURL>
247+
<!-- Allow overriding the public base URL for Unified Build scenarios to pull assets from a local build. -->
248+
<PublicBaseURL Condition="'$(PublicBaseURL)' == ''">https://dotnetbuilds.azureedge.net/public/</PublicBaseURL>
249+
<InternalBaseURL>https://dotnetbuilds.azureedge.net/internal/</InternalBaseURL>
250+
</PropertyGroup>
251+
252+
<!-- Try various places to find the runtime. It's either released (use official version),
253+
public but un-released (use dotnetbuilds/public), or internal and unreleased (use dotnetbuilds/internal) -->
254+
<ItemGroup Condition="'$(DotNetBuild) ' != 'true'">
255+
<RemoteAssetBaseURL Include="$(OfficialBaseURL)" />
256+
<RemoteAssetBaseURL Include="$(PublicBaseURL)" />
257+
<!-- Include the token here as we'll generate the URLs to download based on this item group. -->
258+
<RemoteAssetBaseURL Include="$(InternalBaseURL)"
259+
Condition=" '$(DotnetRuntimeSourceFeedKey)' != '' ">
260+
<token>$(DotnetRuntimeSourceFeedKey)</token>
261+
</RemoteAssetBaseURL>
262+
</ItemGroup>
263+
264+
<!--
265+
Only try downloading from the "public" base URL when doing a vertical build.
266+
In a vertical build, the public URL will be overwritten to point to local build artifacts.
267+
-->
268+
<ItemGroup Condition="'$(DotNetBuild)' == 'true'">
269+
<RemoteAssetBaseURL Include="$(PublicBaseURL)" />
270+
</ItemGroup>
271+
245272
<PropertyGroup>
246273
<!-- PackageReadmeFile specifies the package readme file name in the package. PackageReadmeFilePath points to the package readme file on disk. -->
247274
<EnableDefaultPackageReadmeFile Condition="'$(EnableDefaultPackageReadmeFile)' == '' and '$(IsShipping)' != 'false'">true</EnableDefaultPackageReadmeFile>

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

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -556,16 +556,9 @@ This package is an internal implementation of the .NET Core SDK and is not meant
556556
Targets related to creating .zip/.tar.gz
557557
#########################################
558558
-->
559-
<Target Name="_DownloadAndExtractDotNetRuntime" Condition="'$(DotNetBuild)' != 'true'">
560-
<!-- Try various places to find the runtime. It's either released (use official version),
561-
public but un-released (use dotnetbuilds/public), or internal and unreleased (use dotnetbuilds/internal) -->
559+
<Target Name="_DownloadAndExtractDotNetRuntime">
562560
<ItemGroup>
563-
<UrisToDownload Include="https://dotnetcli.azureedge.net/dotnet/$(DotNetRuntimeDownloadPath)" />
564-
<UrisToDownload Include="https://dotnetbuilds.azureedge.net/public/$(DotNetRuntimeDownloadPath)" />
565-
<UrisToDownload Include="https://dotnetbuilds.azureedge.net/internal/$(DotNetRuntimeDownloadPath)"
566-
Condition=" '$(DotnetRuntimeSourceFeedKey)' != '' ">
567-
<token>$(DotnetRuntimeSourceFeedKey)</token>
568-
</UrisToDownload>
561+
<UrisToDownload Include="@(RemoteAssetBaseURL->'%(Identity)/$(DotNetRuntimeDownloadPath)')" />
569562
</ItemGroup>
570563

571564
<DownloadFile Condition=" !Exists('$(DotNetRuntimeArchive)') "

src/Installers/Windows/WindowsHostingBundle/Product.targets

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -83,12 +83,7 @@
8383
-->
8484
<ItemGroup>
8585
<UrisToDownload Remove="@(UrisToDownload)" />
86-
<UrisToDownload Include="https://dotnetcli.azureedge.net/dotnet/Runtime/%(RemoteAsset.Identity)" />
87-
<UrisToDownload Include="https://dotnetbuilds.azureedge.net/public/Runtime/%(RemoteAsset.Identity)" />
88-
<UrisToDownload Include="https://dotnetbuilds.azureedge.net/internal/Runtime/%(RemoteAsset.Identity)"
89-
Condition=" '$(DotnetRuntimeSourceFeedKey)' != '' ">
90-
<token>$(DotnetRuntimeSourceFeedKey)</token>
91-
</UrisToDownload>
86+
<UrisToDownload Include="@(RemoteAssetBaseURL->'%(Identity)/Runtime/%(RemoteAsset.Identity)')" />
9287
</ItemGroup>
9388

9489
<DownloadFile Condition=" ! Exists('$(DepsPath)%(RemoteAsset.TargetFilename)') "

0 commit comments

Comments
 (0)