Alexander Afanasyev | bd74ad2 | 2016-01-06 18:09:10 -0800 | [diff] [blame] | 1 | Developer Notes |
| 2 | =============== |
| 3 | |
| 4 | ## To build debug version of NFD |
| 5 | |
| 6 | Configure `ndk.dir` and `sdk.dir` in `local.properties` file. For example: |
| 7 | |
Alexander Afanasyev | a8d404b | 2016-11-05 10:07:08 -0600 | [diff] [blame] | 8 | ndk.dir=/opt/crystax-ndk-10.3.1 |
Alexander Afanasyev | bd74ad2 | 2016-01-06 18:09:10 -0800 | [diff] [blame] | 9 | sdk.dir=/opt/android-sdk-macosx |
| 10 | |
| 11 | Alternatively, you can set `ANDROID_NDK_ROOT` environment variable to point towards NDK folder. |
| 12 | |
| 13 | Build process can be customized using several environment variables: |
| 14 | |
| 15 | - `NDK_DEBUG` |
| 16 | |
| 17 | If set, the native code is built in debug mode. For example: |
| 18 | |
Alexander Afanasyev | a8d404b | 2016-11-05 10:07:08 -0600 | [diff] [blame] | 19 | NDK_DEBUG=1 ./gradlew assembleDebug |
Alexander Afanasyev | bd74ad2 | 2016-01-06 18:09:10 -0800 | [diff] [blame] | 20 | |
| 21 | - `NDK_BUILD_ABI=<comma-separated-list-of-platforms>` |
| 22 | |
| 23 | If set, the native code is built only for the specified platforms. For example, the following snippet will build NFD only for x86 platform: |
| 24 | |
| 25 | export NDK_BUILD_ABI=x86 |
Alexander Afanasyev | a8d404b | 2016-11-05 10:07:08 -0600 | [diff] [blame] | 26 | ./gradlew assembleDebug |
Alexander Afanasyev | bd74ad2 | 2016-01-06 18:09:10 -0800 | [diff] [blame] | 27 | |
| 28 | - `NDK_BUILD_PARALLEL=<number>` |
| 29 | |
| 30 | If set, the build will be limited with the specified number of parallel builds. Otherwise, the build will be automatically parallelized based on the number of available CPUs. |
| 31 | |
| 32 | ## To build the release version of NFD |
| 33 | |
| 34 | In order to build the release version of NFD, it needs to be properly signed. In order to specify keystore, keystore's password, key in the keystore, and key's password, add the following configuration into `local.properties` file: |
| 35 | |
| 36 | |
| 37 | keystore=<path-to-.keystore-file> |
| 38 | keystore.password=<keystore-password> |
| 39 | keystore.key.alias=<key-alias-in-keystore> |
| 40 | keystore.key.password=<key-password> |
| 41 | |
| 42 | For more information about application signing and instructions on how to generate keys, refer to [Android Documentation](http://developer.android.com/tools/publishing/app-signing.html). |
| 43 | |
| 44 | ## To publish the release version on Google Play |
| 45 | |
| 46 | The release version of NFD can be automatically uploaded to Google Play, if Google Play parameters are configured in `local.properties` files: |
| 47 | |
| 48 | google-play=<path-to-json-config> |
| 49 | |
| 50 | Note that `.json` config can be downloaded from Google Developer Console. For more information, refer to [Google Play Publishing Plugin](https://github.com/Triple-T/gradle-play-publisher). |