Sha256: 03cfecd98466d716968ff3bd1ec7757ceb73c95afb22f11f3943c6f473b87668

Contents?: true

Size: 1.09 KB

Versions: 1

Compression:

Stored size: 1.09 KB

Contents

#! /bin/sh
#
# create a cordova/android project
# 
# USAGE
#   ./create [path package activity]
#
set -e

PROJECT_PATH=${1:-"./example"}
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)

# clobber any existing example
if [ $# -eq 0 ]
then
    rm -rf $PROJECT_PATH
fi

# update the cordova-android framework for the desired target
android update project --target $TARGET --path ./framework

# 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 cordova.js
cp ./framework/assets/www/cordova-$VERSION.js $PROJECT_PATH/.cordova/android/cordova-$VERSION.js

# copy in cordova.jar
cp ./framework/cordova-$VERSION.jar $PROJECT_PATH/.cordova/android/cordova-$VERSION.jar

# app properties
cat > $PROJECT_PATH/.cordova/config <<eom
VERSION=$VERSION
PROJECT_PATH=$PROJECT_PATH
PACKAGE=$PACKAGE
ACTIVITY=$ACTIVITY
TARGET=$TARGET
eom

(cd $PROJECT_PATH && ./cordova/create)

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
mobile_template-0.0.1 templates/cordova_android/bin/create