BuildStendhalForAndroid: Difference between revisions
Content deleted Content added
imported>AntumDeluge →Gradle: update instructions for changes to source |
imported>AntumDeluge →Building from Command Line: re-organize to make ant preferred build method |
||
| (8 intermediate revisions by the same user not shown) | |||
Line 33:
'''''IMPORTANT:''' Before you can build from the command line/terminal, you must have a [[VisualGuideToBuildingStendhalStep1|Java compiler]] provided by a [https://www.oracle.com/java/technologies/downloads/ Java Development Kit (JDK)] installed.''
=== Ant ===▼
<span style="color:blue;">''Recommended''</span>
As with other instructions on building from the command line, the Android client can also be built with an [https://ant.apache.org/ Apache Ant target]. The Ant target is a wrapper that calls the [[BuildStendhalForAndroid#Gradle|Gradle]] script and passes parameters to it. The same conditions related to invoking the Gradle scripts directly apply to using ant.▼
'''''See also: [[BuildStendhalForAndroid#Signing_Packages|section on signing packages]]'''''
From the Stendhal source root directory, execute the following.▼
Unix/Linux example:▼
<pre>▼
# with env variable set or sdk.dir set in local.properties▼
$ ant android▼
# manually setting env variable▼
$ ANDROID_SDK_ROOT="/path/to/sdk/root" ant android▼
</pre>▼
Windows '''cmd''' example:▼
<pre>▼
# with env variable set or sdk.dir set in local.properties▼
> ant android▼
# manually setting env variable (do not use quotes)▼
> set ANDROID_SDK_ROOT=C:\\path\\to\\sdk\\root▼
> ant android▼
</pre>▼
The resulting .apk packages will be located in the <span style="color:green;"><source root>/build</span> directory.▼
The build type can be set manually using the <span style="color:green;">android.build</span> property. Value can be one of <span style="color:green;">assembleRelease</span> or <span style="color:green;">assembleDebug</span>. The default is <span style="color:green;">assembleDebug</span>.▼
<pre>▼
$ ant android -Dandroid.build=assembleRelease▼
</pre>▼
Alternatively, an argument line can be passed to Gradle using the <span style="color:green;">gradle.params</span> property:
<pre>▼
$ ant android -Dgradle.params="assembleRelease assembleDebug"
</pre>▼
=== Gradle ===
Line 87 ⟶ 130:
keyAlias=<key-alias>
</pre>
▲=== Ant ===
▲As with other instructions on building from the command line, the Android client can also be built with an [https://ant.apache.org/ Apache Ant target]. The same conditions related to invoking the Gradle scripts directly apply to using ant.
▲From the Stendhal source root directory, execute the following.
▲Unix/Linux example:
▲<pre>
▲# with env variable set or sdk.dir set in local.properties
▲$ ant android
▲# manually setting env variable
▲$ ANDROID_SDK_ROOT="/path/to/sdk/root" ant android
▲</pre>
▲Windows '''cmd''' example:
▲<pre>
▲# with env variable set or sdk.dir set in local.properties
▲> ant android
▲# manually setting env variable (do not use quotes)
▲> set ANDROID_SDK_ROOT=C:\\path\\to\\sdk\\root
▲> ant android
▲</pre>
▲The resulting .apk packages will be located in the <span style="color:green;"><source root>/build</span> directory.
▲The build type can be set manually using the <span style="color:green;">android.build</span> property. Value can be one of <span style="color:green;">assembleRelease</span> or <span style="color:green;">assembleDebug</span>. The default is <span style="color:green;">assembleDebug</span>.
▲<pre>
▲$ ant android -Dandroid.build=assembleRelease
▲</pre>
▲<pre>
▲</pre>
| |||