Skip to content

Commit

Permalink
Revert "Download and include runtime packs"
Browse files Browse the repository at this point in the history
This reverts commit 6bd1b0e.

This idea doesn't fully work yet, see:

dotnet/sdk#14044

It partially works for Android, you can do:

    > .\bin\dotnet\dotnet build .\samples\HelloMaui\HelloMaui.Android\HelloMaui.Android.csproj

But it fails if you set `$(RuntimeIdentifier)`:

    > .\bin\dotnet\dotnet build .\samples\HelloMaui\HelloMaui.Android\HelloMaui.Android.csproj -r android.21-arm
    ...
    error NU1101: Unable to find package Microsoft.Android.Runtime.android.21-arm. No packages exist with this id in source(s): Microsoft Visual Studio Offline Packages, nuget.org

I think the first one only works because we set
`$(RuntimeIdentifiers)` *plural* by default--targeting two RIDs. There
is some special `restore` logic running when you define
`$(RuntimeIdentifier)` *singular*.
  • Loading branch information
jonathanpeppers committed Feb 12, 2021
1 parent 6bd1b0e commit 69bc71f
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 40 deletions.
3 changes: 0 additions & 3 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,8 @@
<PackageVersion>0.1.0-alpha1</PackageVersion>
<DotNetVersionBand>6.0.100</DotNetVersionBand>
<DotNetVersion>$(DotNetVersionBand)-preview.1.21103.13</DotNetVersion>
<!-- After bumping $(DotNetVersion) find this version in bin/dotnet/sdk/*/dotnet.runtimeconfig.json -->
<DotNetRuntimeVersion>6.0.0-preview.1.21102.12</DotNetRuntimeVersion>
<MicrosoftAndroidVersion>11.0.200-ci.master.85</MicrosoftAndroidVersion>
<MicrosoftiOSVersion>14.3.100-ci.main.1079</MicrosoftiOSVersion>

<!-- Paths -->
<MauiOutputPath>$(MSBuildThisFileDirectory)bin/</MauiOutputPath>
<DotNetDirectory>$(MauiOutputPath)dotnet/</DotNetDirectory>
Expand Down
10 changes: 10 additions & 0 deletions samples/nuget.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<clear />
<!-- ensure only the sources defined below are used -->
<add key="dotnet6" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet6/nuget/v3/index.json" />
<add key="xamarin" value="https://pkgs.dev.azure.com/azure-public/vside/_packaging/xamarin-impl/nuget/v3/index.json" />
<add key="public" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public/nuget/v3/index.json" />
</packageSources>
</configuration>
8 changes: 4 additions & 4 deletions src/DotNet.Toolchain/DotNet.Toolchain.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
_DownloadDotNetInstallScript;
_InstallDotNet;
_AcquireWorkloads;
_AcquirePacks;
_AcquireSdks;
_CreateWorkloadSentinel;
</_ProvisionDependsOn>
</PropertyGroup>
Expand Down Expand Up @@ -47,11 +47,11 @@
<RemoveDir Directories="@(_WorkloadDirectoriesToDelete);$(DotNetSdkManifestsDirectory)Microsoft.Build.NoTargets" />
<Touch Files="$(DotNetSdkManifestsDirectory).stamp" AlwaysCreate="true" />
</Target>
<Target Name="_AcquirePacks"
Inputs="$(MSBuildAllProjects);../Maui.Dependencies/Maui.Dependencies.Packs.csproj"
<Target Name="_AcquireSdks"
Inputs="$(MSBuildAllProjects);../Maui.Dependencies/Maui.Dependencies.Sdks.csproj"
Outputs="$(DotNetPacksDirectory).stamp">
<Exec
Command="&quot;$(DotNetToolPath)&quot; build &quot;$(MSBuildThisFileDirectory)../Maui.Dependencies/Maui.Dependencies.Packs.csproj&quot; -bl:../../bin/Maui.Dependencies.Packs.binlog"
Command="&quot;$(DotNetToolPath)&quot; build &quot;$(MSBuildThisFileDirectory)../Maui.Dependencies/Maui.Dependencies.Sdks.csproj&quot; -bl:../../bin/Maui.Dependencies.Sdks.binlog"
EnvironmentVariables="NUGET_PACKAGES=$(DotNetPacksDirectory)"
/>
<RemoveDir Directories="$(DotNetPacksDirectory)Microsoft.Build.NoTargets" />
Expand Down
32 changes: 0 additions & 32 deletions src/Maui.Dependencies/Maui.Dependencies.Packs.csproj

This file was deleted.

13 changes: 13 additions & 0 deletions src/Maui.Dependencies/Maui.Dependencies.Sdks.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<Project Sdk="Microsoft.Build.NoTargets">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageDownload Include="Microsoft.Android.Ref" Version="[$(MicrosoftAndroidVersion)]" />
<PackageDownload Include="Microsoft.Android.Sdk.win-x64" Version="[$(MicrosoftAndroidVersion)]" Condition="$([MSBuild]::IsOSPlatform('windows'))" />
<PackageDownload Include="Microsoft.Android.Sdk.osx-x64" Version="[$(MicrosoftAndroidVersion)]" Condition="$([MSBuild]::IsOSPlatform('osx'))" />
<PackageDownload Include="Microsoft.Android.Sdk.BundleTool" Version="[$(MicrosoftAndroidVersion)]" />
<PackageDownload Include="Microsoft.iOS.Ref" Version="[$(MicrosoftiOSVersion)]" />
<PackageDownload Include="Microsoft.iOS.Sdk" Version="[$(MicrosoftiOSVersion)]" />
</ItemGroup>
</Project>
1 change: 0 additions & 1 deletion src/Maui.Dependencies/nuget.config
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
<configuration>
<packageSources>
<clear />
<add key="dotnet6" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet6/nuget/v3/index.json" />
<add key="xamarin" value="https://pkgs.dev.azure.com/azure-public/vside/_packaging/xamarin-impl/nuget/v3/index.json" />
</packageSources>
</configuration>

0 comments on commit 69bc71f

Please sign in to comment.