You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by mm...@apache.org on 2015/03/06 17:29:16 UTC

cordova-lib git commit: Move cordova-app-hello-world dependency to cordova-lib

Repository: cordova-lib
Updated Branches:
  refs/heads/copy-from-app-hello-world 9bddb201b -> 59e470a7a


Move cordova-app-hello-world dependency to cordova-lib


Project: http://git-wip-us.apache.org/repos/asf/cordova-lib/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-lib/commit/59e470a7
Tree: http://git-wip-us.apache.org/repos/asf/cordova-lib/tree/59e470a7
Diff: http://git-wip-us.apache.org/repos/asf/cordova-lib/diff/59e470a7

Branch: refs/heads/copy-from-app-hello-world
Commit: 59e470a7a7831d7b896daa641b9089e70b98e968
Parents: 9bddb20
Author: Michal Mocny <mm...@gmail.com>
Authored: Fri Mar 6 11:29:01 2015 -0500
Committer: Michal Mocny <mm...@gmail.com>
Committed: Fri Mar 6 11:29:01 2015 -0500

----------------------------------------------------------------------
 cordova-lib/package.json          |  1 +
 cordova-lib/src/cordova/create.js | 12 ++++++++----
 cordova-lib/templates/config.xml  | 19 -------------------
 3 files changed, 9 insertions(+), 23 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/59e470a7/cordova-lib/package.json
----------------------------------------------------------------------
diff --git a/cordova-lib/package.json b/cordova-lib/package.json
index c61329c..ff5b5bf 100644
--- a/cordova-lib/package.json
+++ b/cordova-lib/package.json
@@ -18,6 +18,7 @@
   "engineStrict": true,
   "dependencies": {
     "bplist-parser": "0.0.6",
+    "cordova-app-hello-world": "file:../../cordova-app-hello-world",
     "cordova-js": "3.8.0",
     "d8": "0.4.4",
     "dep-graph": "1.1.0",

http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/59e470a7/cordova-lib/src/cordova/create.js
----------------------------------------------------------------------
diff --git a/cordova-lib/src/cordova/create.js b/cordova-lib/src/cordova/create.js
index d5bebd7..ae3f1ee 100644
--- a/cordova-lib/src/cordova/create.js
+++ b/cordova-lib/src/cordova/create.js
@@ -93,12 +93,16 @@ function create(dir, optionalId, optionalName, cfg) {
             throw new CordovaError('App id contains a reserved word, or is not a valid identifier.');
         }
 
-        if (!cfg.lib || !cfg.lib.www) {
-            throw new CordovaError('Must supply a source www path.');
-        }
 
         // This was changed from "uri" to "url", but checking uri for backwards compatibility.
+        cfg.lib = cfg.lib || {};
+        cfg.lib.www = cfg.lib.www || {};
         cfg.lib.www.url = cfg.lib.www.url || cfg.lib.www.uri;
+
+        if (!cfg.lib.www.url) {
+            cfg.lib.www.url = path.join(__dirname, '..', '..', 'node_modules', 'cordova-app-hello-world');
+        }
+
         // TODO (kamrik): extend lazy_load for retrieval without caching to allow net urls for --src.
         cfg.lib.www.version = cfg.lib.www.version || 'not_versioned';
         cfg.lib.www.id = cfg.lib.www.id || 'dummy_id';
@@ -227,7 +231,7 @@ function create(dir, optionalId, optionalName, cfg) {
         // Add template config.xml for apps that are missing it
         var configPath = cordova_util.projectConfig(dir);
         if (!fs.existsSync(configPath)) {
-            shell.cp(path.join(__dirname, '..', '..', 'templates', 'config.xml'), configPath);
+            shell.cp(path.join(__dirname, '..', '..', 'node_modules', 'cordova-app-hello-world', 'config.xml'), configPath);
         }
 
         // Write out id and name to config.xml

http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/59e470a7/cordova-lib/templates/config.xml
----------------------------------------------------------------------
diff --git a/cordova-lib/templates/config.xml b/cordova-lib/templates/config.xml
deleted file mode 100644
index 4a9a4d8..0000000
--- a/cordova-lib/templates/config.xml
+++ /dev/null
@@ -1,19 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<widget xmlns     = "http://www.w3.org/ns/widgets"
-        xmlns:cdv = "http://cordova.apache.org/ns/1.0"
-        id        = "io.cordova.hellocordova"
-        version   = "0.0.1">
-    <name>Hello Cordova</name>
-
-    <description>
-        A sample Apache Cordova application that responds to the deviceready event.
-    </description>
-
-    <author href="http://cordova.io" email="dev@cordova.apache.org">
-        Apache Cordova Team
-    </author>
-
-    <content src="index.html" />
-
-    <access origin="*" />
-</widget>


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org