Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: editorial fixes for BUILDING.md #3

Merged
merged 1 commit into from
Aug 18, 2020
Merged
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
35 changes: 20 additions & 15 deletions BUILDING.md
Original file line number Diff line number Diff line change
@@ -4,7 +4,7 @@

ATAK primarily uses a gradle based build system. We recommend Android Studio as the IDE, however, you can be build the entire application from the command-line.

### Android Studio
### Android Studio

https://developer.android.com/studio

@@ -13,13 +13,15 @@ https://developer.android.com/studio
Unless otherwise noted, all shared objects in ATAK that are compiled from source are compiled using NDK r12b.

Direct download links:

* Windows 32-bit https://dl.google.com/android/repository/android-ndk-r12b-windows-x86.zip
* Windows 64-bit https://dl.google.com/android/repository/android-ndk-r12b-windows-x86_64.zip
* Mac OS X https://dl.google.com/android/repository/android-ndk-r12b-darwin-x86_64.zip
* Linux 64-bit https://dl.google.com/android/repository/android-ndk-r12b-linux-x86_64.zip

The NDK should be installed in one of the directories that gradle will detect. This includes
* `$ANDROID_SDK_HOME/ndk`

* `$ANDROID_SDK_HOME/ndk`
* `set ndk.dir in the project's local.properties` (remember on Windows to correctly construct the path C\:\\location\\to\\sdk)
* `set the $ANDROID_NDK_HOME environment variable` (gradle has deprecated use of this variable)

@@ -30,7 +32,8 @@ The NDK should be installed in one of the directories that gradle will detect. T
ATAK requires STL Soft 1.9. The repository should be cloned under `takengine/thirdparty/stlsoft`.

From local repository root:
```

``` sh
cd takengine/thirdparty
git clone https://github.com/synesissoftware/STLSoft-1.9.git stlsoft
```
@@ -41,48 +44,49 @@ git clone https://github.com/synesissoftware/STLSoft-1.9.git stlsoft

The TAK Third Party build system requires a number of dependencies for execution. Please refer to the Readme.md document in the root of the `takthirdparty` directory for the list of those dependencies and execution of that build system.

# Building The Prerequisite Dependencies
## Building The Prerequisite Dependencies

**NOTE** we've included a convenience script, `scripts/prebuild.sh` to execute the TAK Third Party build

Prior to building the APK within Android Studio, many of the binary thirdparty dependencies must be built with the TAK Third Party build system (for all architectures) from the command line.

## Step 1: Unpack GDAL
### Step 1: Unpack GDAL

A tarball containing a modified version of GDAL 2.2.3 is included with the library in the `depends` directory. The contents must be extracted to the root directory for use during step 2, e.g.

```
``` sh
gzip -d ./depends/gdal-2.2.3-mod.tar.gz
cp ./depends/gdal-2.2.3-mod.tar .
tar xf gdal-2.2.3-mod.tar
```

## Step 2: Build shared object depenencies using TAK Third Party
### Step 2: Build shared object dependencies using TAK Third Party

The following issues should be executed from within the `takthirdparty` directory:

```
``` sh
make TARGET=android-arm64-v8a build_spatialite build_gdal build_commoncommo build_assimp
make TARGET=android-armeabi-v7a build_spatialite build_gdal build_commoncommo build_assimp
make TARGET=android-x86 build_spatialite build_gdal build_commoncommo build_assimp
```

On successful completion, this will create the following directories, containing header files, static libraries and shared objects:
```

``` sh
takthirdparty/builds/android-arm64-v8a-release
takthirdparty/builds/android-armeabi-v7a-release
takthirdparty/builds/android-x86-release
```

These build artifacts will be used by the various `build.gradle` and `Android.mk` scripts used to build the APK.

# Building the ATAK APK
## Building the ATAK APK

The normal build processes in Android Studio may be used for general building and debugging. Below is some helpful information as it relates to the specifics of ATAK development.

**NOTE** You must generate your own signing key. Once generated, you will need to specify the following properties in your `local.properties` file.

```
``` ini
takDebugKeyFile=...
takDebugKeyFilePassword=...
takDebugKeyAlias=...
@@ -96,13 +100,14 @@ takReleaseKeyPassword=...
When specified you must replace the ellipsis (`...`) with the actual values. Note that the paths should be relative.

The following gradle tasks are commonly used

* `assembleCivDebug` builds the ATAK CIV APK in debug mode
* `assembleCivRelease` builds the ATAK CIV APK in release mode
* `installCivDebug` builds and install the ATAK CIV APK in debug mode to all connected devices (see use of `ANDROID_SERIAL` to target a specific device from the commandline)
* `installCivRelease` builds and install the ATAK CIV APK in release mode to all connected devices (see use of `ANDROID_SERIAL` to target a specific device from the commandline)
* `installCivDebug` builds and install the ATAK CIV APK in debug mode to all connected devices (see use of `ANDROID_SERIAL` to target a specific device from the command line)
* `installCivRelease` builds and install the ATAK CIV APK in release mode to all connected devices (see use of `ANDROID_SERIAL` to target a specific device from the command line)
* `createCivDebugJacocoTestReport` executes all tests and generates a code coverage report for ATAK CIV (debug)
* `createCivReleaseJacocoTestReport` executes all tests and generates a code coverage report for ATAK CIV (release)

**NOTE** When executing the `createXXXJacocoTestReport` targets, the gradle command must be passed the option `-Pcoverage`, e.g.

`./gradlew -Pcoverage createCivDebugJacocoTestReport`
`./gradlew -Pcoverage createCivDebugJacocoTestReport`