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/17 17:59:32 UTC
[2/2] js commit: Use modulemapper for the File plugin.
Updated Branches:
refs/heads/symbolmapping 403d9311c -> a9eb0111f
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/a9eb0111
Tree: http://git-wip-us.apache.org/repos/asf/cordova-js/tree/a9eb0111
Diff: http://git-wip-us.apache.org/repos/asf/cordova-js/diff/a9eb0111
Branch: refs/heads/symbolmapping
Commit: a9eb0111fc0815a3f9454276c479ebdbb7242a31
Parents: d989ba1
Author: Andrew Grieve <ag...@chromium.org>
Authored: Thu Jan 17 11:57:51 2013 -0500
Committer: Andrew Grieve <ag...@chromium.org>
Committed: Thu Jan 17 11:57:51 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 | 41 +++++++++++++++++++
lib/ios/platform.js | 9 ----
lib/ios/plugin/file/symbols.js | 26 ++++++++++++
lib/tizen/platform.js | 9 ----
lib/tizen/plugin/file/symbols.js | 25 ++++++++++++
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, 224 insertions(+), 92 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-js/blob/a9eb0111/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/a9eb0111/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/a9eb0111/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/a9eb0111/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..5b55e8d
--- /dev/null
+++ b/lib/common/plugin/file/symbolshelper.js
@@ -0,0 +1,41 @@
+/*
+ * 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('DirectoryEntry', 'cordova/plugin/DirectoryEntry');
+ exportFunc('DirectoryReader', 'cordova/plugin/DirectoryReader');
+ exportFunc('Entry', 'cordova/plugin/Entry');
+ exportFunc('File', 'cordova/plugin/File');
+ exportFunc('FileEntry', 'cordova/plugin/FileEntry');
+ exportFunc('FileError', 'cordova/plugin/FileError');
+ exportFunc('FileReader', 'cordova/plugin/FileReader');
+ exportFunc('FileSystem', 'cordova/plugin/FileSystem');
+ exportFunc('FileTransfer', 'cordova/plugin/FileTransfer');
+ exportFunc('FileTransferError', 'cordova/plugin/FileTransferError');
+ exportFunc('FileUploadOptions', 'cordova/plugin/FileUploadOptions');
+ exportFunc('FileUploadResult', 'cordova/plugin/FileUploadResult');
+ exportFunc('FileWriter', 'cordova/plugin/FileWriter');
+ exportFunc('Flags', 'cordova/plugin/Flags');
+ exportFunc('LocalFileSystem', 'cordova/plugin/LocalFileSystem');
+ exportFunc('Metadata', 'cordova/plugin/Metadata');
+ exportFunc('requestFileSystem', 'cordova/plugin/requestFileSystem');
+ exportFunc('resolveLocalFileSystemURI', 'cordova/plugin/resolveLocalFileSystemURI');
+};
http://git-wip-us.apache.org/repos/asf/cordova-js/blob/a9eb0111/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/a9eb0111/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..b450674
--- /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('Entry', 'cordova/plugin/ios/Entry');
http://git-wip-us.apache.org/repos/asf/cordova-js/blob/a9eb0111/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/a9eb0111/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..baea8ed
--- /dev/null
+++ b/lib/tizen/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/a9eb0111/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/a9eb0111/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..b6093ac
--- /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('requestFileSystem', 'cordova/plugin/webos/requestfilesystem');
+modulemapper.clobbers('FileReader', 'cordova/plugin/webos/filereader');
http://git-wip-us.apache.org/repos/asf/cordova-js/blob/a9eb0111/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/a9eb0111/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..dc72502
--- /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('File', 'cordova/plugin/File');
+modulemapper.clobbers('FileReader', 'cordova/plugin/FileReader');
http://git-wip-us.apache.org/repos/asf/cordova-js/blob/a9eb0111/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/a9eb0111/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..10220a2
--- /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('File', 'cordova/plugin/File');
+modulemapper.clobbers('FileReader', 'cordova/plugin/FileReader');
+modulemapper.clobbers('FileTransfer', 'cordova/plugin/windowsphone/FileTransfer');