Skip to content
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
2 changes: 1 addition & 1 deletion Documentation/guides/DotNet5.md
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ The following instructions can be used for early preview testing.
```xml
<Project Sdk="Microsoft.Android.Sdk/10.0.100">
<PropertyGroup>
<TargetFramework>netcoreapp5.0</TargetFramework>
<TargetFramework>net5.0</TargetFramework>
<RuntimeIdentifier>android.21-arm64</RuntimeIdentifier>
<OutputType>Exe</OutputType>
</PropertyGroup>
Expand Down
2 changes: 1 addition & 1 deletion build-tools/automation/azure-pipelines-oss.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ variables:
PREPARE_FLAGS: PREPARE_CI=1 PREPARE_CI_PR=1
DotNetCoreVersion: 3.1.201
# Version number from: https://dotnet.microsoft.com/download/dotnet-core/5.0
DotNetCorePreviewVersion: 5.0.100-preview.4.20227.14
DotNetCorePreviewVersion: 5.0.100-preview.6.20265.2

stages:
- stage: mac_stage
Expand Down
2 changes: 1 addition & 1 deletion build-tools/automation/azure-pipelines.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ variables:
NUnitConsoleVersion: 3.9.0
DotNetCoreVersion: 3.1.201
# Version number from: https://github.com/dotnet/installer#installers-and-binaries
DotNetCorePreviewVersion: 5.0.100-preview.4.20227.14
DotNetCorePreviewVersion: 5.0.100-preview.6.20265.2
HostedMacMojave: Hosted Mac Internal Mojave
HostedMac: Hosted Mac Internal
HostedWinVS2019: Hosted Windows 2019 with VS2019
Expand Down
2 changes: 1 addition & 1 deletion build-tools/create-packs/Microsoft.Android.Ref.proj
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ by projects that use the Microsoft.Android framework in .NET 5.
<Authors>Microsoft</Authors>
<Description>Microsoft.Android reference assemblies. Please do not reference directly.</Description>
<OutputPath>..\..\bin\Build$(Configuration)\nupkgs\</OutputPath>
<_AndroidRefPackAssemblyPath>ref\netcoreapp5.0</_AndroidRefPackAssemblyPath>
<_AndroidRefPackAssemblyPath>ref\net5.0</_AndroidRefPackAssemblyPath>
</PropertyGroup>

<PropertyGroup>
Expand Down
2 changes: 1 addition & 1 deletion build-tools/create-packs/Microsoft.Android.Runtime.proj
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ projects that use the Microsoft.Android framework in .NET 5.
<Authors>Microsoft</Authors>
<Description>Microsoft.Android runtime components. Please do not reference directly.</Description>
<OutputPath>..\..\bin\Build$(Configuration)\nupkgs\</OutputPath>
<_AndroidRuntimePackAssemblyPath>runtimes\$(AndroidRID)\lib\netcoreapp5.0</_AndroidRuntimePackAssemblyPath>
<_AndroidRuntimePackAssemblyPath>runtimes\$(AndroidRID)\lib\net5.0</_AndroidRuntimePackAssemblyPath>
<_AndroidRuntimePackNativePath>runtimes\$(AndroidRID)\native</_AndroidRuntimePackNativePath>
</PropertyGroup>

Expand Down
2 changes: 1 addition & 1 deletion build-tools/create-packs/Microsoft.Android.Sdk.proj
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ the new entry point for short-form style Android projets in .NET 5.
<Target Name="_GenerateBundledVersions"
DependsOnTargets="_GetDefaultPackageVersion" >
<PropertyGroup>
<_AndroidNETAppTargetFramework>netcoreapp5.0</_AndroidNETAppTargetFramework>
<_AndroidNETAppTargetFramework>net5.0</_AndroidNETAppTargetFramework>
<BundledVersionsPropsFileName>Microsoft.Android.Sdk.BundledVersions.props</BundledVersionsPropsFileName>
</PropertyGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,14 @@ static XASdkProject ()
public XASdkProject (string sdkVersion = "", string outputType = "Exe")
{
Sdk = string.IsNullOrEmpty (sdkVersion) ? "Microsoft.Android.Sdk" : $"Microsoft.Android.Sdk/{sdkVersion}";
TargetFramework = "netcoreapp5.0";
TargetFramework = "net5.0";

PackageName = PackageName ?? string.Format ("{0}.{0}", ProjectName);
JavaPackageName = JavaPackageName ?? PackageName.ToLowerInvariant ();
ExtraNuGetConfigSources = new List<string> { Path.Combine (XABuildPaths.BuildOutputDirectory, "nupkgs") };
ExtraNuGetConfigSources = new List<string> {
Path.Combine (XABuildPaths.BuildOutputDirectory, "nupkgs"),
"https://dnceng.pkgs.visualstudio.com/public/_packaging/dotnet5/nuget/v3/index.json",
};
GlobalPackagesFolder = Path.Combine (XABuildPaths.TopDirectory, "packages");
SetProperty (KnownProperties.OutputType, outputType);

Expand Down
16 changes: 10 additions & 6 deletions src/Xamarin.Android.Build.Tasks/Xamarin.Android.Tooling.targets
Original file line number Diff line number Diff line change
Expand Up @@ -43,20 +43,24 @@ projects.
</Target>

<PropertyGroup Condition=" '$(UsingAndroidNETSdk)' == 'True' ">
<_ResolveSdksDependsOnTargets>ResolveFrameworkReferences</_ResolveSdksDependsOnTargets>
<_ResolveSdksDependsOnTargets>ResolveTargetingPackAssets</_ResolveSdksDependsOnTargets>
</PropertyGroup>
<PropertyGroup Condition=" '$(UsingAndroidNETSdk)' != 'True' ">
<_ResolveSdksDependsOnTargets>_GetReferenceAssemblyPaths</_ResolveSdksDependsOnTargets>
</PropertyGroup>

<Target Name="_ResolveSdks" DependsOnTargets="$(_ResolveSdksDependsOnTargets)">
<!-- When using .NET 5, provide a list of paths to the Android and NETCore targeting pack directories, e.g.
`packages\microsoft.android.ref\10.0.100-ci.master.22\ref\net5.0\` and
`C:\Program Files\dotnet\packs\Microsoft.NETCore.App.Ref\5.0.0-preview.6.20264.1\ref\net5.0\`
See https://github.com/dotnet/sdk/blob/9eeb58e24af894597a534326156d09173d9f0f91/src/Tasks/Microsoft.NET.Build.Tasks/ResolveTargetingPackAssets.cs#L56
-->
<ItemGroup Condition=" '$(UsingAndroidNETSdk)' == 'True' ">
<_ResolveSdksFrameworkRefAssemblyPaths Include="@(ResolvedTargetingPack->'%(Path)\ref\%(TargetFramework)')" Condition=" '@(ResolvedTargetingPack)' == '@(FrameworkReference)' and '%(Identity)' != '' " />
</ItemGroup>
<PropertyGroup>
<_AndroidAllowMissingSdkTooling Condition=" '$(_AndroidAllowMissingSdkTooling)' == '' ">False</_AndroidAllowMissingSdkTooling>
<!-- When using .NET 5, provide a list of paths to all framework reference directories, e.g.
`packages\xamarin.android.app.ref\10.3.99.160\ref\netcoreapp5.0\` and
`C:\Program Files\dotnet\packs\Microsoft.NETCore.App.Ref\5.0.0-preview.2.20160.6\ref\netcoreapp5.0\`
-->
<_XATargetFrameworkDirectories Condition=" '$(UsingAndroidNETSdk)' == 'True' ">@(ResolvedFrameworkReference->'%(TargetingPackPath)\ref\$(TargetFramework)')</_XATargetFrameworkDirectories>
<_XATargetFrameworkDirectories Condition=" '$(UsingAndroidNETSdk)' == 'True' ">@(_ResolveSdksFrameworkRefAssemblyPaths)</_XATargetFrameworkDirectories>
</PropertyGroup>
<ResolveSdks
ContinueOnError="$(_AndroidAllowMissingSdkTooling)"
Expand Down