From 65bb0af8222d338dc9273081e257ce5abe31efd2 Mon Sep 17 00:00:00 2001
From: Pawel Andruszkiewicz
Date: Thu, 7 Apr 2016 14:19:18 +0200
Subject: [PATCH] [FileTransfer] Code structure changed to match cordova
architecture.
Change-Id: I22a8e934fd8800ec9dbcdc4b0dba1b469881428e
Signed-off-by: Pawel Andruszkiewicz
---
src/cordova-api.gyp | 1 -
src/filetransfer/cordova_filetransfer.gyp | 25 ------------
.../cordova_filetransfer_extension.cc | 39 -------------------
.../cordova_filetransfer_extension.h | 36 -----------------
src/lib/cordova_plugins.js | 5 +++
.../tizen/FileTransfer.js} | 4 --
6 files changed, 5 insertions(+), 105 deletions(-)
delete mode 100644 src/filetransfer/cordova_filetransfer.gyp
delete mode 100755 src/filetransfer/cordova_filetransfer_extension.cc
delete mode 100755 src/filetransfer/cordova_filetransfer_extension.h
rename src/{filetransfer/cordova_filetransfer_api.js => lib/plugins/cordova-plugin-file-transfer/tizen/FileTransfer.js} (98%)
diff --git a/src/cordova-api.gyp b/src/cordova-api.gyp
index 970edd7..8b1b5f2 100644
--- a/src/cordova-api.gyp
+++ b/src/cordova-api.gyp
@@ -12,7 +12,6 @@
'file/cordova_file.gyp:*',
'globalization/cordova_globalization.gyp:*',
'networkinformation/cordova_networkinformation.gyp:*',
- 'filetransfer/cordova_filetransfer.gyp:*',
'media/cordova_media.gyp:*',
],
},
diff --git a/src/filetransfer/cordova_filetransfer.gyp b/src/filetransfer/cordova_filetransfer.gyp
deleted file mode 100644
index 661d2be..0000000
--- a/src/filetransfer/cordova_filetransfer.gyp
+++ /dev/null
@@ -1,25 +0,0 @@
-{
- 'includes':[
- '/usr/include/webapi-plugins/src/common/common.gypi',
- ],
- 'targets': [
- {
- 'target_name': 'tizen_cordova_filetransfer',
- 'type': 'loadable_module',
- 'sources': [
- 'cordova_filetransfer_api.js',
- 'cordova_filetransfer_extension.cc',
- 'cordova_filetransfer_extension.h',
- ],
- 'include_dirs': [
- '../',
- '<(SHARED_INTERMEDIATE_DIR)',
- ],
- 'variables': {
- 'packages': [
- 'webapi-plugins',
- ],
- },
- },
- ],
-}
diff --git a/src/filetransfer/cordova_filetransfer_extension.cc b/src/filetransfer/cordova_filetransfer_extension.cc
deleted file mode 100755
index 945f598..0000000
--- a/src/filetransfer/cordova_filetransfer_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 "filetransfer/cordova_filetransfer_extension.h"
-
-// This will be generated from cordova_filetransfer_api.js
-extern const char kSource_cordova_filetransfer_api[];
-
-common::Extension* CreateExtension() {
- return new extension::cordova::filetransfer::CordovaFiletransferExtension();
-}
-
-namespace extension {
-namespace cordova {
-namespace filetransfer {
-
-CordovaFiletransferExtension::CordovaFiletransferExtension() {
- SetExtensionName("tizen.cordova.filetransfer");
- SetJavaScriptAPI(kSource_cordova_filetransfer_api);
-}
-
-CordovaFiletransferExtension::~CordovaFiletransferExtension() {}
-
-} // filetransfer
-} // cordova
-} // extension
diff --git a/src/filetransfer/cordova_filetransfer_extension.h b/src/filetransfer/cordova_filetransfer_extension.h
deleted file mode 100755
index 720590b..0000000
--- a/src/filetransfer/cordova_filetransfer_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 FILETRANSFER_CORDOVA_FILETRANSFER_EXTENSION_H_
-#define FILETRANSFER_CORDOVA_FILETRANSFER_EXTENSION_H_
-
-#include
-
-namespace extension {
-namespace cordova {
-namespace filetransfer {
-
-class CordovaFiletransferExtension : public common::Extension {
- public:
- CordovaFiletransferExtension();
- virtual ~CordovaFiletransferExtension();
-};
-
-} // filetransfer
-} // cordova
-} // extension
-
-#endif // FILETRANSFER_CORDOVA_FILETRANSFER_EXTENSION_H_
diff --git a/src/lib/cordova_plugins.js b/src/lib/cordova_plugins.js
index 699af6e..a19039e 100644
--- a/src/lib/cordova_plugins.js
+++ b/src/lib/cordova_plugins.js
@@ -219,6 +219,11 @@ module.exports = [
"window.FileTransfer"
]
},
+ {
+ "file": "plugins/cordova-plugin-file-transfer/tizen/FileTransfer.js",
+ "id": "cordova-plugin-file-transfer.tizen.FileTransfer",
+ "runs": true
+ },
{
"file": "plugins/cordova-plugin-network-information/www/network.js",
"id": "cordova-plugin-network-information.network",
diff --git a/src/filetransfer/cordova_filetransfer_api.js b/src/lib/plugins/cordova-plugin-file-transfer/tizen/FileTransfer.js
similarity index 98%
rename from src/filetransfer/cordova_filetransfer_api.js
rename to src/lib/plugins/cordova-plugin-file-transfer/tizen/FileTransfer.js
index 305f3ce..692e75e 100755
--- a/src/filetransfer/cordova_filetransfer_api.js
+++ b/src/lib/plugins/cordova-plugin-file-transfer/tizen/FileTransfer.js
@@ -289,8 +289,4 @@ console.log('Loaded cordova.file-transfer API');
// TODO: remove when added to public cordova repository -> begin
});
-
-exports = function(require) {
- require('cordova-tizen').addPlugin('cordova-plugin-file-transfer.FileTransfer', plugin_name, 'runs');
-};
// TODO: remove -> end
--
2.34.1