Skip to content

Commit 41d877a

Browse files
committed
Update our copy of Java.Runtime.Environment.dll.config
Add dll maps to map `libmono-android` as `java-interop` shared library for `Java.Runtime.Environment.dll`. Similar way as we do for `Java.Interop.dll` in `monodroid.targets`
1 parent 9be8ace commit 41d877a

File tree

3 files changed

+23
-10
lines changed

3 files changed

+23
-10
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<dllmap dll="java-interop" os="osx" target="lib/host-Darwin/libmono-android.debug.dylib" />
2+
<dllmap dll="java-interop" os="linux" target="lib/host-Linux/libmono-android.debug.so" />
3+
<dllmap dll="java-interop" os="windows" wordsize="64" target="lib/host-mxe-Win64/libmono-android.debug.dll" />
4+
<dllmap dll="java-interop" os="windows" wordsize="32" target="lib/host-mxe-Win32/libmono-android.debug.dll" />

src/monodroid/monodroid.csproj

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,11 @@
3232
<Name>dependencies</Name>
3333
<ReferenceOutputAssembly>False</ReferenceOutputAssembly>
3434
</ProjectReference>
35+
<ProjectReference Include="..\..\external\Java.Interop\tools\jnimarshalmethod-gen\Xamarin.Android.Tools.JniMarshalMethodGenerator.csproj">
36+
<Project>{D1295A8F-4F42-461D-A046-564476C10002}</Project>
37+
<Name>jnimarshalmethod-gen</Name>
38+
<ReferenceOutputAssembly>False</ReferenceOutputAssembly>
39+
</ProjectReference>
3540
<ProjectReference Include="..\..\src\mono-runtimes\mono-runtimes.csproj">
3641
<Project>{C03E6CF1-7460-4CDC-A4AB-292BBC0F61F2}</Project>
3742
<Name>mono-runtimes</Name>

src/monodroid/monodroid.targets

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@
116116
</ItemGroup>
117117
</Target>
118118
<Target Name="_BuildHostRuntimes"
119-
DependsOnTargets="_GetBuildHostRuntimes;_CreateJavaInteropDllConfig"
119+
DependsOnTargets="_GetBuildHostRuntimes;_CreateJavaInteropDllConfigs"
120120
Inputs="@(_CFile);@(_UnixCFile)"
121121
Outputs="@(_HostRuntime->'$(OutputPath)%(OutputDirectory)\libmono-android.debug.%(NativeLibraryExtension)')">
122122
<Message Text="Building host runtime %(_HostRuntime.Identity) in $(OutputPath)%(_HostRuntime.OutputDirectory)"/>
@@ -143,19 +143,23 @@
143143
Command="%(_HostRuntime.Strip) %(_HostRuntime.StripFlags) &quot;$(OutputPath)%(_HostRuntime.OutputDirectory)\libmono-android.release.%(_HostRuntime.NativeLibraryExtension)&quot;"
144144
/>
145145
</Target>
146-
<Target Name="_CreateJavaInteropDllConfig"
147-
Inputs="$(XAInstallPrefix)xbuild\Xamarin\Android\Java.Interop.dll"
148-
Outputs="$(XAInstallPrefix)xbuild\Xamarin\Android\Java.Interop.dll.config">
146+
<Target Name="_CreateJavaInteropDllConfigs"
147+
Inputs="$(XAInstallPrefix)xbuild\Xamarin\Android\Java.Interop.dll;$(XAInstallPrefix)xbuild\Xamarin\Android\Java.Runtime.Environment.dll"
148+
Outputs="$(XAInstallPrefix)xbuild\Xamarin\Android\Java.Interop.dll.config;$(XAInstallPrefix)xbuild\Xamarin\Android\Java.Runtime.Environment.dll.config">
149+
<ReadLinesFromFile
150+
File="../../build-tools/scripts/java-interop.dllmap">
151+
<Output
152+
TaskParameter="Lines"
153+
ItemName="_JavaInteropDllMapContent" />
154+
</ReadLinesFromFile>
149155
<WriteLinesToFile
150156
File="$(XAInstallPrefix)xbuild\Xamarin\Android\Java.Interop.dll.config"
151-
Lines="&lt;configuration&gt;
152-
&lt;dllmap dll=&quot;java-interop&quot; os=&quot;osx&quot; target=&quot;lib/host-Darwin/libmono-android.debug.dylib&quot; /&gt;
153-
&lt;dllmap dll=&quot;java-interop&quot; os=&quot;linux&quot; target=&quot;lib/host-Linux/libmono-android.debug.so&quot; /&gt;
154-
&lt;dllmap dll=&quot;java-interop&quot; os=&quot;windows&quot; wordsize=&quot;64&quot; target=&quot;lib/host-mxe-Win64/libmono-android.debug.dll&quot; /&gt;
155-
&lt;dllmap dll=&quot;java-interop&quot; os=&quot;windows&quot; wordsize=&quot;32&quot; target=&quot;lib/host-mxe-Win32/libmono-android.debug.dll&quot; /&gt;
156-
&lt;/configuration&gt;"
157+
Lines="&lt;configuration&gt;;@(_JavaInteropDllMapContent);&lt;/configuration&gt;"
157158
Overwrite="True"
158159
/>
160+
<Exec
161+
Command="sed -i .in.bak -e '/&lt;configuration&gt;/r $(MSBuildThisFileDirectory)\..\..\build-tools\scripts\java-interop.dllmap' $(XAInstallPrefix)xbuild\Xamarin\Android\Java.Runtime.Environment.dll.config"
162+
/>
159163
</Target>
160164
<Target Name="CoreCompile"
161165
DependsOnTargets="Build">

0 commit comments

Comments
 (0)