<commit_before># Gradle Android-Arm-Clang plugin

[![Build Status](https://travis-ci.org/sgeb/gradle-android-arm-clang-plugin.png?branch=master)](https://travis-ci.org/sgeb/gradle-android-arm-clang-plugin)

This Gradle plugin provides the Android-Arm-Clang toolchain to cross-compile
C/C++ code. The toolchain must be installed separately, please refer to the
Android documentation for instructions.

## How?

```groovy
executables {
    main {}
}

model {
    platforms {
        "android-arm" {
            operatingSystem "linux"
            architecture "arm"
        }
    }
}
```

Make sure you have `arm-linux-androideabi-clang++` from the Android toolchain in
your `PATH`.

There is an annoyance in the `bin` directory of the Android toolchain: it
contains binaries called `clang` and `clang++`. In order for these not to
override you system-wide compiler, add the toolchain `bin` directory at the end
of `PATH`.

Gradle does not know any OS called `android` and we must stick to `linux` in the
platform definition (which is technically correct). But the Android toolchain
cannot cross-compile to any arbitrary linux-arm platform, only to a platform
running the androideabi. The plugin checks the following to make sure it only
builts for the correct platform:

* operatingSystem must be `linux`
* architecture must be `arm`
* platform name (`android-arm` in this example) must contain the string `android`

## Multiple platforms in peaceful co-existence

The following example defines multiple platforms. They can be (cross-)compiled
using the same build folder and the same code base.

```groovy
executables {
    main {}
}

model {
    platforms {
        "osx-x64" {
            operatingSystem "mac os x"
            architecture "x86_64"<commit_msg>Small typo<commit_after># Gradle Android-Arm-Clang plugin

[![Build Status](https://travis-ci.org/sgeb/gradle-android-arm-clang-plugin.png?branch=master)](https://travis-ci.org/sgeb/gradle-android-arm-clang-plugin)

This Gradle plugin provides the Android-Arm-Clang toolchain to cross-compile
C/C++ code. The toolchain must be installed separately, please refer to the
Android documentation for instructions.

## How?

```groovy
executables {
    main {}
}

model {
    platforms {
        "android-arm" {
            operatingSystem "linux"
            architecture "arm"
        }
    }
}
```

Make sure you have `arm-linux-androideabi-clang++` from the Android toolchain in
your `PATH`.

There is an annoyance in the `bin` directory of the Android toolchain: it
contains binaries called `clang` and `clang++`. In order for these not to
override you system-wide compiler, add the toolchain `bin` directory at the end
of `PATH`.

Gradle does not know any OS called `android` and we must stick to `linux` in the
platform definition (which is technically correct). But the Android toolchain
cannot cross-compile to any arbitrary linux-arm platform, only to a platform
running the androideabi. The plugin checks the following to make sure it only
builds for the correct platform:

* operatingSystem must be `linux`
* architecture must be `arm`
* platform name (`android-arm` in this example) must contain the string `android`

## Multiple platforms in peaceful co-existence

The following example defines multiple platforms. They can be (cross-)compiled
using the same build folder and the same code base.

```groovy
executables {
    main {}
}

model {
    platforms {
        "osx-x64" {
            operatingSystem "mac os x"
            architecture "x86_64"
{'fraction_non_alphanumeric': 0.08685779165483963, 'fraction_numerical': 0.0034061879080329264, 'mean_word_length': 3.673740053050398, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '273602', 'n_tokens_mistral': 1004, 'n_tokens_neox': 985, 'n_words': 410}