-
Notifications
You must be signed in to change notification settings - Fork 694
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Xamarin.Android.Glide] add multitargeting for .NET 6 (#1261)
* Install latest .NET 6 & stable Xamarin.Android on CI * Use Xamarin.Legacy.Sdk. * Build with `dotnet build` * Use `[assembly: AssemblyMetadata("IsTrimmable", "True")]` * Use the same pattern as AndroidX, putting `.aar`/`.jar` files loose inside the NuGet package * Set legacy compatibility properties mentioned here: https://github.com/xamarin/xamarin-android/blob/5f408ebb22df51b598c62f776ee0f82f92661b58/Documentation/guides/OneDotNetBindingProjects.md This also updates any AndroidX dependencies so that they are using the new versions that *also* multitarget for .NET 6.
- Loading branch information
1 parent
643cbc2
commit a245afa
Showing
15 changed files
with
122 additions
and
137 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<Project> | ||
<PropertyGroup> | ||
<TargetFrameworks>MonoAndroid9.0;MonoAndroid10.0;net6.0-android</TargetFrameworks> | ||
<IsBindingProject>true</IsBindingProject> | ||
<Authors>Microsoft</Authors> | ||
<Owners>Microsoft</Owners> | ||
<Copyright>© Microsoft Corporation. All rights reserved.</Copyright> | ||
<PackageProjectUrl>https://go.microsoft.com/fwlink/?linkid=864954</PackageProjectUrl> | ||
<PackageLicenseUrl>https://go.microsoft.com/fwlink/?linkid=865026</PackageLicenseUrl> | ||
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance> | ||
<!-- .NET 6+ generates Resource.designer.cs files for bindings projects which we do not want --> | ||
<AndroidGenerateResourceDesigner>false</AndroidGenerateResourceDesigner> | ||
<!-- .NET 6+ packages support back to API-21 --> | ||
<SupportedOSPlatformVersion>21</SupportedOSPlatformVersion> | ||
<!-- see: https://github.com/xamarin/xamarin-android/blob/5f408ebb22df51b598c62f776ee0f82f92661b58/Documentation/guides/OneDotNetBindingProjects.md --> | ||
<AndroidBoundInterfacesContainConstants>false</AndroidBoundInterfacesContainConstants> | ||
<AndroidBoundInterfacesContainTypes>false</AndroidBoundInterfacesContainTypes> | ||
<AndroidBoundInterfacesContainStaticAndDefaultInterfaceMethods>false</AndroidBoundInterfacesContainStaticAndDefaultInterfaceMethods> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<GlideBuildFolders Include="build\monoandroid9.0" /> | ||
<GlideBuildFolders Include="build\monoandroid10.0" /> | ||
<GlideBuildFolders Include="build\net6.0-android31.0" /> | ||
<GlideBuildFolders Include="buildTransitive\monoandroid9.0" /> | ||
<GlideBuildFolders Include="buildTransitive\monoandroid10.0" /> | ||
<GlideBuildFolders Include="buildTransitive\net6.0-android31.0" /> | ||
</ItemGroup> | ||
</Project> |
5 changes: 4 additions & 1 deletion
5
Android/Glide/source/Xamarin.Android.Glide.DiskLruCache/Properties/AssemblyInfo.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,4 @@ | ||
[assembly: Android.LinkerSafe] | ||
#if !NET | ||
[assembly: Android.LinkerSafe] | ||
#endif | ||
[assembly: System.Reflection.AssemblyMetadata("IsTrimmable", "True")] |
33 changes: 5 additions & 28 deletions
33
...Glide/source/Xamarin.Android.Glide.DiskLruCache/Xamarin.Android.Glide.DiskLruCache.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,45 +1,22 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Project Sdk="MSBuild.Sdk.Extras"> | ||
<Project Sdk="Xamarin.Legacy.Sdk"> | ||
<PropertyGroup> | ||
<TargetFrameworks>MonoAndroid9.0;MonoAndroid10.0</TargetFrameworks> | ||
<IsBindingProject>true</IsBindingProject> | ||
<AssemblyName>Xamarin.Android.Glide.DiskLruCache</AssemblyName> | ||
<MonoAndroidResourcePrefix>Resources</MonoAndroidResourcePrefix> | ||
<MonoAndroidAssetsPrefix>Assets</MonoAndroidAssetsPrefix> | ||
<AndroidUseLatestPlatformSdk>False</AndroidUseLatestPlatformSdk> | ||
<AndroidUseIntermediateDesignerFile>True</AndroidUseIntermediateDesignerFile> | ||
<AndroidResgenFile>Resources\Resource.designer.cs</AndroidResgenFile> | ||
<RootNamespace>Bumptech.Glide.DiskLruCache</RootNamespace> | ||
<AndroidClassParser>class-parse</AndroidClassParser> | ||
<AndroidCodegenTarget>XAJavaInterop1</AndroidCodegenTarget> | ||
</PropertyGroup> | ||
|
||
<PropertyGroup> | ||
<PackageId>Xamarin.Android.Glide.DiskLruCache</PackageId> | ||
<Title>Glide Disk LRU Cache for Xamarin.Android</Title> | ||
<PackageDescription>Xamarin.Android bindings for Glide Disk LRU Cache</PackageDescription> | ||
<Authors>Microsoft</Authors> | ||
<Owners>Microsoft</Owners> | ||
<Copyright>© Microsoft Corporation. All rights reserved.</Copyright> | ||
<PackageProjectUrl>https://go.microsoft.com/fwlink/?linkid=864954</PackageProjectUrl> | ||
<PackageLicenseUrl>https://go.microsoft.com/fwlink/?linkid=865026</PackageLicenseUrl> | ||
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance> | ||
<PackageVersion>4.12.0.1</PackageVersion> | ||
<PackageVersion>4.12.0.2</PackageVersion> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<TransformFile Include="Transforms\*.xml" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<None Include="..\..\externals\disklrucache.jar"> | ||
<Link>disklrucache.jar</Link> | ||
</None> | ||
<None Include="..\..\externals\disklrucache.jar" Pack="True" PackagePath="jar" /> | ||
<None Include="$(PackageId).targets" Pack="True" PackagePath="@(GlideBuildFolders)" /> | ||
<None Include="..\..\External-Dependency-Info.txt" Pack="True" PackagePath="THIRD-PARTY-NOTICES.txt" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<EmbeddedJar Include="..\..\externals\disklrucache.jar" /> | ||
<InputJar Include="..\..\externals\disklrucache.jar" /> | ||
</ItemGroup> | ||
|
||
</Project> |
7 changes: 7 additions & 0 deletions
7
...lide/source/Xamarin.Android.Glide.DiskLruCache/Xamarin.Android.Glide.DiskLruCache.targets
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<Project> | ||
<ItemGroup> | ||
<AndroidJavaLibrary Condition=" '$(AndroidApplication)' == 'true' " Include="$(MSBuildThisFileDirectory)..\..\jar\disklrucache.jar"> | ||
<AndroidXSkipAndroidXMigration>true</AndroidXSkipAndroidXMigration> | ||
</AndroidJavaLibrary> | ||
</ItemGroup> | ||
</Project> |
5 changes: 4 additions & 1 deletion
5
Android/Glide/source/Xamarin.Android.Glide.GifDecoder/Properties/AssemblyInfo.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,4 @@ | ||
[assembly: Android.LinkerSafe] | ||
#if !NET | ||
[assembly: Android.LinkerSafe] | ||
#endif | ||
[assembly: System.Reflection.AssemblyMetadata("IsTrimmable", "True")] |
33 changes: 5 additions & 28 deletions
33
...oid/Glide/source/Xamarin.Android.Glide.GifDecoder/Xamarin.Android.Glide.GifDecoder.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,49 +1,26 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Project Sdk="MSBuild.Sdk.Extras"> | ||
<Project Sdk="Xamarin.Legacy.Sdk"> | ||
<PropertyGroup> | ||
<TargetFrameworks>MonoAndroid9.0;MonoAndroid10.0</TargetFrameworks> | ||
<IsBindingProject>true</IsBindingProject> | ||
<AssemblyName>Xamarin.Android.Glide.GifDecoder</AssemblyName> | ||
<MonoAndroidResourcePrefix>Resources</MonoAndroidResourcePrefix> | ||
<MonoAndroidAssetsPrefix>Assets</MonoAndroidAssetsPrefix> | ||
<AndroidUseLatestPlatformSdk>False</AndroidUseLatestPlatformSdk> | ||
<AndroidUseIntermediateDesignerFile>True</AndroidUseIntermediateDesignerFile> | ||
<AndroidResgenFile>Resources\Resource.designer.cs</AndroidResgenFile> | ||
<RootNamespace>Bumptech.Glide.GifDecoder</RootNamespace> | ||
<AndroidClassParser>class-parse</AndroidClassParser> | ||
<AndroidCodegenTarget>XAJavaInterop1</AndroidCodegenTarget> | ||
</PropertyGroup> | ||
|
||
<PropertyGroup> | ||
<PackageId>Xamarin.Android.Glide.GifDecoder</PackageId> | ||
<Title>Glide GIF Decoder for Xamarin.Android</Title> | ||
<PackageDescription>Xamarin.Android bindings for Glide GIF Decoder</PackageDescription> | ||
<Authors>Microsoft</Authors> | ||
<Owners>Microsoft</Owners> | ||
<Copyright>© Microsoft Corporation. All rights reserved.</Copyright> | ||
<PackageProjectUrl>https://go.microsoft.com/fwlink/?linkid=864954</PackageProjectUrl> | ||
<PackageLicenseUrl>https://go.microsoft.com/fwlink/?linkid=865026</PackageLicenseUrl> | ||
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance> | ||
<PackageVersion>4.12.0.1</PackageVersion> | ||
<PackageVersion>4.12.0.2</PackageVersion> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<TransformFile Include="Transforms\*.xml" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="Xamarin.AndroidX.Annotation" Version="1.2.0.1" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<None Include="..\..\externals\gifdecoder.aar"> | ||
<Link>gifdecoder.aar</Link> | ||
</None> | ||
<None Include="..\..\externals\gifdecoder.aar" Pack="True" PackagePath="aar" /> | ||
<None Include="$(PackageId).targets" Pack="True" PackagePath="@(GlideBuildFolders)" /> | ||
<None Include="..\..\External-Dependency-Info.txt" Pack="True" PackagePath="THIRD-PARTY-NOTICES.txt" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<LibraryProjectZip Include="..\..\externals\gifdecoder.aar" /> | ||
<InputJar Include="..\..\externals\gifdecoder\classes.jar" /> | ||
</ItemGroup> | ||
|
||
</Project> |
7 changes: 7 additions & 0 deletions
7
...id/Glide/source/Xamarin.Android.Glide.GifDecoder/Xamarin.Android.Glide.GifDecoder.targets
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<Project> | ||
<ItemGroup> | ||
<AndroidAarLibrary Include="$(MSBuildThisFileDirectory)..\..\aar\gifdecoder.aar"> | ||
<AndroidXSkipAndroidXMigration>true</AndroidXSkipAndroidXMigration> | ||
</AndroidAarLibrary> | ||
</ItemGroup> | ||
</Project> |
4 changes: 4 additions & 0 deletions
4
...oid/Glide/source/Xamarin.Android.Glide.RecyclerViewIntegration/Properties/AssemblyInfo.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#if !NET | ||
[assembly: Android.LinkerSafe] | ||
#endif | ||
[assembly: System.Reflection.AssemblyMetadata("IsTrimmable", "True")] |
33 changes: 5 additions & 28 deletions
33
...ndroid.Glide.RecyclerViewIntegration/Xamarin.Android.Glide.RecyclerViewIntegration.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
...droid.Glide.RecyclerViewIntegration/Xamarin.Android.Glide.RecyclerViewIntegration.targets
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<Project> | ||
<ItemGroup> | ||
<AndroidAarLibrary Include="$(MSBuildThisFileDirectory)..\..\aar\recyclerview-integration.aar"> | ||
<AndroidXSkipAndroidXMigration>true</AndroidXSkipAndroidXMigration> | ||
</AndroidAarLibrary> | ||
</ItemGroup> | ||
</Project> |
5 changes: 4 additions & 1 deletion
5
Android/Glide/source/Xamarin.Android.Glide/Properties/AssemblyInfo.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,4 @@ | ||
[assembly: Android.LinkerSafe] | ||
#if !NET | ||
[assembly: Android.LinkerSafe] | ||
#endif | ||
[assembly: System.Reflection.AssemblyMetadata("IsTrimmable", "True")] |
33 changes: 5 additions & 28 deletions
33
Android/Glide/source/Xamarin.Android.Glide/Xamarin.Android.Glide.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
Android/Glide/source/Xamarin.Android.Glide/Xamarin.Android.Glide.targets
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<Project> | ||
<ItemGroup> | ||
<AndroidAarLibrary Include="$(MSBuildThisFileDirectory)..\..\aar\glide.aar"> | ||
<AndroidXSkipAndroidXMigration>true</AndroidXSkipAndroidXMigration> | ||
</AndroidAarLibrary> | ||
</ItemGroup> | ||
</Project> |
Oops, something went wrong.