cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tim...@apache.org
Subject webworks commit: [CB-2300] - fixing up create scripts to be more inline with the other projects
Date Fri, 01 Feb 2013 20:09:31 GMT
Updated Branches:
  refs/heads/master 415d116ea -> 2b68338db


[CB-2300] - fixing up create scripts to be more inline with the other projects


Project: http://git-wip-us.apache.org/repos/asf/cordova-blackberry/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-blackberry/commit/2b68338d
Tree: http://git-wip-us.apache.org/repos/asf/cordova-blackberry/tree/2b68338d
Diff: http://git-wip-us.apache.org/repos/asf/cordova-blackberry/diff/2b68338d

Branch: refs/heads/master
Commit: 2b68338db80b591430bf4f0ee6424ac68e08f60f
Parents: 415d116
Author: Tim Kim <timk@adobe.com>
Authored: Thu Jan 31 15:52:03 2013 -0800
Committer: Tim Kim <timk@adobe.com>
Committed: Fri Feb 1 12:08:25 2013 -0800

----------------------------------------------------------------------
 bin/create                           |   12 ++++++----
 bin/create.bat                       |   33 -----------------------------
 bin/create.js                        |   12 +++++++---
 bin/templates/project/www/config.xml |    4 +-
 4 files changed, 17 insertions(+), 44 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-blackberry/blob/2b68338d/bin/create
----------------------------------------------------------------------
diff --git a/bin/create b/bin/create
index 974dc10..dda216b 100755
--- a/bin/create
+++ b/bin/create
@@ -19,13 +19,13 @@
 # create a cordova/blackberry project
 # 
 # USAGE
-#   ./create [path appname]
+#   ./create [path package activity]
 #
 set -e
 
 if [ -n "$1" ] && [ "$1" == "-h" ]
 then
-    echo 'usage: create path appname'
+    echo 'usage: create package activity'
     echo 'After you have created your application, make sure to customize the project.properties
file inside your app directory with your environment specifics!'
     exit 0
 fi
@@ -34,7 +34,8 @@ BUILD_PATH="$( cd "$( dirname "$0" )/.." && pwd )"
 VERSION=$(cat "$BUILD_PATH/VERSION")
 
 PROJECT_PATH="${1:-"./example"}"
-APPNAME=${2:-"cordovaExample"}
+PACKAGE=${2:-"org.apache.cordova.example"}
+ACTIVITY=${2:-"cordovaExample"}
 
 # clobber any existing example
 if [ -d "$PROJECT_PATH" ]
@@ -86,6 +87,7 @@ else
 	cp -r "$BUILD_PATH/sample/." "$PROJECT_PATH"
 fi
 
-# interpolate the app name into config.xml
+# interpolate the activity and package into config.xml
 echo "Updating config.xml ..."
-sed -i '' -e "s/__NAME__/${APPNAME}/g" "$MANIFEST_PATH"
+sed -i '' -e "s/__ACTIVITY__/${ACTIVITY}/g" "$MANIFEST_PATH"
+sed -i '' -e "s/__PACKAGE__/${PACKAGE}/g" "$MANIFEST_PATH"
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cordova-blackberry/blob/2b68338d/bin/create.bat
----------------------------------------------------------------------
diff --git a/bin/create.bat b/bin/create.bat
deleted file mode 100644
index ecb039a..0000000
--- a/bin/create.bat
+++ /dev/null
@@ -1,33 +0,0 @@
-@ECHO OFF
-goto comment
-       Licensed to the Apache Software Foundation (ASF) under one
-       or more contributor license agreements.  See the NOTICE file
-       distributed with this work for additional information
-       regarding copyright ownership.  The ASF licenses this file
-       to you under the Apache License, Version 2.0 (the
-       "License"); you may not use this file except in compliance
-       with the License.  You may obtain a copy of the License at
-
-         http://www.apache.org/licenses/LICENSE-2.0
-
-       Unless required by applicable law or agreed to in writing,
-       software distributed under the License is distributed on an
-       "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-       KIND, either express or implied.  See the License for the
-       specific language governing permissions and limitations
-       under the License.
-:comment
-
-IF NOT DEFINED JAVA_HOME GOTO MISSING
-FOR %%X in (ant.bat) do (
-    SET FOUND=%%~$PATH:X
-    IF NOT DEFINED FOUND GOTO MISSING
-)
-cscript %~dp0\create.js %*
-GOTO END
-:MISSING
-ECHO Missing one of the following:
-ECHO JDK: http://java.oracle.com
-ECHO Apache ant: http://ant.apache.org
-EXIT /B 1
-:END

http://git-wip-us.apache.org/repos/asf/cordova-blackberry/blob/2b68338d/bin/create.js
----------------------------------------------------------------------
diff --git a/bin/create.js b/bin/create.js
index 9d4ce62..ae610a4 100644
--- a/bin/create.js
+++ b/bin/create.js
@@ -93,15 +93,17 @@ function cleanup() {
 }
 
 var args = WScript.Arguments, PROJECT_PATH="example", 
-    APPNAME="cordovaExample",
+    PACKAGE="org.apache.cordova.example",
+    ACTIVITY="cordovaExample",
     shell=WScript.CreateObject("WScript.Shell");
     
 // working dir
 var ROOT = WScript.ScriptFullName.split('\\bin\\create.js').join('');
 
-if (args.Count() == 2) {
+if (args.Count() == 3) {
     PROJECT_PATH=args(0);
-    APPNAME=args(1);
+    PACKAGE=args(1);
+    ACTIVITY=args(2);
 }
 
 if(fso.FolderExists(PROJECT_PATH)) {
@@ -121,5 +123,7 @@ if(fso.FolderExists(ROOT+'\\framework')){
     // copy in the project template
     exec('cmd /c xcopy '+ ROOT + '\\sample\\* '+PROJECT_PATH+' /I /S /Y');    
 }
-replaceInFile(MANIFEST_PATH, /__NAME__/, APPNAME);
+
+replaceInFile(MANIFEST_PATH, /__PACKAGE__/, PACKAGE);
+replaceInFile(MANIFEST_PATH, /__ACTIVITY__/, ACTIVITY);
 cleanup();

http://git-wip-us.apache.org/repos/asf/cordova-blackberry/blob/2b68338d/bin/templates/project/www/config.xml
----------------------------------------------------------------------
diff --git a/bin/templates/project/www/config.xml b/bin/templates/project/www/config.xml
index 40ac2b8..9008b35 100644
--- a/bin/templates/project/www/config.xml
+++ b/bin/templates/project/www/config.xml
@@ -24,9 +24,9 @@
 
 <widget xmlns="http://www.w3.org/ns/widgets"
         xmlns:rim="http://www.blackberry.com/ns/widgets"
-	version="1.0.0.0" id="__NAME__">
+	version="1.0.0.0" id="__PACKAGE__">
 
-  <name>__NAME__</name>
+  <name>__ACTIVITY__</name>
 
   <author>Your Name Here</author>
 


Mime
View raw message