From e06f67b60e448a7df400b0e43b00a95e7e6ba374 Mon Sep 17 00:00:00 2001 From: Pawel Andruszkiewicz Date: Thu, 7 Apr 2016 13:22:24 +0200 Subject: [PATCH] [Device] Code structure changed to match cordova architecture. Change-Id: I157d52bfb87d82eebd1c12ee618a81e6a0bee88d Signed-off-by: Pawel Andruszkiewicz --- src/cordova-api.gyp | 1 - src/device/cordova_device.gyp | 25 ------------ src/device/cordova_device_extension.cc | 39 ------------------- src/device/cordova_device_extension.h | 36 ----------------- src/lib/cordova_plugins.js | 5 +++ .../cordova-plugin-device/tizen/Device.js} | 4 -- 6 files changed, 5 insertions(+), 105 deletions(-) delete mode 100644 src/device/cordova_device.gyp delete mode 100755 src/device/cordova_device_extension.cc delete mode 100755 src/device/cordova_device_extension.h rename src/{device/cordova_device_api.js => lib/plugins/cordova-plugin-device/tizen/Device.js} (94%) diff --git a/src/cordova-api.gyp b/src/cordova-api.gyp index 0266c84..e4e0e86 100644 --- a/src/cordova-api.gyp +++ b/src/cordova-api.gyp @@ -9,7 +9,6 @@ 'type': 'none', 'dependencies': [ 'cordova/cordova.gyp:*', - 'device/cordova_device.gyp:*', 'devicemotion/cordova_devicemotion.gyp:*', 'dialog/cordova_dialog.gyp:*', 'events/cordova_events.gyp:*', diff --git a/src/device/cordova_device.gyp b/src/device/cordova_device.gyp deleted file mode 100644 index b57f435..0000000 --- a/src/device/cordova_device.gyp +++ /dev/null @@ -1,25 +0,0 @@ -{ - 'includes':[ - '/usr/include/webapi-plugins/src/common/common.gypi', - ], - 'targets': [ - { - 'target_name': 'tizen_cordova_device', - 'type': 'loadable_module', - 'sources': [ - 'cordova_device_api.js', - 'cordova_device_extension.cc', - 'cordova_device_extension.h', - ], - 'include_dirs': [ - '../', - '<(SHARED_INTERMEDIATE_DIR)', - ], - 'variables': { - 'packages': [ - 'webapi-plugins', - ], - }, - }, - ], -} diff --git a/src/device/cordova_device_extension.cc b/src/device/cordova_device_extension.cc deleted file mode 100755 index 7287d0c..0000000 --- a/src/device/cordova_device_extension.cc +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (c) 2015 Samsung Electronics Co., Ltd All Rights Reserved - * - * 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. - */ - -#include "device/cordova_device_extension.h" - -// This will be generated from cordova_device_api.js -extern const char kSource_cordova_device_api[]; - -common::Extension* CreateExtension() { - return new extension::cordova::device::CordovaDeviceExtension(); -} - -namespace extension { -namespace cordova { -namespace device { - -CordovaDeviceExtension::CordovaDeviceExtension() { - SetExtensionName("tizen.cordova.device"); - SetJavaScriptAPI(kSource_cordova_device_api); -} - -CordovaDeviceExtension::~CordovaDeviceExtension() {} - -} // device -} // cordova -} // extension diff --git a/src/device/cordova_device_extension.h b/src/device/cordova_device_extension.h deleted file mode 100755 index 93a8072..0000000 --- a/src/device/cordova_device_extension.h +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (c) 2015 Samsung Electronics Co., Ltd All Rights Reserved - * - * 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. - */ - -#ifndef DEVICE_CORDOVA_DEVICE_EXTENSION_H_ -#define DEVICE_CORDOVA_DEVICE_EXTENSION_H_ - -#include - -namespace extension { -namespace cordova { -namespace device { - -class CordovaDeviceExtension : public common::Extension { - public: - CordovaDeviceExtension(); - virtual ~CordovaDeviceExtension(); -}; - -} // device -} // cordova -} // extension - -#endif // DEVICE_CORDOVA_DEVICE_EXTENSION_H_ diff --git a/src/lib/cordova_plugins.js b/src/lib/cordova_plugins.js index 672cfbd..f85b712 100644 --- a/src/lib/cordova_plugins.js +++ b/src/lib/cordova_plugins.js @@ -21,6 +21,11 @@ module.exports = [ "device" ] }, + { + "file": "plugins/cordova-plugin-device/tizen/Device.js", + "id": "cordova-plugin-device.tizen.Device", + "runs": true + }, { "file": "plugins/cordova-plugin-device-motion/www/accelerometer.js", "id": "cordova-plugin-device-motion.Accelerometer", diff --git a/src/device/cordova_device_api.js b/src/lib/plugins/cordova-plugin-device/tizen/Device.js similarity index 94% rename from src/device/cordova_device_api.js rename to src/lib/plugins/cordova-plugin-device/tizen/Device.js index b154467..34da27c 100755 --- a/src/device/cordova_device_api.js +++ b/src/lib/plugins/cordova-plugin-device/tizen/Device.js @@ -57,8 +57,4 @@ console.log('Loaded cordova.device API'); // TODO: remove when added to public cordova repository -> begin }); - -exports = function(require) { - require('cordova-tizen').addPlugin('cordova-plugin-device.device', plugin_name, 'runs'); -}; // TODO: remove -> end -- 2.34.1