Skip to content

Commit

Permalink
Merge branch 'master' of github.com:xamarin/xamarin-android into mono…
Browse files Browse the repository at this point in the history
…-2018-10
  • Loading branch information
alexischr committed Feb 19, 2019
2 parents c988c13 + b08240e commit cdbdcb3
Show file tree
Hide file tree
Showing 93 changed files with 2,466 additions and 1,121 deletions.
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
[submodule "external/sqlite"]
path = external/sqlite
url = https://github.com/xamarin/sqlite.git
branch = 3.26.0
branch = 3.27.1
[submodule "external/xamarin-android-api-compatibility"]
path = external/xamarin-android-api-compatibility
url = https://github.com/xamarin/xamarin-android-api-compatibility.git
Expand Down
2 changes: 1 addition & 1 deletion Configuration.props
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
Condition=" Exists('$(MSBuildThisFileDirectory)Configuration.OperatingSystem.props') And '$(DoNotLoadOSProperties)' != 'True' "
/>
<PropertyGroup>
<ProductVersion>9.1.199</ProductVersion>
<ProductVersion>9.2.99</ProductVersion>
<!-- Used by the `build-tools/create-vsix` build so that `Mono.Android.Export.dll`/etc. are only included *once* -->
<!-- Should correspond to the first value from `$(API_LEVELS)` in `build-tools/scripts/BuildEverything.mk` -->
<AndroidFirstFrameworkVersion Condition="'$(AndroidFirstFrameworkVersion)' == ''">v4.4</AndroidFirstFrameworkVersion>
Expand Down
7 changes: 4 additions & 3 deletions Documentation/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,10 @@
# Building from Source

* [Build System Configuration](building/configuration.md)
* [Build Dependencies](building/dependencies.md)
* [Building Xamarin.Android on Linux and macOS](building/unix-instructions.md)
* [Building Xamarin.Android on Windows](building/windows-instructions.md)
* [Build Dependencies for Linux and macOS](building/unix/dependencies.md)
* [Building Xamarin.Android on Linux and macOS](building/unix/instructions.md)
* [Build Dependencies for Windows](building/windows/dependencies.md)
* [Building Xamarin.Android on Windows](building/windows/instructions.md)


# Development Workflow
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Build Dependencies
# Build Dependencies for Linux and macOS

Building Xamarin.Android requires:

Expand All @@ -14,7 +14,7 @@ If you would like `make prepare` to automatically install
required dependencies, set the `$(AutoProvision)` MSBuild property to True
and (if necessary) set the `$(AutoProvisionUsesSudo)` property to True.
(This is not supported on all operating systems;
see [configuration.md](configuration.md) for details.)
see [configuration.md](../configuration.md) for details.)

If `$(AutoProvision)` is False (the default) and a dependency is missing,
then the build will fail and an error message will be displayed attempting
Expand Down Expand Up @@ -87,7 +87,7 @@ The files that will be downloaded and installed are controlled by
via the `@(AndroidNdkItem)` and `@(AndroidSdkItem)` item groups, and the
URL to download files from is controlled by the `$(AndroidUri)` property.

[android-toolchain.projitems]: ../../build-tools/android-toolchain/android-toolchain.projitems
[android-toolchain.projitems]: ../../../build-tools/android-toolchain/android-toolchain.projitems


<a name="Linux" />
Expand All @@ -114,9 +114,9 @@ and to enable it again, issue the following command:

## macOS Dependencies

The [`android-toolchain.projitems`](../../build-tools/android-toolchain/android-toolchain.projitems),
[`libzip.projitems`](../../src/libzip/libzip.projitems), and
[`monodroid.projitems`](../../src/monodroid/monodroid.projitems) project files, among
The [`android-toolchain.projitems`](../../../build-tools/android-toolchain/android-toolchain.projitems),
[`libzip.projitems`](../../../src/libzip/libzip.projitems), and
[`monodroid.projitems`](../../../src/monodroid/monodroid.projitems) project files, among
others, use the `@(RequiredProgram)` build action to check for the existence
of a program within `$PATH` during the build. If a required program doesn't
exist, then the build will fail and a suggested `brew install` command line
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ can also be used by setting the `$(MSBUILD)` make variable to `xbuild`.

3. Navigate to the `xamarin-android` directory

4. (Optional) [Configure the build](configuration.md).
4. (Optional) [Configure the build](../configuration.md).

5. Prepare the project:

Expand Down Expand Up @@ -120,8 +120,8 @@ or with msbuild:

Another possibility is to run them manually as described below.

See also the [`tests/RunApkTests.targets`](../../tests/RunApkTests.targets) and
[`build-tools/scripts/TestApks.targets`](../../build-tools/scripts/TestApks.targets)
See also the [`tests/RunApkTests.targets`](../../../tests/RunApkTests.targets) and
[`build-tools/scripts/TestApks.targets`](../../../build-tools/scripts/TestApks.targets)
files.

All `.apk`-based unit test projects provide the following targets:
Expand Down Expand Up @@ -214,8 +214,8 @@ There are a few ways to do it:

where *LEVEL* is one of the [API levels from the `$(API_LEVELS)` variable][api-levels].

[override-props]: ../README.md#build-configuration
[api-levels]: ../../build-tools/scripts/BuildEverything.mk#L31
[override-props]: ../../README.md#build-configuration
[api-levels]: ../../../build-tools/scripts/BuildEverything.mk#L31

# How do I rebuild the Mono Runtime and Native Binaries?

Expand Down Expand Up @@ -285,7 +285,7 @@ The `ForceBuild` target will build mono for *all* configured architectures,
then invoke the `_InstallRuntimes` target when all the mono's have finished
building; see the `$(AndroidSupportedHostJitAbis)`,
`$(AndroidSupportedTargetAotAbis)`, and `$(AndroidSupportedTargetJitAbis)`
MSBuild properties within [README.md](../README.md). This may not always be
MSBuild properties within [README.md](../../README.md). This may not always be
desirable, for example if you're trying to fix a Mono runtime bug for a
specific ABI, and improving turnaround time is paramount.
(Building for all ABIs can be time consuming.)
Expand All @@ -295,7 +295,7 @@ where the "relevant directory" is the target of interest within
`src/mono-runtimes/obj/$(Configuration)`. When `make` has completed,
invoke the `_InstallRuntimes` target so that the updated native libraries
are copied into `bin/$(Configuration)/lib`, which will allow subsequent
top-level `make` and [`xabuild`](../../tools/xabuild) invocations to use them.
top-level `make` and [`xabuild`](../../../tools/xabuild) invocations to use them.

For example, to rebuild Mono for armeabi-v7a:

Expand Down
44 changes: 44 additions & 0 deletions Documentation/building/windows/dependencies.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# Build Dependencies for Windows

Building Xamarin.Android requires:

* An existing installation of the Xamarin.Android SDK and the Android SDK
* The .NET Framework 3.5 &ndash; 4.7 development tools
* Git for Windows
* The Java Development Kit (JDK)

The recommended steps to install these dependencies are:

1. Run the [Visual Studio Installer](https://visualstudio.microsoft.com/vs/).

2. Under the **Workloads** tab, ensure that the **Mobile development with
.NET** workload is installed. Under the **Optional** items for the
workload, ensure **Android SDK setup** is selected.

3. Also ensure the **.NET desktop development** workload is installed. Under
the **Optional** items for the workload, ensure the following items are
installed:

* **.NET Framework 4 &ndash; 4.6 development tools**
* **.NET Framework 4.6.2 development tools**
* **.NET Framework 4.7 development tools**
* **.NET Core 2.0 development tools**

The following items are also recommended:

* **.NET Framework 4.7.1 development tools**
* **.NET Framework 4.7.2 development tools**

4. Under the **Individual components** tab, ensure that **Code tools > Git for
Windows** is installed.

5. Ensure the .NET Framework 3.5 SP1 Runtime is installed by downloading and
running the installer from
<https://www.microsoft.com/net/download/visual-studio-sdks>.

6. Download and install the Java SE 8 JDK from the [Oracle
website][oracle-jdk]. You can use either the Windows x64 or Windows x86
version. Make sure **Development Tools** is selected for installation when
running the installer.

[oracle-jdk]: http://www.oracle.com/technetwork/java/javase/downloads/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ MSBuild version 15 or later is required.

4. (Optional) [Configure the build](configuration.md).

5. Prepare the project:
5. In a [Developer Command Prompt][developer-prompt], prepare the project:

msbuild Xamarin.Android.sln /t:Prepare

Expand All @@ -30,22 +30,31 @@ MSBuild version 15 or later is required.

msbuild Xamarin.Android.sln

After the solution has built successfully, you can [use your
build][using-your-build] to build Xamarin.Android application and library
projects. Note that by default `Xamarin.Android.sln` only builds support for
the `$(TargetFrameworkVersion)` specified in the `$(AndroidFrameworkVersion)`
property of the [`Configuration.props`][configprops-master] file (`v9.0` when
this guide was last updated), so you will need to ensure that your application
and library projects are configured to use that particular target framework
version.

[developer-prompt]: https://docs.microsoft.com/dotnet/framework/tools/developer-command-prompt-for-vs
[using-your-build]: https://github.com/xamarin/xamarin-android/blob/master/Documentation/workflow/UsingYourBuild.md
[configprops-master]: https://github.com/xamarin/xamarin-android/blob/master/Configuration.props

## Windows Build Notes

Currently Windows avoids building many of the macOS dependencies by downloading
a zip bundle of mono-related binaries previously built on macOS. This speeds up
a zip bundle of mono-related binaries previously built on macOS. This speeds up
the build and enables development on Windows, in general.

A simple way to ensure you have the needed dependencies on Windows is to install
Visual Studio 2017 (> 15.3.x) along with the Xamarin workload. This will ensure you have
the correct version of Xamarin.Android, the Android SDK, and Java needed.

It also is worth noting that opening `Xamarin.Android.sln` in Visual Studio tends
to hold file locks on output assemblies containing MSBuild tasks. Until there is a solution
for this, it might be more advisable to use an editor like Visual Studio Code and build via
the command-line.

Opening `Xamarin.Android.sln` in Visual Studio currently tends to hold file
locks on output assemblies containing MSBuild tasks. If you are only making
changes to Xamarin.Android.Build.Tasks, one way to avoid this issue is to open
`Xamarin.Android.Build.Tasks.sln` instead. But if you are working on changes
outside of the build tasks, then you might prefer to work in an editor like
Visual Studio Code instead and build via the command-line.

# Building Unit Tests

Expand All @@ -54,7 +63,8 @@ be built with:

msbuild Xamarin.Android-Tests.sln /p:XAIntegratedTests=False

*NOTE*: There is currently no equivalent to [`make jenkins`](unix-instructions.md) on Windows.
*NOTE*: There is currently no equivalent to [`make
jenkins`](../unix/instructions.md) on Windows.

*Troubleshooting*: Ensure you check your MSBuild version (`msbuild -version`)
and path for the proper version of MSBuild.
Expand Down
32 changes: 32 additions & 0 deletions Documentation/guides/BuildProcess.md
Original file line number Diff line number Diff line change
Expand Up @@ -754,6 +754,38 @@ when packaing Release applications.

Added in Xamarin.Android 8.3.

- **AndroidEnablePreloadAssemblies** &ndash; A boolean property which controls
whether or not all managed assemblies bundled within the application package
are loaded during process startup or not.

When set to `True`, all assemblies bundled within the application package
will be loaded during process startup, before any application code is invoked.
This is consistent with what Xamarin.Android did in releases prior to
Xamarin.Andorid 9.2.

When set to `False`, assemblies will only be loaded on an as-needed basis.
This allows applications to startup faster, and is also more consistent with
desktop .NET semantics. To see the time savings, set the `debug.mono.log`
System Property to include `timing`, and look for the
`Finished loading assemblies: preloaded` message within `adb logcat`.

Applications or libraries which use dependency injection may *require* that
this property be `True` if they in turn require that
`AppDomain.CurrentDomain.GetAssemblies()` return all assemblies within the
application bundle, even if the assembly wouldn't otherwise have been needed.
By default this value will be set to `True`.
Added in Xamarin.Android 9.2.
- **AndroidEnableGooglePlayStoreChecks** &ndash; A bool property
which allows developers to disable the following Google Play
Store checks, XA1004, XA1005 and XA1006. This is useful for
developers who are not targeting the Google Play Store and do
not wish to run those checks.
Added in Xamarin.Android 9.4.
### Binding Project Build Properties
The following MSBuild properties are used with
Expand Down
3 changes: 3 additions & 0 deletions Documentation/guides/messages/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@
+ [XA1003](xa1003.md): '{zip}' does not exist. Please rebuild the project.
+ [XA1004](xa1004.md): There was an error opening {filename}. The file is probably corrupt. Try deleting it and building again.
+ [XA1005](xa1005.md): Attempting naive type name fixup for element with ID '{id}' and type '{managedType}'
+ [XA1006](xa1006.md): Your application is running on a version of Android ({compileSdk}) that is more recent than your targetSdkVersion specifies ({targetSdk}). Set your targetSdkVersion to the highest version of Android available to match your TargetFrameworkVersion ({compileSdk}).
+ [XA1007](xa1007.md): The minSdkVersion ({minSdk}) is greater than targetSdkVersion. Please change the value such that minSdkVersion is less than or equal to targetSdkVersion ({targetSdk}).
+ [XA1008](xa1008.md): The TargetFrameworkVersion ({compileSdk}) should not be lower than targetSdkVersion ({targetSdk})

### XA2xxx Linker

Expand Down
7 changes: 7 additions & 0 deletions Documentation/guides/messages/xa1006.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Compiler Warning XA1006

You are building against a version of Android (compileSdk) that
is more recent than your targetSdkVersion specifies (targetSdk).

Set your targetSdkVersion to the highest version of Android available
to match your TargetFrameworkVersion (compileSdk).
6 changes: 6 additions & 0 deletions Documentation/guides/messages/xa1007.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Compiler Warning XA1007

The minSdkVersion (minSdk) is greater than targetSdkVersion.

Please change the value such that minSdkVersion is less than
or equal to targetSdkVersion (targetSdk).
8 changes: 8 additions & 0 deletions Documentation/guides/messages/xa1008.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Compiler Warning XA1008

The TargetFrameworkVersion (compileSdk) must not be lower
than targetSdkVersion (targetSdk).

You should either, increase the `$(TargetFrameworkVersion)`
of your project. Or decrease the `android:targetSdkVersion`
in your `AndroidManifest.xml` to correct this issue.
12 changes: 12 additions & 0 deletions Documentation/guides/messages/xa4216.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Compiler Warning XA4216

This warning indicates your application is targeting an API level that
Xamarin.Android does not support.

Raise the value of `//uses-sdk/@android:minSdkVersion` or
`//uses-sdk/@android:targetSdkVersion` in `AndroidManifest.xml` to a
higher API level that is supported.

Example message:

warning XA4216: AndroidManifest.xml //uses-sdk/@android:minSdkVersion '15' is less than API-16, this configuration is not supported.
16 changes: 16 additions & 0 deletions Documentation/guides/messages/xa4218.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Compiler Warning XA4218

This warning indicates your `AndroidManifest.xml` file specifies
`//application/uses-library`, but the library was not found within the
Android SDK directory.

Solutions:

* Verify you defined the `@android:name` correctly and the file
exists.
* Raise the value of `//uses-sdk/@android:targetSdkVersion` in
`AndroidManifest.xml` to a higher API level.

Example message:

warning XA4218: Unable to find //manifest/application/uses-library at path: C:\Program Files (x86)\Android\android-sdk\platforms\android-22\optional\org.apache.http.legacy.jar
4 changes: 2 additions & 2 deletions Documentation/project-docs/ExploringSources.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

There are two project configurations, `Debug` and `Release`. The project
configuration is controlled by the `$(Configuration)` MSBuild property.
By default this is `Debug`. [`make jenkins`](../building/unix-instructions.md)
By default this is `Debug`. [`make jenkins`](../building/unix/instructions.md)
will build both `Debug` and `Release` configurations. The configuration name
is used within many of the output directories which are created.

Expand Down Expand Up @@ -33,7 +33,7 @@ is used within many of the output directories which are created.
* `external`: git submodules
* `Java.Interop`: Core JNI interaction support
* `mono`: Used to execute IL on Android
* `packages`: NuGet packages; created by [`make prepare`](../building/unix-instructions.md).
* `packages`: NuGet packages; created by [`make prepare`](../building/unix/instructions.md).
* `samples`: Sample applications.
* `src`: Projects which are redistributable, the outputs of which will be in
`bin/$(Configuration)`.
Expand Down
4 changes: 2 additions & 2 deletions Documentation/workflow/HowToBumpMono.md
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ Ensure that `make all` builds *first*. Once that builds, move on to using
`make jenkins`, which adds support for *all* ABIs, *plus* AOT and LLVM
compilers, plus Windows binaries.

See [`Documentation/building/unix-instructions.md`](../building/unix-instructions.md).
See [`Documentation/building/unix/instructions.md`](../building/unix/instructions.md).


<a name="unit-tests" />
Expand All @@ -183,7 +183,7 @@ Run the unit tests by using `make all-tests run-all-tests`.

All unit tests should pass.

See [`Documentation/building/unix-instructions.md`](../building/unix-instructions.md).
See [`Documentation/building/unix/instructions.md`](../building/unix/instructions.md).


<a name="create-pr" />
Expand Down
Loading

0 comments on commit cdbdcb3

Please sign in to comment.