You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by an...@apache.org on 2014/03/27 13:59:52 UTC
[1/5] git commit: src/platforms.js: Adding tizen.
Repository: cordova-plugman
Updated Branches:
refs/heads/master 97fa482d0 -> 2f18534b7
src/platforms.js: Adding tizen.
Project: http://git-wip-us.apache.org/repos/asf/cordova-plugman/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugman/commit/7127d28d
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugman/tree/7127d28d
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugman/diff/7127d28d
Branch: refs/heads/master
Commit: 7127d28deb4d9637a0e199d65368210c1e2bd1c5
Parents: 97fa482
Author: Gabriel Schulhof <ga...@intel.com>
Authored: Wed Oct 23 14:35:32 2013 +0300
Committer: Gabriel Schulhof <ga...@intel.com>
Committed: Tue Mar 25 23:17:13 2014 +0200
----------------------------------------------------------------------
src/platforms.js | 3 ++-
src/platforms/tizen.js | 14 ++++++++++++++
2 files changed, 16 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/7127d28d/src/platforms.js
----------------------------------------------------------------------
diff --git a/src/platforms.js b/src/platforms.js
index 0cb3bcf..a2ad634 100644
--- a/src/platforms.js
+++ b/src/platforms.js
@@ -7,5 +7,6 @@ module.exports = {
'wp8': require('./platforms/wp8'),
'windows8' : require('./platforms/windows8'),
'firefoxos': require('./platforms/firefoxos'),
- 'ubuntu': require('./platforms/ubuntu')
+ 'ubuntu': require('./platforms/ubuntu'),
+ 'tizen': require('./platforms/tizen')
};
http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/7127d28d/src/platforms/tizen.js
----------------------------------------------------------------------
diff --git a/src/platforms/tizen.js b/src/platforms/tizen.js
new file mode 100644
index 0000000..d411709
--- /dev/null
+++ b/src/platforms/tizen.js
@@ -0,0 +1,14 @@
+var path = require('path')
+ , xml_helpers = require('../util/xml-helpers')
+ , common = require('./common');
+
+module.exports = {
+ www_dir: function(project_dir) {
+ return path.join(project_dir, 'www');
+ },
+ package_name:function(project_dir) {
+ var config_path = path.join(module.exports.www_dir(project_dir), 'config.xml');
+ var widget_doc = xml_helpers.parseElementtreeSync(config_path);
+ return widget_doc._root.attrib['id'];
+ }
+};
[5/5] git commit: Tizen: Copy platform file verbatim from firefoxos
Posted by an...@apache.org.
Tizen: Copy platform file verbatim from firefoxos
Project: http://git-wip-us.apache.org/repos/asf/cordova-plugman/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugman/commit/2f18534b
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugman/tree/2f18534b
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugman/diff/2f18534b
Branch: refs/heads/master
Commit: 2f18534b79b51955b534545356172ea4f6d5ebd9
Parents: 03b1299
Author: Gabriel Schulhof <ga...@intel.com>
Authored: Thu Mar 27 11:36:45 2014 +0200
Committer: Gabriel Schulhof <ga...@intel.com>
Committed: Thu Mar 27 11:36:45 2014 +0200
----------------------------------------------------------------------
src/platforms/tizen.js | 63 ++++++++++++++++++++++++++++++++++++++++++---
1 file changed, 60 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/2f18534b/src/platforms/tizen.js
----------------------------------------------------------------------
diff --git a/src/platforms/tizen.js b/src/platforms/tizen.js
index d411709..6d42024 100644
--- a/src/platforms/tizen.js
+++ b/src/platforms/tizen.js
@@ -1,14 +1,71 @@
var path = require('path')
- , xml_helpers = require('../util/xml-helpers')
- , common = require('./common');
+ , fs = require('fs')
+ , common = require('./common')
+ , xml_helpers = require(path.join(__dirname, '..', 'util', 'xml-helpers'));
module.exports = {
www_dir: function(project_dir) {
return path.join(project_dir, 'www');
},
package_name:function(project_dir) {
- var config_path = path.join(module.exports.www_dir(project_dir), 'config.xml');
+ // preferred location if cordova >= 3.4
+ var preferred_path = path.join(project_dir, 'config.xml');
+ if (!fs.existsSync(preferred_path)) {
+ // older location
+ old_config_path = path.join(module.exports.www_dir(project_dir), 'config.xml');
+ if (!fs.existsSync(old_config_path)) {
+ // output newer location and fail reading
+ config_path = preferred_path;
+ require('../../plugman').emit('verbose', 'unable to find '+config_path);
+ } else {
+ config_path = old_config_path;
+ }
+ } else {
+ config_path = preferred_path;
+ }
var widget_doc = xml_helpers.parseElementtreeSync(config_path);
return widget_doc._root.attrib['id'];
+ },
+ "source-file":{
+ install:function(source_el, plugin_dir, project_dir, plugin_id) {
+ var dest = path.join(source_el.attrib['target-dir'], path.basename(source_el.attrib['src']));
+ common.copyFile(plugin_dir, source_el.attrib['src'], project_dir, dest);
+ },
+ uninstall:function(source_el, project_dir, plugin_id) {
+ var dest = path.join(source_el.attrib['target-dir'], path.basename(source_el.attrib['src']));
+ common.removeFile(project_dir, dest);
+ }
+ },
+ "header-file": {
+ install:function(source_el, plugin_dir, project_dir, plugin_id) {
+ require('../../plugman').emit('verbose', 'header-fileinstall is not supported for firefoxos');
+ },
+ uninstall:function(source_el, project_dir, plugin_id) {
+ require('../../plugman').emit('verbose', 'header-file.uninstall is not supported for firefoxos');
+ }
+ },
+ "resource-file":{
+ install:function(el, plugin_dir, project_dir, plugin_id) {
+ require('../../plugman').emit('verbose', 'resource-file.install is not supported for firefoxos');
+ },
+ uninstall:function(el, project_dir, plugin_id) {
+ require('../../plugman').emit('verbose', 'resource-file.uninstall is not supported for firefoxos');
+ }
+ },
+ "framework": {
+ install:function(source_el, plugin_dir, project_dir, plugin_id) {
+ require('../../plugman').emit('verbose', 'framework.install is not supported for firefoxos');
+ },
+ uninstall:function(source_el, project_dir, plugin_id) {
+ require('../../plugman').emit('verbose', 'framework.uninstall is not supported for firefoxos');
+ }
+ },
+ "lib-file": {
+ install:function(source_el, plugin_dir, project_dir, plugin_id) {
+ require('../../plugman').emit('verbose', 'lib-file.install is not supported for firefoxos');
+ },
+ uninstall:function(source_el, project_dir, plugin_id) {
+ require('../../plugman').emit('verbose', 'lib-file.uninstall is not supported for firefoxos');
+ }
}
};
[4/5] git commit: README.md: Place "Tizen" in alphabetical order
Posted by an...@apache.org.
README.md: Place "Tizen" in alphabetical order
Project: http://git-wip-us.apache.org/repos/asf/cordova-plugman/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugman/commit/03b12997
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugman/tree/03b12997
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugman/diff/03b12997
Branch: refs/heads/master
Commit: 03b129971b948765299f5e9f1aad898f9de53ad0
Parents: d6f3918
Author: Gabriel Schulhof <ga...@intel.com>
Authored: Thu Mar 27 11:36:14 2014 +0200
Committer: Gabriel Schulhof <ga...@intel.com>
Committed: Thu Mar 27 11:36:14 2014 +0200
----------------------------------------------------------------------
README.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/03b12997/README.md
----------------------------------------------------------------------
diff --git a/README.md b/README.md
index 7ac71d5..41c2314 100644
--- a/README.md
+++ b/README.md
@@ -28,9 +28,9 @@ You must have `git` on your PATH to be able to install plugins directly from rem
* Amazon Fire OS
* Android
* BlackBerry 10
+* Tizen
* Windows Phone (7+8)
* Windows 8
-* Tizen
## Command Line Usage
plugman help
[2/5] git commit: README.md: Adding Tizen to list of supported
platforms
Posted by an...@apache.org.
README.md: Adding Tizen to list of supported platforms
Project: http://git-wip-us.apache.org/repos/asf/cordova-plugman/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugman/commit/d1633a3c
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugman/tree/d1633a3c
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugman/diff/d1633a3c
Branch: refs/heads/master
Commit: d1633a3c1f581f553bad58f4d494f378188fc989
Parents: 7127d28
Author: Gabriel Schulhof <ga...@intel.com>
Authored: Wed Jan 29 12:08:38 2014 +0200
Committer: Gabriel Schulhof <ga...@intel.com>
Committed: Tue Mar 25 23:17:48 2014 +0200
----------------------------------------------------------------------
README.md | 1 +
1 file changed, 1 insertion(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/d1633a3c/README.md
----------------------------------------------------------------------
diff --git a/README.md b/README.md
index 62f7596..7ac71d5 100644
--- a/README.md
+++ b/README.md
@@ -30,6 +30,7 @@ You must have `git` on your PATH to be able to install plugins directly from rem
* BlackBerry 10
* Windows Phone (7+8)
* Windows 8
+* Tizen
## Command Line Usage
plugman help
[3/5] git commit: Adding spec for Tizen platform
Posted by an...@apache.org.
Adding spec for Tizen platform
Project: http://git-wip-us.apache.org/repos/asf/cordova-plugman/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugman/commit/d6f3918b
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugman/tree/d6f3918b
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugman/diff/d6f3918b
Branch: refs/heads/master
Commit: d6f3918b5437ce639fb8b54c9f8d8fdda86c1298
Parents: d1633a3
Author: Gabriel Schulhof <ga...@intel.com>
Authored: Mon Feb 3 16:53:52 2014 +0200
Committer: Gabriel Schulhof <ga...@intel.com>
Committed: Tue Mar 25 23:18:03 2014 +0200
----------------------------------------------------------------------
package.json | 1 +
spec/platforms/tizen.spec.js | 54 +++++++++++++++++++++++
spec/plugins/DummyPlugin/plugin.xml | 5 +++
spec/plugins/DummyPlugin/src/tizen/dummer.js | 0
spec/projects/tizen/www/config.xml | 2 +
5 files changed, 62 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/d6f3918b/package.json
----------------------------------------------------------------------
diff --git a/package.json b/package.json
index 5ddf316..bda3c2a 100644
--- a/package.json
+++ b/package.json
@@ -34,6 +34,7 @@
"request": "2.22.0"
},
"devDependencies": {
+ "temp": "0.6.x",
"jasmine-node": "1.7.0",
"osenv": "0.0.x"
},
http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/d6f3918b/spec/platforms/tizen.spec.js
----------------------------------------------------------------------
diff --git a/spec/platforms/tizen.spec.js b/spec/platforms/tizen.spec.js
new file mode 100644
index 0000000..372e4d3
--- /dev/null
+++ b/spec/platforms/tizen.spec.js
@@ -0,0 +1,54 @@
+/*
+ *
+ *
+ * Licensed 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 tizen = require('../../src/platforms/tizen'),
+ common = require('../../src/platforms/common'),
+ temp = require('temp'),
+ os = require('osenv'),
+ fs = require('fs'),
+ et = require('elementtree'),
+ path = require('path'),
+ tizen_project = path.join(__dirname, '..', 'projects', 'tizen'),
+ destination = temp.path(),
+ shell = require('shelljs'),
+ dummyPluginPath = path.join(__dirname, '..', 'plugins', 'DummyPlugin'),
+ dummyPlugin = et.XML(fs.readFileSync(
+ path.join(dummyPluginPath, 'plugin.xml'), {encoding: "utf-8"})),
+ dummySources = dummyPlugin
+ .find('./platform[@name="tizen"]')
+ .findall('./source-file');
+
+describe('Tizen project handler', function() {
+ describe('www_dir method', function() {
+ it('should append www to the directory passed in', function() {
+ expect(tizen.www_dir(path.sep)).toEqual(path.join(path.sep, 'www'));
+ });
+ });
+ describe('Manipulating project files', function() {
+ beforeEach(function() {
+ shell.cp('-rf', path.join(tizen_project, '*'), destination);
+ });
+ afterEach(function() {
+ shell.rm('-rf', destination);
+ });
+ describe('package_name method', function() {
+ it('should return the id of the config.xml root element', function() {
+ expect(tizen.package_name(destination)).toEqual("TizenTestPackage");
+ });
+ });
+ });
+});
http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/d6f3918b/spec/plugins/DummyPlugin/plugin.xml
----------------------------------------------------------------------
diff --git a/spec/plugins/DummyPlugin/plugin.xml b/spec/plugins/DummyPlugin/plugin.xml
index 92a8151..bc71119 100644
--- a/spec/plugins/DummyPlugin/plugin.xml
+++ b/spec/plugins/DummyPlugin/plugin.xml
@@ -161,6 +161,11 @@
</js-module>
</platform>
+ <!-- tizen -->
+ <platform name="tizen">
+ <source-file src="src/tizen/dummer.js"/>
+ </platform>
+
<!-- windows8 -->
<platform name="windows8">
<config-file target="config.xml" parent="/*">
http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/d6f3918b/spec/plugins/DummyPlugin/src/tizen/dummer.js
----------------------------------------------------------------------
diff --git a/spec/plugins/DummyPlugin/src/tizen/dummer.js b/spec/plugins/DummyPlugin/src/tizen/dummer.js
new file mode 100644
index 0000000..e69de29
http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/d6f3918b/spec/projects/tizen/www/config.xml
----------------------------------------------------------------------
diff --git a/spec/projects/tizen/www/config.xml b/spec/projects/tizen/www/config.xml
new file mode 100644
index 0000000..788f6d4
--- /dev/null
+++ b/spec/projects/tizen/www/config.xml
@@ -0,0 +1,2 @@
+<?xml version='1.0' encoding='utf-8'?>
+<widget id="TizenTestPackage"></widget>