Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Context: dotnet/java-interop#1046

The assumption is that This Cannot Possibly Impact™ Android.
So… Does It Build™?

…no, it does not build, because dotnet/java-interop#1046 removes
the `net472` build of `jnimarshalmethod-gen.exe`, which causes
packaging to fail.  Noice.

Given that `jnimarshalmethod-gen.exe` only "worked" in Classic,
and that main is (slowly) dropping support for Classic (618bd4a),
update the repo to stop packaging `jnimarshalmethod-gen.*` and
`Java.Runtime.Environment.*`.  This should fix the packaging errors.
  • Loading branch information
jonpryor committed Feb 23, 2023
1 parent 77678eb commit c9d40c8
Show file tree
Hide file tree
Showing 9 changed files with 5 additions and 77 deletions.
4 changes: 2 additions & 2 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
branch = main
[submodule "external/Java.Interop"]
path = external/Java.Interop
url = https://github.com/xamarin/java.interop.git
branch = main
url = https://github.com/jonpryor/java.interop.git
branch = jonp-cecil-expression-compiler
[submodule "external/lz4"]
path = external/lz4
url = https://github.com/lz4/lz4.git
Expand Down
5 changes: 0 additions & 5 deletions build-tools/installers/create-installers.targets
Original file line number Diff line number Diff line change
Expand Up @@ -155,12 +155,7 @@
<_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.

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="jnimarshalmethod-gen is not supported." />
</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 c9d40c8

Please sign in to comment.