Skip to content

Commit

Permalink
Rename to Cordova
Browse files Browse the repository at this point in the history
  • Loading branch information
macdonst committed Feb 3, 2012
1 parent fa4d6d3 commit 664a061
Show file tree
Hide file tree
Showing 97 changed files with 699 additions and 697 deletions.
8 changes: 5 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
.DS_Store
default.properties
gen
assets/www/phonegap.js
assets/www/cordova.js
local.properties
framework/proguard.cfg
framework/phonegap.jar
framework/cordova.jar
framework/cordova-*.jar
framework/phonegap-*.jar
framework/bin
framework/test/com/phonegap/*.class
framework/test/org/apache/cordova/*.class
framework/assets/www/.DS_Store
framework/assets/www/cordova-*.js
framework/assets/www/phonegap-*.js
example
./test
Expand Down
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Requires
Building
---

To create your phonegap.jar, run in the framework directory:
To create your cordova.jar, run in the framework directory:

android update project -p . -t android-15
ant jar
Expand All @@ -45,9 +45,9 @@ Project Commands

These commands live in a generated Cordova Android project.

./phonegap/debug [path] ..................... install to first device
./phonegap/emulate .......................... start avd (emulator) named default
./phonegap/log .............................. starts logcat
./cordovap/debug [path] ..................... install to first device
./cordova/emulate .......................... start avd (emulator) named default
./cordova/log .............................. starts logcat

Running the Example Project
---
Expand All @@ -60,11 +60,11 @@ Create the example project and build it to the first device:

./bin/create
cd example
./phonegap/debug
./cordova/debug

Start adb logcat (console.log calls output here):

./phonegap/log
./cordova/log

Running the [callback/callback-test](http://github.com/callback/callback-test) tests:
---
Expand All @@ -82,7 +82,7 @@ Importing a Cordova Android Project into Eclipse
1. File > New > Project...
2. Android > Android Project
3. Create project from existing source (point to the generated app found in tmp/android)
4. Right click on libs/phonegap.jar and add to build path
4. Right click on libs/cordova.jar and add to build path
5. Right click on the project root: Run as > Run Configurations
6. Click on the Target tab and select Manual (this way you can choose the emulator or device to build to)

Expand Down
2 changes: 1 addition & 1 deletion bin/BOOM
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#! /bin/sh

./bin/create
cd ./example && ./phonegap/debug && ./phonegap/log
cd ./example && ./cordova/debug && ./cordova/log
12 changes: 6 additions & 6 deletions bin/bench
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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 [email protected]:brianleroux/phonegap-bench.git
git clone [email protected]: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
22 changes: 11 additions & 11 deletions bin/create
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
#! /bin/sh
#
# create a phonegap/android project
# create a cordova/android project
#
# USAGE
# ./create [path package activity]
#
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)

Expand All @@ -19,28 +19,28 @@ 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
ACTIVITY=$ACTIVITY
TARGET=$TARGET
eom

(cd $PROJECT_PATH && ./phonegap/create)
(cd $PROJECT_PATH && ./cordova/create)
16 changes: 8 additions & 8 deletions bin/create.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* create a phonegap/android project
* create a cordova/android project
*
* USAGE
* ./create [path package activity]
Expand All @@ -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) {
Expand Down Expand Up @@ -54,22 +54,22 @@ 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');

// 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');
Expand Down
16 changes: 8 additions & 8 deletions bin/create.xml
Original file line number Diff line number Diff line change
@@ -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">

Expand Down Expand Up @@ -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" />
Expand All @@ -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" />
Expand Down
Original file line number Diff line number Diff line change
@@ -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!
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#! /bin/sh

. ./.phonegap/config
. ./.cordova/config

# if there are no devices listed then emulate

Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import android.app.Activity;
import android.os.Bundle;
import com.phonegap.*;
import org.apache.cordova.*;

public class __ACTIVITY__ extends DroidGap
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
Original file line number Diff line number Diff line change
@@ -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>
Original file line number Diff line number Diff line change
@@ -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>

This file was deleted.

8 changes: 4 additions & 4 deletions bin/test
Original file line number Diff line number Diff line change
Expand Up @@ -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
Loading

0 comments on commit 664a061

Please sign in to comment.