cordova-android/framework/build.xml

134 lines
5.1 KiB
XML
Raw Normal View History

<?xml version="1.0" encoding="UTF-8"?>
2011-04-04 07:57:10 +08:00
<project name="PhoneGap" default="jar">
<!-- LOAD VERSION -->
<loadfile property="version" srcFile="../VERSION">
<filterchain>
<striplinebreaks/>
</filterchain>
</loadfile>
<!-- The local.properties file is created and updated by the 'android' tool.
2011-10-21 02:13:44 +08:00
It contains the path to the SDK. It should *NOT* be checked into
Version Control Systems. -->
<loadproperties srcFile="local.properties" />
2011-10-21 02:13:44 +08:00
<!-- The ant.properties file can be created by you. It is only edited by the
'android' tool to add properties to it.
This is the place to change some Ant specific build properties.
Here are some properties you may want to change/update:
2010-02-04 02:27:49 +08:00
source.dir
2011-10-21 02:13:44 +08:00
The name of the source directory. Default is 'src'.
2010-02-04 02:27:49 +08:00
out.dir
2011-10-21 02:13:44 +08:00
The name of the output directory. Default is 'bin'.
2011-10-21 02:13:44 +08:00
For other overridable properties, look at the beginning of the rules
files in the SDK, at tools/ant/build.xml
2011-10-21 02:13:44 +08:00
Properties related to the SDK location or the project target should
be updated using the 'android' tool with the 'update' action.
This file is an integral part of the build system for your
application and should be checked into Version Control Systems.
-->
2011-10-21 02:13:44 +08:00
<property file="ant.properties" />
<!-- The project.properties file is created and updated by the 'android'
tool, as well as ADT.
This contains project specific properties such as project target, and library
dependencies. Lower level build properties are stored in ant.properties
(or in .classpath for Eclipse projects).
This file is an integral part of the build system for your
application and should be checked into Version Control Systems. -->
<loadproperties srcFile="project.properties" />
<property name="dblQuote">"</property>
2011-10-21 02:13:44 +08:00
<!-- 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 -->
<import file="${sdk.dir}/tools/ant/build.xml" />
2009-11-19 07:43:59 +08:00
<target name="check-javascript" depends="build-javascript">
<delete dir="assets/lib"/>
<mkdir dir="assets/lib"/>
<echo file="assets/lib/lint.js">var alert=function(){},device={},Element={},debug={};</echo>
<concat destfile="assets/lib/phonegap-lint.js" append="true">
<fileset dir="assets/lib">
<include name="lint.js" />
</fileset>
<fileset dir="assets/www">
<include name="phonegap-${version}.js" />
</fileset>
</concat>
<exec executable="cmd" os="Windows 7">
<arg value="/c"/>
<arg value="java"/>
<arg value="-cp"/>
<arg value="${basedir}/util/js.jar"/>
<arg value="org.mozilla.javascript.tools.shell.Main"/>
<arg value="${basedir}/util/jslint.js"/>
<arg value="${basedir}/js/lib/phonegap-lint.js"/>
</exec>
<exec executable="java" os="Mac OS X">
<arg value="-cp"/>
<arg value="../util/js.jar"/>
<arg value="org.mozilla.javascript.tools.shell.Main"/>
<arg value="../util/jslint.js"/>
<arg value="assets/lib/phonegap-lint.js"/>
</exec>
</target>
<!-- Combine JavaScript files into one phonegap-uncompressed.js file. -->
<target name="build-javascript">
<!-- Clean up existing files -->
<!--<delete file="assets/www/phonegap_${version}.js"/>-->
<!-- Create uncompressed JS file -->
<concat destfile="assets/www/phonegap-${version}.js">
<fileset dir="assets/js" includes="phonegap.js.base" />
<fileset dir="assets/js" includes="*.js" />
</concat>
<!-- update project files to reference phonegap-x.x.x.min.js -->
<replaceregexp match="phonegap(.*)\.js" replace="phonegap-${version}.js" byline="true">
2011-08-19 09:21:51 +08:00
<fileset file="assets/www/index.html" />
<!-- <fileset file="../bin/templates/project/assets/www/index.html" /> -->
</replaceregexp>
2011-10-21 02:13:44 +08:00
<!-- This is sketchy, but it works, ${dblQuote} does not -->
<replaceregexp match="phonegapVersion = [\u0022].*[\u0022];" replace='phonegapVersion = ${dblQuote}${version}${dblQuote};' byline="true">
<fileset file="src/com/phonegap/Device.java" />
</replaceregexp>
<!-- Delete temp file -->
<!--<delete file="assets/www/phonegap-tmp.js"/>-->
</target>
2009-11-19 07:43:59 +08:00
<!-- Build PhoneGap jar file that includes all native code, and PhoneGap JS file
that includes all JavaScript code.
-->
2011-10-21 02:13:44 +08:00
<target name="jar" depends="build-javascript, -compile">
2011-07-09 04:40:55 +08:00
<jar jarfile="phonegap-${version}.jar" basedir="bin/classes" excludes="com/phonegap/R.class,com/phonegap/R$*.class"/>
</target>
2009-11-19 07:43:59 +08:00
<target name="phonegap_debug" depends="build-javascript, debug">
2010-02-04 02:27:49 +08:00
</target>
2009-11-19 07:43:59 +08:00
<target name="phonegap_release" depends="build-javascript, release">
2009-11-19 07:43:59 +08:00
</target>
2009-11-18 03:33:41 +08:00
2010-02-04 02:27:49 +08:00
2011-10-21 02:13:44 +08:00
</project>