Skip to content

Test single Mono.Android.dll runtime pack #6785

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

Closed
wants to merge 1 commit into from
Closed
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: 2 additions & 0 deletions build-tools/create-packs/Directory.Build.targets
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@
<Exec Command="dotnet pack @(_GlobalProperties, ' ') -p:AndroidApiLevel=$(AndroidLatestUnstableApiLevel) -p:AndroidRID=android-arm64 -p:AndroidABI=arm64-v8a-net6 &quot;$(MSBuildThisFileDirectory)Microsoft.Android.Runtime.proj&quot;" />
<Exec Command="dotnet pack @(_GlobalProperties, ' ') -p:AndroidApiLevel=$(AndroidLatestUnstableApiLevel) -p:AndroidRID=android-x86 -p:AndroidABI=x86-net6 &quot;$(MSBuildThisFileDirectory)Microsoft.Android.Runtime.proj&quot;" />
<Exec Command="dotnet pack @(_GlobalProperties, ' ') -p:AndroidApiLevel=$(AndroidLatestUnstableApiLevel) -p:AndroidRID=android-x64 -p:AndroidABI=x86_64-net6 &quot;$(MSBuildThisFileDirectory)Microsoft.Android.Runtime.proj&quot;" />
<Exec Command="dotnet pack @(_GlobalProperties, ' ') -p:AndroidApiLevel=$(AndroidLatestUnstableApiLevel) &quot;$(MSBuildThisFileDirectory)Microsoft.Android.Runtime.Managed.proj&quot;" />
<Exec Command="dotnet pack @(_GlobalProperties, ' ') -p:AndroidApiLevel=$(AndroidLatestUnstableApiLevel) &quot;$(MSBuildThisFileDirectory)Microsoft.Android.Ref.proj&quot;" />
</Target>

Expand All @@ -76,6 +77,7 @@
<Exec Command="dotnet pack @(_GlobalProperties, ' ') -p:AndroidRID=android-arm64 -p:AndroidABI=arm64-v8a-net6 &quot;$(MSBuildThisFileDirectory)Microsoft.Android.Runtime.proj&quot;" />
<Exec Command="dotnet pack @(_GlobalProperties, ' ') -p:AndroidRID=android-x86 -p:AndroidABI=x86-net6 &quot;$(MSBuildThisFileDirectory)Microsoft.Android.Runtime.proj&quot;" />
<Exec Command="dotnet pack @(_GlobalProperties, ' ') -p:AndroidRID=android-x64 -p:AndroidABI=x86_64-net6 &quot;$(MSBuildThisFileDirectory)Microsoft.Android.Runtime.proj&quot;" />
<Exec Command="dotnet pack @(_GlobalProperties, ' ') &quot;$(MSBuildThisFileDirectory)Microsoft.Android.Runtime.Managed.proj&quot;" />
<Exec Command="dotnet pack @(_GlobalProperties, ' ') &quot;$(MSBuildThisFileDirectory)Microsoft.Android.Ref.proj&quot;" />
<Exec Command="dotnet pack @(_GlobalProperties, ' ') -p:HostOS=Linux &quot;$(MSBuildThisFileDirectory)Microsoft.Android.Sdk.proj&quot;" Condition=" '$(HostOS)' == 'Linux' " />
<Exec Command="dotnet pack @(_GlobalProperties, ' ') -p:HostOS=Darwin &quot;$(MSBuildThisFileDirectory)Microsoft.Android.Sdk.proj&quot;" Condition=" '$(HostOS)' == 'Darwin' " />
Expand Down
48 changes: 48 additions & 0 deletions build-tools/create-packs/Microsoft.Android.Runtime.Managed.proj
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
<!--
***********************************************************************************************
Microsoft.Android.Runtime.Managed.proj

This project file is used to create a Microsoft.Android.Runtime.[API] NuGet, which is a
runtime pack that contains the non ABI specific assets required for a self-contained publish of
projects that use the Microsoft.Android framework.
***********************************************************************************************
-->
<Project Sdk="Microsoft.Build.NoTargets">

<PropertyGroup>
<AndroidRID>android</AndroidRID>
<PackageId>Microsoft.Android.Runtime.$(AndroidApiLevel).$(AndroidRID)</PackageId>
<Description>Microsoft.Android runtime components for API $(AndroidApiLevel). Please do not reference directly.</Description>
<_AndroidRuntimePackAssemblyPath>runtimes\$(AndroidRID)\lib\net6.0</_AndroidRuntimePackAssemblyPath>
</PropertyGroup>

<PropertyGroup>
<BeforePack>
_GetRuntimePackItems;
_GetDefaultPackageVersion;
_GenerateFrameworkListFile;
$(BeforePack);
</BeforePack>
</PropertyGroup>

<Target Name="_GetRuntimePackItems"
DependsOnTargets="_GetLicense">
<PropertyGroup>
<FrameworkListFile>$(IntermediateOutputPath)$(AndroidRID)\RuntimeList.xml</FrameworkListFile>
</PropertyGroup>

<ItemGroup>
<_AndroidRuntimePackAssemblies Include="$(JavaInteropSourceDirectory)\bin\$(Configuration)-net6.0\Java.Interop.dll" />
<_AndroidRuntimePackAssemblies Include="$(_MonoAndroidNETOutputDir)Mono.Android.dll" />
<!-- Always include stable Mono.Android.Export.dll -->
<_AndroidRuntimePackAssemblies Include="$(XAInstallPrefix)xbuild-frameworks\Microsoft.Android\net6.0-android$(AndroidLatestStableApiLevel)\Mono.Android.Export.dll" />
<FrameworkListFileClass Include="@(_AndroidRuntimePackAssemblies->'%(Filename)%(Extension)')" Profile="Android" />
</ItemGroup>

<ItemGroup>
<_PackageFiles Include="@(_AndroidRuntimePackAssemblies)" PackagePath="$(_AndroidRuntimePackAssemblyPath)" TargetPath="$(_AndroidRuntimePackAssemblyPath)" />
<_PackageFiles Include="@(_AndroidRuntimePackAssemblies->'%(RelativeDir)%(Filename).pdb')" PackagePath="$(_AndroidRuntimePackAssemblyPath)" />
</ItemGroup>
</Target>

</Project>
10 changes: 1 addition & 9 deletions build-tools/create-packs/Microsoft.Android.Runtime.proj
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@ projects that use the Microsoft.Android framework in .NET 5.
<AndroidRID Condition=" '$(AndroidRID)' == '' ">android-arm64</AndroidRID>
<AndroidABI Condition=" '$(AndroidABI)' == '' ">arm64-v8a-net6</AndroidABI>
<PackageId>Microsoft.Android.Runtime.$(AndroidApiLevel).$(AndroidRID)</PackageId>
<Description>Microsoft.Android runtime components for API $(AndroidApiLevel). Please do not reference directly.</Description>
<_AndroidRuntimePackAssemblyPath>runtimes\$(AndroidRID)\lib\net6.0</_AndroidRuntimePackAssemblyPath>
<Description>Microsoft.Android runtime components for API $(AndroidApiLevel) and RID $(AndroidRID). Please do not reference directly.</Description>
<_AndroidRuntimePackNativePath>runtimes\$(AndroidRID)\native</_AndroidRuntimePackNativePath>
</PropertyGroup>

Expand All @@ -34,20 +33,13 @@ projects that use the Microsoft.Android framework in .NET 5.
</PropertyGroup>

<ItemGroup>
<_AndroidRuntimePackAssemblies Include="$(JavaInteropSourceDirectory)\bin\$(Configuration)-net6.0\Java.Interop.dll" />
<_AndroidRuntimePackAssemblies Include="$(_MonoAndroidNETOutputDir)Mono.Android.dll" />
<!-- Always include stable Mono.Android.Export.dll -->
<_AndroidRuntimePackAssemblies Include="$(XAInstallPrefix)xbuild-frameworks\Microsoft.Android\net6.0-android$(AndroidLatestStableApiLevel)\Mono.Android.Export.dll" />
<_AndroidRuntimePackAssets Include="$(XAInstallPrefix)xbuild\Xamarin\Android\lib\$(AndroidABI)\libmono-android.debug.so" />
<_AndroidRuntimePackAssets Include="$(XAInstallPrefix)xbuild\Xamarin\Android\lib\$(AndroidABI)\libmono-android.release.so" />
<_AndroidRuntimePackAssets Include="$(XAInstallPrefix)xbuild\Xamarin\Android\lib\$(AndroidABI)\libxamarin-debug-app-helper.so" />
<FrameworkListFileClass Include="@(_AndroidRuntimePackAssemblies->'%(Filename)%(Extension)')" Profile="Android" />
<FrameworkListFileClass Include="@(_AndroidRuntimePackAssets->'%(Filename)%(Extension)')" Profile="Android" />
</ItemGroup>

<ItemGroup>
<_PackageFiles Include="@(_AndroidRuntimePackAssemblies)" PackagePath="$(_AndroidRuntimePackAssemblyPath)" TargetPath="$(_AndroidRuntimePackAssemblyPath)" />
<_PackageFiles Include="@(_AndroidRuntimePackAssemblies->'%(RelativeDir)%(Filename).pdb')" PackagePath="$(_AndroidRuntimePackAssemblyPath)" />
<_PackageFiles Include="@(_AndroidRuntimePackAssets)" PackagePath="$(_AndroidRuntimePackNativePath)" TargetPath="$(_AndroidRuntimePackNativePath)" IsNative="true" />
</ItemGroup>
</Target>
Expand Down
1 change: 0 additions & 1 deletion build-tools/create-packs/Microsoft.Android.Sdk.proj
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,6 @@ core workload SDK packs imported by WorkloadManifest.targets.
<Target Name="_GenerateBundledVersions"
DependsOnTargets="_GetDefaultPackageVersion" >
<PropertyGroup>
<_AndroidNETAppTargetFramework>net6.0</_AndroidNETAppTargetFramework>
<BundledVersionsFileName>Microsoft.Android.Sdk.BundledVersions.targets</BundledVersionsFileName>
</PropertyGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,16 @@ WARNING: DO NOT MODIFY this file unless you are knowledgeable about MSBuild and
RuntimePackRuntimeIdentifiers="android-arm;android-arm64;android-x86;android-x64"
Profile="Android"
/>
<KnownFrameworkReference
Include="Microsoft.Android"
TargetFramework="net6.0"
RuntimeFrameworkName="Microsoft.Android"
LatestRuntimeFrameworkVersion="**FromWorkload**"
TargetingPackName="Microsoft.Android.Ref.$(_AndroidTargetingPackId)"
TargetingPackVersion="**FromWorkload**"
RuntimePackNamePatterns="Microsoft.Android.Runtime.%24(_AndroidRuntimePackId).android"
RuntimePackRuntimeIdentifiers="android-arm;android-arm64;android-x86;android-x64"
Profile="Android"
/>
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@
Pack="false"
PrivateAssets="All"
/>
<FrameworkReference
Include="Microsoft.Android.Unmanaged"
IsImplicitlyDefined="true"
Pack="false"
PrivateAssets="All"
/>
</ItemGroup>

<Import Project="Microsoft.Android.Sdk.SupportedPlatforms.targets" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"Microsoft.Android.Sdk",
"Microsoft.Android.Ref.31",
"Microsoft.Android.Ref.32",
"Microsoft.Android.Runtime.32.android",
"Microsoft.Android.Runtime.32.android-arm",
"Microsoft.Android.Runtime.32.android-arm64",
"Microsoft.Android.Runtime.32.android-x86",
Expand Down Expand Up @@ -53,6 +54,10 @@
"kind": "framework",
"version": "@WORKLOAD_VERSION@"
},
"Microsoft.Android.Runtime.32.android": {
"kind": "framework",
"version": "@WORKLOAD_VERSION@"
},
"Microsoft.Android.Runtime.32.android-arm": {
"kind": "framework",
"version": "@WORKLOAD_VERSION@"
Expand Down