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 2015/03/10 01:40:33 UTC

[1/6] cordova-app-hello-world git commit: [CB-8597] First attempt at importing cordova-app-hello-world via npm dependency

Repository: cordova-app-hello-world
Updated Branches:
  refs/heads/master a5747043c -> 71499c241


[CB-8597] First attempt at importing cordova-app-hello-world via npm dependency


Project: http://git-wip-us.apache.org/repos/asf/cordova-app-hello-world/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-app-hello-world/commit/d4eb5930
Tree: http://git-wip-us.apache.org/repos/asf/cordova-app-hello-world/tree/d4eb5930
Diff: http://git-wip-us.apache.org/repos/asf/cordova-app-hello-world/diff/d4eb5930

Branch: refs/heads/master
Commit: d4eb5930b555545838229f0a8944716018ba3c1b
Parents: 7383e09
Author: Michal Mocny <mm...@gmail.com>
Authored: Tue Mar 3 15:06:45 2015 -0500
Committer: Michal Mocny <mm...@gmail.com>
Committed: Tue Mar 3 15:06:45 2015 -0500

----------------------------------------------------------------------
 config.xml   | 12 ++++++++++++
 package.json | 16 ++++++++++++++++
 2 files changed, 28 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-app-hello-world/blob/d4eb5930/config.xml
----------------------------------------------------------------------
diff --git a/config.xml b/config.xml
new file mode 100644
index 0000000..9dd0a63
--- /dev/null
+++ b/config.xml
@@ -0,0 +1,12 @@
+<?xml version='1.0' encoding='utf-8'?>
+<widget id="io.cordova.hellocordova" version="0.0.1" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
+    <name>HelloCordova</name>
+    <description>
+        A sample Apache Cordova application that responds to the deviceready event.
+    </description>
+    <author email="dev@cordova.apache.org" href="http://cordova.io">
+        Apache Cordova Team
+    </author>
+    <content src="index.html" />
+    <access origin="*" />
+</widget>

http://git-wip-us.apache.org/repos/asf/cordova-app-hello-world/blob/d4eb5930/package.json
----------------------------------------------------------------------
diff --git a/package.json b/package.json
new file mode 100644
index 0000000..d562a36
--- /dev/null
+++ b/package.json
@@ -0,0 +1,16 @@
+{
+  "name": "cordova-app-hello-world",
+  "version": "3.8.0-dev",
+  "description": "",
+  "main": "index.js",
+  "scripts": {
+    "test": "echo \"Error: no test specified\" && exit 1"
+  },
+  "repository": {
+    "type": "git",
+    "url": "https://git-wip-us.apache.org/repos/asf/cordova-app-hello-world.git"
+  },
+  "keywords": [],
+  "author": "Apache Cordova",
+  "license": "Apache version 2.0"
+}


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


[5/6] cordova-app-hello-world git commit: added releasenotes.md

Posted by st...@apache.org.
added releasenotes.md


Project: http://git-wip-us.apache.org/repos/asf/cordova-app-hello-world/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-app-hello-world/commit/7325d138
Tree: http://git-wip-us.apache.org/repos/asf/cordova-app-hello-world/tree/7325d138
Diff: http://git-wip-us.apache.org/repos/asf/cordova-app-hello-world/diff/7325d138

Branch: refs/heads/master
Commit: 7325d1383c07d896d1976ac73cadee5f3eb12c1a
Parents: 074047f
Author: Steve Gill <st...@gmail.com>
Authored: Mon Mar 9 16:44:10 2015 -0700
Committer: Steve Gill <st...@gmail.com>
Committed: Mon Mar 9 16:44:10 2015 -0700

----------------------------------------------------------------------
 RELEASENOTES.md | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-app-hello-world/blob/7325d138/RELEASENOTES.md
----------------------------------------------------------------------
diff --git a/RELEASENOTES.md b/RELEASENOTES.md
new file mode 100644
index 0000000..0b1a5bb
--- /dev/null
+++ b/RELEASENOTES.md
@@ -0,0 +1,21 @@
+<!--
+#
+# 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.
+#
+-->
+# Release Notes


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


[4/6] cordova-app-hello-world git commit: removed version file, package.json can keep track of version

Posted by st...@apache.org.
removed version file, package.json can keep track of version


Project: http://git-wip-us.apache.org/repos/asf/cordova-app-hello-world/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-app-hello-world/commit/074047f3
Tree: http://git-wip-us.apache.org/repos/asf/cordova-app-hello-world/tree/074047f3
Diff: http://git-wip-us.apache.org/repos/asf/cordova-app-hello-world/diff/074047f3

Branch: refs/heads/master
Commit: 074047f381b02b0c9503b61fe5a8de8344916097
Parents: de95beb
Author: Steve Gill <st...@gmail.com>
Authored: Mon Mar 9 15:39:03 2015 -0700
Committer: Steve Gill <st...@gmail.com>
Committed: Mon Mar 9 15:39:03 2015 -0700

----------------------------------------------------------------------
 VERSION | 1 -
 1 file changed, 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-app-hello-world/blob/074047f3/VERSION
----------------------------------------------------------------------
diff --git a/VERSION b/VERSION
deleted file mode 100644
index a4ce38e..0000000
--- a/VERSION
+++ /dev/null
@@ -1 +0,0 @@
-3.7.0-dev


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


[3/6] cordova-app-hello-world git commit: updated package.json

Posted by st...@apache.org.
updated package.json


Project: http://git-wip-us.apache.org/repos/asf/cordova-app-hello-world/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-app-hello-world/commit/de95beb9
Tree: http://git-wip-us.apache.org/repos/asf/cordova-app-hello-world/tree/de95beb9
Diff: http://git-wip-us.apache.org/repos/asf/cordova-app-hello-world/diff/de95beb9

Branch: refs/heads/master
Commit: de95beb92dade8440396c8c73ae82f5dbb40c534
Parents: 60176c0
Author: Steve Gill <st...@gmail.com>
Authored: Fri Mar 6 17:12:47 2015 -0800
Committer: Steve Gill <st...@gmail.com>
Committed: Fri Mar 6 17:12:47 2015 -0800

----------------------------------------------------------------------
 package.json | 12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-app-hello-world/blob/de95beb9/package.json
----------------------------------------------------------------------
diff --git a/package.json b/package.json
index d562a36..0cb00b5 100644
--- a/package.json
+++ b/package.json
@@ -1,16 +1,14 @@
 {
   "name": "cordova-app-hello-world",
   "version": "3.8.0-dev",
-  "description": "",
-  "main": "index.js",
-  "scripts": {
-    "test": "echo \"Error: no test specified\" && exit 1"
-  },
+  "description": "This is the hello world app used by the `cordova create` command.",
   "repository": {
     "type": "git",
     "url": "https://git-wip-us.apache.org/repos/asf/cordova-app-hello-world.git"
   },
-  "keywords": [],
-  "author": "Apache Cordova",
+  "keywords": [
+    "ecosystem:cordova"
+  ],
+  "author": "Apache Software Foundation",
   "license": "Apache version 2.0"
 }


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


[2/6] cordova-app-hello-world git commit: Adding hooks to default app

Posted by st...@apache.org.
Adding hooks to default app


Project: http://git-wip-us.apache.org/repos/asf/cordova-app-hello-world/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-app-hello-world/commit/60176c0a
Tree: http://git-wip-us.apache.org/repos/asf/cordova-app-hello-world/tree/60176c0a
Diff: http://git-wip-us.apache.org/repos/asf/cordova-app-hello-world/diff/60176c0a

Branch: refs/heads/master
Commit: 60176c0a41e685fb5ca18d27db96c42bb261f768
Parents: d4eb593
Author: Michal Mocny <mm...@gmail.com>
Authored: Tue Mar 3 17:43:19 2015 -0500
Committer: Michal Mocny <mm...@gmail.com>
Committed: Tue Mar 3 17:43:19 2015 -0500

----------------------------------------------------------------------
 hooks/README.md | 196 +++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 196 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-app-hello-world/blob/60176c0a/hooks/README.md
----------------------------------------------------------------------
diff --git a/hooks/README.md b/hooks/README.md
new file mode 100644
index 0000000..62e58b4
--- /dev/null
+++ b/hooks/README.md
@@ -0,0 +1,196 @@
+<!--
+#
+# 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.
+#
+-->
+# Cordova Hooks
+
+Cordova Hooks represent special scripts which could be added by application and plugin developers or even by your own build system  to customize cordova commands. Hook scripts could be defined by adding them to the special predefined folder (`/hooks`) or via configuration files (`config.xml` and `plugin.xml`) and run serially in the following order:
+* Application hooks from `/hooks`;
+* Application hooks from `config.xml`;
+* Plugin hooks from `plugins/.../plugin.xml`.
+
+__Remember__: Make your scripts executable.
+
+__Note__: `.cordova/hooks` directory is also supported for backward compatibility, but we don't recommend using it as it is deprecated.
+
+## Supported hook types
+The following hook types are supported:
+
+    after_build/
+    after_compile/
+    after_docs/
+    after_emulate/
+    after_platform_add/
+    after_platform_rm/
+    after_platform_ls/
+    after_plugin_add/
+    after_plugin_ls/
+    after_plugin_rm/
+    after_plugin_search/
+    after_plugin_install/   <-- Plugin hooks defined in plugin.xml are executed exclusively for a plugin being installed
+    after_prepare/
+    after_run/
+    after_serve/
+    before_build/
+    before_compile/
+    before_docs/
+    before_emulate/
+    before_platform_add/
+    before_platform_rm/
+    before_platform_ls/
+    before_plugin_add/
+    before_plugin_ls/
+    before_plugin_rm/
+    before_plugin_search/
+    before_plugin_install/   <-- Plugin hooks defined in plugin.xml are executed exclusively for a plugin being installed
+    before_plugin_uninstall/   <-- Plugin hooks defined in plugin.xml are executed exclusively for a plugin being uninstalled
+    before_prepare/
+    before_run/
+    before_serve/
+    pre_package/ <-- Windows 8 and Windows Phone only.
+
+## Ways to define hooks
+### Via '/hooks' directory
+To execute custom action when corresponding hook type is fired, use hook type as a name for a subfolder inside 'hooks' directory and place you script file here, for example:
+
+    # script file will be automatically executed after each build
+    hooks/after_build/after_build_custom_action.js
+
+
+### Config.xml
+
+Hooks can be defined in project's `config.xml` using `<hook>` elements, for example:
+
+    <hook type="before_build" src="scripts/appBeforeBuild.bat" />
+    <hook type="before_build" src="scripts/appBeforeBuild.js" />
+    <hook type="before_plugin_install" src="scripts/appBeforePluginInstall.js" />
+
+    <platform name="wp8">
+        <hook type="before_build" src="scripts/wp8/appWP8BeforeBuild.bat" />
+        <hook type="before_build" src="scripts/wp8/appWP8BeforeBuild.js" />
+        <hook type="before_plugin_install" src="scripts/wp8/appWP8BeforePluginInstall.js" />
+        ...
+    </platform>
+
+    <platform name="windows8">
+        <hook type="before_build" src="scripts/windows8/appWin8BeforeBuild.bat" />
+        <hook type="before_build" src="scripts/windows8/appWin8BeforeBuild.js" />
+        <hook type="before_plugin_install" src="scripts/windows8/appWin8BeforePluginInstall.js" />
+        ...
+    </platform>
+
+### Plugin hooks (plugin.xml)
+
+As a plugin developer you can define hook scripts using `<hook>` elements in a `plugin.xml` like that:
+
+    <hook type="before_plugin_install" src="scripts/beforeInstall.js" />
+    <hook type="after_build" src="scripts/afterBuild.js" />
+
+    <platform name="wp8">
+        <hook type="before_plugin_install" src="scripts/wp8BeforeInstall.js" />
+        <hook type="before_build" src="scripts/wp8BeforeBuild.js" />
+        ...
+    </platform>
+
+`before_plugin_install`, `after_plugin_install`, `before_plugin_uninstall` plugin hooks will be fired exclusively for the plugin being installed/uninstalled.
+
+## Script Interface
+
+### Javascript
+
+If you are writing hooks in Javascript you should use the following module definition:
+```javascript
+module.exports = function(context) {
+    ...
+}
+```
+
+You can make your scipts async using Q:
+```javascript
+module.exports = function(context) {
+    var Q = context.requireCordovaModule('q');
+    var deferral = new Q.defer();
+
+    setTimeout(function(){
+    	console.log('hook.js>> end');
+		deferral.resolve();
+    }, 1000);
+
+    return deferral.promise;
+}
+```
+
+`context` object contains hook type, executed script full path, hook options, command-line arguments passed to Cordova and top-level "cordova" object:
+```json
+{
+	"hook": "before_plugin_install",
+	"scriptLocation": "c:\\script\\full\\path\\appBeforePluginInstall.js",
+	"cmdLine": "The\\exact\\command\\cordova\\run\\with arguments",
+	"opts": {
+		"projectRoot":"C:\\path\\to\\the\\project",
+		"cordova": {
+			"platforms": ["wp8"],
+			"plugins": ["com.plugin.withhooks"],
+			"version": "0.21.7-dev"
+		},
+		"plugin": {
+			"id": "com.plugin.withhooks",
+			"pluginInfo": {
+				...
+			},
+			"platform": "wp8",
+			"dir": "C:\\path\\to\\the\\project\\plugins\\com.plugin.withhooks"
+		}
+	},
+	"cordova": {...}
+}
+
+```
+`context.opts.plugin` object will only be passed to plugin hooks scripts.
+
+You can also require additional Cordova modules in your script using `context.requireCordovaModule` in the following way:
+```javascript
+var Q = context.requireCordovaModule('q');
+```
+
+__Note__:  new module loader script interface is used for the `.js` files defined via `config.xml` or `plugin.xml` only.
+For compatibility reasons hook files specified via `/hooks` folders are run via Node child_process spawn, see 'Non-javascript' section below.
+
+### Non-javascript
+
+Non-javascript scripts are run via Node child_process spawn from the project's root directory and have the root directory passes as the first argument. All other options are passed to the script using environment variables:
+
+* CORDOVA_VERSION - The version of the Cordova-CLI.
+* CORDOVA_PLATFORMS - Comma separated list of platforms that the command applies to (e.g.: android, ios).
+* CORDOVA_PLUGINS - Comma separated list of plugin IDs that the command applies to (e.g.: org.apache.cordova.file, org.apache.cordova.file-transfer)
+* CORDOVA_HOOK - Path to the hook that is being executed.
+* CORDOVA_CMDLINE - The exact command-line arguments passed to cordova (e.g.: cordova run ios --emulate)
+
+If a script returns a non-zero exit code, then the parent cordova command will be aborted.
+
+## Writing hooks
+
+We highly recommend writing your hooks using Node.js so that they are
+cross-platform. Some good examples are shown here:
+
+[http://devgirl.org/2013/11/12/three-hooks-your-cordovaphonegap-project-needs/](http://devgirl.org/2013/11/12/three-hooks-your-cordovaphonegap-project-needs/)
+
+Also, note that even if you are working on Windows, and in case your hook scripts aren't bat files (which is recommended, if you want your scripts to work in non-Windows operating systems) Cordova CLI will expect a shebang line as the first line for it to know the interpreter it needs to use to launch the script. The shebang line should match the following example:
+
+    #!/usr/bin/env [name_of_interpreter_executable]


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


[6/6] cordova-app-hello-world git commit: Merge branch 'copy-from-app-hello-world'

Posted by st...@apache.org.
Merge branch 'copy-from-app-hello-world'


Project: http://git-wip-us.apache.org/repos/asf/cordova-app-hello-world/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-app-hello-world/commit/71499c24
Tree: http://git-wip-us.apache.org/repos/asf/cordova-app-hello-world/tree/71499c24
Diff: http://git-wip-us.apache.org/repos/asf/cordova-app-hello-world/diff/71499c24

Branch: refs/heads/master
Commit: 71499c241213c23ea53aa53b6063f9fdbd60792a
Parents: a574704 7325d13
Author: Steve Gill <st...@gmail.com>
Authored: Mon Mar 9 17:40:12 2015 -0700
Committer: Steve Gill <st...@gmail.com>
Committed: Mon Mar 9 17:40:12 2015 -0700

----------------------------------------------------------------------
 RELEASENOTES.md |  21 ++++++
 VERSION         |   1 -
 config.xml      |  12 ++++
 hooks/README.md | 196 +++++++++++++++++++++++++++++++++++++++++++++++++++
 package.json    |  14 ++++
 5 files changed, 243 insertions(+), 1 deletion(-)
----------------------------------------------------------------------



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