Skip to content

Commit 1467afa

Browse files
Address trimmable runtime review comments
Add comments documenting runtime jar selection and Java proxy identity semantics. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 7328217 commit 1467afa

3 files changed

Lines changed: 5 additions & 0 deletions

File tree

src/Xamarin.Android.Build.Tasks/Xamarin.Android.Common.targets

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1391,6 +1391,8 @@ because xbuild doesn't support framework reference assemblies.
13911391
<MakeDir Directories="$(MonoAndroidIntermediateAssemblyDir)" Condition=" !Exists ('$(MonoAndroidIntermediateAssemblyDir)') " />
13921392
</Target>
13931393

1394+
<!-- Runtime jar selection: 2×2 matrix of runtime (MonoVM|CoreCLR) × typemap (default|trimmable).
1395+
Trimmable jars replace JavaProxyObject/JavaProxyThrowable with non-native implementations. -->
13941396
<Target Name="_CollectRuntimeJarFilenames">
13951397
<PropertyGroup Condition=" '$(_AndroidRuntime)' != 'CoreCLR' and '$(_AndroidTypeMapImplementation)' != 'trimmable' ">
13961398
<_RuntimeJar>$(MSBuildThisFileDirectory)\java_runtime_net6.jar</_RuntimeJar>

src/java-runtime/java-runtime.targets

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@
7171
>
7272
<MakeDir Directories="%(_RuntimeOutput.IntermediateRuntimeOutputPath)" />
7373
<MakeDir Directories="$(OutputPath)" />
74+
<!-- Remove stale D8 output so 'jar uf' doesn't bundle DEX into the runtime jar. -->
7475
<Delete Files="%(_RuntimeOutput.IntermediateRuntimeOutputPath)\classes.dex" />
7576
<ItemGroup>
7677
<_RuntimeSource Include="@(AllRuntimeSource)" />

src/java-runtime/java-trimmable/net/dot/jni/internal/JavaProxyObject.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
// This trimmable runtime copy cannot use Java.Interop's native object methods:
1414
// those are registered through ManagedPeer.registerNativeMembers, which is not
1515
// supported in the trimmable typemap path.
16+
// Trimmable proxies use Java identity semantics: equals/hashCode/toString
17+
// do not delegate to the wrapped .NET object.
1618
@Override
1719
public boolean equals(Object obj)
1820
{

0 commit comments

Comments
 (0)