Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
[submodule "external/mono"]
path = external/mono
url = https://github.com/mono/mono.git
branch = 2017-06
branch = 2017-10
[submodule "external/mxe"]
path = external/mxe
url = https://github.com/xamarin/mxe.git
Expand Down
6 changes: 3 additions & 3 deletions Configuration.props
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,10 @@
<JavaInteropSourceDirectory Condition=" '$(JavaInteropSourceDirectory)' == '' ">$(MSBuildThisFileDirectory)external\Java.Interop</JavaInteropSourceDirectory>
<LlvmSourceDirectory Condition=" '$(LlvmSourceDirectory)' == '' ">$(MSBuildThisFileDirectory)external\llvm</LlvmSourceDirectory>
<MonoSourceDirectory>$(MSBuildThisFileDirectory)external\mono</MonoSourceDirectory>
<MonoRequiredMinimumVersion Condition=" '$(MonoRequiredMinimumVersion)' == '' ">5.4.0</MonoRequiredMinimumVersion>
<MonoRequiredMaximumVersion Condition=" '$(MonoRequiredMaximumVersion)' == '' ">5.6.0</MonoRequiredMaximumVersion>
<MonoRequiredMinimumVersion Condition=" '$(MonoRequiredMinimumVersion)' == '' ">5.8.0</MonoRequiredMinimumVersion>
<MonoRequiredMaximumVersion Condition=" '$(MonoRequiredMaximumVersion)' == '' ">5.9.0</MonoRequiredMaximumVersion>
<IgnoreMaxMonoVersion Condition=" '$(IgnoreMaxMonoVersion)' == '' ">True</IgnoreMaxMonoVersion>
<MonoRequiredDarwinMinimumVersion>$(MonoRequiredMinimumVersion).147</MonoRequiredDarwinMinimumVersion>
<MonoRequiredDarwinMinimumVersion>$(MonoRequiredMinimumVersion).22</MonoRequiredDarwinMinimumVersion>
<LinkerSourceDirectory>$(MSBuildThisFileDirectory)external\linker</LinkerSourceDirectory>
<OpenTKSourceDirectory>$(MSBuildThisFileDirectory)external\opentk</OpenTKSourceDirectory>
<LibZipSourceDirectory Condition=" '$(LibZipSourceDirectory)' == '' ">$(MSBuildThisFileDirectory)external\libzip</LibZipSourceDirectory>
Expand Down
11 changes: 4 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ Xamarin.Android provides open-source bindings of the Android SDK for use with

Building Xamarin.Android requires:

* [Mono 4.4 or later](#mono-sdk)
* [Latest Mono](#mono-sdk)
* [The Java Development Kit (JDK)](#jdk)
* [Autotools (`autoconf`, `automake`, etc.)](#autotools)
* [The Android SDK and NDK](#ndk)
Expand All @@ -70,10 +70,8 @@ to provide install instructions to obtain the missing dependency, e.g.:

## Mono MDK

Mono 4.4 or later is required to build on [OS X][osx-mono] and Linux.

(This is because the build system uses the [XmlPeek][xmlpeek] task, which
was first added in Mono 4.4.)
Latest Mono is required to build on [OS X][osx-mono] and Linux.
The build will tell you if your version is outdated.

[osx-mono]: http://www.mono-project.com/download/#download-mac
[xmlpeek]: https://msdn.microsoft.com/en-us/library/ff598684.aspx
Expand Down Expand Up @@ -210,8 +208,7 @@ Overridable MSBuild properties include:
supported in order to allow a build to continue. Policy is to require a
system mono which corresponds vaguely to the [`external/mono`](external)
version. This is not strictly required; older mono versions *may* work, they
just are not tested, and thus not guaranteed or supported.
By default this is `5.4.0`.
just are not tested, and thus not guaranteed or supported.
* `$(MonoRequiredMaximumVersion)`: The max *system* mono version that is
required. This is so that we can ensure a stable build environment by
making sure we dont install unstable versions.
Expand Down
4 changes: 2 additions & 2 deletions build-tools/dependencies/dependencies.projitems
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<_DarwinMonoFramework>MonoFramework-MDK-5.4.0.147.macos10.xamarin.universal.pkg</_DarwinMonoFramework>
<_DarwinMonoFramework>MonoFramework-MDK-5.8.0.22.macos10.xamarin.universal.pkg</_DarwinMonoFramework>
<_AptGetInstall>apt-get -f -u install</_AptGetInstall>
</PropertyGroup>
<ItemGroup>
Expand Down Expand Up @@ -59,7 +59,7 @@
<MaximumVersion Condition=" '$(IgnoreMaxMonoVersion)' == '' Or '$(IgnoreMaxMonoVersion)' == 'False' " >$(MonoRequiredMaximumVersion)</MaximumVersion>
<DarwinMinimumVersion>$(MonoRequiredDarwinMinimumVersion)</DarwinMinimumVersion>
<CurrentVersionCommand>$(MSBuildThisFileDirectory)..\scripts\mono-version</CurrentVersionCommand>
<DarwinMinimumUrl>https://bosstoragemirror.blob.core.windows.net/wrench/mono-2017-06/28/28a417c2c0d1a2d1231d8b0a5beea3201208b57d/$(_DarwinMonoFramework)</DarwinMinimumUrl>
<DarwinMinimumUrl>https://bosstoragemirror.azureedge.net/wrench/mono-2017-10/7e/7e85cfa5d228cd5148e59cde1d4d663457f96966/$(_DarwinMonoFramework)</DarwinMinimumUrl>
<DarwinInstall>installer -pkg "$(AndroidToolchainCacheDirectory)\$(_DarwinMonoFramework)" -target /</DarwinInstall>
</RequiredProgram>
</ItemGroup>
Expand Down
4 changes: 2 additions & 2 deletions build-tools/mono-runtimes/mono-runtimes.projitems
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@
<RanLib>ranlib</RanLib>
<Strip>strip</Strip>
<StripFlags>-S</StripFlags>
<ConfigureFlags>--enable-dynamic-btls --enable-maintainer-mode --without-ikvm-native --with-monodroid --with-mcs-docs=no --disable-mono-debugger --with-profile2=no --with-profile4=no --with-profile4_5=yes --disable-boehm --enable-nls=no --disable-iconv</ConfigureFlags>
<ConfigureFlags>--enable-dynamic-btls --enable-maintainer-mode --without-ikvm-native --with-monodroid --with-mcs-docs=no --disable-mono-debugger --with-profile4_x=no --disable-boehm --enable-nls=no --disable-iconv</ConfigureFlags>
<OutputRuntimeFilename>libmonosgen-2.0</OutputRuntimeFilename>
<NativeLibraryExtension>dylib</NativeLibraryExtension>
<OutputProfilerFilename>libmono-profiler-log</OutputProfilerFilename>
Expand All @@ -232,7 +232,7 @@
<RanLib>ranlib</RanLib>
<Strip>strip</Strip>
<StripFlags>-S</StripFlags>
<ConfigureFlags>--enable-dynamic-btls --enable-maintainer-mode --without-ikvm-native --with-monodroid --with-mcs-docs=no --disable-mono-debugger --with-profile2=no --with-profile4=no --with-profile4_5=yes --disable-boehm --enable-nls=no --disable-iconv</ConfigureFlags>
<ConfigureFlags>--enable-dynamic-btls --enable-maintainer-mode --without-ikvm-native --with-monodroid --with-mcs-docs=no --disable-mono-debugger --with-profile4_x=no --disable-boehm --enable-nls=no --disable-iconv</ConfigureFlags>
<OutputRuntimeFilename>libmonosgen-2.0</OutputRuntimeFilename>
<NativeLibraryExtension>so</NativeLibraryExtension>
<OutputProfilerFilename>libmono-profiler-log</OutputProfilerFilename>
Expand Down
2 changes: 1 addition & 1 deletion build-tools/mono-runtimes/mono-runtimes.props
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<_HostWinCFlags Condition=" '$(Configuration)' == 'Debug' ">-ggdb3 -O0 -DXAMARIN_PRODUCT_VERSION=0</_HostWinCFlags>
<_HostWinCFlags Condition=" '$(Configuration)' == 'Release' ">-g -O2 -DXAMARIN_PRODUCT_VERSION=0</_HostWinCFlags>
<_BtlsConfigureFlags>--enable-dynamic-btls --with-btls-android-ndk=$(AndroidToolchainDirectory)\ndk</_BtlsConfigureFlags>
<_CommonConfigureFlags>--without-ikvm-native --enable-maintainer-mode --with-profile2=no --with-profile4=no --with-profile4_5=no --with-monodroid --enable-nls=no --with-sigaltstack=yes --with-tls=pthread mono_cv_uscore=yes</_CommonConfigureFlags>
<_CommonConfigureFlags>--without-ikvm-native --enable-maintainer-mode --with-profile4_x=no --with-monodroid --enable-nls=no --with-sigaltstack=yes --with-tls=pthread mono_cv_uscore=yes</_CommonConfigureFlags>
<_TargetConfigureFlags>$(_CommonConfigureFlags) --enable-minimal=ssa,portability,attach,verifier,full_messages,sgen_remset,sgen_marksweep_par,sgen_marksweep_fixed,sgen_marksweep_fixed_par,sgen_copying,logging,security,shared_handles --disable-mcs-build --disable-executables --disable-iconv --disable-boehm $(_BtlsConfigureFlags)</_TargetConfigureFlags>
<_SecurityCFlags>-fstack-protector</_SecurityCFlags>
<_TargetCFlags>$(_SecurityCFlags) -DMONODROID=1</_TargetCFlags>
Expand Down
8 changes: 4 additions & 4 deletions build-tools/mono-runtimes/mono-runtimes.targets
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
</ItemGroup>
<PropertyGroup>
<_MonoProfileDir>$(MonoSourceFullPath)\mcs\class\lib\monodroid</_MonoProfileDir>
<_MonoOutputDir>$(MonoSourceFullPath)\mcs\class\lib\net_4_x</_MonoOutputDir>
<_MonoOutputDir>$(MonoSourceFullPath)\mcs\class\lib\monodroid_tools</_MonoOutputDir>
</PropertyGroup>
<PropertyGroup>
<ForceBuildDependsOn>
Expand Down Expand Up @@ -274,11 +274,11 @@
/>
<_RuntimeEglibHeaderSource
Condition=" '%(_MonoRuntime.DoBuild)' == 'True' "
Include="@(_MonoRuntime->'$(IntermediateOutputPath)\%(Identity)\eglib\config.h');@(_MonoRuntime->'$(IntermediateOutputPath)\%(Identity)\eglib\src\eglib-config.h')"
Include="@(_MonoRuntime->'$(IntermediateOutputPath)\%(Identity)\mono\eglib\eglib-config.h')"
/>
<_RuntimeEglibHeaderOutput
Condition=" '%(_MonoRuntime.DoBuild)' == 'True' "
Include="@(_MonoRuntime->'$(_OutputIncludeDir)%(Identity)\eglib\config.h');@(_MonoRuntime->'$(_OutputIncludeDir)%(Identity)\eglib\eglib-config.h')"
Include="@(_MonoRuntime->'$(_OutputIncludeDir)%(Identity)\eglib\eglib-config.h')"
/>
<_MonoConstsSource
Condition=" '%(_MonoRuntime.DoBuild)' == 'True' "
Expand All @@ -305,7 +305,7 @@
Files="@(_RuntimeSource);@(_ProfilerSource);@(_MonoPosixHelperSource);@(_BclProfileItems);@(_MonoBtlsSource)"
/>
<Exec
Command="make $(MakeConcurrency) -i test # %(_MonoRuntime.Identity)"
Command="make $(MakeConcurrency) test # %(_MonoRuntime.Identity)"
IgnoreStandardErrorWarningFormat="True"
WorkingDirectory="$(IntermediateOutputPath)\%(_MonoRuntime.Identity)\runtime"
/>
Expand Down
2 changes: 1 addition & 1 deletion build-tools/xa-prep-tasks/xa-prep-tasks.targets
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<Import Project="..\bundle\bundle-path.targets" />
<Import Project="..\scripts\XAVersionInfo.targets" />
<PropertyGroup>
<_AzureBaseUri>https://xamjenkinsartifact.blob.core.windows.net/xamarin-android/xamarin-android/bin/</_AzureBaseUri>
<_AzureBaseUri>https://xamjenkinsartifact.azureedge.net/xamarin-android/xamarin-android/bin/</_AzureBaseUri>
<_NuGetUri>https://dist.nuget.org/win-x86-commandline/latest/nuget.exe</_NuGetUri>
<_NuGetPath>$(MSBuildThisFileDirectory)\..\..\.nuget</_NuGetPath>
</PropertyGroup>
Expand Down
2 changes: 1 addition & 1 deletion external/mono
Submodule mono updated 1887 files
2 changes: 1 addition & 1 deletion external/xamarin-android-api-compatibility
Submodule xamarin-android-api-compatibility updated 35 files
+2 −2 README.md
+0 −5 reference/Microsoft.CSharp.xml
+2 −2 reference/Mono.Android.Export.xml
+23 −10 reference/Mono.Android.xml
+1 −6 reference/Mono.Data.Sqlite.xml
+0 −5 reference/Mono.Data.Tds.xml
+9 −6 reference/Mono.Posix.xml
+38 −495 reference/Mono.Security.xml
+1 −1 reference/OpenTK-1.0.xml
+0 −5 reference/System.ComponentModel.Composition.xml
+0 −5 reference/System.ComponentModel.DataAnnotations.xml
+97 −1 reference/System.Core.xml
+0 −5 reference/System.Data.Services.Client.xml
+0 −5 reference/System.Data.xml
+1 −1 reference/System.EnterpriseServices.xml
+0 −5 reference/System.IO.Compression.FileSystem.xml
+12 −5 reference/System.IO.Compression.xml
+0 −5 reference/System.IdentityModel.xml
+0 −5 reference/System.Json.xml
+0 −5 reference/System.Net.Http.WinHttpHandler.xml
+0 −5 reference/System.Net.Http.xml
+1 −1 reference/System.Net.xml
+0 −5 reference/System.Numerics.Vectors.xml
+0 −5 reference/System.Numerics.xml
+0 −5 reference/System.Reflection.Context.xml
+0 −5 reference/System.Security.xml
+0 −5 reference/System.ServiceModel.Web.xml
+0 −1 reference/System.ServiceModel.xml
+0 −5 reference/System.Transactions.xml
+0 −5 reference/System.Web.Services.xml
+0 −5 reference/System.Windows.xml
+0 −5 reference/System.Xml.Serialization.xml
+13 −2 reference/System.xml
+31 −1 reference/Xamarin.Android.NUnitLite.xml
+219 −49 reference/mscorlib.xml
1 change: 1 addition & 0 deletions src/Xamarin.Android.Build.Tasks/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/Xamarin.Android.Common.props
Original file line number Diff line number Diff line change
Expand Up @@ -1085,9 +1085,11 @@ public void CheckWhichRuntimeIsIncluded (string[] supportedAbi, bool debugSymbol
Assert.AreEqual (runtime.Size, inApkRuntime.Size, "expected {0} got {1}", expectedRuntime, inApkRuntime.Runtime);
inApk = ZipHelper.ReadFileFromZip (apk, string.Format ("lib/{0}/libmono-profiler-log.so", abi));
if (string.Compare (expectedRuntime, "debug", StringComparison.OrdinalIgnoreCase) == 0) {
Assert.IsNotNull (inApk, "libmono-profiler-log.so should exist in the apk.");
if (inApk == null)
Assert.Fail ("libmono-profiler-log.so should exist in the apk.");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why replace Assert.IsNotNull with if (inapt != null) Assert.Fail()? Aren't those semantically the same?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I cherry-picked that from the abandoned #723 so I don't have a lot of context, but the commit message says this: Avoid dumping the content of libmono-profiler-log.so when test is falling which makes sense to me since Assert.IsNotNull would dump the value of inApk to the log.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah. Good reason. :-)

} else {
Assert.IsNull (inApk, "libmono-profiler-log.so should not exist in the apk.");
if (inApk != null)
Assert.Fail ("libmono-profiler-log.so should not exist in the apk.");
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/monodroid/jni/Android.mk
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ LOCAL_C_INCLUDES := \
$(LOCAL_PATH) \
$(LOCAL_PATH)/../../../bin/$(CONFIGURATION)/include \
$(LOCAL_PATH)/../../../bin/$(CONFIGURATION)/include/$(TARGET_ARCH_ABI)/eglib \
"$(MONO_PATH)/eglib/src" \
"$(MONO_PATH)/mono/eglib" \
$(LOCAL_PATH)/zip

LOCAL_LDLIBS := -llog -lz -lstdc++
Expand Down
14 changes: 8 additions & 6 deletions src/monodroid/jni/monodroid-glue.c
Original file line number Diff line number Diff line change
Expand Up @@ -3426,7 +3426,7 @@ set_trace_options (void)
/* Profiler support cribbed from mono/metadata/profiler.c */

typedef void (*ProfilerInitializer) (const char*);
#define INITIALIZER_NAME "mono_profiler_startup"
#define INITIALIZER_NAME "mono_profiler_init"

static mono_bool
load_profiler (void *handle, const char *desc, const char *symbol)
Expand Down Expand Up @@ -3470,7 +3470,7 @@ load_embedded_profiler (const char *desc, const char *name)
}

static mono_bool
load_profiler_from_directory (const char *directory, const char *libname, const char *desc)
load_profiler_from_directory (const char *directory, const char *libname, const char *desc, const char *name)
{
char *full_name = path_combine (directory, libname);
int exists = file_exists (full_name);
Expand All @@ -3485,7 +3485,9 @@ load_profiler_from_directory (const char *directory, const char *libname, const
free (full_name);

if (h) {
mono_bool result = load_profiler (h, desc, INITIALIZER_NAME);
char *symbol = monodroid_strdup_printf ("%s_%s", INITIALIZER_NAME, name);
mono_bool result = load_profiler (h, desc, symbol);
free (symbol);
if (result)
return 1;
dlclose (h);
Expand Down Expand Up @@ -3515,18 +3517,18 @@ monodroid_profiler_load (const char *libmono_path, const char *desc, const char
for (oi = 0; oi < MAX_OVERRIDES; ++oi) {
if (!directory_exists (override_dirs [oi]))
continue;
if ((found = load_profiler_from_directory (override_dirs [oi], libname, desc)))
if ((found = load_profiler_from_directory (override_dirs [oi], libname, desc, mname)))
break;
}

do {
if (found)
break;
if ((found = load_profiler_from_directory (app_libdir, libname, desc)))
if ((found = load_profiler_from_directory (app_libdir, libname, desc, mname)))
break;
if ((found = load_embedded_profiler (desc, mname)))
break;
if (libmono_path != NULL && (found = load_profiler_from_directory (libmono_path, libname, desc)))
if (libmono_path != NULL && (found = load_profiler_from_directory (libmono_path, libname, desc, mname)))
break;
} while (0);

Expand Down
2 changes: 1 addition & 1 deletion src/monodroid/monodroid.props
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<PropertyGroup>
<_DebugCFlags>-ggdb3 -O0 -fno-omit-frame-pointer</_DebugCFlags>
<_ReleaseCFlags>-g -O2</_ReleaseCFlags>
<_CommonCFlags>-Ijni -Ijni/zip "-I$(MonoSourceFullPath)\eglib\src" -std=c99 -DSGEN_BRIDGE_VERSION=$(MonoSgenBridgeVersion) -D_REENTRANT -DHAVE_CONFIG_H -DMONO_DLL_EXPORT -DJI_DLL_EXPORT -fno-strict-aliasing -ffunction-sections -fvisibility=hidden -Wformat -Werror=format-security</_CommonCFlags>
<_CommonCFlags>-Ijni -Ijni/zip "-I$(MonoSourceFullPath)\mono\eglib" -std=c99 -DSGEN_BRIDGE_VERSION=$(MonoSgenBridgeVersion) -D_REENTRANT -DHAVE_CONFIG_H -DMONO_DLL_EXPORT -DJI_DLL_EXPORT -fno-strict-aliasing -ffunction-sections -fvisibility=hidden -Wformat -Werror=format-security</_CommonCFlags>
<_HostUnixCFlags>$(_CommonCFlags) -Wa,--noexecstack</_HostUnixCFlags>
<_HostUnixLdFlags>-Wall -lstdc++ -lz -shared -fpic</_HostUnixLdFlags>
<_HostCommonWinCFlags>$(_CommonCFlags) -DWINDOWS -DNTDDI_VERSION=NTDDI_VISTA -D_WIN32_WINNT=_WIN32_WINNT_VISTA -fomit-frame-pointer</_HostCommonWinCFlags>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
build/
14 changes: 14 additions & 0 deletions tests/Xamarin.Android.Bcl-Tests/Resources/LinkerDescription.xml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,20 @@
<type fullname="System.Reflection.AssemblyKeyNameAttribute">
<method name=".ctor"/>
</type>
<type fullname="System.Reflection.AssemblyKeyFileAttribute">
<method name=".ctor"/>
</type>
<type fullname="System.AttributeUsageAttribute">
<method name=".ctor"/>
<method name="get_AllowMultiple"/>
<method name="set_AllowMultiple"/>
</type>
<type fullname="System.Runtime.InteropServices.MarshalAsAttribute">
<method name=".ctor"/>
<field signature="System.Int32 SizeConst"/>
<field signature="System.Type MarshalTypeRef"/>
<field signature="System.String MarshalCookie"/>
</type>
<type fullname="System.Runtime.CompilerServices.MethodImplAttribute">
<method name=".ctor"/>
</type>
Expand Down