From cd6a777f685500f5236fe4b26b7cd36e8142384a Mon Sep 17 00:00:00 2001 From: Ankit Jain Date: Fri, 22 Apr 2016 18:03:20 -0400 Subject: [PATCH 1/3] Xamarin.Android.sln: Add required projects from external/Java.Interop This is required because of a bug in xbuild. It tries to look for the Java.Interop projects which are referenced from the other projects, in the sln itself, because it needs to figure out a build order for *all* the projects. It should probably allow projects not being present in sln and build them via the reference. --- Xamarin.Android.sln | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/Xamarin.Android.sln b/Xamarin.Android.sln index 645c670f7c0..cb385c08fa1 100644 --- a/Xamarin.Android.sln +++ b/Xamarin.Android.sln @@ -27,6 +27,18 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "api-merge", "build-tools\ap EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Mono.Android.Export", "src\Mono.Android.Export\Mono.Android.Export.csproj", "{B8105878-D423-4159-A3E7-028298281EC6}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Java.Interop.Tools.Cecil", "external\Java.Interop\src\Java.Interop.Tools.Cecil\Java.Interop.Tools.Cecil.csproj", "{D48EE8D0-0A0A-4493-AEF5-DAF5F8CF86AD}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Java.Interop.Tools.Diagnostics", "external\Java.Interop\src\Java.Interop.Tools.Diagnostics\Java.Interop.Tools.Diagnostics.csproj", "{64CC4E44-CE3A-4319-BF3F-6CF8BD513870}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Xamarin.Android.Tools.AnnotationSupport", "external\Java.Interop\src\Xamarin.Android.Tools.AnnotationSupport\Xamarin.Android.Tools.AnnotationSupport.csproj", "{07BC4495-1267-4B78-9EA6-B76FEEA2A64A}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Xamarin.Android.Tools.ApiXmlAdjuster", "external\Java.Interop\src\Xamarin.Android.Tools.ApiXmlAdjuster\Xamarin.Android.Tools.ApiXmlAdjuster.csproj", "{1268EADF-8344-431C-81F6-FCB7CBC99F49}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "jcw-gen", "external\Java.Interop\tools\jcw-gen\jcw-gen.csproj", "{52C7D9B6-E8C8-47D0-9471-652D278D7D77}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Java.Interop.Tools.JavaCallableWrappers", "external\Java.Interop\src\Java.Interop.Tools.JavaCallableWrappers\Java.Interop.Tools.JavaCallableWrappers.csproj", "{D18FCF91-8876-48A0-A693-2DC1E7D3D80A}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|AnyCPU = Debug|AnyCPU From 74df3881c9b128e6106196903b8b0b34fd366d79 Mon Sep 17 00:00:00 2001 From: Ankit Jain Date: Fri, 22 Apr 2016 18:05:51 -0400 Subject: [PATCH 2/3] nuget restore for Java.Interop also --- Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/Makefile b/Makefile index 616766854f8..0191dddf8b3 100644 --- a/Makefile +++ b/Makefile @@ -8,6 +8,7 @@ all: prepare: nuget restore git submodule update --init --recursive + (cd external/Java.Interop && nuget restore) clean: $(MSBUILD) /t:Clean From d5b1a65fd4f932c5e07f26e61385d95585384ff9 Mon Sep 17 00:00:00 2001 From: Ankit Jain Date: Fri, 22 Apr 2016 18:06:13 -0400 Subject: [PATCH 3/3] 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. --- src/Mono.Android/Mono.Android.targets | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/Mono.Android/Mono.Android.targets b/src/Mono.Android/Mono.Android.targets index f311f0f2c4e..baca2c866f1 100644 --- a/src/Mono.Android/Mono.Android.targets +++ b/src/Mono.Android/Mono.Android.targets @@ -71,15 +71,16 @@ <_CommonJavaSources Include="java\**\*.java" /> + $(MSBuildProjectDirectory)\$(OutputPath) ..\..\external\Java.Interop\bin\$(Configuration)\jcw-gen.exe - <_LibDirs>-L "$(OutputPath)" -L "$(OutputPath)..\v1.0\" -L "$(OutputPath)..\v1.0\Facades" - <_Assembly>"$(OutputPath)$(AssemblyName).dll" - <_Out>-o "$(IntermediateOutputPath)android-$(AndroidApiLevel).jcw\src" + <_LibDirs>-L "$(OutputPathAbs)" -L "$(OutputPathAbs)..\v1.0\" -L "$(OutputPathAbs)..\v1.0\Facades" + <_Assembly>"$(OutputPathAbs)$(AssemblyName).dll" + <_Out>-o "$(MSBuildProjectDirectory)\$(IntermediateOutputPath)android-$(AndroidApiLevel).jcw\src"