You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by ag...@apache.org on 2013/01/18 18:23:12 UTC
[1/3] js commit: Use modulemapper for the File plugin.
Use modulemapper for the File plugin.
This *should* be semantically the same as before.
Project: http://git-wip-us.apache.org/repos/asf/cordova-js/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-js/commit/3c6b56ea
Tree: http://git-wip-us.apache.org/repos/asf/cordova-js/tree/3c6b56ea
Diff: http://git-wip-us.apache.org/repos/asf/cordova-js/diff/3c6b56ea
Branch: refs/heads/symbolmapping
Commit: 3c6b56eabde5e7bd0ce8ecba9fc99f9e765cd5a5
Parents: d989ba1
Author: Andrew Grieve <ag...@chromium.org>
Authored: Thu Jan 17 11:57:51 2013 -0500
Committer: Andrew Grieve <ag...@chromium.org>
Committed: Fri Jan 18 12:22:05 2013 -0500
----------------------------------------------------------------------
lib/android/plugin/file/symbols.js | 25 ++++++++++++
lib/common/common.js | 54 --------------------------
lib/common/plugin/file/symbols.js | 25 ++++++++++++
lib/common/plugin/file/symbolshelper.js | 40 +++++++++++++++++++
lib/ios/platform.js | 9 ----
lib/ios/plugin/file/symbols.js | 26 ++++++++++++
lib/tizen/platform.js | 9 ----
lib/tizen/plugin/file/symbols.js | 28 +++++++++++++
lib/webos/platform.js | 8 ----
lib/webos/plugin/file/symbols.js | 27 +++++++++++++
lib/windows8/platform.js | 6 ---
lib/windows8/plugin/file/symbols.js | 27 +++++++++++++
lib/windowsphone/platform.js | 6 ---
lib/windowsphone/plugin/file/symbols.js | 28 +++++++++++++
14 files changed, 226 insertions(+), 92 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-js/blob/3c6b56ea/lib/android/plugin/file/symbols.js
----------------------------------------------------------------------
diff --git a/lib/android/plugin/file/symbols.js b/lib/android/plugin/file/symbols.js
new file mode 100644
index 0000000..baea8ed
--- /dev/null
+++ b/lib/android/plugin/file/symbols.js
@@ -0,0 +1,25 @@
+/*
+ * 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.
+ *
+*/
+
+
+var modulemapper = require('cordova/modulemapper'),
+ symbolshelper = require('cordova/plugin/file/symbolshelper');
+
+symbolshelper(modulemapper.clobbers);
http://git-wip-us.apache.org/repos/asf/cordova-js/blob/3c6b56ea/lib/common/common.js
----------------------------------------------------------------------
diff --git a/lib/common/common.js b/lib/common/common.js
index 2dbe248..8472fc5 100644
--- a/lib/common/common.js
+++ b/lib/common/common.js
@@ -148,54 +148,9 @@ module.exports = {
device: {
path: 'cordova/plugin/device'
},
- DirectoryEntry: {
- path: 'cordova/plugin/DirectoryEntry'
- },
- DirectoryReader: {
- path: 'cordova/plugin/DirectoryReader'
- },
- Entry: {
- path: 'cordova/plugin/Entry'
- },
- File: {
- path: 'cordova/plugin/File'
- },
- FileEntry: {
- path: 'cordova/plugin/FileEntry'
- },
- FileError: {
- path: 'cordova/plugin/FileError'
- },
- FileReader: {
- path: 'cordova/plugin/FileReader'
- },
- FileSystem: {
- path: 'cordova/plugin/FileSystem'
- },
- FileTransfer: {
- path: 'cordova/plugin/FileTransfer'
- },
- FileTransferError: {
- path: 'cordova/plugin/FileTransferError'
- },
- FileUploadOptions: {
- path: 'cordova/plugin/FileUploadOptions'
- },
- FileUploadResult: {
- path: 'cordova/plugin/FileUploadResult'
- },
- FileWriter: {
- path: 'cordova/plugin/FileWriter'
- },
- Flags: {
- path: 'cordova/plugin/Flags'
- },
GlobalizationError: {
path: 'cordova/plugin/GlobalizationError'
},
- LocalFileSystem: {
- path: 'cordova/plugin/LocalFileSystem'
- },
Media: {
path: 'cordova/plugin/Media'
},
@@ -208,9 +163,6 @@ module.exports = {
MediaFileData:{
path: 'cordova/plugin/MediaFileData'
},
- Metadata:{
- path: 'cordova/plugin/Metadata'
- },
Position: {
path: 'cordova/plugin/Position'
},
@@ -219,12 +171,6 @@ module.exports = {
},
ProgressEvent: {
path: 'cordova/plugin/ProgressEvent'
- },
- requestFileSystem:{
- path: 'cordova/plugin/requestFileSystem'
- },
- resolveLocalFileSystemURI:{
- path: 'cordova/plugin/resolveLocalFileSystemURI'
}
},
clobbers: {
http://git-wip-us.apache.org/repos/asf/cordova-js/blob/3c6b56ea/lib/common/plugin/file/symbols.js
----------------------------------------------------------------------
diff --git a/lib/common/plugin/file/symbols.js b/lib/common/plugin/file/symbols.js
new file mode 100644
index 0000000..b260a54
--- /dev/null
+++ b/lib/common/plugin/file/symbols.js
@@ -0,0 +1,25 @@
+/*
+ * 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.
+ *
+*/
+
+
+var modulemapper = require('cordova/modulemapper'),
+ symbolshelper = require('cordova/plugin/file/symbolshelper');
+
+symbolshelper(modulemapper.defaults);
http://git-wip-us.apache.org/repos/asf/cordova-js/blob/3c6b56ea/lib/common/plugin/file/symbolshelper.js
----------------------------------------------------------------------
diff --git a/lib/common/plugin/file/symbolshelper.js b/lib/common/plugin/file/symbolshelper.js
new file mode 100644
index 0000000..5ef5713
--- /dev/null
+++ b/lib/common/plugin/file/symbolshelper.js
@@ -0,0 +1,40 @@
+/*
+ * 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.
+ *
+*/
+
+module.exports = function(exportFunc) {
+ exportFunc('cordova/plugin/DirectoryEntry', 'DirectoryEntry');
+ exportFunc('cordova/plugin/DirectoryReader', 'DirectoryReader');
+ exportFunc('cordova/plugin/Entry', 'Entry');
+ exportFunc('cordova/plugin/File', 'File');
+ exportFunc('cordova/plugin/FileEntry', 'FileEntry');
+ exportFunc('cordova/plugin/FileError', 'FileError');
+ exportFunc('cordova/plugin/FileReader', 'FileReader');
+ exportFunc('cordova/plugin/FileSystem', 'FileSystem');
+ exportFunc('cordova/plugin/FileTransfer', 'FileTransfer');
+ exportFunc('cordova/plugin/FileTransferError', 'FileTransferError');
+ exportFunc('cordova/plugin/FileUploadOptions', 'FileUploadOptions');
+ exportFunc('cordova/plugin/FileUploadResult', 'FileUploadResult');
+ exportFunc('cordova/plugin/FileWriter', 'FileWriter');
+ exportFunc('cordova/plugin/Flags', 'Flags');
+ exportFunc('cordova/plugin/LocalFileSystem', 'LocalFileSystem');
+ exportFunc('cordova/plugin/Metadata', 'Metadata');
+ exportFunc('cordova/plugin/requestFileSystem', 'requestFileSystem');
+ exportFunc('cordova/plugin/resolveLocalFileSystemURI', 'resolveLocalFileSystemURI');
+};
http://git-wip-us.apache.org/repos/asf/cordova-js/blob/3c6b56ea/lib/ios/platform.js
----------------------------------------------------------------------
diff --git a/lib/ios/platform.js b/lib/ios/platform.js
index eb62df5..9470448 100644
--- a/lib/ios/platform.js
+++ b/lib/ios/platform.js
@@ -24,12 +24,6 @@ module.exports = {
initialize:function() {
},
clobbers: {
- File: { // exists natively, override
- path: "cordova/plugin/File"
- },
- FileReader: { // exists natively, override
- path: "cordova/plugin/FileReader"
- },
MediaError: { // exists natively, override
path: "cordova/plugin/MediaError"
},
@@ -44,9 +38,6 @@ module.exports = {
Contact:{
path: "cordova/plugin/ios/Contact"
},
- Entry:{
- path: "cordova/plugin/ios/Entry"
- },
navigator:{
children:{
notification:{
http://git-wip-us.apache.org/repos/asf/cordova-js/blob/3c6b56ea/lib/ios/plugin/file/symbols.js
----------------------------------------------------------------------
diff --git a/lib/ios/plugin/file/symbols.js b/lib/ios/plugin/file/symbols.js
new file mode 100644
index 0000000..8fac210
--- /dev/null
+++ b/lib/ios/plugin/file/symbols.js
@@ -0,0 +1,26 @@
+/*
+ * 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.
+ *
+*/
+
+
+var modulemapper = require('cordova/modulemapper'),
+ symbolshelper = require('cordova/plugin/file/symbolshelper');
+
+symbolshelper(modulemapper.clobbers);
+modulemapper.merges('cordova/plugin/ios/Entry', 'Entry');
http://git-wip-us.apache.org/repos/asf/cordova-js/blob/3c6b56ea/lib/tizen/platform.js
----------------------------------------------------------------------
diff --git a/lib/tizen/platform.js b/lib/tizen/platform.js
index 09f1e34..48cd26a 100644
--- a/lib/tizen/platform.js
+++ b/lib/tizen/platform.js
@@ -25,15 +25,6 @@ module.exports = {
clobbers: {
device: {
path: "cordova/plugin/tizen/Device"
- },
- File: { // exists natively, override
- path: "cordova/plugin/File"
- },
- FileReader: { // exists natively, override
- path: "cordova/plugin/FileReader"
- },
- FileError: { //exists natively, override
- path: "cordova/plugin/FileError"
}
},
merges: {
http://git-wip-us.apache.org/repos/asf/cordova-js/blob/3c6b56ea/lib/tizen/plugin/file/symbols.js
----------------------------------------------------------------------
diff --git a/lib/tizen/plugin/file/symbols.js b/lib/tizen/plugin/file/symbols.js
new file mode 100644
index 0000000..0e726f4
--- /dev/null
+++ b/lib/tizen/plugin/file/symbols.js
@@ -0,0 +1,28 @@
+/*
+ * 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.
+ *
+*/
+
+
+var modulemapper = require('cordova/modulemapper'),
+ symbolshelper = require('cordova/plugin/file/symbolshelper');
+
+symbolshelper(modulemapper.defaults);
+modulemapper.clobbers('cordova/plugin/File', 'File');
+modulemapper.clobbers('cordova/plugin/FileReader', 'FileReader');
+modulemapper.clobbers('cordova/plugin/FileError', 'FileError');
http://git-wip-us.apache.org/repos/asf/cordova-js/blob/3c6b56ea/lib/webos/platform.js
----------------------------------------------------------------------
diff --git a/lib/webos/platform.js b/lib/webos/platform.js
index cb0d7e5..a42f95e 100644
--- a/lib/webos/platform.js
+++ b/lib/webos/platform.js
@@ -94,14 +94,6 @@ module.exports = {
});
},
- clobbers: {
- requestFileSystem:{
- path: 'cordova/plugin/webos/requestfilesystem'
- },
- FileReader: {
- path: "cordova/plugin/webos/filereader"
- }
- },
merges: {
navigator: {
children: {
http://git-wip-us.apache.org/repos/asf/cordova-js/blob/3c6b56ea/lib/webos/plugin/file/symbols.js
----------------------------------------------------------------------
diff --git a/lib/webos/plugin/file/symbols.js b/lib/webos/plugin/file/symbols.js
new file mode 100644
index 0000000..50d7036
--- /dev/null
+++ b/lib/webos/plugin/file/symbols.js
@@ -0,0 +1,27 @@
+/*
+ * 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.
+ *
+*/
+
+
+var modulemapper = require('cordova/modulemapper'),
+ symbolshelper = require('cordova/plugin/file/symbolshelper');
+
+symbolshelper(modulemapper.defaults);
+modulemapper.clobbers('cordova/plugin/webos/requestfilesystem', 'requestFileSystem');
+modulemapper.clobbers('cordova/plugin/webos/filereader', 'FileReader');
http://git-wip-us.apache.org/repos/asf/cordova-js/blob/3c6b56ea/lib/windows8/platform.js
----------------------------------------------------------------------
diff --git a/lib/windows8/platform.js b/lib/windows8/platform.js
index 5ebb2d1..765a5c5 100755
--- a/lib/windows8/platform.js
+++ b/lib/windows8/platform.js
@@ -107,12 +107,6 @@ module.exports = {
}
}
},
- FileReader: {
- path: 'cordova/plugin/FileReader'
- },
- File: {
- path: 'cordova/plugin/File'
- },
MediaError: {
path: 'cordova/plugin/MediaError'
}
http://git-wip-us.apache.org/repos/asf/cordova-js/blob/3c6b56ea/lib/windows8/plugin/file/symbols.js
----------------------------------------------------------------------
diff --git a/lib/windows8/plugin/file/symbols.js b/lib/windows8/plugin/file/symbols.js
new file mode 100644
index 0000000..12a1c8c
--- /dev/null
+++ b/lib/windows8/plugin/file/symbols.js
@@ -0,0 +1,27 @@
+/*
+ * 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.
+ *
+*/
+
+
+var modulemapper = require('cordova/modulemapper'),
+ symbolshelper = require('cordova/plugin/file/symbolshelper');
+
+symbolshelper(modulemapper.defaults);
+modulemapper.clobbers('cordova/plugin/File', 'File');
+modulemapper.clobbers('cordova/plugin/FileReader', 'FileReader');
http://git-wip-us.apache.org/repos/asf/cordova-js/blob/3c6b56ea/lib/windowsphone/platform.js
----------------------------------------------------------------------
diff --git a/lib/windowsphone/platform.js b/lib/windowsphone/platform.js
index 6dbb658..ee25843 100644
--- a/lib/windowsphone/platform.js
+++ b/lib/windowsphone/platform.js
@@ -36,9 +36,6 @@ module.exports = {
initialize:function() {
window.alert = window.alert || require("cordova/plugin/notification").alert;
window.confirm = window.confirm || require("cordova/plugin/notification").confirm;
- window.FileReader = require("cordova/plugin/FileReader");
- window.File = require("cordova/plugin/File");
-
// Inject a listener for the backbutton, and tell native to override the flag (true/false) when we have 1 or more, or 0, listeners
var backButtonChannel = cordova.addDocumentEventHandler('backbutton');
@@ -70,9 +67,6 @@ module.exports = {
},
console:{
path: "cordova/plugin/windowsphone/console"
- },
- FileTransfer: {
- path: 'cordova/plugin/windowsphone/FileTransfer'
}
}
};
http://git-wip-us.apache.org/repos/asf/cordova-js/blob/3c6b56ea/lib/windowsphone/plugin/file/symbols.js
----------------------------------------------------------------------
diff --git a/lib/windowsphone/plugin/file/symbols.js b/lib/windowsphone/plugin/file/symbols.js
new file mode 100644
index 0000000..1929144
--- /dev/null
+++ b/lib/windowsphone/plugin/file/symbols.js
@@ -0,0 +1,28 @@
+/*
+ * 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.
+ *
+*/
+
+
+var modulemapper = require('cordova/modulemapper'),
+ symbolshelper = require('cordova/plugin/file/symbolshelper');
+
+symbolshelper(modulemapper.defaults);
+modulemapper.clobbers('cordova/plugin/File', 'File');
+modulemapper.clobbers('cordova/plugin/FileReader', 'FileReader');
+modulemapper.clobbers('cordova/plugin/windowsphone/FileTransfer', 'FileTransfer');