Skip to content
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

[DO NOT MERGE] demo test net6 BuildActions CI Glide #1398

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open
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
4 changes: 2 additions & 2 deletions Android/Glide/build.cake
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
var TARGET = Argument ("t", Argument ("target", "ci"));

var NUGET_PATCH = ".2";
var NUGET_PATCH = ".0";

var GLIDE_VERSION = "4.12.0";
var GLIDE_VERSION = "4.13.2";
var GLIDE_NUGET_VERSION = GLIDE_VERSION + NUGET_PATCH;
var GLIDE_URL = $"https://repo1.maven.org/maven2/com/github/bumptech/glide/glide/{GLIDE_VERSION}/glide-{GLIDE_VERSION}.aar";

Expand Down
8 changes: 3 additions & 5 deletions Android/Glide/source/Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project>
<PropertyGroup>
<TargetFrameworks>MonoAndroid9.0;MonoAndroid10.0;net6.0-android</TargetFrameworks>
<TargetFrameworks>MonoAndroid12.0;net6.0-android</TargetFrameworks>
<IsBindingProject>true</IsBindingProject>
<Authors>Microsoft</Authors>
<Owners>Microsoft</Owners>
Expand All @@ -18,11 +18,9 @@
<AndroidBoundInterfacesContainStaticAndDefaultInterfaceMethods>false</AndroidBoundInterfacesContainStaticAndDefaultInterfaceMethods>
</PropertyGroup>
<ItemGroup>
<GlideBuildFolders Include="build\monoandroid9.0" />
<GlideBuildFolders Include="build\monoandroid10.0" />
<GlideBuildFolders Include="build\monoandroid12.0" />
<GlideBuildFolders Include="build\net6.0-android31.0" />
<GlideBuildFolders Include="buildTransitive\monoandroid9.0" />
<GlideBuildFolders Include="buildTransitive\monoandroid10.0" />
<GlideBuildFolders Include="buildTransitive\monoandroid12.0" />
<GlideBuildFolders Include="buildTransitive\net6.0-android31.0" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<PropertyGroup>
<Title>Glide Disk LRU Cache for Xamarin.Android</Title>
<PackageDescription>Xamarin.Android bindings for Glide Disk LRU Cache</PackageDescription>
<PackageVersion>4.12.0.2</PackageVersion>
<PackageVersion>4.13.2.0</PackageVersion>
</PropertyGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
<PropertyGroup>
<Title>Glide GIF Decoder for Xamarin.Android</Title>
<PackageDescription>Xamarin.Android bindings for Glide GIF Decoder</PackageDescription>
<PackageVersion>4.12.0.2</PackageVersion>
<PackageVersion>4.13.2.0</PackageVersion>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Xamarin.AndroidX.Annotation" Version="1.2.0.1" />
<PackageReference Include="Xamarin.AndroidX.Annotation" Version="1.4.0" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<PropertyGroup>
<Title>Glide RecyclerView integration for Xamarin.Android</Title>
<PackageDescription>Xamarin.Android bindings for Glide RecyclerView integration</PackageDescription>
<PackageVersion>4.12.0.2</PackageVersion>
<PackageVersion>4.13.2.0</PackageVersion>
</PropertyGroup>

<ItemGroup>
Expand All @@ -20,7 +20,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Xamarin.AndroidX.RecyclerView" Version="1.2.1.1" />
<PackageReference Include="Xamarin.AndroidX.RecyclerView" Version="1.2.1.7" />
</ItemGroup>

<ItemGroup>
Expand Down
143 changes: 72 additions & 71 deletions Android/Glide/source/Xamarin.Android.Glide/Additions/Additions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
using Java.IO;
using Java.Lang;
using Java.Util.Concurrent;
using static Android.Graphics.BitmapFactory;

namespace Bumptech.Glide
{
Expand All @@ -35,13 +36,13 @@ public partial class RequestBuilder
public virtual RequestBuilder Decode(Class resourceClass) => (RequestBuilder)Decode_T(resourceClass);

public virtual RequestBuilder DisallowHardwareConfig() => (RequestBuilder)DisallowHardwareConfig_T();

public virtual RequestBuilder Downsample(DownsampleStrategy strategy) => (RequestBuilder)Downsample_T(strategy);

public virtual RequestBuilder EncodeFormat(Bitmap.CompressFormat format) => (RequestBuilder)EncodeFormat_T(format);

public virtual RequestBuilder EncodeQuality(int quality) => (RequestBuilder)EncodeQuality_T(quality);

public virtual RequestBuilder Error(Drawable drawable) => (RequestBuilder)Error_T(drawable);

public virtual RequestBuilder Error(int resourceId) => (RequestBuilder)Error_T(resourceId);
Expand All @@ -57,7 +58,7 @@ public partial class RequestBuilder
public virtual RequestBuilder Frame(long frameTimeMicros) => (RequestBuilder)Frame_T(frameTimeMicros);

public virtual RequestBuilder Lock() => (RequestBuilder)Lock_T();

public virtual RequestBuilder OptionalCenterCrop() => (RequestBuilder)OptionalCenterCrop_T();

public virtual RequestBuilder OptionalCenterInside() => (RequestBuilder)OptionalCenterInside_T();
Expand All @@ -77,7 +78,7 @@ public partial class RequestBuilder
public virtual RequestBuilder Placeholder(Drawable drawable) => (RequestBuilder)Placeholder_T(drawable);

public virtual RequestBuilder Placeholder(int resourceId) => (RequestBuilder)Placeholder_T(resourceId);

public virtual RequestBuilder Set(Option option, Object value) => (RequestBuilder)Set_T(option, value);

public virtual RequestBuilder SetDiskCacheStrategy(DiskCacheStrategy strategy) => (RequestBuilder)DiskCacheStrategy_T(strategy);
Expand Down Expand Up @@ -118,66 +119,66 @@ public partial class AssetFileDescriptorLocalUriFetcher
}

public partial class FileDescriptorAssetPathFetcher
{
{
protected override void Close(Object data) => Close((ParcelFileDescriptor)data);

protected override Object LoadResource(AssetManager assetManager, string path) => LoadResource_T(assetManager, path);
}

public partial class FileDescriptorLocalUriFetcher
{
protected override void Close(Object data) => Close((ParcelFileDescriptor)data);
public partial class FileDescriptorLocalUriFetcher
{
protected override void Close(Object data) => Close((ParcelFileDescriptor)data);

protected override Object LoadResource(Uri uri, ContentResolver contentResolver) => LoadResource_T(uri, contentResolver);
}

public partial class StreamAssetPathFetcher
{
protected override void Close(Object data)
{
protected override void Close(Object data)
{
var stream = InputStreamInvoker.FromJniHandle(((InputStream)data).Handle, JniHandleOwnership.DoNotTransfer);

Close(stream);
}

protected override Object LoadResource(AssetManager assetManager, string path)
{
var handle = InputStreamAdapter.ToLocalJniHandle(LoadResource_T(assetManager, path));

try
{
return new Object(handle, JniHandleOwnership.TransferLocalRef);
}
finally
{
JNIEnv.DeleteLocalRef(handle);
}
}
}
{
var handle = InputStreamAdapter.ToLocalJniHandle(LoadResource_T(assetManager, path));

try
{
return new Object(handle, JniHandleOwnership.TransferLocalRef);
}
finally
{
JNIEnv.DeleteLocalRef(handle);
}
}
}

public partial class StreamLocalUriFetcher
{
protected override void Close(Object data)
{
protected override void Close(Object data)
{
var stream = InputStreamInvoker.FromJniHandle(((InputStream)data).Handle, JniHandleOwnership.DoNotTransfer);

Close(stream);
}

protected override Object LoadResource(Uri uri, ContentResolver contentResolver)
{
var handle = InputStreamAdapter.ToLocalJniHandle(LoadResource_T(uri, contentResolver));

try
{
return new Object(handle, JniHandleOwnership.TransferLocalRef);
}
finally
{
JNIEnv.DeleteLocalRef(handle);
}
}
}
{
var handle = InputStreamAdapter.ToLocalJniHandle(LoadResource_T(uri, contentResolver));

try
{
return new Object(handle, JniHandleOwnership.TransferLocalRef);
}
finally
{
JNIEnv.DeleteLocalRef(handle);
}
}
}
}

namespace Bumptech.Glide.Load.Engine.Executor
Expand All @@ -196,32 +197,32 @@ public partial class GlideExecutor

namespace Bumptech.Glide.Load.Model
{
public partial class AssetUriLoader
{
public virtual ModelLoaderLoadData BuildLoadData(Object model, int width, int height, Options options) =>
public partial class AssetUriLoader
{
public virtual ModelLoaderLoadData BuildLoadData(Object model, int width, int height, Options options) =>
BuildLoadData((Uri)model, width, height, options);

public virtual bool Handles(Object model) => Handles((Uri)model);
}

public partial class ByteArrayLoader
{
public virtual ModelLoaderLoadData BuildLoadData(Object model, int width, int height, Options options) =>
{
public virtual ModelLoaderLoadData BuildLoadData(Object model, int width, int height, Options options) =>
BuildLoadData(model?.ToArray<byte>(), width, height, options);

public virtual bool Handles(Object model) => Handles(model?.ToArray<byte>());
}

public partial class StringLoader
{
public virtual ModelLoaderLoadData BuildLoadData(Object model, int width, int height, Options options) =>
public partial class StringLoader
{
public virtual ModelLoaderLoadData BuildLoadData(Object model, int width, int height, Options options) =>
BuildLoadData(model?.ToString(), width, height, options);

public virtual bool Handles(Object model) => Handles(model?.ToString());
}
public partial class FileLoader
{
public virtual ModelLoaderLoadData BuildLoadData(Object model, int width, int height, Options options) =>
{
public virtual ModelLoaderLoadData BuildLoadData(Object model, int width, int height, Options options) =>
BuildLoadData((File)model, width, height, options);

public virtual bool Handles(Object model) => Handles((File)model);
Expand All @@ -236,16 +237,16 @@ public virtual ModelLoaderLoadData BuildLoadData(Object model, int width, int he
}

public partial class UriLoader
{
public virtual ModelLoaderLoadData BuildLoadData(Object model, int width, int height, Options options) =>
{
public virtual ModelLoaderLoadData BuildLoadData(Object model, int width, int height, Options options) =>
BuildLoadData((Uri)model, width, height, options);

public virtual bool Handles(Object model) => Handles((Uri)model);
}

public partial class UrlUriLoader
{
public virtual ModelLoaderLoadData BuildLoadData(Object model, int width, int height, Options options) =>
{
public virtual ModelLoaderLoadData BuildLoadData(Object model, int width, int height, Options options) =>
BuildLoadData((Uri)model, width, height, options);

public virtual bool Handles(Object model) => Handles((Uri)model);
Expand Down Expand Up @@ -280,40 +281,40 @@ public bool Handles(Object source, Options options)
namespace Bumptech.Glide.Load.Resource.Gif
{
public partial class GifDrawableEncoder
{
{
public virtual unsafe bool Encode(Object data, global::Java.IO.File file, global::Bumptech.Glide.Load.Options options)
=> Encode((IResource)data, file, options);
}
}

namespace Bumptech.Glide.Load.Resource.Bitmap
{
public partial class BitmapDrawableEncoder
{
public virtual bool Encode(Object data, Java.IO.File file, Options options) => Encode((IResource)data, file, options);
public partial class BitmapDrawableEncoder
{
public virtual bool Encode(Object data, Java.IO.File file, Options options) => Encode((IResource)data, file, options);
}

public partial class BitmapEncoder
{
public virtual bool Encode(Object data, Java.IO.File file, Options options) => Encode((IResource)data, file, options);
{
public virtual bool Encode(Object data, Java.IO.File file, Options options) => Encode((IResource)data, file, options);
}

public partial class StreamBitmapDecoder : IResourceDecoder
{
IResource IResourceDecoder.Decode(Object source, int width, int height, Options options)
{
var stream = InputStreamInvoker.FromJniHandle(source.Handle, JniHandleOwnership.DoNotTransfer);
{
IResource IResourceDecoder.Decode(Object source, int width, int height, Options options)
{
var stream = InputStreamInvoker.FromJniHandle(source.Handle, JniHandleOwnership.DoNotTransfer);

return Decode(stream, width, height, options);
}
return Decode(stream, width, height, options);
}

bool IResourceDecoder.Handles(Object source, Options options)
{
var stream = InputStreamInvoker.FromJniHandle(source.Handle, JniHandleOwnership.DoNotTransfer);
bool IResourceDecoder.Handles(Object source, Options options)
{
var stream = InputStreamInvoker.FromJniHandle(source.Handle, JniHandleOwnership.DoNotTransfer);

return Handles(stream, options);
}
}
return Handles(stream, options);
}
}
}

namespace Bumptech.Glide.Request
Expand Down Expand Up @@ -341,7 +342,7 @@ public partial class RequestOptions
public virtual RequestOptions EncodeFormat(Bitmap.CompressFormat format) => (RequestOptions)EncodeFormat_T(format);

public virtual RequestOptions EncodeQuality(int quality) => (RequestOptions)EncodeQuality_T(quality);

public virtual RequestBuilder Error(Drawable drawable) => (RequestBuilder)Error_T(drawable);

public virtual RequestOptions Error(int resourceId) => (RequestOptions)Error_T(resourceId);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<PropertyGroup>
<Title>Glide for Xamarin.Android</Title>
<PackageDescription>Xamarin.Android bindings for Glide</PackageDescription>
<PackageVersion>4.12.0.2</PackageVersion>
<PackageVersion>4.13.2.0</PackageVersion>
</PropertyGroup>

<ItemGroup>
Expand All @@ -20,9 +20,9 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Xamarin.AndroidX.Fragment" Version="1.3.6.1" />
<PackageReference Include="Xamarin.AndroidX.ExifInterface" Version="1.3.3" />
<PackageReference Include="Xamarin.AndroidX.VectorDrawable.Animated" Version="1.1.0.8" />
<PackageReference Include="Xamarin.AndroidX.Fragment" Version="1.5.0" />
<PackageReference Include="Xamarin.AndroidX.ExifInterface" Version="1.3.3.6" />
<PackageReference Include="Xamarin.AndroidX.VectorDrawable.Animated" Version="1.1.0.14" />
</ItemGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -103,4 +103,4 @@ jobs:
packageName: Xamarin.Components # SBOM package name. TODO: Customize for specific component: Replace with the name of the nuget package such as Square.Moshi.Adapters
packageVersionRegex: '' # SBOM package version. TODO: Customize for specific component: Regular expression used to glean the version number from the package name such as '(?i)^Square.Moshi.Adapters\.(?<version>\d+\.\d+\.\d+).nupkg$'
packageFilter: '*.nupkg'
condition: startsWith(variables['Build.SourceBranch'], 'refs/tags/')
condition: startsWith(variables['Build.SourceBranch'], 'refs/tags/')
2 changes: 1 addition & 1 deletion global.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
"MSBuild.Sdk.Extras": "3.0.44",
"Microsoft.Build.Traversal": "3.1.6",
"Microsoft.Build.NoTargets": "3.4.0",
"Xamarin.Legacy.Sdk": "0.1.2-alpha6"
"Xamarin.Legacy.Sdk": "0.2.0-alpha1"
}
}