Rename to Cordova

This commit is contained in:
macdonst
2012-02-01 20:45:49 -05:00
parent fa4d6d369a
commit 664a061d10
97 changed files with 699 additions and 697 deletions
+1 -1
View File
@@ -1,4 +1,4 @@
#! /bin/sh
./bin/create
cd ./example && ./phonegap/debug && ./phonegap/log
cd ./example && ./cordova/debug && ./cordova/log
+6 -6
View File
@@ -1,6 +1,6 @@
#! /bin/sh
#
# Creates an app in `./bench` that posts results to http://phonegap-bench.heroku.com with current PhoneGap/Android sha.
# Creates an app in `./bench` that posts results to http://cordova-bench.heroku.com with current cordova/Android sha.
#
# USAGE
# ./bin/bench
@@ -13,17 +13,17 @@ then
fi
# create a benching app
./bin/create ./bench com.phonegap.bench PhoneGapBench
./bin/create ./bench org.apache.cordova.bench cordovaBench
# grab the latest bench www code
git clone git@github.com:brianleroux/phonegap-bench.git
git clone git@github.com:brianleroux/cordova-bench.git
# copy it into the app
cat ./phonegap-bench/www/index.html > ./bench/assets/www/index.html
#cat ~/Desktop/phonegap-bench/www/index.html > ./bench/assets/www/index.html
cat ./cordova-bench/www/index.html > ./bench/assets/www/index.html
#cat ~/Desktop/cordova-bench/www/index.html > ./bench/assets/www/index.html
# clean up
rm -rf ./phonegap-bench
rm -rf ./cordova-bench
# launch to the first device found
./bin/debug ./bench
+11 -11
View File
@@ -1,6 +1,6 @@
#! /bin/sh
#
# create a phonegap/android project
# create a cordova/android project
#
# USAGE
# ./create [path package activity]
@@ -8,8 +8,8 @@
set -e
PROJECT_PATH=${1:-"./example"}
PACKAGE=${2:-"com.phonegap.example"}
ACTIVITY=${3:-"PhoneGapExample"}
PACKAGE=${2:-"org.apache.cordova.example"}
ACTIVITY=${3:-"cordovaExample"}
TARGET=$(android list targets | grep 'id: ' | sed 's/id: \([0-9]*\).*/\1/g' | tail -1)
VERSION=$(cat ./VERSION)
@@ -19,23 +19,23 @@ then
rm -rf $PROJECT_PATH
fi
# update the phonegap-android framework for the desired target
# update the cordova-android framework for the desired target
android update project --target $TARGET --path ./framework
# compile phonegap.js and phonegap.jar
# compile cordova.js and cordova.jar
cd ./framework && ant jar && cd ../
# copy all the bin scripts etc in there
cp -R ./bin/templates/project/ $PROJECT_PATH
# copy in phonegap.js
cp ./framework/assets/www/phonegap-$VERSION.js $PROJECT_PATH/.phonegap/android/phonegap-$VERSION.js
# copy in cordova.js
cp ./framework/assets/www/cordova-$VERSION.js $PROJECT_PATH/.cordova/android/cordova-$VERSION.js
# copy in phonegap.jar
cp ./framework/phonegap-$VERSION.jar $PROJECT_PATH/.phonegap/android/phonegap-$VERSION.jar
# copy in cordova.jar
cp ./framework/cordova-$VERSION.jar $PROJECT_PATH/.cordova/android/cordova-$VERSION.jar
# app properties
cat > $PROJECT_PATH/.phonegap/config <<eom
cat > $PROJECT_PATH/.cordova/config <<eom
VERSION=$VERSION
PROJECT_PATH=$PROJECT_PATH
PACKAGE=$PACKAGE
@@ -43,4 +43,4 @@ ACTIVITY=$ACTIVITY
TARGET=$TARGET
eom
(cd $PROJECT_PATH && ./phonegap/create)
(cd $PROJECT_PATH && ./cordova/create)
+8 -8
View File
@@ -1,5 +1,5 @@
/*
* create a phonegap/android project
* create a cordova/android project
*
* USAGE
* ./create [path package activity]
@@ -26,7 +26,7 @@ function exec(s) {
}
var args = WScript.Arguments, PROJECT_PATH="example",
PACKAGE="com.phonegap.example", ACTIVITY="PhoneGapExample",
PACKAGE="org.apache.cordova.example", ACTIVITY="cordovaExample",
shell=WScript.CreateObject("WScript.Shell");
if (args.Count() == 3) {
@@ -54,10 +54,10 @@ fi
// create the project
exec('android.bat create project --target '+TARGET+' --path '+PROJECT_PATH+' --package '+PACKAGE+' --activity '+ACTIVITY);
// update the phonegap framework project to a target that exists on this machine
// update the cordova framework project to a target that exists on this machine
exec('android.bat update project --target '+TARGET+' --path framework');
// compile phonegap.js and phonegap.jar
// compile cordova.js and cordova.jar
// 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
exec('ant.bat -f framework\\build.xml jar');
@@ -65,11 +65,11 @@ exec('ant.bat -f framework\\build.xml jar');
// copy in the project template
exec('cmd /c xcopy bin\\templates\\project '+PROJECT_PATH+' /S /Y');
// copy in phonegap.js
exec('cmd /c copy framework\\assets\\www\\phonegap-'+VERSION+'.js '+PROJECT_PATH+'\\assets\\www\\phonegap-'+VERSION+'.js /Y');
// copy in cordova.js
exec('cmd /c copy framework\\assets\\www\\cordova-'+VERSION+'.js '+PROJECT_PATH+'\\assets\\www\\cordova-'+VERSION+'.js /Y');
// copy in phonegap.jar
exec('cmd /c copy framework\\phonegap-'+VERSION+'.jar '+PROJECT_PATH+'\\libs\\phonegap-'+VERSION+'.jar /Y');
// copy in cordova.jar
exec('cmd /c copy framework\\cordova-'+VERSION+'.jar '+PROJECT_PATH+'\\libs\\cordova-'+VERSION+'.jar /Y');
// copy in default activity
exec('cmd /c copy bin\\templates\\Activity.java '+ACTIVITY_PATH+' /Y');
+8 -8
View File
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<project name="PhoneGap" default="create" basedir="../">
<project name="cordova" default="create" basedir="../">
<property name="project.path" value="${basedir}/example"/>
<property name="package" value="com.phonegap.example"/>
<property name="activity" value="PhoneGapExample"/>
<property name="package" value="org.apache.cordova.example"/>
<property name="activity" value="cordovaExample"/>
<target name="create">
@@ -50,7 +50,7 @@
<arg line="update project --target ${target} --path ${basedir}/framework"/>
</exec>
<!-- compile phonegap.js and phonegap.jar -->
<!-- compile cordova.js and cordova.jar -->
<!-- // 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 -->
<ant antfile="${basedir}/framework/build.xml" useNativeBasedir="true" inheritAll="false" />
@@ -60,11 +60,11 @@
<fileset dir="${basedir}/bin/templates/project"/>
</copy>
<!-- copy in phonegap.js -->
<copy file="${basedir}/framework/assets/www/phonegap-${version}.js" todir="${project.path}/assets/www/" />
<!-- copy in cordova.js -->
<copy file="${basedir}/framework/assets/www/cordova-${version}.js" todir="${project.path}/assets/www/" />
<!-- copy in phonegap.jar -->
<copy file="${basedir}/framework/phonegap-${version}.jar" todir="${project.path}/libs/" />
<!-- copy in cordova.jar -->
<copy file="${basedir}/framework/cordova-${version}.jar" todir="${project.path}/libs/" />
<!-- copy in default activity -->
<copy file="${basedir}/bin/templates/Activity.java" tofile="${activity.path}" overwrite="true" />
@@ -1,3 +1,3 @@
this is local config for phonegap stuff to be eventually moved to
this is local config for cordova stuff to be eventually moved to
config.xml ...we think. feedback to @davejohnson/@brianleroux
appreciated here!
@@ -1,13 +1,13 @@
#! /bin/sh
#
# create a phonegap/android project
# create a cordova/android project
#
# USAGE
# ./create [path package activity]
#
# load up the config
. ./.phonegap/config
. ./.cordova/config
PACKAGE_AS_PATH=$(echo $PACKAGE | sed 's/\./\//g')
ACTIVITY_PATH=./src/$PACKAGE_AS_PATH/$ACTIVITY.java
@@ -16,17 +16,17 @@ MANIFEST_PATH=./AndroidManifest.xml
# create the project
android create project --target $TARGET --path . --package $PACKAGE --activity $ACTIVITY
# copy all the phonegap scripts etc in there
cp -R ./phonegap/templates/project/* .
# copy all the cordova scripts etc in there
cp -R ./cordova/templates/project/* .
# copy in phonegap.js
cp ./.phonegap/android/phonegap-$VERSION.js ./assets/www
# copy in cordova.js
cp ./.cordova/android/cordova-$VERSION.js ./assets/www
# copy in phonegap.jar
cp ./.phonegap/android/phonegap-$VERSION.jar ./libs
# copy in cordova.jar
cp ./.cordova/android/cordova-$VERSION.jar ./libs
# copy in default activity
cat ./phonegap/templates/Activity.java > $ACTIVITY_PATH
cat ./cordova/templates/Activity.java > $ACTIVITY_PATH
# interpolate the acivity name and package
find "$ACTIVITY_PATH" | xargs grep '__ACTIVITY__' -sl | xargs -L1 sed -i -e "s/__ACTIVITY__/${ACTIVITY}/g"
@@ -1,6 +1,6 @@
#! /bin/sh
. ./.phonegap/config
. ./.cordova/config
# if there are no devices listed then emulate
@@ -2,7 +2,7 @@ package __ID__;
import android.app.Activity;
import android.os.Bundle;
import com.phonegap.*;
import org.apache.cordova.*;
public class __ACTIVITY__ extends DroidGap
{
@@ -39,7 +39,7 @@
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name="com.phonegap.DroidGap" android:label="@string/app_name"
<activity android:name="org.apache.cordova.DroidGap" android:label="@string/app_name"
android:configChanges="orientation|keyboardHidden">
<intent-filter>
</intent-filter>
@@ -5,7 +5,7 @@
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
<title>PhoneGap</title>
<link rel="stylesheet" href="master.css" type="text/css" media="screen" title="no title">
<script type="text/javascript" charset="utf-8" src="phonegap-1.4.1.js"></script>
<script type="text/javascript" charset="utf-8" src="cordova-1.4.1.js"></script>
<script type="text/javascript" charset="utf-8" src="main.js"></script>
</head>

Before

Width:  |  Height:  |  Size: 5.7 KiB

After

Width:  |  Height:  |  Size: 5.7 KiB

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<phonegap>
<cordova>
<access origin="http://127.0.0.1*"/>
<log level="DEBUG"/>
</phonegap>
</cordova>
@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<plugins>
<plugin name="App" value="org.apache.cordova.App"/>
<plugin name="Geolocation" value="org.apache.cordova.GeoBroker"/>
<plugin name="Device" value="org.apache.cordova.Device"/>
<plugin name="Accelerometer" value="org.apache.cordova.AccelListener"/>
<plugin name="Compass" value="org.apache.cordova.CompassListener"/>
<plugin name="Media" value="org.apache.cordova.AudioHandler"/>
<plugin name="Camera" value="org.apache.cordova.CameraLauncher"/>
<plugin name="Contacts" value="org.apache.cordova.ContactManager"/>
<plugin name="File" value="org.apache.cordova.FileUtils"/>
<plugin name="Network Status" value="org.apache.cordova.NetworkManager"/>
<plugin name="Notification" value="org.apache.cordova.Notification"/>
<plugin name="Storage" value="org.apache.cordova.Storage"/>
<plugin name="Temperature" value="org.apache.cordova.TempListener"/>
<plugin name="FileTransfer" value="org.apache.cordova.FileTransfer"/>
<plugin name="Capture" value="org.apache.cordova.Capture"/>
<plugin name="Battery" value="org.apache.cordova.BatteryListener"/>
</plugins>
@@ -1,19 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<plugins>
<plugin name="App" value="com.phonegap.App"/>
<plugin name="Geolocation" value="com.phonegap.GeoBroker"/>
<plugin name="Device" value="com.phonegap.Device"/>
<plugin name="Accelerometer" value="com.phonegap.AccelListener"/>
<plugin name="Compass" value="com.phonegap.CompassListener"/>
<plugin name="Media" value="com.phonegap.AudioHandler"/>
<plugin name="Camera" value="com.phonegap.CameraLauncher"/>
<plugin name="Contacts" value="com.phonegap.ContactManager"/>
<plugin name="Crypto" value="com.phonegap.CryptoHandler"/>
<plugin name="File" value="com.phonegap.FileUtils"/>
<plugin name="Network Status" value="com.phonegap.NetworkManager"/>
<plugin name="Notification" value="com.phonegap.Notification"/>
<plugin name="Storage" value="com.phonegap.Storage"/>
<plugin name="Temperature" value="com.phonegap.TempListener"/>
<plugin name="FileTransfer" value="com.phonegap.FileTransfer"/>
<plugin name="Capture" value="com.phonegap.Capture"/>
</plugins>
+4 -4
View File
@@ -13,14 +13,14 @@ then
fi
# generate a working proj
./bin/create ./test com.phonegap.test PhoneGapTest
./bin/create ./test org.apache.cordova.test CordovaTest
# kill the default app and replace it w/ mobile-spec
rm -rf ./test/assets/www
mv ./callback-test ./test/assets/www
# copy in phonegap.js since www dir was replaced above
cp ./framework/assets/www/phonegap-$VERSION.js ./test/assets/www/phonegap-$VERSION.js
# copy in cordova.js since www dir was replaced above
cp ./framework/assets/www/cordova-$VERSION.js ./test/assets/www/cordova-$VERSION.js
# build it, launch it and start logging on stdout
cd ./test && ./phonegap/debug && ./phonegap/log
cd ./test && ./cordova/debug && ./cordova/log
+6 -6
View File
@@ -8,14 +8,14 @@ exports['default example project is generated'] = (test) ->
test.ok true, "this assertion should pass" unless error?
test.done()
exports['default example project has a ./.phonegap folder'] = (test) ->
exports['default example project has a ./.cordova folder'] = (test) ->
test.expect 1
path.exists './example/.phonegap', (exists) ->
test.ok exists, 'the phonegap folder exists'
path.exists './example/.cordova', (exists) ->
test.ok exists, 'the cordova folder exists'
test.done()
exports['default example project has a /phonegap folder'] = (test) ->
exports['default example project has a /cordova folder'] = (test) ->
test.expect 1
path.exists './example/phonegap', (exists) ->
test.ok exists, 'the other phonegap folder exists'
path.exists './example/cordova', (exists) ->
test.ok exists, 'the other cordova folder exists'
test.done()