I have an Android game that is compiled using Ant and I try to integrate it
with Amazon Game Circle. My project and GameCircleSDK look similar in
structure: both contain jni/
, libs/
, res/
and other standard directories
for Android. To integrate Game Circle, Amazon's documentation only touches Eclipse and instructs to
include Game Circle in the workspace and add it as a dependency.
What is the equivalent for this in Ant? I would like to keep Game Circle out of my source tree and still compile against it, get all JARs and resources.
The build.xml
and the rest of the build files I currently use are the default ones generated by android create project
. I'm posting it here for reference (stripped down the default comments):
<?xml version="1.0" encoding="UTF-8"?>
<project name="Game" default="help">
<property file="local.properties" />
<property file="ant.properties" />
<property environment="env" />
<condition property="sdk.dir" value="${env.ANDROID_HOME}">
<isset property="env.ANDROID_HOME" />
</condition>
<loadproperties srcFile="project.properties" />
<fail
message="sdk.dir is missing."
unless="sdk.dir"
/>
<import file="custom_rules.xml" optional="true" />
<import file="${sdk.dir}/tools/ant/build.xml" />
</project>
Here's how you do it:
Add the the SDK as a reference in project.properties
. The path must be relative.
android.library.reference.1=../../relative/path/to/gamecircle
Add a build.xml
to GameCircle by running android update lib-project -p /path/to/gamecircle
.