You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by st...@apache.org on 2013/09/18 23:32:16 UTC

git commit: added windows support for firefoxos

Updated Branches:
  refs/heads/master ee5c976fc -> 36c254431


added windows support for firefoxos


Project: http://git-wip-us.apache.org/repos/asf/cordova-firefoxos/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-firefoxos/commit/36c25443
Tree: http://git-wip-us.apache.org/repos/asf/cordova-firefoxos/tree/36c25443
Diff: http://git-wip-us.apache.org/repos/asf/cordova-firefoxos/diff/36c25443

Branch: refs/heads/master
Commit: 36c25443158faf169a5c39dc150b307cb116f789
Parents: ee5c976
Author: Steven Gill <st...@gmail.com>
Authored: Wed Sep 18 14:00:16 2013 -0700
Committer: Steven Gill <st...@gmail.com>
Committed: Wed Sep 18 14:00:16 2013 -0700

----------------------------------------------------------------------
 bin/check_reqs                                  |  37 +++----
 bin/check_reqs.bat                              |  26 +++++
 bin/create                                      | 107 +++++--------------
 bin/create.bat                                  |  26 +++++
 bin/lib/check_reqs.js                           |  26 +++++
 bin/lib/create.js                               |  63 +++++++++++
 bin/templates/project/cordova/run               |   2 +-
 bin/templates/project/www/index.html            |   1 +
 .../www/res/icon/blackberry10/icon-80.png       | Bin 0 -> 7287 bytes
 .../res/screen/blackberry10/splash-1280x768.png | Bin 0 -> 60771 bytes
 .../res/screen/blackberry10/splash-720x720.png  | Bin 0 -> 50431 bytes
 .../res/screen/blackberry10/splash-768x1280.png | Bin 0 -> 57145 bytes
 cordova-lib/cordova.js                          |   6 +-
 package.json                                    |   6 +-
 14 files changed, 195 insertions(+), 105 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-firefoxos/blob/36c25443/bin/check_reqs
----------------------------------------------------------------------
diff --git a/bin/check_reqs b/bin/check_reqs
old mode 100644
new mode 100755
index 15f163a..4a8abee
--- a/bin/check_reqs
+++ b/bin/check_reqs
@@ -1,26 +1,27 @@
 #!/usr/bin/env node
 
 /*
-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
+       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
+         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.
+       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.
 */
 
-//add methods as we determine what are the requirements
+var check_reqs = require('./lib/check_reqs');
+
+if(!check_reqs.run()) {
+      process.exit(2);
+}
 
-module.exports.run = function() {
-    return true;
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cordova-firefoxos/blob/36c25443/bin/check_reqs.bat
----------------------------------------------------------------------
diff --git a/bin/check_reqs.bat b/bin/check_reqs.bat
new file mode 100644
index 0000000..cb2c6f5
--- /dev/null
+++ b/bin/check_reqs.bat
@@ -0,0 +1,26 @@
+:: 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.
+
+@ECHO OFF
+SET script_path="%~dp0check_reqs"
+IF EXIST %script_path% (
+        node "%script_path%" %*
+) ELSE (
+    ECHO.
+    ECHO ERROR: Could not find 'check_reqs' script in 'bin' folder, aborting...>&2
+    EXIT /B 1
+)

http://git-wip-us.apache.org/repos/asf/cordova-firefoxos/blob/36c25443/bin/create
----------------------------------------------------------------------
diff --git a/bin/create b/bin/create
index 21e1eb7..8c88f6e 100755
--- a/bin/create
+++ b/bin/create
@@ -1,91 +1,36 @@
 #!/usr/bin/env node
 
 /*
- * 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.
- */
- 
-var fs = require('fs'),
-    shjs = require('shelljs'),
-    args = process.argv,
-    path = require('path'),
-    check_reqs = require('./check_reqs');
-
-/*
-* $ create [options]
-*
-* Creates an firefoxos application with the given options.
-*
-* Options:
-*
-* - `project_path` {String} Path to the new Cordova android project.
-* - `package_name`{String} Package name, following reverse-domain style convention.
-* - `project_name` {String} Project name.
+       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.
 */
+var path = require('path');
+var create = require('./lib/create');
+var args = process.argv;
 
 // Support basic help commands
-if((args[2] == '--help' || args[2] == '/?' || args[2] == '-h' ||
+if(args.length < 3 || (args[2] == '--help' || args[2] == '/?' || args[2] == '-h' ||
                     args[2] == 'help' || args[2] == '-help' || args[2] == '/help')) {
-    help();
+    console.log('Usage: ' + path.relative(process.cwd(), path.join(__dirname, 'create')) + ' <path_to_new_project> <package_name> <project_name>');
+    console.log('    <path_to_new_project>: Path to your new Cordova Firefox OS project');
+    console.log('    <package_name>: Package name, following reverse-domain style convention');
+    console.log('    <project_name>: Project name');
+    process.exit(1);
 } else {
-    main(args[2], args[3], args[4]);
-}
-
-function main(project_path,package_name,project_name){
-    var ROOT = path.join(__dirname, '..'); 
-    var VERSION = fs.readFileSync(path.join(ROOT, 'VERSION'), 'utf-8');
-    
-    // Set default values for path, package and name
-    project_path = typeof project_path !== 'undefined' ? project_path : "CordovaExample";
-    package_name = typeof package_name !== 'undefined' ? package_name : 'org.apache.cordova.example';
-    project_name = typeof project_name !== 'undefined' ? project_name : 'CordovaExample';
-
-    // Check if project already exists
-    if(fs.existsSync(project_path)) {
-        console.error('Project already exists! Delete and recreate');
-        process.exit(2);
-    }
-    
-    // Check that requirements are met and proper targets are installed
-    if(!check_reqs.run()) {
-        console.error('Please make sure you meeet the software requirements in order to build an firefoxos cordova project');
-        process.exit(2);
-    }
-    
-    console.log('Creating Firefox OS project');
-    console.log('Project Path '+ path.relative(process.cwd(),project_path));
-    console.log('Package Name '+ package_name);
-    console.log('Project Name '+ project_name);
-
-    //copy template folder
-    shjs.cp('-r', path.join(ROOT, 'bin', 'templates', 'project', 'www'), project_path);
-    
-    //copy cordova js file
-    shjs.cp('-r', path.join(ROOT, 'cordova-lib', 'cordova.js'), path.join(project_path,'www'));  
-
-    //copy cordova folder
-    shjs.cp('-r', path.join(ROOT, 'bin', 'templates', 'project', 'cordova'), project_path); 
-    shjs.chmod(755, path.join(project_path, 'cordova', 'run'));
+    create.createProject(args[2], args[3], args[4], args[5]);
 }
 
-function help(){
-    console.log('Usage: ./' + path.relative(process.cwd(), path.join(__dirname, 'create')) + ' <path_to_new_project> <package_name> <project_name>');
-    console.log(' <path_to_new_project>: Path to your new Cordova Android project');
-    console.log(' <package_name>: Package name, following reverse-domain style convention');
-    console.log(' <project_name>: Project name');
-    process.exit(0);
-}

http://git-wip-us.apache.org/repos/asf/cordova-firefoxos/blob/36c25443/bin/create.bat
----------------------------------------------------------------------
diff --git a/bin/create.bat b/bin/create.bat
new file mode 100644
index 0000000..4b475a2
--- /dev/null
+++ b/bin/create.bat
@@ -0,0 +1,26 @@
+:: 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.
+
+@ECHO OFF
+SET script_path="%~dp0create"
+IF EXIST %script_path% (
+    node %script_path% %*
+) ELSE (
+    ECHO.
+    ECHO ERROR: Could not find 'create' script in 'bin' folder, aborting...>&2
+    EXIT /B 1
+)
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cordova-firefoxos/blob/36c25443/bin/lib/check_reqs.js
----------------------------------------------------------------------
diff --git a/bin/lib/check_reqs.js b/bin/lib/check_reqs.js
new file mode 100644
index 0000000..15f163a
--- /dev/null
+++ b/bin/lib/check_reqs.js
@@ -0,0 +1,26 @@
+#!/usr/bin/env node
+
+/*
+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.
+*/
+
+//add methods as we determine what are the requirements
+
+module.exports.run = function() {
+    return true;
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cordova-firefoxos/blob/36c25443/bin/lib/create.js
----------------------------------------------------------------------
diff --git a/bin/lib/create.js b/bin/lib/create.js
new file mode 100755
index 0000000..d93753e
--- /dev/null
+++ b/bin/lib/create.js
@@ -0,0 +1,63 @@
+#!/usr/bin/env node
+
+/*
+ * 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.
+ */
+ 
+var fs = require('fs'),
+    shjs = require('shelljs'),
+    args = process.argv,
+    path = require('path'),
+    ROOT    = path.join(__dirname, '..', '..'),
+    check_reqs = require('./check_reqs');
+
+exports.createProject = function(project_path,package_name,project_name){
+    var VERSION = fs.readFileSync(path.join(ROOT, 'VERSION'), 'utf-8');
+    
+    // Set default values for path, package and name
+    project_path = typeof project_path !== 'undefined' ? project_path : "CordovaExample";
+    package_name = typeof package_name !== 'undefined' ? package_name : 'org.apache.cordova.example';
+    project_name = typeof project_name !== 'undefined' ? project_name : 'CordovaExample';
+
+    // Check if project already exists
+    if(fs.existsSync(project_path)) {
+        console.error('Project already exists! Delete and recreate');
+        process.exit(2);
+    }
+    
+    // Check that requirements are met and proper targets are installed
+    if(!check_reqs.run()) {
+        console.error('Please make sure you meeet the software requirements in order to build an firefoxos cordova project');
+        process.exit(2);
+    }
+    
+    console.log('Creating Firefox OS project');
+    console.log('Project Path '+ path.relative(process.cwd(),project_path));
+    console.log('Package Name '+ package_name);
+    console.log('Project Name '+ project_name);
+
+    //copy template folder
+    shjs.cp('-r', path.join(ROOT, 'bin', 'templates', 'project', 'www'), project_path);
+    
+    //copy cordova js file
+    shjs.cp('-r', path.join(ROOT, 'cordova-lib', 'cordova.js'), path.join(project_path,'www'));  
+
+    //copy cordova folder
+    shjs.cp('-r', path.join(ROOT, 'bin', 'templates', 'project', 'cordova'), project_path); 
+    shjs.chmod(755, path.join(project_path, 'cordova', 'run'));
+}

http://git-wip-us.apache.org/repos/asf/cordova-firefoxos/blob/36c25443/bin/templates/project/cordova/run
----------------------------------------------------------------------
diff --git a/bin/templates/project/cordova/run b/bin/templates/project/cordova/run
index 8093242..577c06a 100755
--- a/bin/templates/project/cordova/run
+++ b/bin/templates/project/cordova/run
@@ -1 +1 @@
-echo "run not implemented"
+echo "run not implemented, please use firefoxos simulator to launch app"

http://git-wip-us.apache.org/repos/asf/cordova-firefoxos/blob/36c25443/bin/templates/project/www/index.html
----------------------------------------------------------------------
diff --git a/bin/templates/project/www/index.html b/bin/templates/project/www/index.html
index e84fbd7..bde5741 100644
--- a/bin/templates/project/www/index.html
+++ b/bin/templates/project/www/index.html
@@ -21,6 +21,7 @@
     <head>
         <meta charset="utf-8" />
         <meta name="format-detection" content="telephone=no" />
+        <!-- WARNING: for iOS 7, remove the width=device-width and height=device-height attributes. See https://issues.apache.org/jira/browse/CB-4323 -->
         <meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width, height=device-height, target-densitydpi=device-dpi" />
         <link rel="stylesheet" type="text/css" href="css/index.css" />
         <title>Hello World</title>

http://git-wip-us.apache.org/repos/asf/cordova-firefoxos/blob/36c25443/bin/templates/project/www/res/icon/blackberry10/icon-80.png
----------------------------------------------------------------------
diff --git a/bin/templates/project/www/res/icon/blackberry10/icon-80.png b/bin/templates/project/www/res/icon/blackberry10/icon-80.png
new file mode 100644
index 0000000..f86a27a
Binary files /dev/null and b/bin/templates/project/www/res/icon/blackberry10/icon-80.png differ

http://git-wip-us.apache.org/repos/asf/cordova-firefoxos/blob/36c25443/bin/templates/project/www/res/screen/blackberry10/splash-1280x768.png
----------------------------------------------------------------------
diff --git a/bin/templates/project/www/res/screen/blackberry10/splash-1280x768.png b/bin/templates/project/www/res/screen/blackberry10/splash-1280x768.png
new file mode 100644
index 0000000..5f4bca9
Binary files /dev/null and b/bin/templates/project/www/res/screen/blackberry10/splash-1280x768.png differ

http://git-wip-us.apache.org/repos/asf/cordova-firefoxos/blob/36c25443/bin/templates/project/www/res/screen/blackberry10/splash-720x720.png
----------------------------------------------------------------------
diff --git a/bin/templates/project/www/res/screen/blackberry10/splash-720x720.png b/bin/templates/project/www/res/screen/blackberry10/splash-720x720.png
new file mode 100644
index 0000000..fe1756f
Binary files /dev/null and b/bin/templates/project/www/res/screen/blackberry10/splash-720x720.png differ

http://git-wip-us.apache.org/repos/asf/cordova-firefoxos/blob/36c25443/bin/templates/project/www/res/screen/blackberry10/splash-768x1280.png
----------------------------------------------------------------------
diff --git a/bin/templates/project/www/res/screen/blackberry10/splash-768x1280.png b/bin/templates/project/www/res/screen/blackberry10/splash-768x1280.png
new file mode 100644
index 0000000..0fb9c1b
Binary files /dev/null and b/bin/templates/project/www/res/screen/blackberry10/splash-768x1280.png differ

http://git-wip-us.apache.org/repos/asf/cordova-firefoxos/blob/36c25443/cordova-lib/cordova.js
----------------------------------------------------------------------
diff --git a/cordova-lib/cordova.js b/cordova-lib/cordova.js
index ddb2df4..498194f 100644
--- a/cordova-lib/cordova.js
+++ b/cordova-lib/cordova.js
@@ -1,5 +1,5 @@
 // Platform: firefoxos
-// 3.0.0-dev-58-ged1894d
+// 3.1.0-rc1
 /*
  Licensed to the Apache Software Foundation (ASF) under one
  or more contributor license agreements.  See the NOTICE file
@@ -19,7 +19,7 @@
  under the License.
 */
 ;(function() {
-var CORDOVA_JS_BUILD_LABEL = '3.0.0-dev-58-ged1894d';
+var CORDOVA_JS_BUILD_LABEL = '3.1.0-rc1';
 // file: lib/scripts/require.js
 
 var require,
@@ -100,6 +100,7 @@ define("cordova", function(require, exports, module) {
 
 
 var channel = require('cordova/channel');
+var platform = require('cordova/platform');
 
 /**
  * Intercept calls to addEventListener + removeEventListener and handle deviceready,
@@ -172,6 +173,7 @@ var cordova = {
     define:define,
     require:require,
     version:CORDOVA_JS_BUILD_LABEL,
+    platformId:platform.id,
     /**
      * Methods to add/remove your own addEventListener hijacking on document + window.
      */

http://git-wip-us.apache.org/repos/asf/cordova-firefoxos/blob/36c25443/package.json
----------------------------------------------------------------------
diff --git a/package.json b/package.json
index aa1512d..2091a83 100644
--- a/package.json
+++ b/package.json
@@ -1,10 +1,10 @@
 {
   "name": "cordova-firefoxos",
-  "version": "0.0.0",
+  "version": "3.1.0",
   "description": "cordova firefoxos",
-  "main": "create",
+  "main": "./bin/create",
   "scripts": {
-    "test": "./create"
+    "test": "./bin/create"
   },
   "repository": {
     "type": "git",