Skip to content

Commit

Permalink
Bump to xamarin/java.interop/main@77800dda (#7824)
Browse files Browse the repository at this point in the history
Changes: dotnet/java-interop@bbaeda6...77800dd

  * dotnet/java-interop@77800dda: [Java.Interop.Tools.Expressions] Add Java.Interop.Tools.Expressions (dotnet/java-interop#1046)

Remember `jnimarshalmethod-gen.exe`?  (0140ab8, d5b2ece, 106a621, …)
It never made it to completion, was never stable enough to be used,
even though we did add a "public" *documented*
`$(AndroidGenerateJniMarshalMethods)` MSBuild property to control it…

`jnimarshalmethod-gen.exe` never made it to .NET Android, as it
required .NET Framework features which didn't make it to .NET Core.

dotnet/java-interop@77800dda updates `jnimarshalmethod-gen` to drop
support for building on .NET Framework 4.7.2, and adds support to
build it for .NET 7.

Update `build-tools/installers/create-installers.targets` so that
`jnimarshalmethod-gen.exe` is no longer included in the Classic
installers (which are increasingly moot anyway; see also 618bd4a).

Remove generation of `Java.Runtime.Environment.dll.config`, as
that file was only supported when using Mono, which won't be the case
under .NET 7.

Update the `_GenerateJniMarshalMethods` target so that it `<Error/>`s
when `$(AndroidGenerateJniMarshalMethods)` is True.  While
`jnimarshalmethod-gen.dll` may run on .NET 7 now, @jonpryor doesn't
want to deal with the *integration* work to see if it is usable on
.NET Android, especially considering that the Classic version didn't
work either!  (That integration effort is for "later".)
  • Loading branch information
jonpryor committed Feb 28, 2023
1 parent d447bff commit c9918ef
Show file tree
Hide file tree
Showing 8 changed files with 3 additions and 76 deletions.
6 changes: 0 additions & 6 deletions build-tools/installers/create-installers.targets
Original file line number Diff line number Diff line change
Expand Up @@ -155,12 +155,6 @@
<_LegacyJIFiles Include="$(LegacyMSBuildSrcDir)jcw-gen.pdb" />
<_LegacyJIFiles Include="$(LegacyMSBuildSrcDir)jit-times.exe" />
<_LegacyJIFiles Include="$(LegacyMSBuildSrcDir)jit-times.pdb" />
<_LegacyJIFiles Include="$(LegacyMSBuildSrcDir)jnimarshalmethod-gen.exe" />
<_LegacyJIFiles Include="$(LegacyMSBuildSrcDir)jnimarshalmethod-gen.pdb" />
<_LegacyJIFiles Include="$(LegacyMSBuildSrcDir)Java.Interop.dll.config" />
<_LegacyJIFiles Include="$(LegacyMSBuildSrcDir)Java.Runtime.Environment.dll" /> <!-- Required by jnimarshalmethod-gen.exe -->
<_LegacyJIFiles Include="$(LegacyMSBuildSrcDir)Java.Runtime.Environment.pdb" />
<_LegacyJIFiles Include="$(LegacyMSBuildSrcDir)Java.Runtime.Environment.dll.config" Condition=" '$(HostOS)' != 'Windows' " />
<_LegacyJIFiles Include="$(LegacyMSBuildSrcDir)logcat-parse.exe" />
<_LegacyJIFiles Include="$(LegacyMSBuildSrcDir)logcat-parse.pdb" />
<_LegacyJIFiles Include="$(LegacyMSBuildSrcDir)Mono.CSharp.dll" /> <!-- Required by logcat-parse.exe -->
Expand Down
26 changes: 0 additions & 26 deletions build-tools/scripts/JavaInteropDllConfigs.targets

This file was deleted.

2 changes: 1 addition & 1 deletion external/Java.Interop
17 changes: 1 addition & 16 deletions src/Xamarin.Android.Build.Tasks/Xamarin.Android.Common.targets
Original file line number Diff line number Diff line change
Expand Up @@ -1456,22 +1456,7 @@ because xbuild doesn't support framework reference assemblies.
DependsOnTargets="_GetReferenceAssemblyPaths;_SetLatestTargetFrameworkVersion"
Inputs="$(_AndroidBuildPropertiesCache);@(ResolvedUserAssemblies)"
Outputs="$(_AndroidStampDirectory)_GenerateJniMarshalMethods.stamp">
<ItemGroup>
<_JniFrameworkAssembly Include="Mono.Android.dll" />
<_JniFrameworkAssembly Include="OpenTK.dll" />
<_JniFrameworkAssembly Include="Xamarin.Android.NUnitLite.dll" />
<_AssembliesToProcess Include="@(ResolvedUserAssemblies)" />
<_AssembliesToProcess Include="@(ResolvedFrameworkAssemblies)" Condition=" '%(Filename)' == '@(_JniFrameworkAssembly->'%(Filename)')' " />
</ItemGroup>
<RemoveDirFixed Directories="$(_JniMarshalMethodsOutputDir)" />
<MakeDir Directories="$(_JniMarshalMethodsOutputDir)" />
<Exec
Command="DYLD_LIBRARY_PATH=&quot;$(MonoAndroidLibDirectory)&quot; MONO_CONFIG=&quot;$(MonoAndroidBinDirectory)mono.config&quot; MONO_PATH=&quot;$(MonoAndroidBinDirectory)\bcl&quot;:&quot;$(MonoAndroidBinDirectory)\bcl\Facades&quot;:&quot;$(_XATargetFrameworkDirectories)&quot; &quot;$(MonoAndroidBinDirectory)mono&quot; --debug &quot;$(MonoAndroidToolsDirectory)\jnimarshalmethod-gen.exe&quot; --jvm=&quot;$(JdkJvmPath)&quot; @(ResolvedAssemblies->'--r=&quot;%(Identity)&quot;', ' ') --o=&quot;$(_JniMarshalMethodsOutputDir)&quot; $(AndroidGenerateJniMarshalMethodsAdditionalArguments) @(_AssembliesToProcess->'&quot;%(Identity)&quot;', ' ')"
/>
<Touch Files="$(_AndroidStampDirectory)_GenerateJniMarshalMethods.stamp" AlwaysCreate="True" />
<ItemGroup>
<FileWrites Include="$(_AssembliesToProcess)" />
</ItemGroup>
<Error Text="%24(AndroidGenerateJniMarshalMethods)=True is not supported at this time." />
</Target>

<Target Name="_LinkAssembliesNoShrinkInputs">
Expand Down
10 changes: 0 additions & 10 deletions src/monodroid/monodroid.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,5 @@

<ItemGroup>
<ProjectReference Include="..\java-runtime\java-runtime.csproj" ReferenceOutputAssembly="False" />
<!--
`jnimarshalmethod-gen.exe` needs to be built first because our
`_CreateJavaInteropDllConfigs` target replaces
`Java.Runtime.Environment.dll.config`, which will be created as
part of the `jnimarshalmethod-gen.exe` build.
We don't want our updated version to be replaced by the
`jnimarshalmethod-gen.exe` build.
-->
<ProjectReference Include="..\..\external\Java.Interop\tools\jnimarshalmethod-gen\Xamarin.Android.Tools.JniMarshalMethodGenerator.csproj" ReferenceOutputAssembly="False" />
</ItemGroup>
</Project>
3 changes: 1 addition & 2 deletions src/monodroid/monodroid.targets
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
<Import Project="..\..\external\Java.Interop\bin\Build$(Configuration)\JdkInfo.props" Condition="Exists('..\..\external\Java.Interop\bin\Build$(Configuration)\JdkInfo.props')"/>
<Import Project="..\..\bin\Build$(Configuration)\cmake-config.props" Condition="Exists('..\..\bin\Build$(Configuration)\cmake-config.props')" />
<Import Project="monodroid.projitems" />
<Import Project="..\..\build-tools\scripts\JavaInteropDllConfigs.targets" />
<UsingTask AssemblyFile="$(BootstrapTasksAssembly)" TaskName="Xamarin.Android.Tools.BootstrapTasks.GenerateMonoDroidIncludes" />
<UsingTask AssemblyFile="$(BootstrapTasksAssembly)" TaskName="Xamarin.Android.Tools.BootstrapTasks.RunParallelCmds" />
<UsingTask AssemblyFile="$(PrepTasksAssembly)" TaskName="Xamarin.Android.BuildTools.PrepTasks.ReplaceFileContents" />
Expand Down Expand Up @@ -207,7 +206,7 @@
</Target>

<Target Name="_BuildHostRuntimes"
DependsOnTargets="_CreateJavaInteropDllConfigs;_BuildHostRuntimesInputs"
DependsOnTargets="_BuildHostRuntimesInputs"
Inputs="@(_BuildHostRuntimesInputs)"
Outputs="@(_BuildHostRuntimesOutputs)">
<Message Text="Building host runtime %(_HostRuntime.Identity) in $(OutputPath)%(_HostRuntime.OutputDirectory)"/>
Expand Down
9 changes: 0 additions & 9 deletions tests/Mono.Android-Tests/Directory.Build.targets
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,4 @@
<Exec Command="&quot;$(NdkBuildPath)&quot;" WorkingDirectory="$(MSBuildThisFileDirectory)"/>
</Target>

<Import Project="$(MSBuildThisFileDirectory)..\..\build-tools\scripts\JavaInteropDllConfigs.targets" />

<!-- Not required when testing against a system installation of XA. -->
<Target Name="EnsureJavaInteropDllConfigs"
Condition="Exists ('$(XAInstallPrefix)xbuild\Xamarin\Android\Java.Interop.dll')"
BeforeTargets="_GenerateJniMarshalMethods"
DependsOnTargets="_CreateJavaInteropDllConfigs">
</Target>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,4 @@
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="Xamarin.Forms.Performance.Integration.Droid.projitems" />
<Import Project="$(XamarinAndroidSourcePath)build-tools\scripts\TestApks.targets" />
<Import Project="$(XamarinAndroidSourcePath)build-tools\scripts\JavaInteropDllConfigs.targets" />
<Target Name="EnsureJavaInteropDllConfigs"
Condition="Exists ('$(XAInstallPrefix)xbuild\Xamarin\Android\Java.Interop.dll')"
BeforeTargets="_GenerateJniMarshalMethods"
DependsOnTargets="_CreateJavaInteropDllConfigs">
</Target>
</Project>

0 comments on commit c9918ef

Please sign in to comment.