incubator-callback-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a...@apache.org
Subject [3/3] android commit: creating project without source
Date Fri, 29 Jun 2012 00:08:55 GMT
creating project without source


Project: http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/commit/99fb3ebe
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/tree/99fb3ebe
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/diff/99fb3ebe

Branch: refs/heads/master
Commit: 99fb3ebe003cb27c03dd80ec377c595540ff17b8
Parents: 5829840
Author: Anis Kadri <anis.kadri@gmail.com>
Authored: Tue Jun 26 17:34:19 2012 -0700
Committer: Anis Kadri <anis.kadri@gmail.com>
Committed: Tue Jun 26 17:34:19 2012 -0700

----------------------------------------------------------------------
 bin/create |   53 +++++++++++++++++++++++++++++++++++------------------
 1 files changed, 35 insertions(+), 18 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/blob/99fb3ebe/bin/create
----------------------------------------------------------------------
diff --git a/bin/create b/bin/create
index a4adc90..688b5fd 100755
--- a/bin/create
+++ b/bin/create
@@ -48,8 +48,14 @@ fi
 function on_exit {
     # [ -f $BUILD_PATH/framework/libs/commons-codec-1.6.jar ] && rm $BUILD_PATH/framework/libs/commons-codec-1.6.jar
     # [ -d $BUILD_PATH/framework/libs ] && rmdir $BUILD_PATH/framework/libs
-    [ -f $BUILD_PATH/framework/assets/www/cordova-$VERSION.js ] && rm $BUILD_PATH/framework/assets/www/cordova-$VERSION.js
-    [ -f $BUILD_PATH/framework/cordova-$VERSION.jar ] && rm $BUILD_PATH/framework/cordova-$VERSION.jar
+    if [ -f $BUILD_PATH/framework/assets/www/cordova-$VERSION.js ]
+    then
+        rm $BUILD_PATH/framework/assets/www/cordova-$VERSION.js
+    fi
+    if [ -f $BUILD_PATH/framework/cordova-$VERSION.jar ]
+    then
+        rm $BUILD_PATH/framework/cordova-$VERSION.jar
+    fi
 }
 
 function on_error {
@@ -68,21 +74,26 @@ MANIFEST_PATH=$PROJECT_PATH/AndroidManifest.xml
 
 TARGET=$($ANDROID_BIN list targets | grep id: | tail -1 | cut -f 2 -d ' ' )
 
+# if this a distribution release no need to build a jar
+if [ ! -e $BUILD_PATH/cordova-$VERSION.jar ] && [ -d $BUILD_PATH/framework ]
+then
 # update the cordova-android framework for the desired target
-$ANDROID_BIN update project --target $TARGET --path $BUILD_PATH/framework &> /dev/null
-
-if [ ! -e $BUILD_PATH/framework/libs/commons-codec-1.6.jar ]; then
-    # Use curl to get the jar (TODO: Support Apache Mirrors)
-    curl -OL http://mirror.symnds.com/software/Apache//commons/codec/binaries/commons-codec-1.6-bin.zip
&> /dev/null
-    unzip commons-codec-1.6-bin.zip &> /dev/null
-    mkdir -p $BUILD_PATH/framework/libs
-    cp commons-codec-1.6/commons-codec-1.6.jar $BUILD_PATH/framework/libs
-    # cleanup yo
-    rm commons-codec-1.6-bin.zip && rm -rf commons-codec-1.6
-fi
+    $ANDROID_BIN update project --target $TARGET --path $BUILD_PATH/framework &> /dev/null
+
+    if [ ! -e $BUILD_PATH/framework/libs/commons-codec-1.6.jar ]; then
+        # Use curl to get the jar (TODO: Support Apache Mirrors)
+        curl -OL http://mirror.symnds.com/software/Apache//commons/codec/binaries/commons-codec-1.6-bin.zip
&> /dev/null
+        unzip commons-codec-1.6-bin.zip &> /dev/null
+        mkdir -p $BUILD_PATH/framework/libs
+        cp commons-codec-1.6/commons-codec-1.6.jar $BUILD_PATH/framework/libs
+        # cleanup yo
+        rm commons-codec-1.6-bin.zip && rm -rf commons-codec-1.6
+    fi
 
 # compile cordova.js and cordova.jar
-(cd $BUILD_PATH/framework && ant jar &> /dev/null )
+    (cd $BUILD_PATH/framework && ant jar &> /dev/null )
+fi
+
 
 # create new android project
 $ANDROID_BIN create project --target $TARGET --path $PROJECT_PATH --package $PACKAGE --activity
$ACTIVITY &> /dev/null
@@ -92,10 +103,16 @@ cp -r $BUILD_PATH/bin/templates/project/assets $PROJECT_PATH
 cp -r $BUILD_PATH/bin/templates/project/res $PROJECT_PATH
 
 # copy cordova.js, cordova.jar and res/xml
-cp -r $BUILD_PATH/framework/res/xml $PROJECT_PATH/res
-
-cp $BUILD_PATH/framework/assets/www/cordova-$VERSION.js $PROJECT_PATH/assets/www/cordova-$VERSION.js
-cp $BUILD_PATH/framework/cordova-$VERSION.jar $PROJECT_PATH/libs/cordova-$VERSION.jar
+if [ -d $BUILD_PATH/framework ]
+then
+    cp -r $BUILD_PATH/framework/res/xml $PROJECT_PATH/res
+    cp $BUILD_PATH/framework/assets/www/cordova-$VERSION.js $PROJECT_PATH/assets/www/cordova-$VERSION.js
+    cp $BUILD_PATH/framework/cordova-$VERSION.jar $PROJECT_PATH/libs/cordova-$VERSION.jar
+else
+    cp -r $BUILD_PATH/xml $PROJECT_PATH/res/xml
+    cp $BUILD_PATH/cordova-$VERSION.js $PROJECT_PATH/assets/www/cordova-$VERSION.js
+    cp $BUILD_PATH/cordova-$VERSION.jar $PROJECT_PATH/libs/cordova-$VERSION.jar
+fi
 
 # interpolate the activity name and package
 cp $BUILD_PATH/bin/templates/project/Activity.java $ACTIVITY_PATH


Mime
View raw message