From 97f08f788104fd983ca386c8851ead6a0ccaf24f Mon Sep 17 00:00:00 2001 From: Jonathan Pryor Date: Fri, 28 Jul 2017 06:36:32 -0700 Subject: [PATCH] [structure] Rework installation directory structure (#704) Context: https://github.com/xamarin/xamarin-android/pull/253#discussion_r82862993 The *intention* is that Jenkins-produced `oss-xamarin.android*.zip` artifacts be usable on Windows, so that side-by-side testing can be performed without replacing the system installation. Usage is in [UsingJenkinsBuildArtifacts.md](Documentation/UsingJenkinsBuildArtifacts). This isn't *entirely* the case. It was *apparently* the case at the time of commit 87ca2737, but things have bitrotten since. For example, following the 87ca2737 instructions would currently result in an XA0020 `Could not find monodroid` error, because `class-parse.exe` wasn't where Windows expects it to be (it was in `lib/mandroid`, not `lib/xbuild/Xamarin/Android`). This needs to be fixed. Additionally, PR #253 mentions that, for filesystem organization, it would be useful if the macOS/Linux directory structure -- `$prefix/bin`, `$prefix/lib/mandroid`, `$prefix/lib/xbuild/Xamarin/Android`, `$prefix/lib/xbuild-frameworks` -- more closely resembled the Windows directory structure of `$MSBuild` and `$ReferenceAssemblies` (as seen in `.vsix` files). This would turn macOS/Linux into using `$xa_prefix/xbuild` and `$xa_prefix/xbuild-frameworks` directories. `$prefix/bin` would only contain `xabuild`. What is currently in `$prefix/lib/mandroid` would be merged with `$xa_prefix/xbuild/Xamarin/Android`. `$xa_prefix` would `$prefix/lib/xamarin.android`. This would turn the current macOS structure: $prefix/bin/xabuild $prefix/bin/generator $prefix/bin/cross-arm $prefix/lib/mandroid/generator.exe $prefix/lib/xbuild-frameworks/MonoAndroid/v1.0/mscorlib.dll $prefix/lib/xbuild/Xamarin/Android/Xamarin.Android.Common.targets Into: $prefix/bin/xabuild $prefix/lib/xamarin.android/xbuild-frameworks/MonoAndroid/v1.0/mscorlib.dll $prefix/lib/xamarin.android/xbuild/Xamarin/Android/generator.exe $prefix/lib/xamarin.android/xbuild/Xamarin/Android/Xamarin.Android.Common.targets $prefix/lib/xamarin.android/xbuild/Xamarin/Android/Darwin/cross-arm Other notes: * The `bundle-*.zip` filename has been has been changed to include a *hash* of the contents of various files, in particular `build-tools\mono-runtimes.*`. This was instigated via a conversation with @kumpera about making the filename more "idiot-proof": `mono-runtimes.props` contains *compiler flags*, and if any of those change, then *logically* the bundle should differ as well, as the mono runtimes may differ in significant ways. In theory, the `-vXX` version should be used to track this, but this is a manual change, easy to overlook. The new `-hHASH` part of the filename should be more automagic. The new `` task in `xa-prep-tasks.dll` is responsible for creating the hash value. * `Configuration.Java.Interop.Override.props` was moved into `build-tools/scripts`, because that would cleanup the root directory a bit. * OS-specific binaries are now placed into `$prefix/lib/xamarin.android/xbuild/Xamarin/Android/$(HostOS)`. On a theoretical plus side, this means that the same build directory can contain OS-specific binaries for multiple operating systems. (I don't know if anyone shares a build tree between e.g. macOS and Linux, but if anyone *does*...) Unfortunately this requires a workaround for an `xbuild` bug: `%(_LlvmRuntime.InstallPath)` and `%(_MonoCrossRuntime.InstallPath)` *cannot* use MSBuild properties, e.g. `$(HostOS)/` doesn't work as desired; it's instead treated literally. Special-case `%(InstallPath)` until we fully migrate to MSBuild. * `$(MonoAndroidToolsDirectory)` should be considered *dead*, along with `$(MonoAndroidBinDirectory)`, as these should now *always* be the same directory as where `Xamarin.Android.Build.Tasks.dll` is located, or a `$(HostOS)` sub-directory. * `Xamarin.ProjectTools.csproj` needed to be updated to ensure that the build order was correct. * Remove all `[Obsolete]` and unreferenced members from `Xamarin.Android.Build.Utilities.dll`. There's too much in there, and it makes my head hurt trying to understand the interrelationships between it all. If it's not used, it's gone. * The changes to `src/monodroid/jni/Android.mk` are...weird. The removal of `-I$(topdir)/libmonodroid/zip`/etc. is to reduce use of non-existent paths, as `$(topdir)` isn't defined, so that's *actually* `-I/libmonodroid/zip`, which is nonsensical. So far, so good. What's *odd* is the addition of `$(LOCAL_PATH)` to `$(LOCAL_C_INCLUDES)`: This is needed so that `external/mono/support/zlib-helper.c` exports `CreateZStream` and related symbols, otherwise we get a unit test failure in `GzipStreamTest.Compression` due to an `EntryPointNotFoundException`, because `CreateZStream` isn't exported/public. What's odd here is that I don't understand what caused this behavior to change. Previous builds exported `CreateZStream`, otherwise the tests would fail, and I don't understand how any of the other changes in this PR would be at fault, though that's certainly the most plausible explanation. Regardless, `-Ijni` *first* (due to adding `$(LOCAL_PATH)` to `$(LOCAL_C_INCLUDES)`) is the desired behavior, so that `jni/config.h` is included, thus ensuring that `MONO_API` has the required definition when building `zlib-helper.c`. --- Configuration.props | 1 + Documentation/DevelopmentTips.md | 4 +- Documentation/UsingJenkinsBuildArtifacts.md | 6 +- Makefile | 9 +- README.md | 10 +- build-tools/api-xml-adjuster/Makefile | 4 +- build-tools/bundle/bundle-path.targets | 11 +- build-tools/bundle/bundle.targets | 2 - build-tools/create-vsix/create-vsix.targets | 7 +- .../libzip-windows/libzip-windows.mdproj | 5 +- .../libzip-windows/libzip-windows.targets | 1 - build-tools/libzip/libzip.mdproj | 4 +- build-tools/libzip/libzip.targets | 7 +- .../mono-runtimes/mono-runtimes.mdproj | 5 +- .../mono-runtimes/mono-runtimes.projitems | 30 ++-- .../mono-runtimes/mono-runtimes.targets | 115 ++++++------ build-tools/scripts/BuildEverything.mk | 16 +- .../Configuration.Java.Interop.Override.props | 2 +- .../scripts/JavaCallableWrappers.targets | 5 +- .../scripts/MonoAndroidFramework.props | 2 +- .../unix-distribution-setup.targets | 22 +-- .../HashFileContents.cs | 94 ++++++++++ .../xa-prep-tasks/xa-prep-tasks.csproj | 1 + .../xa-prep-tasks/xa-prep-tasks.targets | 4 +- .../Mono.Android.Export.csproj | 6 +- src/Mono.Android/Mono.Android.csproj | 6 +- src/Mono.Android/Mono.Android.targets | 2 +- .../Test/Mono.Android-Tests.csproj | 2 +- src/Mono.Data.Sqlite/Mono.Data.Sqlite.csproj | 8 +- src/Mono.Posix/Mono.Posix.csproj | 8 +- src/OpenTK-1.0/OpenTK.csproj | 8 +- .../System.Drawing.Primitives.mdproj | 3 +- .../System.EnterpriseServices.csproj | 4 +- src/Xamarin.Android.Build.Tasks/Tasks/Aot.cs | 18 +- .../Tasks/BuildApk.cs | 5 +- .../Tasks/Generator.cs | 2 +- .../Tasks/ImportJavaDoc.cs | 6 +- src/Xamarin.Android.Build.Tasks/Tasks/MDoc.cs | 2 +- .../Tasks/ResolveSdksTask.cs | 28 +-- .../BindingBuildTest.cs | 2 +- .../Xamarin.Android.Build.Tests/BuildTest.cs | 8 +- .../Xamarin.ProjectTools/Common/Builder.cs | 6 +- .../Xamarin.ProjectTools.csproj | 16 +- .../Utilities/MonoAndroidHelper.cs | 28 ++- .../Xamarin.Android.Bindings.targets | 34 +--- .../Xamarin.Android.Build.Tasks.csproj | 6 +- .../Xamarin.Android.Build.Tasks.targets | 21 +-- .../Xamarin.Android.Common.targets | 20 +-- .../MonoDroidSdk.cs | 9 - .../Sdks/MonoDroidSdkBase.cs | 169 +++--------------- .../Sdks/MonoDroidSdkUnix.cs | 50 ++---- .../Sdks/MonoDroidSdkWindows.cs | 41 ++--- .../Xamarin.Android.Build.Utilities.csproj | 5 +- .../Xamarin.Android.NUnitLite.csproj | 4 +- .../Xamarin.Android.Tools.Aidl.csproj | 6 +- ...amarin.Android.Tools.BootstrapTasks.csproj | 1 + src/monodroid/jni/Android.mk | 2 +- src/monodroid/monodroid.mdproj | 4 +- src/monodroid/monodroid.targets | 4 +- src/netstandard/netstandard.mdproj | 3 +- src/proguard/proguard.mdproj | 3 +- tests/api-compatibility/api-compatibility.mk | 4 +- tools/javadoc2mdoc/javadoc2mdoc.csproj | 4 +- tools/scripts/generator | 6 - tools/scripts/mono-symbolicate | 2 +- tools/scripts/mono-symbolicate.cmd | 2 - tools/scripts/xabuild | 17 +- 67 files changed, 436 insertions(+), 516 deletions(-) rename Configuration.Java.Interop.Override.props => build-tools/scripts/Configuration.Java.Interop.Override.props (75%) create mode 100644 build-tools/xa-prep-tasks/Xamarin.Android.BuildTools.PrepTasks/HashFileContents.cs delete mode 100755 tools/scripts/generator delete mode 100644 tools/scripts/mono-symbolicate.cmd diff --git a/Configuration.props b/Configuration.props index a8d20c3bf5f..f1f2556dd43 100644 --- a/Configuration.props +++ b/Configuration.props @@ -20,6 +20,7 @@ False False + $(MSBuildThisFileDirectory)\bin\$(Configuration)\lib\xamarin.android\ Windows $(HostCc64) $(HostCxx64) diff --git a/Documentation/DevelopmentTips.md b/Documentation/DevelopmentTips.md index 09d46717fd6..bd20a7dd1f4 100644 --- a/Documentation/DevelopmentTips.md +++ b/Documentation/DevelopmentTips.md @@ -45,7 +45,7 @@ For example, to rebuild Mono for armeabi-v7a: $ make -C build-tools/mono-runtimes/obj/Debug/armeabi-v7a - # This updates bin/$(Configuration)/lib/xbuild/Xamarin/Android/lib/armeabi-v7a/libmonosgen-2.0.so + # This updates bin/$(Configuration)/lib/xamarin.android/xbuild/Xamarin/Android/lib/armeabi-v7a/libmonosgen-2.0.so $ xbuild /t:_InstallRuntimes build-tools/mono-runtimes/mono-runtimes.mdproj # How do I rebuild BCL assemblies? @@ -65,7 +65,7 @@ varies based on the operating system you're building from: Once the assemblies have been rebuilt, they can be copied into the appropriate Xamarin.Android SDK directory by using the `_InstallBcl` target: - # This updates bin/$(Configuration)/lib/xbuild-frameworks/MonoAndroid/v1.0/ASSEMBLY.dll + # This updates bin/$(Configuration)/lib/xamarin.android/xbuild-frameworks/MonoAndroid/v1.0/ASSEMBLY.dll $ xbuild build-tools/mono-runtimes/mono-runtimes.mdproj /t:_InstallBcl # Update Directory diff --git a/Documentation/UsingJenkinsBuildArtifacts.md b/Documentation/UsingJenkinsBuildArtifacts.md index 581b99fe1fe..0ca38b9a44c 100644 --- a/Documentation/UsingJenkinsBuildArtifacts.md +++ b/Documentation/UsingJenkinsBuildArtifacts.md @@ -156,9 +156,9 @@ For example (using the paths from [Android SDK Setup](#Android_SDK_Setup)): msbuild /p:AndroidSdkDirectory="C:\xa-sdk\android-sdk" ^ /p:AndroidNdkDirectory="C:\xa-sdk\android-ndk\android-ndk-r14" ^ - /p:MonoAndroidBinDirectory="C:\xa-sdk\oss-xamarin.android_v7.2.99.19_Darwin-x86_64_master_3b893cd\bin\Debug\lib\xbuild\Xamarin\Android" ^ - /p:MonoAndroidToolsDirectory="C:\xa-sdk\oss-xamarin.android_v7.2.99.19_Darwin-x86_64_master_3b893cd\bin\Debug\lib\xbuild\Xamarin\Android" ^ - /p:TargetFrameworkRootPath="C:\xa-sdk\oss-xamarin.android_v7.2.99.19_Darwin-x86_64_master_3b893cd\bin\Debug\lib\xbuild-frameworks" ^ + /p:MonoAndroidBinDirectory="C:\xa-sdk\oss-xamarin.android_v7.2.99.19_Darwin-x86_64_master_3b893cd\bin\Debug\lib\xamarin.android\xbuild\Xamarin\Android" ^ + /p:MonoAndroidToolsDirectory="C:\xa-sdk\oss-xamarin.android_v7.2.99.19_Darwin-x86_64_master_3b893cd\bin\Debug\lib\xamarin.android\xbuild\Xamarin\Android" ^ + /p:TargetFrameworkRootPath="C:\xa-sdk\oss-xamarin.android_v7.2.99.19_Darwin-x86_64_master_3b893cd\bin\Debug\lib\xamarin.android\xbuild-frameworks" ^ /t:SignAndroidPackage ^ samples\HelloWorld\HelloWorld.csproj diff --git a/Makefile b/Makefile index b60bcbd7d57..5f4471a390e 100644 --- a/Makefile +++ b/Makefile @@ -32,15 +32,16 @@ install:: echo "run 'make all' before you execute 'make install'!"; \ exit 1; \ fi + -mkdir -p "$(prefix)/bin" -mkdir -p "$(prefix)/lib/mono/xbuild-frameworks" -mkdir -p "$(prefix)/lib/xamarin.android" -mkdir -p "$(prefix)/lib/mono/xbuild/Xamarin/" - cp -a "bin/$(CONFIGURATION)/." "$(prefix)/lib/xamarin.android/" + cp -a "bin/$(CONFIGURATION)/lib/xamarin.android/." "$(prefix)/lib/xamarin.android/" cp tools/scripts/xabuild "$(prefix)/bin/xabuild" -rm -rf "$(prefix)/lib/mono/xbuild/Xamarin/Android" -rm -rf "$(prefix)/lib/mono/xbuild-frameworks/MonoAndroid" - ln -s "$(prefix)/lib/xamarin.android/lib/xbuild/Xamarin/Android/" "$(prefix)/lib/mono/xbuild/Xamarin/Android" - ln -s "$(prefix)/lib/xamarin.android/lib/xbuild-frameworks/MonoAndroid/" "$(prefix)/lib/mono/xbuild-frameworks/MonoAndroid" + ln -s "$(prefix)/lib/xamarin.android/xbuild/Xamarin/Android/" "$(prefix)/lib/mono/xbuild/Xamarin/Android" + ln -s "$(prefix)/lib/xamarin.android/xbuild-frameworks/MonoAndroid/" "$(prefix)/lib/mono/xbuild-frameworks/MonoAndroid" uninstall:: rm -rf "$(prefix)/lib/xamarin.android/" "$(prefix)/bin/xabuild" @@ -90,7 +91,7 @@ prepare-external: prepare-deps (cd $(call GetPath,JavaInterop) && make bin/BuildDebug/JdkInfo.props) prepare-props: prepare-external - cp Configuration.Java.Interop.Override.props external/Java.Interop/Configuration.Override.props + cp build-tools/scripts/Configuration.Java.Interop.Override.props external/Java.Interop/Configuration.Override.props cp $(call GetPath,MonoSource)/mcs/class/msfinal.pub . prepare-msbuild: prepare-props diff --git a/README.md b/README.md index aff2131f2cc..05239fcdbf7 100644 --- a/README.md +++ b/README.md @@ -320,13 +320,13 @@ The `bin\$(Configuration)` directory, e.g. `bin\Debug`, contains acts as a *local installation prefix*, in which the directory structure mirrors that of the OS X Xamarin.Android.framework directory structure: -* `bin\$(Configuration)\lib\xbuild\Xamarin\Android`: MSBuild-related support +* `bin\$(Configuration)\lib\xamarin.android\xbuild\Xamarin\Android`: MSBuild-related support files and required runtimes used by the MSBuild tooling. -* `bin\$(Configuration)\lib\xbuild-frameworks\MonoAndroid`: Xamarin.Android +* `bin\$(Configuration)\lib\xamarin.android\xbuild-frameworks\MonoAndroid`: Xamarin.Android profiles. -* `bin\$(Configuration)\lib\xbuild-frameworks\MonoAndroid\v1.0`: Xamarin.Android +* `bin\$(Configuration)\lib\xamarin.android\xbuild-frameworks\MonoAndroid\v1.0`: Xamarin.Android Base Class Library assemblies such as `mscorlib.dll`. -* `bin\$(Configuration)\lib\xbuild-frameworks\MonoAndroid\*`: Contains +* `bin\$(Configuration)\lib\xamarin.android\xbuild-frameworks\MonoAndroid\*`: Contains `Mono.Android.dll` for a given Xamarin.Android `$(TargetFrameworkVersion)`. # Xamarin.Android `$(TargetFrameworkVersion)`s @@ -354,7 +354,7 @@ For example, to generate `Mono.Android.dll` for API-19 (Android 4.4): cd src/Mono.Android xbuild /p:AndroidApiLevel=19 /p:AndroidFrameworkVersion=v4.4 - # creates bin\Debug\lib\xbuild-frameworks\MonoAndroid\v4.4\Mono.Android.dll + # creates bin\Debug\lib\xamarin.android\xbuild-frameworks\MonoAndroid\v4.4\Mono.Android.dll diff --git a/build-tools/api-xml-adjuster/Makefile b/build-tools/api-xml-adjuster/Makefile index 6a4420069ad..093c5d7334e 100644 --- a/build-tools/api-xml-adjuster/Makefile +++ b/build-tools/api-xml-adjuster/Makefile @@ -6,7 +6,7 @@ ANDROID_SDK_PATH=$(shell find ~/ -maxdepth 1 -name android-sdk-*) DOCS_DIR=~/android-toolchain/docs -MANDROID = ../../bin/$(CONFIGURATION)/lib/mandroid +MANDROID = ../../bin/$(CONFIGURATION)/lib/xamarin.anroid/xbuild/Xamarin/Android BUILDBIN = ../../bin/Build$(CONFIGURATION) CLASS_PARSE = $(MANDROID)/class-parse.exe @@ -62,7 +62,7 @@ $(ANALYZED_XML): $(API_XML_TOOL) $(CLASS_PARSE_XML) $(RUN_API_XML_TOOL) $(CLASS_PARSE_XML) $(ANALYZED_XML) || rm -f $(ANALYZED_XML) $(CLASS_PARSE): - cd $(JAVA_INTEROP_PATH)/tools/class-parse && $(XBUILD) /p:OutputPath=$(TOP)/out/lib/mandroid + cd $(JAVA_INTEROP_PATH)/tools/class-parse && $(XBUILD) /p:OutputPath=$(TOP)/out/lib/xamarin.android/xbuild/Xamarin.Android/ $(API_XML_TOOL): $(XBUILD) diff --git a/build-tools/bundle/bundle-path.targets b/build-tools/bundle/bundle-path.targets index 0e5bcf5ec66..bf25b44545f 100644 --- a/build-tools/bundle/bundle-path.targets +++ b/build-tools/bundle/bundle-path.targets @@ -1,6 +1,7 @@ + + + + + + + + - bundle-v18-$(Configuration)-$(HostOS)-libzip=$(_LibZipHash),llvm=$(_LlvmHash),mono=$(_MonoHash).zip + bundle-v19-h$(_VersionHash)-$(Configuration)-$(HostOS)-libzip=$(_LibZipHash),llvm=$(_LlvmHash),mono=$(_MonoHash).zip diff --git a/build-tools/bundle/bundle.targets b/build-tools/bundle/bundle.targets index e5951385da7..3bc6b93b559 100644 --- a/build-tools/bundle/bundle.targets +++ b/build-tools/bundle/bundle.targets @@ -1,8 +1,6 @@ - - diff --git a/build-tools/create-vsix/create-vsix.targets b/build-tools/create-vsix/create-vsix.targets index b46ac5bd0cc..3ce11dfde20 100644 --- a/build-tools/create-vsix/create-vsix.targets +++ b/build-tools/create-vsix/create-vsix.targets @@ -9,7 +9,7 @@ $(PrepareForBuildDependsOn); AddContent - ..\..\bin\$(Configuration)\lib\ + ..\..\bin\$(Configuration)\lib\xamarin.android\ @@ -36,16 +36,17 @@ + + Xamarin/%(RecursiveDir) - - Xamarin/Android/%(RecursiveDir) + Microsoft/Framework/%(RecursiveDir) diff --git a/build-tools/libzip-windows/libzip-windows.mdproj b/build-tools/libzip-windows/libzip-windows.mdproj index 2c93339112d..4c3fab18134 100644 --- a/build-tools/libzip-windows/libzip-windows.mdproj +++ b/build-tools/libzip-windows/libzip-windows.mdproj @@ -9,10 +9,10 @@ - ..\..\bin\$(Configuration) + $(XAInstallPrefix)xbuild\Xamarin\Android\ - ..\..\bin\$(Configuration) + $(XAInstallPrefix)xbuild\Xamarin\Android\ @@ -24,6 +24,7 @@ + {8FF78EB6-6FC8-46A7-8A15-EBBA9045C5FA} diff --git a/build-tools/libzip-windows/libzip-windows.targets b/build-tools/libzip-windows/libzip-windows.targets index 1a39ae4cbe6..e2ddd817baa 100644 --- a/build-tools/libzip-windows/libzip-windows.targets +++ b/build-tools/libzip-windows/libzip-windows.targets @@ -1,4 +1,3 @@ - diff --git a/build-tools/libzip/libzip.mdproj b/build-tools/libzip/libzip.mdproj index adb4bf75a81..0fc1e179978 100644 --- a/build-tools/libzip/libzip.mdproj +++ b/build-tools/libzip/libzip.mdproj @@ -9,10 +9,10 @@ - ..\..\bin\$(Configuration) + $(XAInstallPrefix)xbuild\Xamarin\Android\ - ..\..\bin\$(Configuration) + $(XAInstallPrefix)xbuild\Xamarin\Android\ diff --git a/build-tools/libzip/libzip.targets b/build-tools/libzip/libzip.targets index f1e7b8220b5..4553ac369c2 100644 --- a/build-tools/libzip/libzip.targets +++ b/build-tools/libzip/libzip.targets @@ -8,6 +8,7 @@ _Configure; _Make + <_LibZipOutputPath>$(XAInstallPrefix)xbuild\Xamarin\Android\ @@ -29,7 +30,7 @@ /> - + Always @@ -43,7 +44,7 @@ /> @@ -73,6 +74,6 @@ - + diff --git a/build-tools/mono-runtimes/mono-runtimes.mdproj b/build-tools/mono-runtimes/mono-runtimes.mdproj index 0948676f6d0..03e71fc76b9 100644 --- a/build-tools/mono-runtimes/mono-runtimes.mdproj +++ b/build-tools/mono-runtimes/mono-runtimes.mdproj @@ -6,11 +6,12 @@ GenericProject {C03E6CF1-7460-4CDC-A4AB-292BBC0F61F2} + - ..\..\bin\Debug + $(XAInstallPrefix) - ..\..\bin\Release + $(XAInstallPrefix) diff --git a/build-tools/mono-runtimes/mono-runtimes.projitems b/build-tools/mono-runtimes/mono-runtimes.projitems index e967df03de4..3130b863f7e 100644 --- a/build-tools/mono-runtimes/mono-runtimes.projitems +++ b/build-tools/mono-runtimes/mono-runtimes.projitems @@ -260,7 +260,8 @@ true - bin/ + Darwin/ + Linux/ <_LlvmRuntime Include="llvm64" Condition=" '$(_LlvmNeeded)' != '' And '$(_LlvmCanBuild64)' == 'yes' "> @@ -271,7 +272,8 @@ true - bin/ + Darwin/ + Linux/ <_LlvmRuntime Include="llvmwin32" Condition=" '$(_LlvmNeeded)' != '' And ($(AndroidSupportedHostJitAbisForConditionalChecks.Contains (':mxe-Win32:')) Or $(AndroidSupportedHostJitAbisForConditionalChecks.Contains (':linux-Win32:'))) "> @@ -282,7 +284,7 @@ PATH="$(AndroidMxeFullPath)\bin:$(PATH)" .exe true - lib/mandroid/ + <_LlvmRuntime Include="llvmwin64" Condition=" '$(_LlvmNeeded)' != '' And ($(AndroidSupportedHostJitAbisForConditionalChecks.Contains (':mxe-Win64:')) Or $(AndroidSupportedHostJitAbisForConditionalChecks.Contains (':linux-Win64:'))) "> @@ -293,7 +295,7 @@ PATH="$(AndroidMxeFullPath)\bin:$(PATH)" .exe false - lib/mandroid/ + @@ -318,7 +320,8 @@ - bin/ + Darwin/ + Linux/ cross-arm @@ -341,7 +344,8 @@ - bin/ + Darwin/ + Linux/ cross-arm64 @@ -364,7 +368,8 @@ - bin/ + Darwin/ + Linux/ cross-x86 @@ -387,7 +392,8 @@ - bin/ + Darwin/ + Linux/ cross-x86_64 @@ -410,7 +416,7 @@ .exe PATH="$(AndroidMxeFullPath)\bin:$(PATH)" $(_LlvmConfigureEnvironmentWin32) - lib/mandroid/ + cross-arm @@ -433,7 +439,7 @@ .exe PATH="$(AndroidMxeFullPath)\bin:$(PATH)" $(_LlvmConfigureEnvironmentWin64) - lib/mandroid/ + cross-arm64 @@ -456,7 +462,7 @@ .exe PATH="$(AndroidMxeFullPath)\bin:$(PATH)" $(_LlvmConfigureEnvironmentWin32) - lib/mandroid/ + cross-x86 @@ -479,7 +485,7 @@ .exe PATH="$(AndroidMxeFullPath)\bin:$(PATH)" $(_LlvmConfigureEnvironmentWin32) - lib/mandroid/ + cross-x86_64 diff --git a/build-tools/mono-runtimes/mono-runtimes.targets b/build-tools/mono-runtimes/mono-runtimes.targets index 713d0371a6e..ea46d000f17 100644 --- a/build-tools/mono-runtimes/mono-runtimes.targets +++ b/build-tools/mono-runtimes/mono-runtimes.targets @@ -3,8 +3,9 @@ <_SourceTopDir>..\.. - <_BclFrameworkDir>$(OutputPath)\lib\xbuild-frameworks\MonoAndroid\v1.0 - <_MandroidDir>$(OutputPath)\lib\mandroid + <_BclFrameworkDir>$(XAInstallPrefix)xbuild-frameworks\MonoAndroid\v1.0\ + <_MSBuildDir>$(XAInstallPrefix)xbuild\Xamarin\Android + <_OutputIncludeDir>..\..\bin\$(Configuration)\include\ <_DebugFileExt Condition=" '$(_DebugFileExt)' == '' ">.pdb @@ -25,16 +26,15 @@ - <_FSharpInstalledItems Include="@(FSharpItem->'$(OutputPath)\lib\xbuild-frameworks\MonoAndroid\v1.0\%(Identity)')" /> + <_FSharpInstalledItems Include="@(FSharpItem->'$(_BclFrameworkDir)%(Identity)')" /> - <_MonoDocCopyItems Include="@(MonoDocCopyItem->'$(_MonoOutputDir)\%(Identity)')" /> - <_MonoDocInstalledItems Include="@(MonoDocCopyItem->'$(_MandroidDir)\%(Identity)')" /> - <_MonoDocInstalledItems Include="$(_MandroidDir)\mdoc.exe" /> + <_MonoDocInstalledItems Include="@(MonoDocCopyItem->'$(_MSBuildDir)\%(Identity)')" /> + <_MonoDocInstalledItems Include="$(_MSBuildDir)\mdoc.exe" /> <_MonoProfileDir>$(MonoSourceFullPath)\mcs\class\lib\monodroid @@ -79,16 +79,16 @@ /> - <_BclInstalledItem Include="@(_BclAssembly->'$(OutputPath)\lib\xbuild-frameworks\MonoAndroid\v1.0\%(Identity)')" /> + <_BclInstalledItem Include="@(_BclAssembly->'$(_BclFrameworkDir)%(Identity)')" /> <_BclInstalledItem Condition=" '$(_DebugFileExt)' == '.mdb' " - Include="@(_BclAssembly->'$(OutputPath)\lib\xbuild-frameworks\MonoAndroid\v1.0\%(Identity).mdb')" - Exclude="@(_BclExcludeDebugSymbols->'$(OutputPath)\lib\xbuild-frameworks\MonoAndroid\v1.0\%(Identity).mdb')" + Include="@(_BclAssembly->'$(_BclFrameworkDir)%(Identity).mdb')" + Exclude="@(_BclExcludeDebugSymbols->'$(_BclFrameworkDir)%(Identity).mdb')" /> <_BclInstalledItem Condition=" '$(_DebugFileExt)' == '.pdb' " - Include="@(_BclAssembly->'$(OutputPath)\lib\xbuild-frameworks\MonoAndroid\v1.0\%(Filename).pdb')" - Exclude="@(_BclExcludeDebugSymbols->'$(OutputPath)\lib\xbuild-frameworks\MonoAndroid\v1.0\%(Filename).pdb')" + Include="@(_BclAssembly->'$(_BclFrameworkDir)%(Filename).pdb')" + Exclude="@(_BclExcludeDebugSymbols->'$(_BclFrameworkDir)%(Filename).pdb')" /> @@ -97,14 +97,14 @@ <_MonoUtilitySource Include="@(_MonoUtility->'$(_MonoOutputDir)\%(Identity)')" /> - <_MonoUtilityDest Include="@(_MonoUtility->'$(_MandroidDir)\%(Identity)')" /> + <_MonoUtilityDest Include="@(_MonoUtility->'$(_MSBuildDir)\%(Identity)')" /> <_MonoUtilitySource Condition=" '$(_DebugFileExt)' == '.mdb'" Include="@(_MonoUtility->'$(_MonoOutputDir)\%(Identity).mdb')" /> <_MonoUtilityDest Condition=" '$(_DebugFileExt)' == '.mdb'" - Include="@(_MonoUtility->'$(_MandroidDir)\%(Identity).mdb')" + Include="@(_MonoUtility->'$(_MSBuildDir)\%(Identity).mdb')" /> <_MonoUtilitySource Condition=" '$(_DebugFileExt)' == '.pdb'" @@ -112,7 +112,7 @@ /> <_MonoUtilityDest Condition=" '$(_DebugFileExt)' == '.pdb'" - Include="@(_MonoUtility->'$(_MandroidDir)\%(Filename).pdb')" + Include="@(_MonoUtility->'$(_MSBuildDir)\%(Filename).pdb')" /> @@ -137,10 +137,10 @@ <_LlvmArchive Include="$(_LlvmOutputDirTop)\%(_LlvmRuntime.BuildDir)\Release\lib\*.a" /> <_LlvmSourceBinary Include="@(_LlvmRuntime->'$(_LlvmOutputDirTop)\%(BuildDir)\Release\bin\opt%(ExeSuffix)')" Condition=" '%(_LlvmRuntime.InstallBinaries)' == 'true' " /> - <_LlvmTargetBinary Include="@(_LlvmRuntime->'$(OutputPath)\%(InstallPath)opt%(ExeSuffix)')" Condition=" '%(_LlvmRuntime.InstallBinaries)' == 'true' "/> + <_LlvmTargetBinary Include="@(_LlvmRuntime->'$(_MSBuildDir)\%(InstallPath)opt%(ExeSuffix)')" Condition=" '%(_LlvmRuntime.InstallBinaries)' == 'true' "/> <_LlvmSourceBinary Include="@(_LlvmRuntime->'$(_LlvmOutputDirTop)\%(BuildDir)\Release\bin\llc%(ExeSuffix)')" Condition=" '%(_LlvmRuntime.InstallBinaries)' == 'true' " /> - <_LlvmTargetBinary Include="@(_LlvmRuntime->'$(OutputPath)\%(InstallPath)llc%(ExeSuffix)')" Condition=" '%(_LlvmRuntime.InstallBinaries)' == 'true' " /> + <_LlvmTargetBinary Include="@(_LlvmRuntime->'$(_MSBuildDir)\%(InstallPath)llc%(ExeSuffix)')" Condition=" '%(_LlvmRuntime.InstallBinaries)' == 'true' " /> @@ -223,11 +223,11 @@ /> <_InstallRuntimeOutput Condition=" '%(_MonoRuntime.DoBuild)' == 'True' " - Include="@(_MonoRuntime->'$(OutputPath)\lib\xbuild\Xamarin\Android\lib\%(Identity)\%(OutputRuntimeFilename).%(NativeLibraryExtension)')" + Include="@(_MonoRuntime->'$(_MSBuildDir)\lib\%(Identity)\%(OutputRuntimeFilename).%(NativeLibraryExtension)')" /> <_InstallUnstrippedRuntimeOutput Condition=" '%(_MonoRuntime.DoBuild)' == 'True' " - Include="@(_MonoRuntime->'$(OutputPath)\lib\xbuild\Xamarin\Android\lib\%(Identity)\%(OutputRuntimeFilename).d.%(NativeLibraryExtension)')" + Include="@(_MonoRuntime->'$(_MSBuildDir)\lib\%(Identity)\%(OutputRuntimeFilename).d.%(NativeLibraryExtension)')" /> <_ProfilerSource Condition=" '%(_MonoRuntime.DoBuild)' == 'True' And '%(_MonoRuntime.OutputProfilerFilename)' != '' " @@ -235,11 +235,11 @@ /> <_InstallProfilerOutput Condition=" '%(_MonoRuntime.DoBuild)' == 'True' And '%(_MonoRuntime.OutputProfilerFilename)' != '' " - Include="@(_MonoRuntime->'$(OutputPath)\lib\xbuild\Xamarin\Android\lib\%(Identity)\%(OutputProfilerFilename).%(NativeLibraryExtension)')" + Include="@(_MonoRuntime->'$(_MSBuildDir)\lib\%(Identity)\%(OutputProfilerFilename).%(NativeLibraryExtension)')" /> <_InstallUnstrippedProfilerOutput Condition=" '%(_MonoRuntime.DoBuild)' == 'True' And '%(_MonoRuntime.OutputProfilerFilename)' != '' " - Include="@(_MonoRuntime->'$(OutputPath)\lib\xbuild\Xamarin\Android\lib\%(Identity)\%(OutputProfilerFilename).d.%(NativeLibraryExtension)')" + Include="@(_MonoRuntime->'$(_MSBuildDir)\lib\%(Identity)\%(OutputProfilerFilename).d.%(NativeLibraryExtension)')" /> <_MonoBtlsSource Condition=" '%(_MonoRuntime.DoBuild)' == 'True' And '%(_MonoRuntime.OutputMonoBtlsFilename)' != '' " @@ -247,11 +247,11 @@ /> <_InstallMonoBtlsOutput Condition=" '%(_MonoRuntime.DoBuild)' == 'True' And '%(_MonoRuntime.OutputMonoBtlsFilename)' != '' " - Include="@(_MonoRuntime->'$(OutputPath)\lib\xbuild\Xamarin\Android\lib\%(Identity)\%(OutputMonoBtlsFilename).%(NativeLibraryExtension)')" + Include="@(_MonoRuntime->'$(_MSBuildDir)\lib\%(Identity)\%(OutputMonoBtlsFilename).%(NativeLibraryExtension)')" /> <_InstallUnstrippedMonoBtlsOutput Condition=" '%(_MonoRuntime.DoBuild)' == 'True' And '%(_MonoRuntime.OutputMonoBtlsFilename)' != '' " - Include="@(_MonoRuntime->'$(OutputPath)\lib\xbuild\Xamarin\Android\lib\%(Identity)\%(OutputMonoBtlsFilename).d.%(NativeLibraryExtension)')" + Include="@(_MonoRuntime->'$(_MSBuildDir)\lib\%(Identity)\%(OutputMonoBtlsFilename).d.%(NativeLibraryExtension)')" /> <_MonoPosixHelperSource Condition=" '%(_MonoRuntime.DoBuild)' == 'True' And '%(_MonoRuntime.OutputMonoPosixHelperFilename)' != '' " @@ -259,11 +259,11 @@ /> <_InstallMonoPosixHelperOutput Condition=" '%(_MonoRuntime.DoBuild)' == 'True' And '%(_MonoRuntime.OutputMonoPosixHelperFilename)' != '' " - Include="@(_MonoRuntime->'$(OutputPath)\lib\xbuild\Xamarin\Android\lib\%(Identity)\%(OutputMonoPosixHelperFilename).%(NativeLibraryExtension)')" + Include="@(_MonoRuntime->'$(_MSBuildDir)\lib\%(Identity)\%(OutputMonoPosixHelperFilename).%(NativeLibraryExtension)')" /> <_InstallUnstrippedMonoPosixHelperOutput Condition=" '%(_MonoRuntime.DoBuild)' == 'True' And '%(_MonoRuntime.OutputMonoPosixHelperFilename)' != '' " - Include="@(_MonoRuntime->'$(OutputPath)\lib\xbuild\Xamarin\Android\lib\%(Identity)\%(OutputMonoPosixHelperFilename).d.%(NativeLibraryExtension)')" + Include="@(_MonoRuntime->'$(_MSBuildDir)\lib\%(Identity)\%(OutputMonoPosixHelperFilename).d.%(NativeLibraryExtension)')" /> <_RuntimeEglibHeaderSource Condition=" '%(_MonoRuntime.DoBuild)' == 'True' " @@ -271,7 +271,7 @@ /> <_RuntimeEglibHeaderOutput Condition=" '%(_MonoRuntime.DoBuild)' == 'True' " - Include="@(_MonoRuntime->'$(OutputPath)\include\%(Identity)\eglib\config.h');@(_MonoRuntime->'$(OutputPath)\include\%(Identity)\eglib\eglib-config.h')" + Include="@(_MonoRuntime->'$(_OutputIncludeDir)%(Identity)\eglib\config.h');@(_MonoRuntime->'$(_OutputIncludeDir)%(Identity)\eglib\eglib-config.h')" /> <_MonoConstsSource Condition=" '%(_MonoRuntime.DoBuild)' == 'True' " @@ -279,7 +279,7 @@ /> <_MonoConstsOutput Condition=" '%(_MonoRuntime.DoBuild)' == 'True' " - Include="$(OutputPath)\include\Consts.cs" + Include="$(_OutputIncludeDir)Consts.cs" /> <_RuntimeBuildStamp Condition=" '%(_MonoRuntime.DoBuild)' == 'true' " Include="@(_MonoRuntime->'$(IntermediateOutputPath)\%(Identity)\.stamp')" /> @@ -300,15 +300,15 @@ + Inputs="@(_RuntimeSource);@(_ProfilerSource);@(_MonoPosixHelperSource);@(_RuntimeEglibHeaderSource)" + Outputs="@(_InstallRuntimeOutput);@(_InstallProfilerOutput);@(_InstallMonoPosixHelperOutput);@(_RuntimeEglibHeaderOutput)"> @@ -346,7 +346,7 @@ /> @@ -360,7 +360,7 @@ /> @@ -374,13 +374,13 @@ /> <_MonoCilStripSource Include="$(_MonoOutputDir)\mono-cil-strip.exe" /> - <_MonoCilStripDest Include="$(_MandroidDir)\cil-strip.exe" /> + <_MonoCilStripDest Include="$(_MSBuildDir)\cil-strip.exe" /> <_MonoCilStripSource Condition=" '$(_DebugFileExt)' == '.mdb' " Include="$(_MonoOutputDir)\mono-cil-strip.exe.mdb" @@ -395,13 +395,13 @@ /> <_MonoCilStripDest Condition=" '$(_DebugFileExt)' == '.pdb' " - Include="$(_MandroidDir)\cil-strip.pdb" + Include="$(_MSBuildDir)\cil-strip.pdb" /> - + - + - + + Outputs="@(_BclInstalledItem);$(_BclFrameworkDir)RedistList\FrameworkList.xml"> - - + + <_PackageConfigFiles Include="$(_SourceTopDir)\src\Xamarin.Android.Build.Tasks\packages.config" /> @@ -453,14 +453,14 @@ /> @@ -545,23 +545,22 @@ --> - - - + + @@ -585,10 +584,10 @@ - - diff --git a/build-tools/scripts/BuildEverything.mk b/build-tools/scripts/BuildEverything.mk index 694db08ae35..d3933ea1cee 100644 --- a/build-tools/scripts/BuildEverything.mk +++ b/build-tools/scripts/BuildEverything.mk @@ -99,33 +99,33 @@ framework-assemblies: $(foreach a, $(API_LEVELS), \ CUR_VERSION=`echo "$(ALL_FRAMEWORKS)"|tr -s " "|cut -d " " -s -f $(a)`; \ $(foreach conf, $(CONFIGURATIONS), \ - REDIST_FILE=bin/$(conf)/lib/xbuild-frameworks/MonoAndroid/$${CUR_VERSION}/RedistList/FrameworkList.xml; \ + REDIST_FILE=bin/$(conf)/lib/xamarin.android/xbuild-frameworks/MonoAndroid/$${CUR_VERSION}/RedistList/FrameworkList.xml; \ grep -q $${PREV_VERSION} $${REDIST_FILE}; \ if [ $$? -ne 0 ] ; then \ - rm -f bin/$(conf)/lib/xbuild-frameworks/MonoAndroid/$${CUR_VERSION}/RedistList/FrameworkList.xml; \ + rm -f bin/$(conf)/lib/xamarin.android/xbuild-frameworks/MonoAndroid/$${CUR_VERSION}/RedistList/FrameworkList.xml; \ fi; \ $(MSBUILD) $(MSBUILD_FLAGS) src/Mono.Android/Mono.Android.csproj /p:Configuration=$(conf) $(_MSBUILD_ARGS) \ /p:AndroidApiLevel=$(a) /p:AndroidPlatformId=$(word $(a), $(ALL_PLATFORM_IDS)) /p:AndroidFrameworkVersion=$${CUR_VERSION} \ /p:AndroidPreviousFrameworkVersion=$${PREV_VERSION}; ) \ PREV_VERSION=$${CUR_VERSION}; ) $(foreach conf, $(CONFIGURATIONS), \ - rm -f bin/$(conf)/lib/xbuild-frameworks/MonoAndroid/v1.0/Xamarin.Android.NUnitLite.dll; \ + rm -f bin/$(conf)/lib/xamarin.android/xbuild-frameworks/MonoAndroid/v1.0/Xamarin.Android.NUnitLite.dll; \ $(MSBUILD) $(MSBUILD_FLAGS) src/Xamarin.Android.NUnitLite/Xamarin.Android.NUnitLite.csproj /p:Configuration=$(conf) $(_MSBUILD_ARGS) \ /p:AndroidApiLevel=$(firstword $(API_LEVELS)) /p:AndroidPlatformId=$(word $(firstword $(API_LEVELS)), $(ALL_PLATFORM_IDS)) /p:AndroidFrameworkVersion=$(firstword $(FRAMEWORKS)); ) _latest_framework=$$($(MSBUILD) /p:DoNotLoadOSProperties=True /nologo /v:minimal /t:GetAndroidLatestFrameworkVersion build-tools/scripts/Info.targets | tr -d '[[:space:]]') ; \ $(foreach conf, $(CONFIGURATIONS), \ - rm -f "bin/$(conf)/lib/xbuild-frameworks/MonoAndroid/$$_latest_framework"/Mono.Android.Export.* ; \ + rm -f "bin/$(conf)/lib/xamarin.android/xbuild-frameworks/MonoAndroid/$$_latest_framework"/Mono.Android.Export.* ; \ $(MSBUILD) $(MSBUILD_FLAGS) src/Mono.Android.Export/Mono.Android.Export.csproj /p:Configuration=$(conf) $(_MSBUILD_ARGS) \ /p:AndroidApiLevel=$(firstword $(API_LEVELS)) /p:AndroidPlatformId=$(word $(firstword $(API_LEVELS)), $(ALL_PLATFORM_IDS)) /p:AndroidFrameworkVersion=$(firstword $(FRAMEWORKS)); ) \ $(foreach conf, $(CONFIGURATIONS), \ - rm -f "bin/$(conf)/lib/xbuild-frameworks/MonoAndroid/$$_latest_framework"/OpenTK-1.0.* ; \ + rm -f "bin/$(conf)/lib/xamarin.android/xbuild-frameworks/MonoAndroid/$$_latest_framework"/OpenTK-1.0.* ; \ $(MSBUILD) $(MSBUILD_FLAGS) src/OpenTK-1.0/OpenTK.csproj /p:Configuration=$(conf) $(_MSBUILD_ARGS) \ /p:AndroidApiLevel=$(firstword $(API_LEVELS)) /p:AndroidPlatformId=$(word $(firstword $(API_LEVELS)), $(ALL_PLATFORM_IDS)) /p:AndroidFrameworkVersion=$(firstword $(FRAMEWORKS)); ) opentk-jcw: $(foreach a, $(API_LEVELS), \ $(foreach conf, $(CONFIGURATIONS), \ - touch bin/$(conf)/lib/xbuild-frameworks/MonoAndroid/*/OpenTK-1.0.dll; \ + touch bin/$(conf)/lib/xamarin.android/xbuild-frameworks/MonoAndroid/*/OpenTK-1.0.dll; \ $(MSBUILD) $(MSBUILD_FLAGS) src/OpenTK-1.0/OpenTK.csproj /t:GenerateJavaCallableWrappers /p:Configuration=$(conf) $(_MSBUILD_ARGS) \ /p:AndroidApiLevel=$(a) /p:AndroidPlatformId=$(word $(a), $(ALL_PLATFORM_IDS)) /p:AndroidFrameworkVersion=$(word $(a), $(ALL_FRAMEWORKS)); )) @@ -159,10 +159,10 @@ package-oss $(ZIP_OUTPUT): _exclude_list=".__exclude_list.txt"; \ ls -1d $(_BUNDLE_ZIPS_EXCLUDE) > "$$_exclude_list" 2>/dev/null ; \ for c in $(CONFIGURATIONS) ; do \ - _sl="$(ZIP_OUTPUT_BASENAME)/bin/$$c/lib/xbuild/.__sys_links.txt"; \ + _sl="$(ZIP_OUTPUT_BASENAME)/bin/$$c/lib/xamarin.android/xbuild/.__sys_links.txt"; \ if [ ! -f "$$_sl" ]; then continue; fi; \ for f in `cat $$_sl` ; do \ - echo "$(ZIP_OUTPUT_BASENAME)/bin/$$c/lib/xbuild/$$f" >> "$$_exclude_list"; \ + echo "$(ZIP_OUTPUT_BASENAME)/bin/$$c/lib/xamarin.android/xbuild/$$f" >> "$$_exclude_list"; \ done; \ done; \ zip -r "$(ZIP_OUTPUT)" \ diff --git a/Configuration.Java.Interop.Override.props b/build-tools/scripts/Configuration.Java.Interop.Override.props similarity index 75% rename from Configuration.Java.Interop.Override.props rename to build-tools/scripts/Configuration.Java.Interop.Override.props index 0442c16fb63..21f49311f20 100644 --- a/Configuration.Java.Interop.Override.props +++ b/build-tools/scripts/Configuration.Java.Interop.Override.props @@ -1,6 +1,6 @@ - $(MSBuildThisFileDirectory)..\..\bin\$(Configuration)\lib\mandroid\ + $(MSBuildThisFileDirectory)..\..\bin\$(Configuration)\lib\xamarin.android\xbuild\Xamarin\Android\ diff --git a/build-tools/scripts/JavaCallableWrappers.targets b/build-tools/scripts/JavaCallableWrappers.targets index 542af48db99..12b39c45f3d 100644 --- a/build-tools/scripts/JavaCallableWrappers.targets +++ b/build-tools/scripts/JavaCallableWrappers.targets @@ -6,8 +6,9 @@ Outputs="$(OutputPath)mono.android.jar"> - $(MSBuildProjectDirectory)\$(OutputPath) - "$(MSBuildThisFileDirectory)..\..\bin\$(Configuration)\lib\mandroid\jcw-gen.exe" -v10 + $(OutputPath) + $(MSBuildProjectDirectory)\$(OutputPath) + "$(XAInstallPrefix)xbuild\Xamarin\Android\jcw-gen.exe" -v10 <_LibDirs>-L "$(OutputPathAbs)" -L "$(OutputPathAbs)..\v1.0\" -L "$(OutputPathAbs)..\v1.0\Facades" <_Out>-o "$(MSBuildProjectDirectory)\$(IntermediateOutputPath)jcw\src" diff --git a/build-tools/scripts/MonoAndroidFramework.props b/build-tools/scripts/MonoAndroidFramework.props index 5336aaeed6d..ae198fe2e66 100644 --- a/build-tools/scripts/MonoAndroidFramework.props +++ b/build-tools/scripts/MonoAndroidFramework.props @@ -3,7 +3,7 @@ $(AndroidFrameworkVersion) - $(MSBuildThisFileDirectory)..\..\bin\$(Configuration)\lib\xbuild-frameworks + $(XAInstallPrefix)xbuild-frameworks $(TargetFrameworkRootPath)\MonoAndroid\v1.0 diff --git a/build-tools/unix-distribution-setup/unix-distribution-setup.targets b/build-tools/unix-distribution-setup/unix-distribution-setup.targets index 9c402ac7d75..648abf51e8d 100644 --- a/build-tools/unix-distribution-setup/unix-distribution-setup.targets +++ b/build-tools/unix-distribution-setup/unix-distribution-setup.targets @@ -1,23 +1,18 @@ - - + + <_CrossDir>$(OutputPath)lib\xamarin.android\xbuild\Xamarin\Android\$(HostOS) + - <_ExecutableScript Include="$(OutputPath)bin\cross*" /> + <_ExecutableScript Include="$(_CrossDir)\cross*" /> <_ExecutableScript - Condition=" Exists('$(OutputPath)bin\llc') " - Include="$(OutputPath)bin\llc" + Condition=" Exists('$(_CrossDir)\llc') " + Include="$(_CrossDir)\llc" /> <_ExecutableScript - Condition=" Exists('$(OutputPath)bin\opt') " - Include="$(OutputPath)bin\opt" + Condition=" Exists('$(_CrossDir)\opt') " + Include="$(_CrossDir)\opt" /> - diff --git a/build-tools/xa-prep-tasks/Xamarin.Android.BuildTools.PrepTasks/HashFileContents.cs b/build-tools/xa-prep-tasks/Xamarin.Android.BuildTools.PrepTasks/HashFileContents.cs new file mode 100644 index 00000000000..fde3af0fdf3 --- /dev/null +++ b/build-tools/xa-prep-tasks/Xamarin.Android.BuildTools.PrepTasks/HashFileContents.cs @@ -0,0 +1,94 @@ +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.IO; +using System.Linq; +using System.Security.Cryptography; +using System.Text; + +using Microsoft.Build.Framework; +using Microsoft.Build.Utilities; + +namespace Xamarin.Android.BuildTools.PrepTasks +{ + public class HashFileContents : Task + { + [Required] + public ITaskItem[] Files { get; set; } + + + public string HashAlgorithm { get; set; } = "SHA1"; + + public int AbbreviatedHashLength { get; set; } = 8; + + [Output] + // Specifies %(Hashes.Target), %(Hashes.AbbreviatedHash). Hash is %(Hashes.Identity)). + public ITaskItem[] Hashes { get; set; } + + [Output] + public string CompleteHash { get; set; } + + [Output] + public string AbbreviatedCompleteHash { get; set; } + + public override bool Execute () + { + Log.LogMessage (MessageImportance.Low, $"Task {nameof (HashFileContents)}"); + Log.LogMessage (MessageImportance.Low, $" {nameof (AbbreviatedHashLength)}: {AbbreviatedHashLength}"); + Log.LogMessage (MessageImportance.Low, $" {nameof (HashAlgorithm)}: {HashAlgorithm}"); + Log.LogMessage (MessageImportance.Low, $" {nameof (Files)}:"); + foreach (var e in Files) { + Log.LogMessage (MessageImportance.Low, $" {e.ItemSpec}"); + } + + ProcessFiles (); + + Log.LogMessage (MessageImportance.Low, $" [Output] {nameof (AbbreviatedCompleteHash)}: {AbbreviatedCompleteHash}"); + Log.LogMessage (MessageImportance.Low, $" [Output] {nameof (CompleteHash)}: {CompleteHash}"); + Log.LogMessage (MessageImportance.Low, $" [Output] {nameof (Hashes)}:"); + foreach (var e in Hashes) { + Log.LogMessage (MessageImportance.Low, $" {e.GetMetadata ("Target")}: {e.ItemSpec}:"); + } + return !Log.HasLoggedErrors; + } + + void ProcessFiles () + { + var hashes = new List (Files.Length); + byte[] block = new byte [4096]; + using (var complete = System.Security.Cryptography.HashAlgorithm.Create (HashAlgorithm)) { + foreach (var file in Files) { + var hash = ProcessFile (complete, block, file.ItemSpec); + var e = new TaskItem (hash); + e.SetMetadata ("Target", Path.GetFullPath (file.ItemSpec)); + e.SetMetadata ("AbbreviatedHash", hash.Substring (0, AbbreviatedHashLength)); + hashes.Add (e); + } + complete.TransformFinalBlock (block, 0, 0); + CompleteHash = FormatHash (complete.Hash); + AbbreviatedCompleteHash = CompleteHash.Substring (0, AbbreviatedHashLength); + } + Hashes = hashes.ToArray (); + } + + string ProcessFile (HashAlgorithm complete, byte[] block, string path) + { + using (var fileHash = System.Security.Cryptography.HashAlgorithm.Create (HashAlgorithm)) + using (var file = File.OpenRead (path)) { + int read; + while ((read = file.Read (block, 0, block.Length)) > 0) { + complete.TransformBlock (block, 0, read, block, 0); + fileHash.TransformBlock (block, 0, read, block, 0); + } + fileHash.TransformFinalBlock (block, 0, 0); + return FormatHash (fileHash.Hash); + } + } + + string FormatHash (byte[] hash) + { + return string.Join ("", hash.Select (b => b.ToString ("x2"))); + } + } +} + diff --git a/build-tools/xa-prep-tasks/xa-prep-tasks.csproj b/build-tools/xa-prep-tasks/xa-prep-tasks.csproj index a11a6d21259..36b7b2ccc9c 100644 --- a/build-tools/xa-prep-tasks/xa-prep-tasks.csproj +++ b/build-tools/xa-prep-tasks/xa-prep-tasks.csproj @@ -41,6 +41,7 @@ + diff --git a/build-tools/xa-prep-tasks/xa-prep-tasks.targets b/build-tools/xa-prep-tasks/xa-prep-tasks.targets index c6012c13a33..8a177a7bdb6 100644 --- a/build-tools/xa-prep-tasks/xa-prep-tasks.targets +++ b/build-tools/xa-prep-tasks/xa-prep-tasks.targets @@ -12,9 +12,8 @@ - - <_XAPrefix>..\..\bin\$(Configuration)\lib\xbuild\Xamarin\Android + <_XAPrefix>$(XAInstallPrefix)xbuild\Xamarin\Android <_VersionFile>..\..\bin\$(Configuration)\Version <_VersionCommitFile>..\..\bin\$(Configuration)\Version.commit <_VersionRevFile>..\..\bin\$(Configuration)\Version.rev @@ -23,6 +22,7 @@ <_XAVersionCommitFile>$(_XAPrefix)\Version.commit <_XAVersionRevFile>$(_XAPrefix)\Version.rev + MonoAndroid $(AndroidFrameworkVersion) - $(MSBuildThisFileDirectory)..\..\bin\$(Configuration)\lib\xbuild-frameworks + $(XAInstallPrefix)xbuild-frameworks true full false - ..\..\bin\Debug\lib\xbuild-frameworks\MonoAndroid\$(AndroidFrameworkVersion) + $(XAInstallPrefix)xbuild-frameworks\MonoAndroid\$(AndroidFrameworkVersion) DEBUG; prompt 4 @@ -31,7 +31,7 @@ true full true - ..\..\bin\Release\lib\xbuild-frameworks\MonoAndroid\$(AndroidFrameworkVersion) + $(XAInstallPrefix)xbuild-frameworks\MonoAndroid\$(AndroidFrameworkVersion) prompt 4 false diff --git a/src/Mono.Android/Mono.Android.csproj b/src/Mono.Android/Mono.Android.csproj index 11c32affcf7..9fccb14d309 100644 --- a/src/Mono.Android/Mono.Android.csproj +++ b/src/Mono.Android/Mono.Android.csproj @@ -14,13 +14,13 @@ MonoAndroid v1.0 - $(MSBuildThisFileDirectory)..\..\bin\$(Configuration)\lib\xbuild-frameworks + $(XAInstallPrefix)xbuild-frameworks true full false - ..\..\bin\Debug\lib\xbuild-frameworks\MonoAndroid\$(AndroidFrameworkVersion) + $(XAInstallPrefix)xbuild-frameworks\MonoAndroid\$(AndroidFrameworkVersion)\ DEBUG;JAVA_INTEROP;NET_2_0 prompt 4 @@ -32,7 +32,7 @@ true full true - ..\..\bin\Release\lib\xbuild-frameworks\MonoAndroid\$(AndroidFrameworkVersion) + $(XAInstallPrefix)xbuild-frameworks\MonoAndroid\$(AndroidFrameworkVersion)\ JAVA_INTEROP;NET_2_0 prompt 4 diff --git a/src/Mono.Android/Mono.Android.targets b/src/Mono.Android/Mono.Android.targets index fcba4609605..0093ce67c58 100644 --- a/src/Mono.Android/Mono.Android.targets +++ b/src/Mono.Android/Mono.Android.targets @@ -67,7 +67,7 @@ Outputs="$(IntermediateOutputPath)mcw\Mono.Android.projitems"> - "$(OutputPath)..\..\..\mandroid\generator.exe" + "$(XAInstallPrefix)xbuild\Xamarin\Android\generator.exe" <_GenFlags>--public --product-version=7 <_ApiLevel>--api-level=$(AndroidApiLevel) <_Out>-o "$(IntermediateOutputPath)mcw" diff --git a/src/Mono.Android/Test/Mono.Android-Tests.csproj b/src/Mono.Android/Test/Mono.Android-Tests.csproj index 4811f05e98c..0060e645364 100644 --- a/src/Mono.Android/Test/Mono.Android-Tests.csproj +++ b/src/Mono.Android/Test/Mono.Android-Tests.csproj @@ -98,7 +98,7 @@ - + diff --git a/src/Mono.Data.Sqlite/Mono.Data.Sqlite.csproj b/src/Mono.Data.Sqlite/Mono.Data.Sqlite.csproj index adae3a7ad6f..46d9d2dfb51 100644 --- a/src/Mono.Data.Sqlite/Mono.Data.Sqlite.csproj +++ b/src/Mono.Data.Sqlite/Mono.Data.Sqlite.csproj @@ -26,7 +26,7 @@ true full false - ..\..\bin\$(Configuration)\lib\xbuild-frameworks\MonoAndroid\v1.0 + $(XAInstallPrefix)xbuild-frameworks\MonoAndroid\v1.0 DEBUG;TRACE;NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE;SQLITE_STANDARD;MONODROID prompt 4 @@ -37,7 +37,7 @@ true - ..\..\bin\$(Configuration)\lib\xbuild-frameworks\MonoAndroid\v1.0 + $(XAInstallPrefix)xbuild-frameworks\MonoAndroid\v1.0 prompt 4 false @@ -174,11 +174,11 @@ Locale.cs - + Consts.cs - + diff --git a/src/Mono.Posix/Mono.Posix.csproj b/src/Mono.Posix/Mono.Posix.csproj index a7c3c20e8d2..a93c3cc18ec 100644 --- a/src/Mono.Posix/Mono.Posix.csproj +++ b/src/Mono.Posix/Mono.Posix.csproj @@ -26,7 +26,7 @@ true full false - ..\..\bin\$(Configuration)\lib\xbuild-frameworks\MonoAndroid\v1.0 + $(XAInstallPrefix)xbuild-frameworks\MonoAndroid\v1.0 DEBUG;TRACE;NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE;MONODROID prompt True @@ -37,7 +37,7 @@ true - ..\..\bin\$(Configuration)\lib\xbuild-frameworks\MonoAndroid\v1.0 + $(XAInstallPrefix)xbuild-frameworks\MonoAndroid\v1.0 prompt 4 false @@ -230,11 +230,11 @@ Locale.cs - + Consts.cs - + diff --git a/src/OpenTK-1.0/OpenTK.csproj b/src/OpenTK-1.0/OpenTK.csproj index c4b33c22d82..57fb44b1970 100644 --- a/src/OpenTK-1.0/OpenTK.csproj +++ b/src/OpenTK-1.0/OpenTK.csproj @@ -28,10 +28,10 @@ true full false - ..\..\bin\$(Configuration)\lib\xbuild-frameworks\MonoAndroid\$(AndroidFrameworkVersion) + $(XAInstallPrefix)xbuild-frameworks\MonoAndroid\$(AndroidFrameworkVersion) prompt 4 - ..\..\bin\$(Configuration)\lib\xbuild-frameworks\MonoAndroid\$(AndroidFrameworkVersion)\OpenTK-1.0.xml + $(XAInstallPrefix)xbuild-frameworks\MonoAndroid\$(AndroidFrameworkVersion)\OpenTK-1.0.xml None false @@ -39,10 +39,10 @@ true full true - ..\..\bin\$(Configuration)\lib\xbuild-frameworks\MonoAndroid\$(AndroidFrameworkVersion) + $(XAInstallPrefix)xbuild-frameworks\MonoAndroid\$(AndroidFrameworkVersion) prompt 4 - ..\..\bin\$(Configuration)\lib\xbuild-frameworks\MonoAndroid\$(AndroidFrameworkVersion)\OpenTK-1.0.xml + $(XAInstallPrefix)xbuild-frameworks\MonoAndroid\$(AndroidFrameworkVersion)\OpenTK-1.0.xml false diff --git a/src/System.Drawing.Primitives/System.Drawing.Primitives.mdproj b/src/System.Drawing.Primitives/System.Drawing.Primitives.mdproj index f231340f7cc..8900428bdfe 100644 --- a/src/System.Drawing.Primitives/System.Drawing.Primitives.mdproj +++ b/src/System.Drawing.Primitives/System.Drawing.Primitives.mdproj @@ -4,12 +4,13 @@ AnyCPU GenericProject {C9FF2E4D-D927-479E-838B-647C16763F64} - ..\..\bin\$(Configuration)\lib\xbuild-frameworks\MonoAndroid\v1.0\Facades + $(XAInstallPrefix)xbuild-frameworks\MonoAndroid\v1.0\Facades + $(XAInstallPrefix)xbuild-frameworks\MonoAndroid\v1.0\Facades diff --git a/src/System.EnterpriseServices/System.EnterpriseServices.csproj b/src/System.EnterpriseServices/System.EnterpriseServices.csproj index 3a837497e59..32fbe78e72f 100644 --- a/src/System.EnterpriseServices/System.EnterpriseServices.csproj +++ b/src/System.EnterpriseServices/System.EnterpriseServices.csproj @@ -17,7 +17,7 @@ true full false - ..\..\bin\Debug\lib\xbuild-frameworks\MonoAndroid\v1.0 + $(XAInstallPrefix)xbuild-frameworks\MonoAndroid\v1.0\ DEBUG; prompt 4 @@ -26,7 +26,7 @@ true - ..\..\bin\Release\lib\xbuild-frameworks\MonoAndroid\v1.0 + $(XAInstallPrefix)xbuild-frameworks\MonoAndroid\v1.0\ prompt 4 false diff --git a/src/Xamarin.Android.Build.Tasks/Tasks/Aot.cs b/src/Xamarin.Android.Build.Tasks/Tasks/Aot.cs index 6c66bdd696d..b6ec4329499 100644 --- a/src/Xamarin.Android.Build.Tasks/Tasks/Aot.cs +++ b/src/Xamarin.Android.Build.Tasks/Tasks/Aot.cs @@ -41,9 +41,6 @@ public class Aot : AsyncTask [Required] public string AndroidApiLevel { get; set; } - [Required] - public string SdkBinDirectory { get; set; } - [Required] public ITaskItem[] ResolvedAssemblies { get; set; } @@ -210,7 +207,6 @@ bool DoExecute () { LogDebugMessage (" EnableLLVM: {0}", EnableLLVM); LogDebugMessage (" IntermediateAssemblyDir: {0}", IntermediateAssemblyDir); LogDebugMessage (" LinkMode: {0}", LinkMode); - LogDebugMessage (" SdkBinDirectory: {0}", SdkBinDirectory); LogDebugMessage (" SupportedAbis: {0}", SupportedAbis); LogDebugTaskItems (" ResolvedAssemblies:", ResolvedAssemblies); LogDebugTaskItems (" AdditionalNativeLibraryReferences:", AdditionalNativeLibraryReferences); @@ -293,6 +289,8 @@ IEnumerable GetAotConfigs () NdkUtil.NdkVersion ndkVersion; bool hasNdkVersion = NdkUtil.GetNdkToolchainRelease (AndroidNdkDirectory, out ndkVersion); + var sdkBinDirectory = MonoAndroidHelper.GetOSBinPath (); + var abis = SupportedAbis.Split (new char[] { ',', ';' }, StringSplitOptions.RemoveEmptyEntries); foreach (var abi in abis) { string aotCompiler = ""; @@ -302,14 +300,14 @@ IEnumerable GetAotConfigs () switch (abi) { case "armeabi": - aotCompiler = Path.Combine (SdkBinDirectory, "cross-arm"); + aotCompiler = Path.Combine (sdkBinDirectory, "cross-arm"); outdir = Path.Combine (AotOutputDirectory, "armeabi"); mtriple = "armv5-linux-gnueabi"; arch = AndroidTargetArch.Arm; break; case "armeabi-v7a": - aotCompiler = Path.Combine (SdkBinDirectory, "cross-arm"); + aotCompiler = Path.Combine (sdkBinDirectory, "cross-arm"); outdir = Path.Combine (AotOutputDirectory, "armeabi-v7a"); mtriple = "armv7-linux-gnueabi"; arch = AndroidTargetArch.Arm; @@ -318,21 +316,21 @@ IEnumerable GetAotConfigs () case "arm64": case "arm64-v8a": case "aarch64": - aotCompiler = Path.Combine (SdkBinDirectory, "cross-arm64"); + aotCompiler = Path.Combine (sdkBinDirectory, "cross-arm64"); outdir = Path.Combine (AotOutputDirectory, "arm64-v8a"); mtriple = "aarch64-linux-android"; arch = AndroidTargetArch.Arm64; break; case "x86": - aotCompiler = Path.Combine (SdkBinDirectory, "cross-x86"); + aotCompiler = Path.Combine (sdkBinDirectory, "cross-x86"); outdir = Path.Combine (AotOutputDirectory, "x86"); mtriple = "i686-linux-android"; arch = AndroidTargetArch.X86; break; case "x86_64": - aotCompiler = Path.Combine (SdkBinDirectory, "cross-x86_64"); + aotCompiler = Path.Combine (sdkBinDirectory, "cross-x86_64"); outdir = Path.Combine (AotOutputDirectory, "x86_64"); mtriple = "x86_64-linux-android"; arch = AndroidTargetArch.X86_64; @@ -402,7 +400,7 @@ IEnumerable GetAotConfigs () aotOptions.Add ("mtriple=" + mtriple); aotOptions.Add ("tool-prefix=" + GetShortPath (toolPrefix)); aotOptions.Add ("ld-flags=" + ldFlags); - aotOptions.Add ("llvm-path=" + GetShortPath (SdkBinDirectory)); + aotOptions.Add ("llvm-path=" + GetShortPath (sdkBinDirectory)); aotOptions.Add ("temp-path=" + GetShortPath (tempDir)); string aotOptionsStr = (EnableLLVM ? "--llvm " : "") + "--aot=" + string.Join (",", aotOptions); diff --git a/src/Xamarin.Android.Build.Tasks/Tasks/BuildApk.cs b/src/Xamarin.Android.Build.Tasks/Tasks/BuildApk.cs index ad4bd013178..c98b6f23379 100644 --- a/src/Xamarin.Android.Build.Tasks/Tasks/BuildApk.cs +++ b/src/Xamarin.Android.Build.Tasks/Tasks/BuildApk.cs @@ -24,8 +24,6 @@ public class BuildApk : Task { public string AndroidNdkDirectory { get; set; } - public string SdkBinDirectory { get; set; } - [Required] public string ApkInputPath { get; set; } @@ -616,6 +614,7 @@ private void AddGdbservers (ZipArchiveEx apk, ArchiveFileList files, string supp if (string.IsNullOrEmpty (AndroidNdkDirectory)) return; + var sdkBinDirectory = MonoAndroidHelper.GetOSBinPath (); int count = 0; foreach (var sabi in supportedAbis.Split (new char[] { ',', ';' }, StringSplitOptions.RemoveEmptyEntries)) { var arch = GdbPaths.GetArchFromAbi (sabi); @@ -627,7 +626,7 @@ private void AddGdbservers (ZipArchiveEx apk, ArchiveFileList files, string supp string.Equals (f.Item2, "lib/" + sabi, StringComparison.Ordinal))) continue; var entryName = string.Format ("lib/{0}/{1}", sabi, debugServerFile); - var debugServerPath = GdbPaths.GetDebugServerPath (debugServer, arch, AndroidNdkDirectory, SdkBinDirectory); + var debugServerPath = GdbPaths.GetDebugServerPath (debugServer, arch, AndroidNdkDirectory, sdkBinDirectory); if (!File.Exists (debugServerPath)) continue; Log.LogDebugMessage ("Adding {0} debug server '{1}' to the APK as '{2}'", sabi, debugServerPath, entryName); diff --git a/src/Xamarin.Android.Build.Tasks/Tasks/Generator.cs b/src/Xamarin.Android.Build.Tasks/Tasks/Generator.cs index b9753b83f84..f94e7287e36 100644 --- a/src/Xamarin.Android.Build.Tasks/Tasks/Generator.cs +++ b/src/Xamarin.Android.Build.Tasks/Tasks/Generator.cs @@ -147,7 +147,7 @@ protected override string GenerateCommandLineCommands () } protected override string ToolName { - get { return OS.IsWindows ? "generator.exe" : "generator"; } + get { return "generator.exe"; } } protected override string GenerateFullPathToTool () diff --git a/src/Xamarin.Android.Build.Tasks/Tasks/ImportJavaDoc.cs b/src/Xamarin.Android.Build.Tasks/Tasks/ImportJavaDoc.cs index 938a50959c4..d160a6672f6 100644 --- a/src/Xamarin.Android.Build.Tasks/Tasks/ImportJavaDoc.cs +++ b/src/Xamarin.Android.Build.Tasks/Tasks/ImportJavaDoc.cs @@ -23,12 +23,14 @@ public class ImportJavaDoc : ToolTask public string OutputDocDirectory { get; set; } protected override string ToolName { - get { return "javadoc-to-mdoc"; } + get { return "javadoc-to-mdoc.exe"; } } protected override string GenerateFullPathToTool () { - return MonoDroidSdk.JavaDocToMDocExe; + return Path.Combine ( + Path.GetFullPath (Path.GetDirectoryName (GetType ().Assembly.Location)), + "javadoc-to-mdoc.exe"); } protected override string GenerateCommandLineCommands () diff --git a/src/Xamarin.Android.Build.Tasks/Tasks/MDoc.cs b/src/Xamarin.Android.Build.Tasks/Tasks/MDoc.cs index 1faccf4c188..1981e1fe2a4 100644 --- a/src/Xamarin.Android.Build.Tasks/Tasks/MDoc.cs +++ b/src/Xamarin.Android.Build.Tasks/Tasks/MDoc.cs @@ -21,7 +21,7 @@ public class MDoc : ToolTask public bool RunExport { get; set; } protected override string ToolName { - get { return OS.IsWindows ? "mdoc.exe" : "mdoc"; } + get { return "mdoc.exe"; } } protected override string GenerateFullPathToTool () diff --git a/src/Xamarin.Android.Build.Tasks/Tasks/ResolveSdksTask.cs b/src/Xamarin.Android.Build.Tasks/Tasks/ResolveSdksTask.cs index 61d8dd95071..2a8f0ed1051 100644 --- a/src/Xamarin.Android.Build.Tasks/Tasks/ResolveSdksTask.cs +++ b/src/Xamarin.Android.Build.Tasks/Tasks/ResolveSdksTask.cs @@ -125,34 +125,23 @@ public bool RunTask () Log.LogDebugMessage ("ResolveSdksTask:"); Log.LogDebugMessage (" AndroidApiLevel: {0}", AndroidApiLevel); Log.LogDebugMessage (" AndroidSdkBuildToolsVersion: {0}", AndroidSdkBuildToolsVersion); + Log.LogDebugMessage ($" {nameof (AndroidSdkPath)}: {AndroidSdkPath}"); + Log.LogDebugMessage ($" {nameof (AndroidNdkPath)}: {AndroidNdkPath}"); Log.LogDebugTaskItems (" ReferenceAssemblyPaths: ", ReferenceAssemblyPaths); Log.LogDebugMessage (" TargetFrameworkVersion: {0}", TargetFrameworkVersion); Log.LogDebugMessage (" UseLatestAndroidPlatformSdk: {0}", UseLatestAndroidPlatformSdk); Log.LogDebugMessage (" SequencePointsMode: {0}", SequencePointsMode); - Log.LogDebugMessage (" MonoAndroidToolsPath: {0}", MonoAndroidToolsPath); - Log.LogDebugMessage (" MonoAndroidBinPath: {0}", MonoAndroidBinPath); Log.LogDebugMessage (" LintToolPath: {0}", LintToolPath); - MonoAndroidHelper.RefreshMonoDroidSdk (MonoAndroidToolsPath, MonoAndroidBinPath, ReferenceAssemblyPaths); - MonoAndroidHelper.RefreshAndroidSdk (AndroidSdkPath, AndroidNdkPath, JavaSdkPath); - - // OS X: $prefix/lib/mandroid - // Windows: %ProgramFiles(x86)%\MSBuild\Xamarin\Android - this.MonoAndroidToolsPath = MonoDroidSdk.RuntimePath; - - // OS X: $prefix/bin + // OS X: $prefix/lib/xamarin.android/xbuild/Xamarin/Android // Windows: %ProgramFiles(x86)%\MSBuild\Xamarin\Android - this.MonoAndroidBinPath = MonoDroidSdk.BinPath; - - if (this.MonoAndroidBinPath == null) { - Log.LogCodedError ("XA0020", "Could not find mandroid!"); - return false; + if (string.IsNullOrEmpty (MonoAndroidToolsPath)) { + MonoAndroidToolsPath = Path.GetDirectoryName (typeof (ResolveSdks).Assembly.Location); } + MonoAndroidBinPath = MonoAndroidHelper.GetOSBinPath () + Path.DirectorySeparatorChar; - string include; - if (MonoAndroidToolsPath != null && - Directory.Exists (include = Path.Combine (MonoAndroidToolsPath, "include"))) - MonoAndroidIncludePath = include; + MonoAndroidHelper.RefreshMonoDroidSdk (MonoAndroidToolsPath, null, ReferenceAssemblyPaths); + MonoAndroidHelper.RefreshAndroidSdk (AndroidSdkPath, AndroidNdkPath, JavaSdkPath); this.AndroidNdkPath = AndroidSdk.AndroidNdkPath; this.AndroidSdkPath = AndroidSdk.AndroidSdkPath; @@ -275,7 +264,6 @@ public bool RunTask () Log.LogDebugMessage (" JavaSdkPath: {0}", JavaSdkPath); Log.LogDebugMessage (" MonoAndroidBinPath: {0}", MonoAndroidBinPath); Log.LogDebugMessage (" MonoAndroidToolsPath: {0}", MonoAndroidToolsPath); - Log.LogDebugMessage (" MonoAndroidIncludePath: {0}", MonoAndroidIncludePath); Log.LogDebugMessage (" TargetFrameworkVersion: {0}", TargetFrameworkVersion); Log.LogDebugMessage (" ZipAlignPath: {0}", ZipAlignPath); Log.LogDebugMessage (" SupportedApiLevel: {0}", SupportedApiLevel); diff --git a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/BindingBuildTest.cs b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/BindingBuildTest.cs index 62a5ee6707e..3627ea30ef5 100644 --- a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/BindingBuildTest.cs +++ b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/BindingBuildTest.cs @@ -230,7 +230,7 @@ public void BindingCustomJavaApplicationClass () binding.AndroidClassParser = "class-parse"; var multidexJar = Environment.OSVersion.Platform == PlatformID.Win32NT ? Path.Combine (Environment.GetFolderPath (Environment.SpecialFolder.ProgramFilesX86), "MSBuild", "Xamarin", "Android", "android-support-multidex.jar") - : Path.Combine ("$(MonoDroidInstallDirectory)", "lib", "mandroid", "android-support-multidex.jar"); + : Path.Combine ("$(MonoDroidInstallDirectory)", "lib", "xamarin.android", "xbuild", "Xamarin", "Android", "android-support-multidex.jar"); binding.Jars.Add (new AndroidItem.EmbeddedJar (() => multidexJar)); using (var bindingBuilder = CreateDllBuilder ("temp/BindingCustomJavaApplicationClass/MultiDexBinding")) { bindingBuilder.Build (binding); diff --git a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/BuildTest.cs b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/BuildTest.cs index ce1dbd8f7a5..d0d5661558f 100644 --- a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/BuildTest.cs +++ b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/BuildTest.cs @@ -1231,7 +1231,7 @@ public void BuildWithNativeLibraries ([Values (true, false)] bool isRelease) [Test] public void BuildWithExternalJavaLibrary () { - string multidex_jar = "$(MonoDroidInstallDirectory)\\lib\\mandroid\\android-support-multidex.jar"; + string multidex_jar = @"$(MonoDroidInstallDirectory)\lib\xamarin.android\xbuild\Xamarin\Android\android-support-multidex.jar"; var binding = new XamarinAndroidBindingProject () { ProjectName = "BuildWithExternalJavaLibraryBinding", Jars = { new AndroidItem.InputJar (() => multidex_jar), }, @@ -1812,9 +1812,9 @@ public void BuildAMassiveApp() armeabi-v7a;x86 - $(AndroidSupportedAbis);armeabi - $(AndroidSupportedAbis);arm64-v8a - $(AndroidSupportedAbis);x86_64 + $(AndroidSupportedAbis);armeabi + $(AndroidSupportedAbis);arm64-v8a + $(AndroidSupportedAbis);x86_64 diff --git a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.ProjectTools/Common/Builder.cs b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.ProjectTools/Common/Builder.cs index 13eb95ba2ac..dbab6120a03 100644 --- a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.ProjectTools/Common/Builder.cs +++ b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.ProjectTools/Common/Builder.cs @@ -51,7 +51,7 @@ public string FrameworkLibDirectory { outdir = Path.GetFullPath (Path.Combine (Root, "..", "..", "bin", "Release")); if (!Directory.Exists (outdir)) outdir = "/Library/Frameworks/Xamarin.Android.framework/Versions/Current"; - return Path.Combine (outdir, "lib"); + return Path.Combine (outdir, "lib", "xamarin.android"); } else { var x86 = Environment.GetFolderPath (Environment.SpecialFolder.ProgramFilesX86); @@ -130,7 +130,7 @@ protected bool BuildInternal (string projectOrSolution, string target, string [] args.AppendFormat ("/p:AndroidNdkDirectory=\"{0}\" ", ndkPath); } if (RunXBuild) { - var outdir = Path.GetFullPath (Path.Combine (FrameworkLibDirectory, "..")); + var outdir = Path.GetFullPath (Path.Combine (FrameworkLibDirectory, "..", "..")); var targetsdir = Path.Combine (FrameworkLibDirectory, "xbuild"); args.AppendFormat (" {0} ", logger); @@ -140,7 +140,7 @@ protected bool BuildInternal (string projectOrSolution, string target, string [] } if (Directory.Exists (outdir)) { psi.EnvironmentVariables ["MONO_ANDROID_PATH"] = outdir; - psi.EnvironmentVariables ["XBUILD_FRAMEWORK_FOLDERS_PATH"] = Path.Combine (outdir, "lib", "xbuild-frameworks"); + psi.EnvironmentVariables ["XBUILD_FRAMEWORK_FOLDERS_PATH"] = Path.Combine (outdir, "lib", "xamarin.android", "xbuild-frameworks"); args.AppendFormat ("/p:MonoDroidInstallDirectory=\"{0}\" ", outdir); } args.AppendFormat ("/t:{0} {1} /p:UseHostCompilerIfAvailable=false /p:BuildingInsideVisualStudio=true", target, QuoteFileName (Path.Combine (Root, projectOrSolution))); diff --git a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.ProjectTools/Xamarin.ProjectTools.csproj b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.ProjectTools/Xamarin.ProjectTools.csproj index ea4e0a241ed..9318761fb16 100644 --- a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.ProjectTools/Xamarin.ProjectTools.csproj +++ b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.ProjectTools/Xamarin.ProjectTools.csproj @@ -134,12 +134,12 @@ + Include="$(XAInstallPrefix)xbuild\Xamarin\Android\libzip.3.0.dylib"> PreserveNewest + Include="$(XAInstallPrefix)xbuild\Xamarin\Android\libzip.so"> PreserveNewest {E248B2CA-303B-4645-ADDC-9D4459D550FD} libZipSharp + + {900A0F71-BAAD-417A-8D1A-8D330297CDD0} + libzip + False + + + {0DE278D6-000F-4001-BB98-187C0AF58A61} + libzip-windows + False + diff --git a/src/Xamarin.Android.Build.Tasks/Utilities/MonoAndroidHelper.cs b/src/Xamarin.Android.Build.Tasks/Utilities/MonoAndroidHelper.cs index 7c66ccaacc6..83921a11285 100644 --- a/src/Xamarin.Android.Build.Tasks/Utilities/MonoAndroidHelper.cs +++ b/src/Xamarin.Android.Build.Tasks/Utilities/MonoAndroidHelper.cs @@ -20,6 +20,8 @@ namespace Xamarin.Android.Tasks { public class MonoAndroidHelper { + static Lazy uname = new Lazy (GetOSBinDirName, System.Threading.LazyThreadSafetyMode.PublicationOnly); + // Set in ResolveSdks.Execute(); // Requires that ResolveSdks.Execute() run before anything else public static string[] TargetFrameworkDirectories; @@ -50,6 +52,30 @@ public static int RunProcess (string name, string args, DataReceivedEventHandler } } + static string GetOSBinDirName () + { + if (OS.IsWindows) + return ""; + string os = null; + DataReceivedEventHandler output = (o, e) => { + if (string.IsNullOrWhiteSpace (e.Data)) + return; + os = e.Data.Trim (); + }; + DataReceivedEventHandler error = (o, e) => {}; + int r = RunProcess ("uname", "-s", output, error); + if (r == 0) + return os; + return null; + } + + // Path which contains OS-specific binaries; formerly known as $prefix/bin + internal static string GetOSBinPath () + { + var toolsDir = Path.GetFullPath (Path.GetDirectoryName (typeof (MonoAndroidHelper).Assembly.Location)); + return Path.Combine (toolsDir, uname.Value); + } + #if MSBUILD public static void RefreshAndroidSdk (string sdkPath, string ndkPath, string javaPath) { @@ -264,7 +290,7 @@ public static bool ExistsInFrameworkPath (string assembly) { return TargetFrameworkDirectories // TargetFrameworkDirectories will contain a "versioned" directory, - // e.g. $prefix/lib/xbuild-frameworks/MonoAndroid/v1.0. + // e.g. $prefix/lib/xamarin.android/xbuild-frameworks/MonoAndroid/v1.0. // Trim off the version. .Select (p => Path.GetDirectoryName (p.TrimEnd (Path.DirectorySeparatorChar))) .Any (p => assembly.StartsWith (p)); diff --git a/src/Xamarin.Android.Build.Tasks/Xamarin.Android.Bindings.targets b/src/Xamarin.Android.Build.Tasks/Xamarin.Android.Bindings.targets index b4ad15d9f05..3a1b1b65af9 100755 --- a/src/Xamarin.Android.Build.Tasks/Xamarin.Android.Bindings.targets +++ b/src/Xamarin.Android.Build.Tasks/Xamarin.Android.Bindings.targets @@ -171,8 +171,6 @@ Copyright (C) 2012 Xamarin Inc. All rights reserved. AndroidNdkPath="$(AndroidNdkDirectory)" BuildingInsideVisualStudio="$(BuildingInsideVisualStudio)" JavaSdkPath="$(JavaSdkDirectory)" - MonoAndroidBinPath="$(MonoAndroidBinDirectory)" - MonoAndroidToolsPath="$(MonoAndroidToolsDirectory)" ProjectFilePath="$(MSBuildProjectFullPath)" ReferenceAssemblyPaths="$(_XATargetFrameworkDirectories)" TargetFrameworkVersion="$(TargetFrameworkVersion)" @@ -187,8 +185,7 @@ Copyright (C) 2012 Xamarin Inc. All rights reserved. - - + @@ -209,27 +206,9 @@ Copyright (C) 2012 Xamarin Inc. All rights reserved. - - - - - - - - - - - - - - - - @@ -255,7 +234,6 @@ Copyright (C) 2012 Xamarin Inc. All rights reserved. - @@ -400,7 +378,7 @@ Copyright (C) 2012 Xamarin Inc. All rights reserved. ApiXmlInput="$(ApiOutputFile).class-parse" ReferencedManagedLibraries="@(ReferencePath);@(ReferenceDependencyPaths)" MonoAndroidFrameworkDirectories="$(_TargetFrameworkDirectories)" - ToolPath="$(_MonoAndroidBinDirectory)" + ToolPath="$(MonoAndroidToolsDirectory)" ToolExe="$(BindingsGeneratorToolExe)" /> @@ -450,7 +428,7 @@ Copyright (C) 2012 Xamarin Inc. All rights reserved. ReferencedManagedLibraries="@(ReferencePath);@(ReferenceDependencyPaths)" MonoAndroidFrameworkDirectories="$(_TargetFrameworkDirectories)" TypeMappingReportFile="$(GeneratedOutputPath)type-mapping.txt" - ToolPath="$(_MonoAndroidBinDirectory)" + ToolPath="$(MonoAndroidToolsDirectory)" ToolExe="$(BindingsGeneratorToolExe)" UseShortFileNames="$(UseShortGeneratorFileNames)" /> @@ -514,7 +492,7 @@ Copyright (C) 2012 Xamarin Inc. All rights reserved. References="@(ReferencePath);@(ReferenceDependencyPaths)" TargetAssembly="@(IntermediateAssembly)" OutputDocDirectory="$(IntermediateOutputPath)docs" - ToolPath="$(_MonoAndroidBinDirectory)" + ToolPath="$(MonoAndroidToolsDirectory)" ToolExe="$(MDocToolExe)" /> @@ -536,7 +514,7 @@ Copyright (C) 2012 Xamarin Inc. All rights reserved. RunExport="True" TargetAssembly="@(IntermediateAssembly)" OutputDocDirectory="$(IntermediateOutputPath)docs" - ToolPath="$(_MonoAndroidBinDirectory)" + ToolPath="$(MonoAndroidToolsDirectory)" ToolExe="$(MDocToolExe)" /> Xamarin.Android.Tasks Xamarin.Android.Build.Tasks 512 - v4.5 + v4.5.1 2.0 @@ -19,7 +19,7 @@ True full False - ..\..\bin\$(Configuration)\lib\xbuild\Xamarin\Android + $(XAInstallPrefix)xbuild\Xamarin\Android\ TRACE;DEBUG;HAVE_CECIL;MSBUILD;ANDROID_24 prompt 4 @@ -27,7 +27,7 @@ True - ..\..\bin\$(Configuration)\lib\xbuild\Xamarin\Android + $(XAInstallPrefix)xbuild\Xamarin\Android\ TRACE;HAVE_CECIL;MSBUILD;ANDROID_24 prompt 4 diff --git a/src/Xamarin.Android.Build.Tasks/Xamarin.Android.Build.Tasks.targets b/src/Xamarin.Android.Build.Tasks/Xamarin.Android.Build.Tasks.targets index 22787d5b3bc..1c1722cbb75 100644 --- a/src/Xamarin.Android.Build.Tasks/Xamarin.Android.Build.Tasks.targets +++ b/src/Xamarin.Android.Build.Tasks/Xamarin.Android.Build.Tasks.targets @@ -6,7 +6,7 @@ - <_SharedRuntimeBuildPath Condition=" '$(_SharedRuntimeBuildPath)' == '' ">..\..\bin\$(Configuration)\lib\xbuild-frameworks\MonoAndroid\ + <_SharedRuntimeBuildPath Condition=" '$(_SharedRuntimeBuildPath)' == '' ">$(XAInstallPrefix)xbuild-frameworks\MonoAndroid\ <_GeneratedProfileClass>$(IntermediateOutputPath)Profile.g.cs _GenerateXACommonProps; @@ -145,37 +145,38 @@ + Outputs="$(OutputPath)android-support-multidex.jar;$(OutputPath)MULTIDEX_JAR_LICENSE"> - + DestinationFiles="$(OutputPath)android-support-multidex.jar" /> + + DestinationFiles="$(OutputPath)MULTIDEX_JAR_LICENSE" /> - + - <_MonoSymbolicateScript Include="mono-symbolicate;mono-symbolicate.cmd" /> - <_MonoSymbolicateScriptSource Include="@(_MonoSymbolicateScript->'..\..\tools\scripts\%(Identity)')" /> - <_MonoSymbolicateScriptDestination Include="@(_MonoSymbolicateScript->'$(OutputPath)..\..\..\..\bin\%(Identity)')" /> + <_MonoSymbolicateScriptSource Include="..\..\tools\scripts\mono-symbolicate" /> + <_MonoSymbolicateScriptDestination Include="$(OutputPath)$(HostOS)\mono-symbolicate" /> + + diff --git a/src/Xamarin.Android.Build.Tasks/Xamarin.Android.Common.targets b/src/Xamarin.Android.Build.Tasks/Xamarin.Android.Common.targets index 6e799b3a18c..5ab0f1bfb70 100755 --- a/src/Xamarin.Android.Build.Tasks/Xamarin.Android.Common.targets +++ b/src/Xamarin.Android.Build.Tasks/Xamarin.Android.Common.targets @@ -598,8 +598,6 @@ Copyright (C) 2011-2012 Xamarin. All rights reserved. SequencePointsMode="$(_AndroidSequencePointsMode)" BuildingInsideVisualStudio="$(BuildingInsideVisualStudio)" JavaSdkPath="$(JavaSdkDirectory)" - MonoAndroidBinPath="$(MonoAndroidBinDirectory)" - MonoAndroidToolsPath="$(MonoAndroidToolsDirectory)" ProjectFilePath="$(MSBuildProjectFullPath)" ReferenceAssemblyPaths="$(_XATargetFrameworkDirectories)" TargetFrameworkVersion="$(TargetFrameworkVersion)" @@ -616,9 +614,8 @@ Copyright (C) 2011-2012 Xamarin. All rights reserved. - - - + + @@ -692,14 +689,6 @@ because xbuild doesn't support framework reference assemblies. - - - - - - - @@ -738,7 +727,6 @@ because xbuild doesn't support framework reference assemblies. - @@ -2118,7 +2106,6 @@ because xbuild doesn't support framework reference assemblies. AndroidAotMode="$(AndroidAotMode)" AndroidNdkDirectory="$(_AndroidNdkDirectory)" AndroidApiLevel="$(_AndroidApiLevel)" - SdkBinDirectory="$(MonoAndroidBinDirectory)" SupportedAbis="$(_BuildTargetAbis)" AndroidSequencePointsMode="$(_SequencePointsMode)" AotAdditionalArguments="$(AndroidAotAdditionalArguments)" @@ -2155,7 +2142,6 @@ because xbuild doesn't support framework reference assemblies. diff --git a/src/Xamarin.Android.Build.Utilities/MonoDroidSdk.cs b/src/Xamarin.Android.Build.Utilities/MonoDroidSdk.cs index 9781e40a755..9ea105620dd 100644 --- a/src/Xamarin.Android.Build.Utilities/MonoDroidSdk.cs +++ b/src/Xamarin.Android.Build.Utilities/MonoDroidSdk.cs @@ -45,16 +45,7 @@ static MonoDroidSdkBase GetSdk () return sdk; } - public static string RuntimePath { get { return GetSdk ().RuntimePath; } } - - public static string BinPath { get { return GetSdk ().BinPath; } } - public static string FrameworkPath { get { return GetSdk ().BclPath; } } - - [Obsolete ("Do not use.")] - public static string JavaDocToMDocExe { - get { return Path.Combine (BinPath, OS.IsWindows ? "javadoc-to-mdoc.exe" : "javadoc-to-mdoc"); } - } } } diff --git a/src/Xamarin.Android.Build.Utilities/Sdks/MonoDroidSdkBase.cs b/src/Xamarin.Android.Build.Utilities/Sdks/MonoDroidSdkBase.cs index dfdb9829a50..5f21ebbbf4b 100644 --- a/src/Xamarin.Android.Build.Utilities/Sdks/MonoDroidSdkBase.cs +++ b/src/Xamarin.Android.Build.Utilities/Sdks/MonoDroidSdkBase.cs @@ -8,22 +8,7 @@ namespace Xamarin.Android.Build.Utilities { abstract class MonoDroidSdkBase { - protected readonly static string DebugRuntime = "Mono.Android.DebugRuntime-debug.apk"; protected readonly static string ClassParseExe = "class-parse.exe"; - protected readonly static string GeneratorScript = "generator"; - - // I can never remember the difference between SdkPath and anything else... - [Obsolete ("Do not use.")] - public string SdkPath { get; private set; } - - // Contains mandroid - public string BinPath { get; private set; } - - // Not actually shipped... - public string IncludePath { get; private set; } - - // Contains Mono.Android.DebugRuntime-*.apk, platforms/*/*.apk. - public string RuntimePath { get; private set; } // Root directory for XA libraries, contains designer dependencies public string LibrariesPath { get; private set; } @@ -31,41 +16,23 @@ abstract class MonoDroidSdkBase // Contains mscorlib.dll public string BclPath { get; private set; } - public int SharedRuntimeVersion { get; private set; } - - // expectedRuntimePath: contains Mono.Android.DebugRuntime-*.apk - // binPath: contains mandroid - // mscorlibDir: contains mscorlib.dll + // expectedRuntimePath: contains class-parse.exe + // binPath: ignored; present for compatibility + // bclPath: contains mscorlib.dll public void Initialize (string expectedRuntimePath = null, string binPath = null, string bclPath = null) { - var runtimePath = GetValidPath ("MonoAndroidToolsPath", expectedRuntimePath, ValidateRuntime, () => FindRuntime ()); - if (runtimePath != null) { - binPath = GetValidPath ("MonoAndroidBinPath", binPath, ValidateBin, () => FindBin (runtimePath)); - bclPath = GetValidPath ("mscorlib.dll", bclPath, ValidateFramework, () => FindFramework (runtimePath)); - } else { - if (expectedRuntimePath != null) - AndroidLogger.LogWarning (null, "Runtime was not found at {0}", expectedRuntimePath); - binPath = bclPath = null; - } + var runtimePath = GetValidPath ("MonoAndroidToolsPath", expectedRuntimePath, ValidateRuntime, () => FindRuntime ()) + ?? Path.GetFullPath (Path.GetDirectoryName (GetType ().Assembly.Location)); + bclPath = GetValidPath ("mscorlib.dll", bclPath, ValidateFramework, () => FindFramework (runtimePath)); - if (runtimePath == null || binPath == null || bclPath == null) { + if (runtimePath == null || bclPath == null) { Reset (); return; } - RuntimePath = runtimePath; - #pragma warning disable 0618 - SdkPath = Path.GetFullPath (Path.Combine (runtimePath, "..", "..")); - #pragma warning restore 0618 - BinPath = binPath; BclPath = bclPath; LibrariesPath = FindLibraries (runtimePath); - IncludePath = FindInclude (runtimePath); - if (IncludePath != null && !Directory.Exists (IncludePath)) - IncludePath = null; - - SharedRuntimeVersion = GetCurrentSharedRuntimeVersion (); FindSupportedFrameworks (); } @@ -92,126 +59,40 @@ static string GetValidPath (string description, string path, Func public void Reset () { #pragma warning disable 0618 - SdkPath = BinPath = IncludePath = RuntimePath = BclPath = null; + BclPath = LibrariesPath = null; #pragma warning restore 0618 - SharedRuntimeVersion = 0; - } - - protected abstract string FindRuntime (); - protected abstract string FindFramework (string runtimePath); - - // Check for platform-specific `mandroid` name - protected abstract bool ValidateBin (string binPath); - - protected static bool ValidateRuntime (string loc) - { - return !string.IsNullOrWhiteSpace (loc) && - (File.Exists (Path.Combine (loc, DebugRuntime)) || // Normal/expected - File.Exists (Path.Combine (loc, ClassParseExe)) || // Normal/expected - File.Exists (Path.Combine (loc, "Ionic.Zip.dll"))); // Wrench builds - } - - protected static bool ValidateFramework (string loc) - { - return loc != null && File.Exists (Path.Combine (loc, "mscorlib.dll")); } - public string FindVersionFile () + protected virtual string FindRuntime () { - #pragma warning disable 0618 - if (string.IsNullOrEmpty (SdkPath)) - return null; - #pragma warning restore 0618 - foreach (var loc in GetVersionFileLocations ()) { - if (File.Exists (loc)) { - return loc; + string monoAndroidPath = Environment.GetEnvironmentVariable ("MONO_ANDROID_PATH"); + if (!string.IsNullOrEmpty (monoAndroidPath)) { + string msbuildDir = Path.Combine (monoAndroidPath, "lib", "xamarin.android", "xbuild", "Xamarin", "Android"); + if (Directory.Exists (msbuildDir)) { + if (ValidateRuntime (msbuildDir)) + return msbuildDir; + AndroidLogger.LogInfo (null, $"MONO_ANDROID_PATH points to {monoAndroidPath}, but `{msbuildDir}{Path.DirectorySeparatorChar}class-parse.exe` does not exist."); } + else + AndroidLogger.LogInfo (null, $"MONO_ANDROID_PATH points to {monoAndroidPath}, but it does not exist."); } return null; } - protected virtual IEnumerable GetVersionFileLocations () - { - #pragma warning disable 0618 - yield return Path.Combine (SdkPath, "Version"); - #pragma warning restore 0618 - } - - protected abstract string FindBin (string runtimePath); - - protected abstract string FindInclude (string runtimePath); - - protected abstract string FindLibraries (string runtimePath); - - [Obsolete ("Do not use.")] - public string GetPlatformNativeLibPath (string abi) - { - return FindPlatformNativeLibPath (SdkPath, abi); - } - - [Obsolete ("Do not use.")] - public string GetPlatformNativeLibPath (AndroidTargetArch arch) - { - return FindPlatformNativeLibPath (SdkPath, GetMonoDroidArchName (arch)); - } - - [Obsolete ("Do not use.")] - static string GetMonoDroidArchName (AndroidTargetArch arch) - { - switch (arch) { - case AndroidTargetArch.Arm: - return "armeabi"; - case AndroidTargetArch.Mips: - return "mips"; - case AndroidTargetArch.X86: - return "x86"; - } - return null; - } - - [Obsolete] - protected string FindPlatformNativeLibPath (string sdk, string arch) - { - return Path.Combine (sdk, "lib", arch); - } + protected abstract string FindFramework (string runtimePath); - static XmlReaderSettings GetSafeReaderSettings () + protected static bool ValidateRuntime (string loc) { - //allow DTD but not try to resolve it from web - return new XmlReaderSettings { - CloseInput = true, - DtdProcessing = DtdProcessing.Ignore, - XmlResolver = null, - }; + return !string.IsNullOrWhiteSpace (loc) && + File.Exists (Path.Combine (loc, ClassParseExe)); } - int GetCurrentSharedRuntimeVersion () + protected static bool ValidateFramework (string loc) { - string file = Path.Combine (RuntimePath, "Mono.Android.DebugRuntime-debug.xml"); - - return GetManifestVersion (file); + return loc != null && File.Exists (Path.Combine (loc, "mscorlib.dll")); } - internal static int GetManifestVersion (string file) - { - // It seems that MfA 1.0 on Windows didn't include the xml files to get the runtime version. - if (!File.Exists (file)) - return int.MaxValue; - - try { - using (var r = XmlReader.Create (file, GetSafeReaderSettings())) { - if (r.MoveToContent () == XmlNodeType.Element && r.MoveToAttribute ("android:versionCode")) { - int value; - if (int.TryParse (r.Value, out value)) - return value; - AndroidLogger.LogInfo ("Cannot parse runtime version code: ({0})", r.Value); - } - } - } catch (Exception ex) { - AndroidLogger.LogError ("Error trying to find shared runtime version", ex); - } - return int.MaxValue; - } + protected abstract string FindLibraries (string runtimePath); internal static Version ToVersion (string frameworkDir) { diff --git a/src/Xamarin.Android.Build.Utilities/Sdks/MonoDroidSdkUnix.cs b/src/Xamarin.Android.Build.Utilities/Sdks/MonoDroidSdkUnix.cs index ce2afe5d41f..46c6e48a3ba 100644 --- a/src/Xamarin.Android.Build.Utilities/Sdks/MonoDroidSdkUnix.cs +++ b/src/Xamarin.Android.Build.Utilities/Sdks/MonoDroidSdkUnix.cs @@ -8,26 +8,31 @@ namespace Xamarin.Android.Build.Utilities class MonoDroidSdkUnix : MonoDroidSdkBase { readonly static string[] RuntimeToFrameworkPaths = new[]{ + // runtimePath=$prefix/lib/xamarin.android/xbuild/Xamarin/Android/ + Path.Combine ("..", "..", "..", "xbuild-frameworks", "MonoAndroid"), Path.Combine ("..", "..", "..", ".xamarin.android", "lib", "xbuild-frameworks", "MonoAndroid"), Path.Combine ("..", "xbuild-frameworks", "MonoAndroid"), Path.Combine ("..", "mono", "2.1"), }; readonly static string[] SearchPaths = { + "/Library/Frameworks/Xamarin.Android.framework/Versions/Current/lib/xamarin.android/xbuild/Xamarin/Android", "/Library/Frameworks/Xamarin.Android.framework/Versions/Current/lib/mandroid", "/Developer/MonoAndroid/usr/lib/mandroid", "/app/lib/mandroid", - "/opt/mono-android/lib/mandroid" + "/app/lib/xamarin.android/xbuild/Xamarin/Android", + "/opt/mono-android/lib/mandroid", + "/opt/mono-android/lib/xamarin.android/xbuild/Xamarin/Android", }; protected override string FindRuntime () { string monoAndroidPath = Environment.GetEnvironmentVariable ("MONO_ANDROID_PATH"); if (!string.IsNullOrEmpty (monoAndroidPath)) { - string libMandroid = Path.Combine (monoAndroidPath, "lib", "mandroid"); - if (Directory.Exists (libMandroid)) { - if (ValidateRuntime (libMandroid)) - return libMandroid; + string msbuildDir = Path.Combine (monoAndroidPath, "lib", "xamarin.android", "xbuild", "Xamarin", "Android"); + if (Directory.Exists (msbuildDir)) { + if (ValidateRuntime (msbuildDir)) + return msbuildDir; AndroidLogger.LogInfo (null, "MONO_ANDROID_PATH points to {0}, but it is invalid.", monoAndroidPath); } else AndroidLogger.LogInfo (null, "MONO_ANDROID_PATH points to {0}, but it does not exist.", monoAndroidPath); @@ -36,20 +41,13 @@ protected override string FindRuntime () // check also in the users folder var personal = Environment.GetFolderPath (Environment.SpecialFolder.Personal); var additionalSearchPaths = new [] { - // for Mono.Posix and Mono.Data.Sqlite builds in xamarin-android. - monoAndroidPath = Path.GetFullPath (Path.Combine (new Uri (GetType ().Assembly.CodeBase).LocalPath, "..", "..", "..", "..", "..", "lib", "mandroid")), - Path.Combine (personal, @".xamarin.android/lib/mandroid") + Path.GetFullPath (Path.GetDirectoryName (GetType ().Assembly.Location)), + Path.Combine (personal, @".xamarin.android/lib/xamarin.android/xbuild/Xamarin/Android") }; return additionalSearchPaths.Concat (SearchPaths).FirstOrDefault (ValidateRuntime); } - protected override bool ValidateBin (string binPath) - { - return !string.IsNullOrWhiteSpace (binPath) && - File.Exists (Path.Combine (binPath, GeneratorScript)); - } - protected override string FindFramework (string runtimePath) { foreach (var relativePath in RuntimeToFrameworkPaths) { @@ -70,34 +68,10 @@ protected override string FindFramework (string runtimePath) return null; } - protected override string FindBin (string runtimePath) - { - string binPath = Path.GetFullPath (Path.Combine (runtimePath, "..", "..", "bin")); - if (File.Exists (Path.Combine (binPath, GeneratorScript))) - return binPath; - return null; - } - - protected override string FindInclude (string runtimePath) - { - string includeDir = Path.GetFullPath (Path.Combine (runtimePath, "..", "..", "include")); - if (Directory.Exists (includeDir)) - return includeDir; - return null; - } - protected override string FindLibraries (string runtimePath) { return Path.GetFullPath (Path.Combine (runtimePath, "..")); } - - protected override IEnumerable GetVersionFileLocations () - { - yield return Path.GetFullPath (Path.Combine (RuntimePath, "..", "..", "Version")); - string sdkPath = Path.GetDirectoryName (Path.GetDirectoryName (RuntimePath)); - if (Path.GetFileName (sdkPath) == "usr") - yield return Path.GetFullPath (Path.Combine (Path.GetDirectoryName (sdkPath), "Version")); - } } } diff --git a/src/Xamarin.Android.Build.Utilities/Sdks/MonoDroidSdkWindows.cs b/src/Xamarin.Android.Build.Utilities/Sdks/MonoDroidSdkWindows.cs index e8e8ea85256..1e5b041a55c 100644 --- a/src/Xamarin.Android.Build.Utilities/Sdks/MonoDroidSdkWindows.cs +++ b/src/Xamarin.Android.Build.Utilities/Sdks/MonoDroidSdkWindows.cs @@ -9,18 +9,20 @@ class MonoDroidSdkWindows : MonoDroidSdkBase { protected override string FindRuntime () { - string monoAndroidPath = Environment.GetEnvironmentVariable ("MONO_ANDROID_PATH"); - if (!string.IsNullOrEmpty (monoAndroidPath)) { - if (Directory.Exists (monoAndroidPath) && ValidateRuntime (monoAndroidPath)) - return monoAndroidPath; - } - string xamarinSdk = Path.Combine (OS.ProgramFilesX86, "MSBuild", "Xamarin", "Android"); - return Directory.Exists (xamarinSdk) - ? xamarinSdk - : OS.ProgramFilesX86 + @"\MSBuild\Novell"; + var r = base.FindRuntime (); + if (r != null) + return r; + var paths = new []{ + Path.GetFullPath (Path.GetDirectoryName (GetType ().Assembly.Location)), + Path.Combine (OS.ProgramFilesX86, "MSBuild", "Xamarin", "Android"), + Path.Combine (OS.ProgramFilesX86, "MSBuild", "Novell"), + }; + return paths.FirstOrDefault (p => ValidateRuntime (p)); } static readonly string[] RuntimeToFrameworkPaths = new []{ + // runtimePath=$prefix/lib/xamarin.android/xbuild/Xamarin/Android/ + Path.Combine ("..", "..", "..", "xbuild-frameworks", "MonoAndroid"), Path.Combine ("..", "..", "..", "Common7", "IDE", "ReferenceAssemblies", "Microsoft", "Framework","MonoAndroid"), Path.Combine ("..", "..", "..", "Reference Assemblies", "Microsoft", "Framework", "MonoAndroid"), Path.Combine (OS.ProgramFilesX86, "Reference Assemblies", "Microsoft", "Framework", "MonoAndroid"), @@ -46,31 +48,10 @@ protected override string FindFramework (string runtimePath) return null; } - protected override string FindBin (string runtimePath) - { - return runtimePath; - } - - protected override bool ValidateBin (string binPath) - { - return !string.IsNullOrWhiteSpace (binPath) && - File.Exists (Path.Combine (binPath, "generator.exe")); - } - - protected override string FindInclude (string runtimePath) - { - return Path.GetFullPath (Path.Combine (runtimePath, "include")); - } - protected override string FindLibraries (string runtimePath) { return Path.GetFullPath (runtimePath); } - - protected override IEnumerable GetVersionFileLocations () - { - yield return Path.GetFullPath (Path.Combine (RuntimePath, "Version")); - } } } diff --git a/src/Xamarin.Android.Build.Utilities/Xamarin.Android.Build.Utilities.csproj b/src/Xamarin.Android.Build.Utilities/Xamarin.Android.Build.Utilities.csproj index da208f36abe..3702c29f718 100644 --- a/src/Xamarin.Android.Build.Utilities/Xamarin.Android.Build.Utilities.csproj +++ b/src/Xamarin.Android.Build.Utilities/Xamarin.Android.Build.Utilities.csproj @@ -9,11 +9,12 @@ Xamarin.Android.Build.Utilities v4.5 + true full false - ..\..\bin\$(Configuration)\lib\xbuild\Xamarin\Android + $(XAInstallPrefix)xbuild\Xamarin\Android\ DEBUG; prompt 4 @@ -22,7 +23,7 @@ full true - ..\..\bin\$(Configuration)\lib\xbuild\Xamarin\Android + $(XAInstallPrefix)xbuild\Xamarin\Android\ prompt 4 false diff --git a/src/Xamarin.Android.NUnitLite/Xamarin.Android.NUnitLite.csproj b/src/Xamarin.Android.NUnitLite/Xamarin.Android.NUnitLite.csproj index 9eba814f71f..a35079d57b2 100644 --- a/src/Xamarin.Android.NUnitLite/Xamarin.Android.NUnitLite.csproj +++ b/src/Xamarin.Android.NUnitLite/Xamarin.Android.NUnitLite.csproj @@ -22,7 +22,7 @@ true full false - ..\..\bin\Debug\lib\xbuild-frameworks\MonoAndroid\v1.0 + $(XAInstallPrefix)xbuild-frameworks\MonoAndroid\v1.0 DEBUG;NUNITLITE;CLR_4_0;NET_4_5;__MOBILE__;MONOTOUCH $(OutputPath)\$(AssemblyName).xml prompt @@ -32,7 +32,7 @@ true - ..\..\bin\Release\lib\xbuild-frameworks\MonoAndroid\v1.0 + $(XAInstallPrefix)xbuild-frameworks\MonoAndroid\v1.0 NUNITLITE;CLR_4_0;NET_4_5;__MOBILE__;MONOTOUCH $(OutputPath)\$(AssemblyName).xml prompt diff --git a/src/Xamarin.Android.Tools.Aidl/Xamarin.Android.Tools.Aidl.csproj b/src/Xamarin.Android.Tools.Aidl/Xamarin.Android.Tools.Aidl.csproj index aec8d1758be..1e2e84a4ba5 100644 --- a/src/Xamarin.Android.Tools.Aidl/Xamarin.Android.Tools.Aidl.csproj +++ b/src/Xamarin.Android.Tools.Aidl/Xamarin.Android.Tools.Aidl.csproj @@ -9,11 +9,12 @@ Xamarin.Android.Tools.Aidl v4.5 + True full False - ..\..\bin\$(Configuration)\lib\xbuild\Xamarin\Android + $(XAInstallPrefix)xbuild\Xamarin\Android DEBUG; prompt 4 @@ -22,7 +23,7 @@ none True - ..\..\bin\$(Configuration)\lib\xbuild\Xamarin\Android + $(XAInstallPrefix)xbuild\Xamarin\Android prompt 4 False @@ -35,7 +36,6 @@ False - diff --git a/src/Xamarin.Android.Tools.BootstrapTasks/Xamarin.Android.Tools.BootstrapTasks.csproj b/src/Xamarin.Android.Tools.BootstrapTasks/Xamarin.Android.Tools.BootstrapTasks.csproj index 6e4c628937a..fe40ed2e4fd 100644 --- a/src/Xamarin.Android.Tools.BootstrapTasks/Xamarin.Android.Tools.BootstrapTasks.csproj +++ b/src/Xamarin.Android.Tools.BootstrapTasks/Xamarin.Android.Tools.BootstrapTasks.csproj @@ -59,6 +59,7 @@ {900A0F71-BAAD-417A-8D1A-8D330297CDD0} libzip + False {7CE69551-BD73-4726-ACAA-AAF89C84BAF8} diff --git a/src/monodroid/jni/Android.mk b/src/monodroid/jni/Android.mk index ebece5f3cf0..a3658629220 100644 --- a/src/monodroid/jni/Android.mk +++ b/src/monodroid/jni/Android.mk @@ -14,7 +14,6 @@ LOCAL_CFLAGS = $(COMMON_CFLAGS) \ -DSGEN_BRIDGE_VERSION=$(SGEN_BRIDGE_VERSION) \ -D_REENTRANT -DPLATFORM_ANDROID -DANDROID -DLINUX -Dlinux -D__linux_ \ -DHAVE_CONFIG_H -DJI_DLL_EXPORT -DMONO_DLL_EXPORT \ - -I$(topdir)/libmonodroid/zip -I$(BUILDDIR)/include -I$(BUILDDIR)/include/eglib \ -fno-strict-aliasing \ -ffunction-sections \ -fomit-frame-pointer \ @@ -36,6 +35,7 @@ LOCAL_LDFLAGS += \ -Wl,--no-undefined \ LOCAL_C_INCLUDES := \ + $(LOCAL_PATH) \ $(LOCAL_PATH)/../../../bin/$(CONFIGURATION)/include \ $(LOCAL_PATH)/../../../bin/$(CONFIGURATION)/include/$(TARGET_ARCH_ABI)/eglib \ "$(MONO_PATH)/eglib/src" \ diff --git a/src/monodroid/monodroid.mdproj b/src/monodroid/monodroid.mdproj index 0c00d6b6802..9af18c55a4c 100644 --- a/src/monodroid/monodroid.mdproj +++ b/src/monodroid/monodroid.mdproj @@ -8,10 +8,10 @@ - ..\..\bin\Debug\lib\xbuild\Xamarin\Android\lib + $(XAInstallPrefix)xbuild\Xamarin\Android\lib\ - ..\..\bin\Release\lib\xbuild\Xamarin\Android\lib + $(XAInstallPrefix)xbuild\Xamarin\Android\lib\ diff --git a/src/monodroid/monodroid.targets b/src/monodroid/monodroid.targets index 61fa25f06ed..70d5204fa41 100644 --- a/src/monodroid/monodroid.targets +++ b/src/monodroid/monodroid.targets @@ -42,8 +42,8 @@ - + Outputs="@(_EmbeddedBlob->'jni\%(Include)');$(MSBuildThisFileDirectory)bin\$(Configuration)\include\config.h"> + diff --git a/src/netstandard/netstandard.mdproj b/src/netstandard/netstandard.mdproj index bb156e6d507..71192eb0c65 100644 --- a/src/netstandard/netstandard.mdproj +++ b/src/netstandard/netstandard.mdproj @@ -4,12 +4,13 @@ AnyCPU GenericProject {93614CB8-4564-43B9-93B0-4AF4B3B16AAE} - ..\..\bin\$(Configuration)\lib\xbuild-frameworks\MonoAndroid\v1.0\Facades + $(XAInstallPrefix)xbuild-frameworks\MonoAndroid\v1.0\Facades + $(XAInstallPrefix)xbuild-frameworks\MonoAndroid\v1.0\Facades diff --git a/src/proguard/proguard.mdproj b/src/proguard/proguard.mdproj index 031cbee1654..6c4d84669d5 100644 --- a/src/proguard/proguard.mdproj +++ b/src/proguard/proguard.mdproj @@ -4,12 +4,13 @@ AnyCPU GenericProject {4B9D96BB-95AB-44E8-9F87-13B12C8BCED1} - ..\..\bin\$(Configuration)\lib\mandroid\proguard + $(XAInstallPrefix)xbuild\Xamarin\Android\proguard\ + $(XAInstallPrefix)xbuild\Xamarin\Android\proguard\ diff --git a/tests/api-compatibility/api-compatibility.mk b/tests/api-compatibility/api-compatibility.mk index 3d08dc1f97a..eb31a9162bf 100644 --- a/tests/api-compatibility/api-compatibility.mk +++ b/tests/api-compatibility/api-compatibility.mk @@ -9,7 +9,7 @@ MONO_API_HTML = bin/Build$(CONFIGURATION)/mono-api-html.exe MONO_API_INFO_DIR = $(MONO_PATH)/mcs/tools/corcompare MONO_API_INFO = bin/Build$(CONFIGURATION)/mono-api-info.exe MONO_OPTIONS_SRC = $(MONO_PATH)/mcs/class/Mono.Options/Mono.Options/Options.cs -FRAMEWORK_DIR = bin/$(CONFIGURATION)/lib/xbuild-frameworks/MonoAndroid +FRAMEWORK_DIR = bin/$(CONFIGURATION)/lib/xamarin.android/xbuild-frameworks/MonoAndroid run-api-compatibility-tests: $(MONO_API_HTML) $(MONO_API_INFO) @@ -25,7 +25,7 @@ $(MONO_API_HTML): $(wildcard $(MONO_API_HTML_DIR)/*.cs) $(MONO_OPTIONS_SRC) -r:System.Xml.dll -r:System.Xml.Linq.dll MONO_API_INFO_REFS = \ - bin/$(CONFIGURATION)/lib/mandroid/Xamarin.Android.Cecil.dll + bin/$(CONFIGURATION)/lib/xamarin.android/xbuild/Xamarin/Android/Xamarin.Android.Cecil.dll $(MONO_API_INFO): $(wildcard $(MONO_API_INFO_DIR)/*.cs) $(MONO_OPTIONS_SRC) $(CSC) -out:$@ $^ /main:CorCompare.Driver \ diff --git a/tools/javadoc2mdoc/javadoc2mdoc.csproj b/tools/javadoc2mdoc/javadoc2mdoc.csproj index 3b2e08065df..0dc986ca4a1 100644 --- a/tools/javadoc2mdoc/javadoc2mdoc.csproj +++ b/tools/javadoc2mdoc/javadoc2mdoc.csproj @@ -13,7 +13,7 @@ true full false - ..\..\bin\Debug\lib\mandroid + $(XAInstallPrefix)xbuild\Xamarin\Android\ DEBUG; prompt 4 @@ -22,7 +22,7 @@ true - ..\..\bin\Release\lib\mandroid + $(XAInstallPrefix)xbuild\Xamarin\Android\ prompt 4 true diff --git a/tools/scripts/generator b/tools/scripts/generator deleted file mode 100755 index 1bcede4ad5d..00000000000 --- a/tools/scripts/generator +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh -BINDIR=`dirname "$0"` -MANDROID_DIR="$BINDIR/../lib/mandroid" - -unset MONO_PATH -exec mono $MONO_OPTIONS "$MANDROID_DIR/generator.exe" "$@" diff --git a/tools/scripts/mono-symbolicate b/tools/scripts/mono-symbolicate index 665c029f882..1ae5a0cf25d 100755 --- a/tools/scripts/mono-symbolicate +++ b/tools/scripts/mono-symbolicate @@ -1,6 +1,6 @@ #!/bin/sh BINDIR=`dirname "$0"` -MANDROID_DIR="$BINDIR/../lib/mandroid" +MANDROID_DIR="$BINDIR/.." unset MONO_PATH exec mono $MONO_OPTIONS "$MANDROID_DIR/mono-symbolicate.exe" "$@" diff --git a/tools/scripts/mono-symbolicate.cmd b/tools/scripts/mono-symbolicate.cmd deleted file mode 100644 index 72fc6afaf76..00000000000 --- a/tools/scripts/mono-symbolicate.cmd +++ /dev/null @@ -1,2 +0,0 @@ -@echo off -%~dp0\..\lib\mandroid\mono-symbolicate.exe %* diff --git a/tools/scripts/xabuild b/tools/scripts/xabuild index fc9d67cbb8a..472793bdd7c 100755 --- a/tools/scripts/xabuild +++ b/tools/scripts/xabuild @@ -21,7 +21,7 @@ # MSBuild engine to use. Defaults to `xbuild`, assumed to be in `$PATH` # TARGETS_DIR: # The MSBuild `$(MSBuildExtensionsPath)` root location. -# Defaults to `$prefix/lib/xbuild`. +# Defaults to `$prefix/lib/xamarin.android/xbuild`. # # Examples: # To create a .apk for the HelloWorld sample: @@ -72,16 +72,16 @@ if [[ "$prefix" == */tools/scripts ]] ; then exit 1 fi prefix="$real_prefix" - xa_prefix="$real_prefix" + xa_prefix="$real_prefix/lib/xamarin.android" elif [[ "$prefix" == */bin ]] ; then prefix="$prefix/.." - xa_prefix="$prefix/../lib/xamarin.android" + xa_prefix="$prefix/lib/xamarin.android" else (>&2 echo "$name: Could not determine Xamarin.Android prefix.") exit 1 fi -for t in "$TARGETS_DIR" "$prefix/lib/mono/xbuild" "$prefix/lib/xbuild" ; do +for t in "$TARGETS_DIR" "$prefix/lib/mono/xbuild" "$xa_prefix/xbuild" ; do if [ -z "$t" -o ! -d "$t" ]; then continue fi @@ -111,8 +111,7 @@ fi declare -a XABUILD_FLAGS XABUILD_FLAGS=( - /p:MonoAndroidBinDirectory="$xa_prefix/bin" - /p:MonoAndroidToolsDirectory="$xa_prefix/lib/mandroid" + /p:MonoAndroidToolsDirectory="$xa_prefix/xbuild/Xamarin/Android" /p:MonoDroidInstallDirectory="$MONO_ANDROID_PATH" ) @@ -139,9 +138,9 @@ function GetXbuildDir() read -r -d '' get_xbuild_dir_cmd <<-'EOF' || true using System.IO; var corlib_loc = typeof (int).Assembly.Location; - // e.g. /Library/Frameworks/Mono.framework/Versions/5.2.0/lib/mono/4.5 + // e.g. corlib_dir=/Library/Frameworks/Mono.framework/Versions/5.2.0/lib/mono/4.5 var corlib_dir = Path.GetDirectoryName (corlib_loc); - // e.g. /Library/Frameworks/Mono.framework/Versions/5.2.0/lib/mono/xbuild + // e.g. xbuild_dir=/Library/Frameworks/Mono.framework/Versions/5.2.0/lib/mono/xbuild var xbuild_dir = Path.Combine (corlib_dir, "..", "xbuild"); print (Path.GetFullPath (xbuild_dir)); EOF @@ -156,7 +155,7 @@ function ConfigureLocalXbuild() fi xbuild_dir=`GetXbuildDir` local sys_entry=`ls -1 "$xbuild_dir" | head -1` - if [ -d "$TARGETS_DIR/$sys_entry" ] ; then + if [ -f "$TARGETS_DIR/.__sys_links.txt" ] ; then # already configured; bail return 0 fi