Updated Branches: refs/heads/master 486eb149f -> 54caa6e43
Fail the build gracefully with helpful error messages if the local.properties file is missing, or if the commons-codec jar is missing, or if ant is not at the minimum required version. Also add a little more detail to README.md. Project: http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/commit/54caa6e4 Tree: http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/tree/54caa6e4 Diff: http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/diff/54caa6e4 Branch: refs/heads/master Commit: 54caa6e438f0edeb6764164b33ed5f51a02561c9 Parents: 486eb14 Author: Marcel Kinard <cmarc...@gmail.com> Authored: Tue Sep 25 13:09:40 2012 -0400 Committer: Marcel Kinard <cmarc...@gmail.com> Committed: Tue Sep 25 13:09:40 2012 -0400 ---------------------------------------------------------------------- README.md | 4 ++-- framework/build.xml | 40 ++++++++++++++++++++++++++++++++++------ 2 files changed, 36 insertions(+), 8 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/blob/54caa6e4/README.md ---------------------------------------------------------------------- diff --git a/README.md b/README.md index 5bcd8fd..d2d2e99 100755 --- a/README.md +++ b/README.md @@ -15,8 +15,8 @@ indicate that the project has yet to be fully endorsed by the ASF. Requires --- -- Java JDK 1.5 -- Apache ANT +- Java JDK 1.5 or greater +- Apache ANT 1.8.0 or greater - Android SDK [http://developer.android.com](http://developer.android.com) - Apache Commons Codec [http://commons.apache.org/codec/](http://commons.apache.org/codec/) http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/blob/54caa6e4/framework/build.xml ---------------------------------------------------------------------- diff --git a/framework/build.xml b/framework/build.xml index e8910c3..9e7b127 100644 --- a/framework/build.xml +++ b/framework/build.xml @@ -26,9 +26,37 @@ </filterchain> </loadfile> - <!-- The local.properties file is created and updated by the 'android' tool. - It contains the path to the SDK. It should *NOT* be checked into - Version Control Systems. --> + <!-- check that the version of ant is at least 1.8.0, as is needed + for the dblQuote property --> + <antversion property="thisantversion" atleast="1.8.0" /> + <fail message="The required minimum version of ant is 1.8.0, you have ${ant.version}" + unless="thisantversion" /> + + <!-- check that commons codec is available. You should copy the codec jar to + framework/libs, as it is not included in the Cordova distribution. + The name of the jar file in framework/libs does not matter. --> + <available classname="org.apache.commons.codec.binary.Base64" + property="exists.base64" + ignoresystemclasses="true"> + <classpath> + <pathelement path="${classpath}" /> + <fileset dir="libs"> + <include name="*.jar" /> + </fileset> + </classpath> + </available> + <fail message="You need to put a copy of Apache Commons Codec jar in the framework/libs directory" + unless="exists.base64" /> + + <!-- The local.properties file is created and updated by the 'android' + tool. (For example "sdkdir/tools/android update project -p ." inside + of this directory where the AndroidManifest.xml file exists. This + properties file that gets built contains the path to the SDK. It + should *NOT* be checked into Version Control Systems since it holds + data about the local machine. --> + <available file="local.properties" property="exists.local.properties" /> + <fail message="You need to create the file 'local.properties' by running 'android update project -p .' here." + unless="exists.local.properties" /> <loadproperties srcFile="local.properties" /> <!-- The ant.properties file can be created by you. It is only edited by the @@ -66,13 +94,13 @@ application and should be checked into Version Control Systems. --> <loadproperties srcFile="project.properties" /> - <!-- quick check on sdk.dir --> + <!-- quick check on sdk.dir --> <fail message="sdk.dir is missing. Make sure to generate local.properties using 'android update project'" unless="sdk.dir" /> - <!-- version-tag: custom --> + <!-- version-tag: custom --> <!-- extension targets. Uncomment the ones where you want to do custom work in between standard targets --> <!-- @@ -106,7 +134,7 @@ In all cases you must update the value of version-tag below to read 'custom' instead of an integer, in order to avoid having your file be overridden by tools such as "android update project" --> - <import file="${sdk.dir}/tools/ant/build.xml" /> + <import file="${sdk.dir}/tools/ant/build.xml" /> <!-- Combine JavaScript files into one cordova-uncompressed.js file. --> <target name="build-javascript" depends="clean">