mirror of
https://github.com/apache/cordova-android.git
synced 2025-02-01 02:12:58 +08:00
Fix up a few things for the ant create to work on mac
This commit is contained in:
parent
28b972be52
commit
ef8e8a3ab4
@ -60,7 +60,7 @@ exec('android.bat update project --target '+TARGET+' --path framework');
|
|||||||
// compile phonegap.js and phonegap.jar
|
// compile phonegap.js and phonegap.jar
|
||||||
// if you see an error about "Unable to resolve target" then you may need to
|
// if you see an error about "Unable to resolve target" then you may need to
|
||||||
// update your android tools or install an additional Android platform version
|
// update your android tools or install an additional Android platform version
|
||||||
exec('ant.bat -v -f framework\\build.xml jar');
|
exec('ant.bat -f framework\\build.xml jar');
|
||||||
|
|
||||||
// copy in the project template
|
// copy in the project template
|
||||||
exec('cmd /c xcopy bin\\templates\\project '+PROJECT_PATH+' /S /Y');
|
exec('cmd /c xcopy bin\\templates\\project '+PROJECT_PATH+' /S /Y');
|
||||||
|
@ -7,17 +7,20 @@
|
|||||||
|
|
||||||
<target name="create">
|
<target name="create">
|
||||||
|
|
||||||
|
<!-- this stuff is seriously stupid -->
|
||||||
<echo file="tmp/package.tmp">package-as-path=${package}</echo>
|
<echo file="tmp/package.tmp">package-as-path=${package}</echo>
|
||||||
<replace file="tmp/package.tmp" token="." value="\\" />
|
<replace file="tmp/package.tmp" token="." value="\\" />
|
||||||
<property file="tmp/package.tmp" />
|
<property file="tmp/package.tmp" />
|
||||||
|
|
||||||
<property name="activity.path" value="${project.path}/src/${package-as-path}/${activity}.java" />
|
<property name="activity.path" value="${project.path}/src/${package-as-path}/${activity}.java" />
|
||||||
<property name="manifest.path" value="${project.path}/AndroidManifest.xml" />
|
<property name="manifest.path" value="${project.path}/AndroidManifest.xml" />
|
||||||
|
|
||||||
<!-- get the highest target on this machine -->
|
<!-- get the highest target on this machine -->
|
||||||
<exec executable="cmd" osfamily="windows" output="target.list.tmp">
|
<!-- this stuff is also seriously stupid -->
|
||||||
|
<exec executable="cmd" osfamily="windows" output="tmp/target.list.tmp">
|
||||||
<arg line="/c android.bat list targets"/>
|
<arg line="/c android.bat list targets"/>
|
||||||
</exec>
|
</exec>
|
||||||
<exec executable="android" osfamily="mac,unix">
|
<exec executable="android" osfamily="mac" output="tmp/target.list.tmp">
|
||||||
<arg line="list targets"/>
|
<arg line="list targets"/>
|
||||||
</exec>
|
</exec>
|
||||||
<replaceregexp file="tmp/target.list.tmp" match=".*id:\s([0-9]).*" replace="target=\1" flags="s" />
|
<replaceregexp file="tmp/target.list.tmp" match=".*id:\s([0-9]).*" replace="target=\1" flags="s" />
|
||||||
@ -35,7 +38,7 @@
|
|||||||
<exec executable="cmd" osfamily="windows">
|
<exec executable="cmd" osfamily="windows">
|
||||||
<arg line="/c android.bat create project --target ${target} --path ${project.path} --package ${package} --activity ${activity}"/>
|
<arg line="/c android.bat create project --target ${target} --path ${project.path} --package ${package} --activity ${activity}"/>
|
||||||
</exec>
|
</exec>
|
||||||
<exec executable="android" osfamily="mac,unix">
|
<exec executable="android" osfamily="mac">
|
||||||
<arg line="create project --target ${target} --path ${project.path} --package ${package} --activity ${activity}"/>
|
<arg line="create project --target ${target} --path ${project.path} --package ${package} --activity ${activity}"/>
|
||||||
</exec>
|
</exec>
|
||||||
|
|
||||||
@ -43,19 +46,14 @@
|
|||||||
<exec executable="cmd" osfamily="windows">
|
<exec executable="cmd" osfamily="windows">
|
||||||
<arg line="/c android.bat update project --target ${target} --path ${basedir}/framework"/>
|
<arg line="/c android.bat update project --target ${target} --path ${basedir}/framework"/>
|
||||||
</exec>
|
</exec>
|
||||||
<exec executable="android" osfamily="mac,unix">
|
<exec executable="android" osfamily="mac">
|
||||||
<arg line="update project --target ${target} --path ${basedir}/framework"/>
|
<arg line="update project --target ${target} --path ${basedir}/framework"/>
|
||||||
</exec>
|
</exec>
|
||||||
|
|
||||||
<!-- compile phonegap.js and phonegap.jar -->
|
<!-- compile phonegap.js and phonegap.jar -->
|
||||||
<!-- // if you see an error about "Unable to resolve target" then you may need to
|
<!-- // if you see an error about "Unable to resolve target" then you may need to
|
||||||
// update your android tools or install an additional Android platform version -->
|
// update your android tools or install an additional Android platform version -->
|
||||||
<exec executable="cmd" osfamily="windows">
|
<ant antfile="${basedir}/framework/build.xml" useNativeBasedir="true" inheritAll="false" />
|
||||||
<arg line="ant.bat -v -f ${basedir}/framework/build.xml jar"/>
|
|
||||||
</exec>
|
|
||||||
<exec executable="ant" osfamily="mac,unix">
|
|
||||||
<arg line="-v -f ${basedir}/framework/build.xml jar"/>
|
|
||||||
</exec>
|
|
||||||
|
|
||||||
<!-- copy in the project template -->
|
<!-- copy in the project template -->
|
||||||
<copy todir="${project.path}" overwrite="true">
|
<copy todir="${project.path}" overwrite="true">
|
||||||
|
@ -32,14 +32,14 @@
|
|||||||
|
|
||||||
<application android:icon="@drawable/icon" android:label="@string/app_name"
|
<application android:icon="@drawable/icon" android:label="@string/app_name"
|
||||||
android:debuggable="true">
|
android:debuggable="true">
|
||||||
<activity android:name=".StandAlone" android:windowSoftInputMode="adjustPan"
|
<activity android:name="__ACTIVITY__" android:label="@string/app_name"
|
||||||
android:label="@string/app_name" android:configChanges="orientation|keyboardHidden">
|
android:configChanges="orientation|keyboardHidden">
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="android.intent.action.MAIN" />
|
<action android:name="android.intent.action.MAIN" />
|
||||||
<category android:name="android.intent.category.LAUNCHER" />
|
<category android:name="android.intent.category.LAUNCHER" />
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
</activity>
|
</activity>
|
||||||
<activity android:name="__ACTIVITY__" android:label="@string/app_name"
|
<activity android:name="com.phonegap.DroidGap" android:label="@string/app_name"
|
||||||
android:configChanges="orientation|keyboardHidden">
|
android:configChanges="orientation|keyboardHidden">
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
|
@ -109,7 +109,7 @@
|
|||||||
<target name="build-javascript">
|
<target name="build-javascript">
|
||||||
|
|
||||||
<!-- Clean up existing files -->
|
<!-- Clean up existing files -->
|
||||||
<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">
|
||||||
@ -120,14 +120,14 @@
|
|||||||
<!-- 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}.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="../bin/templates/www/index.html" />
|
<fileset file="../bin/templates/project/assets/www/index.html" />
|
||||||
</replaceregexp>
|
</replaceregexp>
|
||||||
<replaceregexp match="phonegapVersion = [\u0022].*[\u0022];" replace="phonegapVersion = ${dblQuote}${version}${dblQuote};" byline="true">
|
<replaceregexp match="phonegapVersion = [\u0022].*[\u0022];" replace="phonegapVersion = ${dblQuote}${version}${dblQuote};" byline="true">
|
||||||
<fileset file="src/com/phonegap/Device.java" />
|
<fileset file="src/com/phonegap/Device.java" />
|
||||||
</replaceregexp>
|
</replaceregexp>
|
||||||
|
|
||||||
<!-- Delete temp file -->
|
<!-- Delete temp file -->
|
||||||
<delete file="assets/www/phonegap-tmp.js"/>
|
<!--<delete file="assets/www/phonegap-tmp.js"/>-->
|
||||||
</target>
|
</target>
|
||||||
|
|
||||||
<!-- Build PhoneGap jar file that includes all native code, and PhoneGap JS file
|
<!-- Build PhoneGap jar file that includes all native code, and PhoneGap JS file
|
||||||
|
Loading…
Reference in New Issue
Block a user