mirror of
https://github.com/apache/cordova-android.git
synced 2025-02-22 00:32:55 +08:00
Merge pull request #144 from macdonst/is129
Fix for #129: PhoneGap JS Naming Convention
This commit is contained in:
commit
b85a769372
@ -5,7 +5,7 @@
|
|||||||
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
|
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
|
||||||
<title>PhoneGap</title>
|
<title>PhoneGap</title>
|
||||||
<link rel="stylesheet" href="master.css" type="text/css" media="screen" title="no title" charset="utf-8">
|
<link rel="stylesheet" href="master.css" type="text/css" media="screen" title="no title" charset="utf-8">
|
||||||
<script type="text/javascript" charset="utf-8" src="phonegap.0.9.6.1.min.js"></script>
|
<script type="text/javascript" charset="utf-8" src="phonegap-0.9.6.1.min.js"></script>
|
||||||
<script type="text/javascript" charset="utf-8" src="main.js"></script>
|
<script type="text/javascript" charset="utf-8" src="main.js"></script>
|
||||||
|
|
||||||
</head>
|
</head>
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<title></title>
|
<title></title>
|
||||||
<script src="phonegap.0.9.6.1.min.js"></script>
|
<script src="phonegap-0.9.6.1.min.js"></script>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
|
||||||
|
@ -40,6 +40,9 @@
|
|||||||
This file is an integral part of the build system for your application and
|
This file is an integral part of the build system for your application and
|
||||||
should be checked in in Version Control Systems. -->
|
should be checked in in Version Control Systems. -->
|
||||||
<property file="default.properties" />
|
<property file="default.properties" />
|
||||||
|
|
||||||
|
<!-- We need to setup the double quote. -->
|
||||||
|
<property name="dblQuote">"</property>
|
||||||
|
|
||||||
<!-- Custom Android task to deal with the project target, and import the proper rules.
|
<!-- Custom Android task to deal with the project target, and import the proper rules.
|
||||||
This requires ant 1.6.0 or above. -->
|
This requires ant 1.6.0 or above. -->
|
||||||
@ -71,54 +74,54 @@
|
|||||||
-->
|
-->
|
||||||
<setup />
|
<setup />
|
||||||
|
|
||||||
<target name="check-javascript" depends="build-javascript">
|
<target name="check-javascript" depends="build-javascript">
|
||||||
<delete dir="assets/lib"/>
|
<delete dir="assets/lib"/>
|
||||||
<mkdir dir="assets/lib"/>
|
<mkdir dir="assets/lib"/>
|
||||||
<echo file="assets/lib/lint.js">var alert=function(){},device={},Element={},debug={};</echo>
|
<echo file="assets/lib/lint.js">var alert=function(){},device={},Element={},debug={};</echo>
|
||||||
<concat destfile="assets/lib/phonegap-lint.js" append="true">
|
<concat destfile="assets/lib/phonegap-lint.js" append="true">
|
||||||
<fileset dir="assets/lib">
|
<fileset dir="assets/lib">
|
||||||
<include name="lint.js" />
|
<include name="lint.js" />
|
||||||
</fileset>
|
</fileset>
|
||||||
<fileset dir="assets/www">
|
<fileset dir="assets/www">
|
||||||
<include name="phonegap.${version}.js" />
|
<include name="phonegap-${version}.js" />
|
||||||
</fileset>
|
</fileset>
|
||||||
</concat>
|
</concat>
|
||||||
|
|
||||||
<exec executable="cmd" os="Windows 7">
|
<exec executable="cmd" os="Windows 7">
|
||||||
<arg value="/c"/>
|
<arg value="/c"/>
|
||||||
<arg value="java"/>
|
<arg value="java"/>
|
||||||
<arg value="-cp"/>
|
<arg value="-cp"/>
|
||||||
<arg value="${basedir}/util/js.jar"/>
|
<arg value="${basedir}/util/js.jar"/>
|
||||||
<arg value="org.mozilla.javascript.tools.shell.Main"/>
|
<arg value="org.mozilla.javascript.tools.shell.Main"/>
|
||||||
<arg value="${basedir}/util/jslint.js"/>
|
<arg value="${basedir}/util/jslint.js"/>
|
||||||
<arg value="${basedir}/js/lib/phonegap-lint.js"/>
|
<arg value="${basedir}/js/lib/phonegap-lint.js"/>
|
||||||
</exec>
|
</exec>
|
||||||
<exec executable="java" os="Mac OS X">
|
<exec executable="java" os="Mac OS X">
|
||||||
<arg value="-cp"/>
|
<arg value="-cp"/>
|
||||||
<arg value="../util/js.jar"/>
|
<arg value="../util/js.jar"/>
|
||||||
<arg value="org.mozilla.javascript.tools.shell.Main"/>
|
<arg value="org.mozilla.javascript.tools.shell.Main"/>
|
||||||
<arg value="../util/jslint.js"/>
|
<arg value="../util/jslint.js"/>
|
||||||
<arg value="assets/lib/phonegap-lint.js"/>
|
<arg value="assets/lib/phonegap-lint.js"/>
|
||||||
</exec>
|
</exec>
|
||||||
</target>
|
</target>
|
||||||
|
|
||||||
<!-- Combine JavaScript files into one phonegap.js file.
|
<!-- Combine JavaScript files into one phonegap.js file.
|
||||||
This task does not create a compressed JavaScript file. -->
|
This task does not create a compressed JavaScript file. -->
|
||||||
<target name="build-uncompressed-javascript">
|
<target name="build-uncompressed-javascript">
|
||||||
|
|
||||||
<!-- Clean up existing files -->
|
<!-- Clean up existing files -->
|
||||||
<delete file="assets/www/phonegap.${version}.min.js"/>
|
<delete file="assets/www/phonegap-${version}.min.js"/>
|
||||||
<delete file="assets/www/phonegap-tmp.js"/>
|
<delete file="assets/www/phonegap-tmp.js"/>
|
||||||
<delete file="assets/www/phonegap.${version}.js"/>
|
<delete file="assets/www/phonegap-${version}.js"/>
|
||||||
|
|
||||||
<!-- Create uncompressed JS file -->
|
<!-- Create uncompressed JS file -->
|
||||||
<concat destfile="assets/www/phonegap.${version}.js">
|
<concat destfile="assets/www/phonegap-${version}.js">
|
||||||
<fileset dir="assets/js" includes="phonegap.js.base" />
|
<fileset dir="assets/js" includes="phonegap.js.base" />
|
||||||
<fileset dir="assets/js" includes="*.js" />
|
<fileset dir="assets/js" includes="*.js" />
|
||||||
</concat>
|
</concat>
|
||||||
|
|
||||||
<!-- update project files to reference phonegap-x.x.x.js -->
|
<!-- update project files to reference phonegap-x.x.x.js -->
|
||||||
<replaceregexp match="phonegap(.*)\.js" replace="phonegap.${version}.js" byline="true">
|
<replaceregexp match="phonegap(.*)\.js" replace="phonegap-${version}.js" byline="true">
|
||||||
<fileset file="assets/www/index.html" />
|
<fileset file="assets/www/index.html" />
|
||||||
<fileset file="../example/index.html" />
|
<fileset file="../example/index.html" />
|
||||||
</replaceregexp>
|
</replaceregexp>
|
||||||
@ -134,25 +137,28 @@
|
|||||||
<delete file="assets/www/phonegap_${version}.js"/>
|
<delete file="assets/www/phonegap_${version}.js"/>
|
||||||
|
|
||||||
<!-- Create uncompressed JS file -->
|
<!-- Create uncompressed JS file -->
|
||||||
<concat destfile="assets/www/phonegap.${version}.js">
|
<concat destfile="assets/www/phonegap-${version}.js">
|
||||||
<fileset dir="assets/js" includes="phonegap.js.base" />
|
<fileset dir="assets/js" includes="phonegap.js.base" />
|
||||||
<fileset dir="assets/js" includes="*.js" />
|
<fileset dir="assets/js" includes="*.js" />
|
||||||
</concat>
|
</concat>
|
||||||
|
|
||||||
<!-- Compress JS file -->
|
<!-- Compress JS file -->
|
||||||
<java jar="${basedir}/../util/yuicompressor/yuicompressor-2.4.2.jar" fork="true" failonerror="true">
|
<java jar="${basedir}/../util/yuicompressor/yuicompressor-2.4.2.jar" fork="true" failonerror="true">
|
||||||
<arg line="--nomunge -o assets/www/phonegap-tmp.js assets/www/phonegap.${version}.js"/>
|
<arg line="--nomunge -o assets/www/phonegap-tmp.js assets/www/phonegap-${version}.js"/>
|
||||||
</java>
|
</java>
|
||||||
<concat destfile="assets/www/phonegap.${version}.min.js">
|
<concat destfile="assets/www/phonegap-${version}.min.js">
|
||||||
<fileset dir="assets/js" includes="header.txt" />
|
<fileset dir="assets/js" includes="header.txt" />
|
||||||
<fileset dir="assets/www" includes="phonegap-tmp.js" />
|
<fileset dir="assets/www" includes="phonegap-tmp.js" />
|
||||||
</concat>
|
</concat>
|
||||||
|
|
||||||
<!-- update project files to reference phonegap-x.x.x.min.js -->
|
<!-- update project files to reference phonegap-x.x.x.min.js -->
|
||||||
<replaceregexp match="phonegap(.*)\.js" replace="phonegap.${version}.min.js" byline="true">
|
<replaceregexp match="phonegap(.*)\.js" replace="phonegap-${version}.min.js" byline="true">
|
||||||
<fileset file="assets/www/index.html" />
|
<fileset file="assets/www/index.html" />
|
||||||
<fileset file="../example/index.html" />
|
<fileset file="../example/index.html" />
|
||||||
</replaceregexp>
|
</replaceregexp>
|
||||||
|
<replaceregexp match="phonegapVersion = [\u0022].*[\u0022];" replace="phonegapVersion = ${dblQuote}${version}${dblQuote};" byline="true">
|
||||||
|
<fileset file="src/com/phonegap/Device.java" />
|
||||||
|
</replaceregexp>
|
||||||
|
|
||||||
<!-- Delete temp file -->
|
<!-- Delete temp file -->
|
||||||
<delete file="assets/www/phonegap-tmp.js"/>
|
<delete file="assets/www/phonegap-tmp.js"/>
|
||||||
|
Loading…
Reference in New Issue
Block a user