BuildStendhalForAndroid: Difference between revisions

Jump to navigation Jump to search
Content deleted Content added
imported>AntumDeluge
Setting Revision Suffix: update instructions for recent changes
imported>AntumDeluge
Gradle: update instructions for changes to source
Line 36: Line 36:
=== Gradle ===
=== Gradle ===


The [https://gradle.org/ Gradle Build Tool] is used for building. The necessary tools are already included with the source code. Two scripts are provided for executing the build: <span style="color:green;">android/gradlew</span> for Unix/Linux systems, & <span style="color:green;">android/gradlew.bat</span> for Windows.
The [https://gradle.org/ Gradle Build Tool] is used for building. The necessary tools are already included with the source code. Two scripts are provided for executing the build: <span style="color:green;">app/android/gradlew</span> for Unix/Linux systems and <span style="color:green;">app/android/gradlew.bat</span> for Windows.


In order for the build to complete, the scripts must know where the SDK libraries are located. The script will check the '''<span style="color:green;">ANDROID_SDK_ROOT</span>''' environment variable, or it will parse the value of '''<span style="color:green;">sdk.dir</span>''' in the <span style="color:green;">android/local.properties</span> file ''('''NOTE:''' Windows users must use double backslashes for directories (\\))''.
In order for the build to complete, the scripts must know where the SDK libraries are located. The script will check the '''<span style="color:green;">ANDROID_SDK_ROOT</span>''' environment variable, or it will parse the value of '''<span style="color:green;">sdk.dir</span>''' in the <span style="color:green;">app/android/local.properties</span> file ''('''NOTE:''' Windows users must use double backslashes for directories (\\))''.


Example <span style="color:green;">local.properties</span> for Unix/Linux:
Example <span style="color:green;">local.properties</span> for Unix/Linux:
Line 52: Line 52:
'''''NOTE:''' On Windows, if you used Android Studio to download the SDK, it will be located in <span style="color:green;">C:\\Users\\<username>\\AppData\\Local\\Android\\Sdk</span>.''
'''''NOTE:''' On Windows, if you used Android Studio to download the SDK, it will be located in <span style="color:green;">C:\\Users\\<username>\\AppData\\Local\\Android\\Sdk</span>.''


There are three build types available: <span style="color:darkgreen;">assembleRelease</span>, <span style="color:darkgreen;">assemblePrerelease</span>, & <span style="color:darkgreen;">assembleDebug</span>. From a command line or terminal, move into the <span style="color:green;">android</span> sub-directory & execute the following.
There are two build types available: <span style="color:darkgreen;">assembleRelease</span> and <span style="color:darkgreen;">assembleDebug</span>. From a command line or terminal, move into the <span style="color:green;">app/android</span> sub-directory and execute the following.


Unix/Linux example:
Unix/Linux example:
Line 75: Line 75:
If <span style="color:darkgreen;">build</span> is used as the argument (<code>gradlew build</code>), it will execute all build types.
If <span style="color:darkgreen;">build</span> is used as the argument (<code>gradlew build</code>), it will execute all build types.


After build completes, the resulting .apk packages will be located in <span style="color:green;"><source root>/build/build_android_client/outputs/apk</span>.
After build completes, the resulting .apk packages will be located in the <span style="color:green;"><source root>/build</span> directory.


==== Signing Packages ====
==== Signing Packages ====


On most Android systems packages will [https://developer.android.com/studio/publish/app-signing need to be signed] in order to work. By default Gradle will sign packages using a debugging keystore which must by installed in your home directory. You can specify a different keystore by creating a file <span style="color:darkblue;">android/keystore.properties</span> with contents as follows:
On most Android systems packages will [https://developer.android.com/studio/publish/app-signing need to be signed] in order to work. By default Gradle will sign packages using a debugging keystore which must be installed in your home directory. You can specify a different keystore by creating a file <span style="color:darkblue;">app/android/keystore.properties</span> with contents as follows:


<pre>
<pre>