Skip to content

Commit 567370a

Browse files
committed
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.
1 parent 77678eb commit 567370a

File tree

9 files changed

+5
-78
lines changed

9 files changed

+5
-78
lines changed

.gitmodules

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
branch = main
1313
[submodule "external/Java.Interop"]
1414
path = external/Java.Interop
15-
url = https://github.com/xamarin/java.interop.git
16-
branch = main
15+
url = https://github.com/jonpryor/java.interop.git
16+
branch = jonp-cecil-expression-compiler
1717
[submodule "external/lz4"]
1818
path = external/lz4
1919
url = https://github.com/lz4/lz4.git

build-tools/installers/create-installers.targets

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -155,12 +155,6 @@
155155
<_LegacyJIFiles Include="$(LegacyMSBuildSrcDir)jcw-gen.pdb" />
156156
<_LegacyJIFiles Include="$(LegacyMSBuildSrcDir)jit-times.exe" />
157157
<_LegacyJIFiles Include="$(LegacyMSBuildSrcDir)jit-times.pdb" />
158-
<_LegacyJIFiles Include="$(LegacyMSBuildSrcDir)jnimarshalmethod-gen.exe" />
159-
<_LegacyJIFiles Include="$(LegacyMSBuildSrcDir)jnimarshalmethod-gen.pdb" />
160-
<_LegacyJIFiles Include="$(LegacyMSBuildSrcDir)Java.Interop.dll.config" />
161-
<_LegacyJIFiles Include="$(LegacyMSBuildSrcDir)Java.Runtime.Environment.dll" /> <!-- Required by jnimarshalmethod-gen.exe -->
162-
<_LegacyJIFiles Include="$(LegacyMSBuildSrcDir)Java.Runtime.Environment.pdb" />
163-
<_LegacyJIFiles Include="$(LegacyMSBuildSrcDir)Java.Runtime.Environment.dll.config" Condition=" '$(HostOS)' != 'Windows' " />
164158
<_LegacyJIFiles Include="$(LegacyMSBuildSrcDir)logcat-parse.exe" />
165159
<_LegacyJIFiles Include="$(LegacyMSBuildSrcDir)logcat-parse.pdb" />
166160
<_LegacyJIFiles Include="$(LegacyMSBuildSrcDir)Mono.CSharp.dll" /> <!-- Required by logcat-parse.exe -->

build-tools/scripts/JavaInteropDllConfigs.targets

Lines changed: 0 additions & 26 deletions
This file was deleted.

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

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1456,22 +1456,7 @@ because xbuild doesn't support framework reference assemblies.
14561456
DependsOnTargets="_GetReferenceAssemblyPaths;_SetLatestTargetFrameworkVersion"
14571457
Inputs="$(_AndroidBuildPropertiesCache);@(ResolvedUserAssemblies)"
14581458
Outputs="$(_AndroidStampDirectory)_GenerateJniMarshalMethods.stamp">
1459-
<ItemGroup>
1460-
<_JniFrameworkAssembly Include="Mono.Android.dll" />
1461-
<_JniFrameworkAssembly Include="OpenTK.dll" />
1462-
<_JniFrameworkAssembly Include="Xamarin.Android.NUnitLite.dll" />
1463-
<_AssembliesToProcess Include="@(ResolvedUserAssemblies)" />
1464-
<_AssembliesToProcess Include="@(ResolvedFrameworkAssemblies)" Condition=" '%(Filename)' == '@(_JniFrameworkAssembly->'%(Filename)')' " />
1465-
</ItemGroup>
1466-
<RemoveDirFixed Directories="$(_JniMarshalMethodsOutputDir)" />
1467-
<MakeDir Directories="$(_JniMarshalMethodsOutputDir)" />
1468-
<Exec
1469-
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;', ' ')"
1470-
/>
1471-
<Touch Files="$(_AndroidStampDirectory)_GenerateJniMarshalMethods.stamp" AlwaysCreate="True" />
1472-
<ItemGroup>
1473-
<FileWrites Include="$(_AssembliesToProcess)" />
1474-
</ItemGroup>
1459+
<Error Text="jnimarshalmethod-gen is not supported." />
14751460
</Target>
14761461

14771462
<Target Name="_LinkAssembliesNoShrinkInputs">

src/monodroid/monodroid.csproj

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,5 @@
1717

1818
<ItemGroup>
1919
<ProjectReference Include="..\java-runtime\java-runtime.csproj" ReferenceOutputAssembly="False" />
20-
<!--
21-
`jnimarshalmethod-gen.exe` needs to be built first because our
22-
`_CreateJavaInteropDllConfigs` target replaces
23-
`Java.Runtime.Environment.dll.config`, which will be created as
24-
part of the `jnimarshalmethod-gen.exe` build.
25-
26-
We don't want our updated version to be replaced by the
27-
`jnimarshalmethod-gen.exe` build.
28-
-->
29-
<ProjectReference Include="..\..\external\Java.Interop\tools\jnimarshalmethod-gen\Xamarin.Android.Tools.JniMarshalMethodGenerator.csproj" ReferenceOutputAssembly="False" />
3020
</ItemGroup>
3121
</Project>

src/monodroid/monodroid.targets

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
<Import Project="..\..\external\Java.Interop\bin\Build$(Configuration)\JdkInfo.props" Condition="Exists('..\..\external\Java.Interop\bin\Build$(Configuration)\JdkInfo.props')"/>
44
<Import Project="..\..\bin\Build$(Configuration)\cmake-config.props" Condition="Exists('..\..\bin\Build$(Configuration)\cmake-config.props')" />
55
<Import Project="monodroid.projitems" />
6-
<Import Project="..\..\build-tools\scripts\JavaInteropDllConfigs.targets" />
76
<UsingTask AssemblyFile="$(BootstrapTasksAssembly)" TaskName="Xamarin.Android.Tools.BootstrapTasks.GenerateMonoDroidIncludes" />
87
<UsingTask AssemblyFile="$(BootstrapTasksAssembly)" TaskName="Xamarin.Android.Tools.BootstrapTasks.RunParallelCmds" />
98
<UsingTask AssemblyFile="$(PrepTasksAssembly)" TaskName="Xamarin.Android.BuildTools.PrepTasks.ReplaceFileContents" />
@@ -207,7 +206,7 @@
207206
</Target>
208207

209208
<Target Name="_BuildHostRuntimes"
210-
DependsOnTargets="_CreateJavaInteropDllConfigs;_BuildHostRuntimesInputs"
209+
DependsOnTargets="_BuildHostRuntimesInputs"
211210
Inputs="@(_BuildHostRuntimesInputs)"
212211
Outputs="@(_BuildHostRuntimesOutputs)">
213212
<Message Text="Building host runtime %(_HostRuntime.Identity) in $(OutputPath)%(_HostRuntime.OutputDirectory)"/>

tests/Mono.Android-Tests/Directory.Build.targets

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,4 @@
2424
<Exec Command="&quot;$(NdkBuildPath)&quot;" WorkingDirectory="$(MSBuildThisFileDirectory)"/>
2525
</Target>
2626

27-
<Import Project="$(MSBuildThisFileDirectory)..\..\build-tools\scripts\JavaInteropDllConfigs.targets" />
28-
29-
<!-- Not required when testing against a system installation of XA. -->
30-
<Target Name="EnsureJavaInteropDllConfigs"
31-
Condition="Exists ('$(XAInstallPrefix)xbuild\Xamarin\Android\Java.Interop.dll')"
32-
BeforeTargets="_GenerateJniMarshalMethods"
33-
DependsOnTargets="_CreateJavaInteropDllConfigs">
34-
</Target>
35-
3627
</Project>

tests/Xamarin.Forms-Performance-Integration/Droid/Xamarin.Forms.Performance.Integration.Droid.targets

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,4 @@
22
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
33
<Import Project="Xamarin.Forms.Performance.Integration.Droid.projitems" />
44
<Import Project="$(XamarinAndroidSourcePath)build-tools\scripts\TestApks.targets" />
5-
<Import Project="$(XamarinAndroidSourcePath)build-tools\scripts\JavaInteropDllConfigs.targets" />
6-
<Target Name="EnsureJavaInteropDllConfigs"
7-
Condition="Exists ('$(XAInstallPrefix)xbuild\Xamarin\Android\Java.Interop.dll')"
8-
BeforeTargets="_GenerateJniMarshalMethods"
9-
DependsOnTargets="_CreateJavaInteropDllConfigs">
10-
</Target>
115
</Project>

0 commit comments

Comments
 (0)