Skip to content

Commit d5b1a65

Browse files
author
Ankit Jain
committed
Fix Mono.Android.targets - jcw-gen
- Build _GenerateJavaCallableWrappers *after* CoreBuild instead of CoreCompile. This is because it depends on Mono.Android.dll being in the OutputDir, but the *copy* to that directory happens *after* CoreCompile. This was hit when Mono.Android.dll would get compiled to obj/Debug/Mono.Android.dll , but before it can be copied, jcw-gen is run which expects Mono.Android.dll in the bin/Debug, thus breaking the build. - Paths passed to jcw-gen.exe as arguments should be relative to the directory containing jcw-gen.exe or should be absolute.
1 parent 74df388 commit d5b1a65

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/Mono.Android/Mono.Android.targets

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,15 +71,16 @@
7171
<_CommonJavaSources Include="java\**\*.java" />
7272
</ItemGroup>
7373
<Target Name="_GenerateJavaCallableWrappers"
74-
AfterTargets="CoreCompile"
74+
AfterTargets="CoreBuild"
7575
Inputs="$(OutputPath)$(AssemblyName).dll"
7676
Outputs="$(OutputPath)mono.android.jar">
7777
<MakeDir Directories="$(IntermediateOutputPath)android-$(AndroidApiLevel).jcw\bin" />
7878
<PropertyGroup>
79+
<OutputPathAbs>$(MSBuildProjectDirectory)\$(OutputPath)</OutputPathAbs>
7980
<JcwGen>..\..\external\Java.Interop\bin\$(Configuration)\jcw-gen.exe</JcwGen>
80-
<_LibDirs>-L "$(OutputPath)" -L "$(OutputPath)..\v1.0\" -L "$(OutputPath)..\v1.0\Facades"</_LibDirs>
81-
<_Assembly>"$(OutputPath)$(AssemblyName).dll"</_Assembly>
82-
<_Out>-o "$(IntermediateOutputPath)android-$(AndroidApiLevel).jcw\src"</_Out>
81+
<_LibDirs>-L "$(OutputPathAbs)" -L "$(OutputPathAbs)..\v1.0\" -L "$(OutputPathAbs)..\v1.0\Facades"</_LibDirs>
82+
<_Assembly>"$(OutputPathAbs)$(AssemblyName).dll"</_Assembly>
83+
<_Out>-o "$(MSBuildProjectDirectory)\$(IntermediateOutputPath)android-$(AndroidApiLevel).jcw\src"</_Out>
8384
</PropertyGroup>
8485
<Exec
8586
Command="$(ManagedRuntime) $(JcwGen) $(_Out) $(_LibDirs) $(_Assembly)"

0 commit comments

Comments
 (0)