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/08/15 22:26:02 UTC
js commit: [android] Move non-plugin files out of plugins/
subdirectory.
Updated Branches:
refs/heads/master 1be287663 -> 7d5f6f628
[android] Move non-plugin files out of plugins/ subdirectory.
Project: http://git-wip-us.apache.org/repos/asf/cordova-js/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-js/commit/7d5f6f62
Tree: http://git-wip-us.apache.org/repos/asf/cordova-js/tree/7d5f6f62
Diff: http://git-wip-us.apache.org/repos/asf/cordova-js/diff/7d5f6f62
Branch: refs/heads/master
Commit: 7d5f6f6285087675b4afe5512ae70ad5a476da20
Parents: 1be2876
Author: Andrew Grieve <ag...@chromium.org>
Authored: Thu Aug 15 16:24:52 2013 -0400
Committer: Andrew Grieve <ag...@chromium.org>
Committed: Thu Aug 15 16:24:52 2013 -0400
----------------------------------------------------------------------
build/packager.js | 3 +-
lib/android/android/nativeapiprovider.js | 36 ++++++++++++++++++++
lib/android/android/promptbasednativeapi.js | 35 +++++++++++++++++++
lib/android/exec.js | 2 +-
lib/android/plugin/android/nativeapiprovider.js | 36 --------------------
.../plugin/android/promptbasednativeapi.js | 35 -------------------
test/android/test.exec.js | 2 +-
7 files changed, 74 insertions(+), 75 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-js/blob/7d5f6f62/build/packager.js
----------------------------------------------------------------------
diff --git a/build/packager.js b/build/packager.js
index 71433ce..c154c5c 100644
--- a/build/packager.js
+++ b/build/packager.js
@@ -102,8 +102,7 @@ packager.bundle = function(platform, debug, commitId) {
copyProps(modules, collectFiles(path.join('lib', platform)));
if (platform === 'test') {
- // TODO: move plugin files used in tests out of plugins
- copyProps(modules, collectFiles(path.join('lib', 'android', 'plugin', 'android'), 'plugin/android/'));
+ copyProps(modules, collectFiles(path.join('lib', 'android', 'android'), 'android/'));
}
var output = [];
http://git-wip-us.apache.org/repos/asf/cordova-js/blob/7d5f6f62/lib/android/android/nativeapiprovider.js
----------------------------------------------------------------------
diff --git a/lib/android/android/nativeapiprovider.js b/lib/android/android/nativeapiprovider.js
new file mode 100644
index 0000000..2e9aa67
--- /dev/null
+++ b/lib/android/android/nativeapiprovider.js
@@ -0,0 +1,36 @@
+/*
+ * 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.
+*/
+
+/**
+ * Exports the ExposedJsApi.java object if available, otherwise exports the PromptBasedNativeApi.
+ */
+
+var nativeApi = this._cordovaNative || require('cordova/android/promptbasednativeapi');
+var currentApi = nativeApi;
+
+module.exports = {
+ get: function() { return currentApi; },
+ setPreferPrompt: function(value) {
+ currentApi = value ? require('cordova/android/promptbasednativeapi') : nativeApi;
+ },
+ // Used only by tests.
+ set: function(value) {
+ currentApi = value;
+ }
+};
http://git-wip-us.apache.org/repos/asf/cordova-js/blob/7d5f6f62/lib/android/android/promptbasednativeapi.js
----------------------------------------------------------------------
diff --git a/lib/android/android/promptbasednativeapi.js b/lib/android/android/promptbasednativeapi.js
new file mode 100644
index 0000000..c12f46e
--- /dev/null
+++ b/lib/android/android/promptbasednativeapi.js
@@ -0,0 +1,35 @@
+/*
+ * 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.
+*/
+
+/**
+ * Implements the API of ExposedJsApi.java, but uses prompt() to communicate.
+ * This is used only on the 2.3 simulator, where addJavascriptInterface() is broken.
+ */
+
+module.exports = {
+ exec: function(service, action, callbackId, argsJson) {
+ return prompt(argsJson, 'gap:'+JSON.stringify([service, action, callbackId]));
+ },
+ setNativeToJsBridgeMode: function(value) {
+ prompt(value, 'gap_bridge_mode:');
+ },
+ retrieveJsMessages: function(fromOnlineEvent) {
+ return prompt(+fromOnlineEvent, 'gap_poll:');
+ }
+};
http://git-wip-us.apache.org/repos/asf/cordova-js/blob/7d5f6f62/lib/android/exec.js
----------------------------------------------------------------------
diff --git a/lib/android/exec.js b/lib/android/exec.js
index f22c46b..0d35ff1 100644
--- a/lib/android/exec.js
+++ b/lib/android/exec.js
@@ -34,7 +34,7 @@
* @param {String[]} [args] Zero or more arguments to pass to the method
*/
var cordova = require('cordova'),
- nativeApiProvider = require('cordova/plugin/android/nativeapiprovider'),
+ nativeApiProvider = require('cordova/android/nativeapiprovider'),
utils = require('cordova/utils'),
base64 = require('cordova/base64'),
jsToNativeModes = {
http://git-wip-us.apache.org/repos/asf/cordova-js/blob/7d5f6f62/lib/android/plugin/android/nativeapiprovider.js
----------------------------------------------------------------------
diff --git a/lib/android/plugin/android/nativeapiprovider.js b/lib/android/plugin/android/nativeapiprovider.js
deleted file mode 100644
index 50fd8ad..0000000
--- a/lib/android/plugin/android/nativeapiprovider.js
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * 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.
-*/
-
-/**
- * Exports the ExposedJsApi.java object if available, otherwise exports the PromptBasedNativeApi.
- */
-
-var nativeApi = this._cordovaNative || require('cordova/plugin/android/promptbasednativeapi');
-var currentApi = nativeApi;
-
-module.exports = {
- get: function() { return currentApi; },
- setPreferPrompt: function(value) {
- currentApi = value ? require('cordova/plugin/android/promptbasednativeapi') : nativeApi;
- },
- // Used only by tests.
- set: function(value) {
- currentApi = value;
- }
-};
http://git-wip-us.apache.org/repos/asf/cordova-js/blob/7d5f6f62/lib/android/plugin/android/promptbasednativeapi.js
----------------------------------------------------------------------
diff --git a/lib/android/plugin/android/promptbasednativeapi.js b/lib/android/plugin/android/promptbasednativeapi.js
deleted file mode 100644
index c12f46e..0000000
--- a/lib/android/plugin/android/promptbasednativeapi.js
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * 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.
-*/
-
-/**
- * Implements the API of ExposedJsApi.java, but uses prompt() to communicate.
- * This is used only on the 2.3 simulator, where addJavascriptInterface() is broken.
- */
-
-module.exports = {
- exec: function(service, action, callbackId, argsJson) {
- return prompt(argsJson, 'gap:'+JSON.stringify([service, action, callbackId]));
- },
- setNativeToJsBridgeMode: function(value) {
- prompt(value, 'gap_bridge_mode:');
- },
- retrieveJsMessages: function(fromOnlineEvent) {
- return prompt(+fromOnlineEvent, 'gap_poll:');
- }
-};
http://git-wip-us.apache.org/repos/asf/cordova-js/blob/7d5f6f62/test/android/test.exec.js
----------------------------------------------------------------------
diff --git a/test/android/test.exec.js b/test/android/test.exec.js
index 7d6f2a7..b97f066 100644
--- a/test/android/test.exec.js
+++ b/test/android/test.exec.js
@@ -22,7 +22,7 @@
describe('exec.processMessages', function () {
var cordova = require('cordova'),
exec = require('cordova/androidexec'),
- nativeApiProvider = require('cordova/plugin/android/nativeapiprovider'),
+ nativeApiProvider = require('cordova/android/nativeapiprovider'),
origNativeApi = nativeApiProvider.get();
var nativeApi = {