Permalink
Browse files

Removed all the CMakeList.txt files and replaced them with the QNX Ma…

…kefile system. Also added subdirectories for x86/armv7-le architectures instead of build-device, build-simulator folders

Reviewed By: Nukul Bhasin <nbhasin@rim.com>
tested By: Tracy Li <tli@rim.com>
  • Loading branch information...
1 parent c3d823f commit eafb6cf1d9b7a0961da832dbc47a1030e13662ee @pagey pagey committed with nukulb Sep 21, 2012
Showing with 605 additions and 503 deletions.
  1. +21 −3 .gitignore
  2. +0 −40 CMakeLists.txt
  3. +8 −0 Makefile
  4. +4 −27 build/build/build-native.js
  5. +15 −6 build/build/clean-native.js
  6. +2 −4 build/build/conf.js
  7. +5 −8 build/build/native-test.js
  8. +11 −9 build/build/pack.js
  9. +9 −0 ext/Makefile
  10. +2 −2 ext/bbm.platform/BBMJNEXT.js
  11. +8 −0 ext/bbm.platform/Makefile
  12. +1 −1 ext/bbm.platform/manifest.json
  13. +0 −27 ext/bbm.platform/native/CMakeLists.txt
  14. +8 −0 ext/bbm.platform/native/Makefile
  15. +8 −0 ext/bbm.platform/native/arm/Makefile
  16. +1 −0 ext/bbm.platform/native/arm/so.le-v7/Makefile
  17. +12 −1 ext/bbm.platform/native/bbm_bps.cpp
  18. +1 −2 ext/bbm.platform/native/bbm_js.cpp
  19. +1 −1 ext/bbm.platform/native/bbm_js.hpp
  20. +17 −0 ext/bbm.platform/native/common.mk
  21. +8 −0 ext/bbm.platform/native/x86/Makefile
  22. +1 −0 ext/bbm.platform/native/x86/so/Makefile
  23. +8 −0 ext/connection/Makefile
  24. +2 −2 ext/connection/connectionJNEXT.js
  25. +0 −22 ext/connection/native/CMakeLists.txt
  26. +8 −0 ext/connection/native/Makefile
  27. +8 −0 ext/connection/native/arm/Makefile
  28. +2 −0 ext/connection/native/arm/o.le-v7/Makefile
  29. +1 −0 ext/connection/native/arm/so.le-v7/Makefile
  30. +22 −0 ext/connection/native/common.mk
  31. +1 −1 ext/connection/native/connection_bps.cpp
  32. +3 −3 ext/connection/native/connection_bps.hpp
  33. 0 ext/connection/native/{unitTests → }/test_main.cpp
  34. +0 −68 ext/connection/native/unitTests/.qnx_internal.mk
  35. +0 −24 ext/connection/native/unitTests/CMakeLists.txt
  36. +8 −0 ext/connection/native/x86/Makefile
  37. +1 −0 ext/connection/native/x86/so/Makefile
  38. +8 −0 ext/io.filetransfer/Makefile
  39. +2 −2 ext/io.filetransfer/index.js
  40. +1 −1 ext/io.filetransfer/manifest.json
  41. +0 −28 ext/io.filetransfer/native/CMakeLists.txt
  42. +8 −0 ext/io.filetransfer/native/Makefile
  43. +8 −0 ext/io.filetransfer/native/arm/Makefile
  44. +2 −0 ext/io.filetransfer/native/arm/o.le-v7/Makefile
  45. +1 −0 ext/io.filetransfer/native/arm/so.le-v7/Makefile
  46. +28 −0 ext/io.filetransfer/native/common.mk
  47. +4 −5 ext/io.filetransfer/native/filetransfer_curl.cpp
  48. +1 −1 ext/io.filetransfer/native/filetransfer_js.cpp
  49. +8 −8 ext/io.filetransfer/native/{unitTests → }/test_main.cpp
  50. +0 −24 ext/io.filetransfer/native/unitTests/CMakeLists.txt
  51. +8 −0 ext/io.filetransfer/native/x86/Makefile
  52. +2 −0 ext/io.filetransfer/native/x86/o/Makefile
  53. +1 −0 ext/io.filetransfer/native/x86/so/Makefile
  54. +8 −0 ext/json/Makefile
  55. 0 ext/json/client.js
  56. 0 ext/json/index.js
  57. +5 −0 ext/json/manifest.json
  58. +8 −0 ext/json/native/Makefile
  59. +8 −0 ext/json/native/arm/Makefile
  60. +1 −0 ext/json/native/arm/so.le-v7/Makefile
  61. +14 −0 ext/json/native/common.mk
  62. +8 −0 ext/json/native/x86/Makefile
  63. +1 −0 ext/json/native/x86/so/Makefile
  64. +43 −0 ext/meta.mk
  65. +8 −0 ext/pim.contacts/Makefile
  66. +2 −2 ext/pim.contacts/index.js
  67. +1 −1 ext/pim.contacts/manifest.json
  68. +0 −25 ext/pim.contacts/native/CMakeLists.txt
  69. +8 −0 ext/pim.contacts/native/Makefile
  70. +8 −0 ext/pim.contacts/native/arm/Makefile
  71. +2 −0 ext/pim.contacts/native/arm/o.le-v7/Makefile
  72. +1 −0 ext/pim.contacts/native/arm/so.le-v7/Makefile
  73. +24 −0 ext/pim.contacts/native/common.mk
  74. +24 −24 ext/pim.contacts/native/pim_contacts_qt.cpp
  75. +5 −2 ext/pim.contacts/native/{unitTests → }/test_main.cpp
  76. +0 −25 ext/pim.contacts/native/unitTests/CMakeLists.txt
  77. +8 −0 ext/push/Makefile
  78. +2 −2 ext/push/index.js
  79. +1 −1 ext/push/manifest.json
  80. +0 −26 ext/push/native/CMakeLists.txt
  81. +8 −0 ext/push/native/Makefile
  82. +8 −0 ext/push/native/arm/Makefile
  83. +2 −0 ext/push/native/arm/o.le-v7/Makefile
  84. +1 −0 ext/push/native/arm/so.le-v7/Makefile
  85. +23 −0 ext/push/native/common.mk
  86. +1 −1 ext/push/native/push_js.cpp
  87. +1 −1 ext/push/native/push_ndk.cpp
  88. +4 −2 ext/push/native/{unitTests → }/test_main.cpp
  89. +0 −28 ext/push/native/unitTests/CMakeLists.txt
  90. +8 −0 ext/push/native/x86/Makefile
  91. +2 −0 ext/push/native/x86/o/Makefile
  92. +1 −0 ext/push/native/x86/so/Makefile
  93. +8 −0 ext/ui.dialog/Makefile
  94. +2 −2 ext/ui.dialog/index.js
  95. +1 −1 ext/ui.dialog/manifest.json
  96. +0 −26 ext/ui.dialog/native/CMakeLists.txt
  97. +8 −0 ext/ui.dialog/native/Makefile
  98. +8 −0 ext/ui.dialog/native/arm/Makefile
  99. +1 −0 ext/ui.dialog/native/arm/so.le-v7/Makefile
  100. +17 −0 ext/ui.dialog/native/common.mk
  101. +1 −2 ext/ui.dialog/native/dialog_js.cpp
  102. +8 −0 ext/ui.dialog/native/x86/Makefile
  103. +1 −0 ext/ui.dialog/native/x86/so/Makefile
  104. +3 −3 test/unit/ext/bbm.platform/BBMEvents.js
  105. +3 −3 test/unit/ext/connection/connectionEvents.js
  106. +4 −4 test/unit/ext/io.filetransfer/index.js
  107. +2 −2 test/unit/ext/pim.contacts/index.js
View
24 .gitignore
@@ -1,16 +1,34 @@
+#Node Modules
node_modules/
-build-*simulator/
-build-*device/
+
+#Eclipse Junk
.project
.settings
+
+#Mac OS stuff
*.DS_Store
+
+#Ctags
tags
+
+#swp and tmp files
*.*~
*.swp
+
+#output
target/
clientFiles/
-ext/*/native/unitTests/build/*
lib/webworks-info.js
+/ext/*/native/arm/*/*.o
+/ext/*/native/arm/*/*.so
+/ext/*/native/arm/*/*.a
+/ext/*/native/arm/*/test
+/ext/*/native/x86/*/*.a
+/ext/*/native/x86/*/*.o
+/ext/*/native/x86/*/*.so
+/ext/*/native/x86/*/test
+
+#Test-App generation
test/test-app/wwTest.zip
test/test-app/device
test/test-app/simulator
View
40 CMakeLists.txt
@@ -1,40 +0,0 @@
-cmake_minimum_required(VERSION 2.6)
-
-set (CMAKE_INSTALL_PREFIX "/")
-
-if (CMAKE_BUILD_TYPE STREQUAL "Release")
- set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wl,-s")
- set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wl,-s")
-endif ()
-
-if ($ENV{UNIT_TESTS})
- if (${CMAKE_SYSTEM_PROCESSOR} STREQUAL "x86")
- add_subdirectory(ext/connection/native/unitTests)
- add_subdirectory(ext/io.filetransfer/native/unitTests)
- add_subdirectory(ext/push/native/unitTests)
- endif ()
-
- if (${CMAKE_SYSTEM_PROCESSOR} STREQUAL "armle-v7")
- add_subdirectory(ext/connection/native/unitTests)
- add_subdirectory(ext/io.filetransfer/native/unitTests)
- add_subdirectory(ext/push/native/unitTests)
- add_subdirectory(ext/pim.contacts/native/unitTests)
- endif ()
-else ()
- if (${CMAKE_SYSTEM_PROCESSOR} STREQUAL "x86")
- add_subdirectory(ext/bbm.platform/native)
- add_subdirectory(ext/connection/native)
- add_subdirectory(ext/io.filetransfer/native)
- add_subdirectory(ext/push/native)
- add_subdirectory(ext/ui.dialog/native)
- endif ()
-
- if (${CMAKE_SYSTEM_PROCESSOR} STREQUAL "armle-v7")
- add_subdirectory(ext/pim.contacts/native)
- add_subdirectory(ext/bbm.platform/native)
- add_subdirectory(ext/connection/native)
- add_subdirectory(ext/io.filetransfer/native)
- add_subdirectory(ext/push/native)
- add_subdirectory(ext/ui.dialog/native)
- endif ()
-endif ()
View
8 Makefile
@@ -0,0 +1,8 @@
+LIST=VARIANT
+ifndef QRECURSE
+QRECURSE=recurse.mk
+ifdef QCONFIG
+QRDIR=$(dir $(QCONFIG))
+endif
+endif
+include $(QRDIR)$(QRECURSE)
View
31 build/build/build-native.js
@@ -20,43 +20,20 @@ var utils = require("./utils"),
_c = require("./conf");
module.exports = function (isForUnitTest) {
- var MAKE_CMD = "make " + "-j " + _c.COMPILER_THREADS,
- simDir = (isForUnitTest ? _c.UNIT_TEST_SIM_BUILD : _c.SIM_BUILD),
- deviceDir = (isForUnitTest ? _c.UNIT_TEST_DEVICE_BUILD : _c.DEVICE_BUILD),
+ var MAKE_CMD = "make " + "JLEVEL=" + _c.COMPILER_THREADS,
buildEnv = process.env;
return function (prev, baton) {
- var SH_CMD = "bash ",
- build = jWorkflow.order(),
- thisBaton = baton,
- configurePrefix,
- configureX86,
- configureARM;
+ var build = jWorkflow.order(),
+ thisBaton = baton;
thisBaton.take();
- //Create build directories if necessary
- if (!path.existsSync(simDir)) {
- fs.mkdirSync(simDir);
- }
-
- if (!path.existsSync(deviceDir)) {
- fs.mkdirSync(deviceDir);
- }
-
- //configure-qsk commands
- configurePrefix = utils.isWindows() ? SH_CMD : "";
- configureX86 = configurePrefix + _c.DEPENDENCIES_CONFIGURE_QSK + " x86";
- configureARM = configurePrefix + _c.DEPENDENCIES_CONFIGURE_QSK + " arm a9";
-
if (isForUnitTest) {
buildEnv.UNIT_TESTS = "1";
}
- build = build.andThen(utils.execCommandWithJWorkflow(configureX86, {cwd: simDir, env: buildEnv}))
- .andThen(utils.execCommandWithJWorkflow(MAKE_CMD, {cwd: simDir}))
- .andThen(utils.execCommandWithJWorkflow(configureARM, {cwd: deviceDir, env: buildEnv}))
- .andThen(utils.execCommandWithJWorkflow(MAKE_CMD, {cwd: deviceDir}))
+ build = build.andThen(utils.execCommandWithJWorkflow(MAKE_CMD))
.andThen(function () {
//catch the success case
thisBaton.pass(prev);
View
21 build/build/clean-native.js
@@ -13,14 +13,23 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-var wrench = require("../../node_modules/wrench"),
- path = require("path"),
- _c = require("./conf");
+
+var utils = require("./utils"),
+ jWorkflow = require("jWorkflow");
module.exports = function (prev, baton) {
- [_c.SIM_BUILD, _c.DEVICE_BUILD, _c.UNIT_TEST_SIM_BUILD, _c.UNIT_TEST_DEVICE_BUILD].forEach(function (element, index, array) {
- if (path.existsSync(element)) {
- wrench.rmdirSyncRecursive(element, true);
+ var cleanNative;
+
+ baton.take();
+
+ cleanNative = jWorkflow.order()
+ .andThen(utils.execCommandWithJWorkflow("make clean"))
+ .andThen(function () {
+ baton.pass(prev);
+ }).start(function (error) {
+ if (error) {
+ baton.drop(error);
}
});
+
};
View
6 build/build/conf.js
@@ -25,10 +25,8 @@ module.exports = {
DEPLOY_STYLES: path.normalize(__dirname + "/../../target/zip/ui-resources/styles/"),
TARGET: path.normalize(__dirname + "/../../target/"),
BUILD: path.normalize(__dirname + "/.."),
- DEVICE_BUILD: path.normalize(__dirname + "/../../build-device"),
- SIM_BUILD: path.normalize(__dirname + "/../../build-simulator"),
- UNIT_TEST_DEVICE_BUILD: path.normalize(__dirname + "/../../build-unit-test-device"),
- UNIT_TEST_SIM_BUILD: path.normalize(__dirname + "/../../build-unit-test-simulator"),
+ UNIT_TEST_DEVICE_BUILD: path.normalize(__dirname + "/../../ext"),
+ UNIT_TEST_SIM_BUILD: path.normalize(__dirname + "/../../ext"),
CLIENTFILES: path.normalize(__dirname + "/../../clientFiles"),
LIB: path.normalize(__dirname + "/../../lib"),
EXT: path.normalize(__dirname + "/../../ext"),
View
13 build/build/native-test.js
@@ -27,19 +27,17 @@ function _getCmd(ext, device, ip) {
testDir;
//unit tests directories
- deviceDir = path.join(_c.UNIT_TEST_DEVICE_BUILD, "ext", ext, "native/unitTests/test");
- simDir = path.join(_c.UNIT_TEST_SIM_BUILD, "ext", ext, "native/unitTests/test");
-
+ deviceDir = path.join(_c.UNIT_TEST_DEVICE_BUILD, ext, "native/arm/o.le-v7/test");
+ simDir = path.join(_c.UNIT_TEST_SIM_BUILD, ext, "native/x86/o/test");
testDir = device === "device" ? deviceDir : simDir;
-
+
//If the folder exists, grab the test
if (path.existsSync(testDir)) {
console.log("Running Unit tests for " + ext);
cmd += " " +
"scp " + testDir + " root@" + ip + ":/tmp/test && " +
"ssh root@" + ip + " '. /base/scripts/env.sh; cd ../tmp; chmod 755 test; ./test'";
}
-
return cmd;
}
@@ -50,10 +48,9 @@ module.exports = function (prev, baton) {
device = args[0] === "simulator" ? "simulator" : "device",
ip = utils.isValidIPAddress(args[1]) ? args[1] : _c.USB_IP,
omitList = args.slice(2) || [],
- buildFolder = (device === "device" ? _c.UNIT_TEST_DEVICE_BUILD : _c.UNIT_TEST_SIM_BUILD),
- exts = fs.readdirSync(path.join(buildFolder, "ext")),
+ exts = fs.readdirSync(path.join(_c.ROOT, "ext")),
i;
-
+
thisBaton.take();
for (i = 0; i < exts.length; i++) {
if (!utils.arrayContains(omitList, exts[i])) {
View
20 build/build/pack.js
@@ -33,11 +33,12 @@ function copyExtensions(extPath, extDest) {
//Iterate over extensions directory
fs.readdirSync(extPath).forEach(function (extension) {
var apiDir = path.normalize(path.resolve(extPath, extension)),
+ apiDirDeviceSO = path.normalize(path.join(apiDir, 'native', 'arm', 'so.le-v7')),
+ apiDirSimulatorSO = path.normalize(path.join(apiDir, 'native', 'x86', 'so')),
apiDest = path.join(extDest, extension),
extensionStats = fs.lstatSync(apiDir),
soPath,
soDest,
- apiNativeDir,
jsFiles,
soFiles;
@@ -56,15 +57,16 @@ function copyExtensions(extPath, extDest) {
utils.copyFile(jsFile, apiDest, apiDir);
});
- //find and copy each .so file to the extension folder
- [{src: _c.DEVICE_BUILD, dst: "device"}, {src: _c.SIM_BUILD, dst: "simulator"}].forEach(function (target) {
- soPath = path.normalize(path.join(target.src, "ext", extension, "native"));
- soDest = path.join(apiDest, target.dst);
- apiNativeDir = path.normalize(path.join(apiDir, "native"));
+ // Copy the .so file for this extension
+ [{ src: apiDirDeviceSO, dst: "device" }, { src: apiDirSimulatorSO, dst: "simulator"}].forEach(function (target) {
+ if (path.existsSync(target.src)) {
+ soDest = path.join(apiDest, target.dst);
- //If this is a native extension, copy all .so files
- if (path.existsSync(soPath) && path.existsSync(apiNativeDir)) {
- soFiles = utils.listFiles(soPath, function (file) {
+ if (!path.exists(soDest)) {
+ fs.mkdirSync(soDest);
+ }
+
+ soFiles = utils.listFiles(target.src, function (file) {
return path.extname(file) === ".so";
});
View
9 ext/Makefile
@@ -0,0 +1,9 @@
+LIST=VARIANT
+EARLY_DIRS=json
+ifndef QRECURSE
+QRECURSE=recurse.mk
+ifdef QCONFIG
+QRDIR=$(dir $(QCONFIG))
+endif
+endif
+include $(QRDIR)$(QRECURSE)
View
4 ext/bbm.platform/BBMJNEXT.js
@@ -91,11 +91,11 @@ JNEXT.BBM = function ()
};
_self.init = function () {
- if (!JNEXT.require("bbm")) {
+ if (!JNEXT.require("libbbm")) {
return false;
}
- _self.m_id = JNEXT.createObject("bbm.BBM");
+ _self.m_id = JNEXT.createObject("libbbm.BBM");
if (_self.m_id === "") {
return false;
View
8 ext/bbm.platform/Makefile
@@ -0,0 +1,8 @@
+LIST=VARIANT
+ifndef QRECURSE
+QRECURSE=recurse.mk
+ifdef QCONFIG
+QRDIR=$(dir $(QCONFIG))
+endif
+endif
+include $(QRDIR)$(QRECURSE)
View
2 ext/bbm.platform/manifest.json
@@ -1,5 +1,5 @@
{
"global": false,
"namespace": "blackberry.bbm.platform",
- "dependencies": []
+ "dependencies": ["json"]
}
View
27 ext/bbm.platform/native/CMakeLists.txt
@@ -1,27 +0,0 @@
-cmake_minimum_required(VERSION 2.8)
-
-if (CMAKE_COMPILER_IS_GNUCC)
- set(CMAKE_CXX_FLAGS "-Werror -fexceptions -fPIC ${CMAKE_CXX_FLAGS}")
- set(CMAKE_C_FLAGS "-Werror -fPIC ${CMAKE_C_FLAGS}")
-endif ()
-
-set(bbm_srcs
- bbm_bps.cpp
- bbm_js.cpp
- ../../../dependencies/JsonCpp/jsoncpp-src-0.5.0/src/lib_json/json_reader.cpp
- ../../../dependencies/JsonCpp/jsoncpp-src-0.5.0/src/lib_json/json_value.cpp
- ../../../dependencies/JsonCpp/jsoncpp-src-0.5.0/src/lib_json/json_writer.cpp
- ../../../dependencies/jnext_1_0_8_3/jncore/jnext-extensions/common/plugin.cpp
-)
-
-include_directories(${CMAKE_SOURCE_DIR})
-include_directories(${CMAKE_SOURCE_DIR}/dependencies/jnext_1_0_8_3/jncore/jnext-extensions/common)
-include_directories(${CMAKE_SOURCE_DIR}/dependencies/JsonCpp/jsoncpp-src-0.5.0/include)
-
-add_library(bbm MODULE ${bbm_srcs})
-target_link_libraries(bbm bbmsp bps socket QtCore)
-
-set_target_properties(bbm PROPERTIES PREFIX "")
-
-install(TARGETS bbm LIBRARY DESTINATION ".")
-
View
8 ext/bbm.platform/native/Makefile
@@ -0,0 +1,8 @@
+LIST=CPU
+ifndef QRECURSE
+QRECURSE=recurse.mk
+ifdef QCONFIG
+QRDIR=$(dir $(QCONFIG))
+endif
+endif
+include $(QRDIR)$(QRECURSE)
View
8 ext/bbm.platform/native/arm/Makefile
@@ -0,0 +1,8 @@
+LIST=VARIANT
+ifndef QRECURSE
+QRECURSE=recurse.mk
+ifdef QCONFIG
+QRDIR=$(dir $(QCONFIG))
+endif
+endif
+include $(QRDIR)$(QRECURSE)
View
1 ext/bbm.platform/native/arm/so.le-v7/Makefile
@@ -0,0 +1 @@
+include ../../common.mk
View
13 ext/bbm.platform/native/bbm_bps.cpp
@@ -140,6 +140,12 @@ void BBMBPS::processProfileUpdate(bbmsp_event_t *event)
case BBMSP_STATUS:
updateString += "status " + getFullProfile();
break;
+ case BBMSP_INSTALL_APP:
+ return;
+ case BBMSP_UNINSTALL_APP:
+ return;
+ case BBMSP_INVITATION_RECEIVED:
+ return;
}
m_pParent->NotifyEvent(updateString);
}
@@ -168,6 +174,12 @@ void BBMBPS::processContactUpdate(bbmsp_event_t *event)
case BBMSP_STATUS:
updateString += "status " + getFullContact(contact);
break;
+ case BBMSP_INSTALL_APP:
+ return;
+ case BBMSP_UNINSTALL_APP:
+ return;
+ case BBMSP_INVITATION_RECEIVED:
+ return;
}
m_pParent->NotifyEvent(updateString);
}
@@ -512,7 +524,6 @@ std::string BBMBPS::GetContact(bbmsp_contact_t *contact, BBMField field)
{
MUTEX_LOCK();
std::string value;
- unsigned int size;
char buffer[4096];
switch (field)
View
3 ext/bbm.platform/native/bbm_js.cpp
@@ -108,11 +108,10 @@ std::string BBM::InvokeMethod(const std::string& command)
bool parse = reader.parse(strParam, obj);
if (!parse) {
- fprintf(stderr, "%s" "error parsing\n");
return "";
}
- int status;
+ int status = 0;
const std::string strStatus = obj["status"].asString();
const std::string strStatusMessage = obj["statusMessage"].asString();
View
2 ext/bbm.platform/native/bbm_js.hpp
@@ -36,9 +36,9 @@ class BBM : public JSExt
void StartEvents();
void StopEvents();
private:
+ std::string m_id;
pthread_t m_thread;
webworks::BBMBPS* m_pBBMController;
- std::string m_id;
};
#endif // BBM_JS_HPP_
View
17 ext/bbm.platform/native/common.mk
@@ -0,0 +1,17 @@
+ifndef QCONFIG
+QCONFIG=qconfig.mk
+endif
+include $(QCONFIG)
+
+NAME=bbm
+PLUGIN=yes
+JSON=yes
+
+include ../../../../meta.mk
+
+SRCS+=bbm_bps.cpp \
+ bbm_js.cpp
+
+include $(MKFILES_ROOT)/qtargets.mk
+
+LIBS+=bps bbmsp socket QtCore
View
8 ext/bbm.platform/native/x86/Makefile
@@ -0,0 +1,8 @@
+LIST=VARIANT
+ifndef QRECURSE
+QRECURSE=recurse.mk
+ifdef QCONFIG
+QRDIR=$(dir $(QCONFIG))
+endif
+endif
+include $(QRDIR)$(QRECURSE)
View
1 ext/bbm.platform/native/x86/so/Makefile
@@ -0,0 +1 @@
+include ../../common.mk
View
8 ext/connection/Makefile
@@ -0,0 +1,8 @@
+LIST=VARIANT
+ifndef QRECURSE
+QRECURSE=recurse.mk
+ifdef QCONFIG
+QRDIR=$(dir $(QCONFIG))
+endif
+endif
+include $(QRDIR)$(QRECURSE)
View
4 ext/connection/connectionJNEXT.js
@@ -84,11 +84,11 @@ JNEXT.Connection = function () {
};
self.init = function () {
- if (!JNEXT.require("netstatus")) {
+ if (!JNEXT.require("libconnection")) {
return false;
}
- self.m_id = JNEXT.createObject("netstatus.Connection");
+ self.m_id = JNEXT.createObject("libconnection.Connection");
if (self.m_id === "") {
return false;
View
22 ext/connection/native/CMakeLists.txt
@@ -1,22 +0,0 @@
-cmake_minimum_required(VERSION 2.8)
-
-if (CMAKE_COMPILER_IS_GNUCC)
- set(CMAKE_CXX_FLAGS "-fexceptions -fPIC ${CMAKE_CXX_FLAGS}")
- set(CMAKE_C_FLAGS "-fPIC ${CMAKE_C_FLAGS}")
-endif ()
-
-include_directories(${CMAKE_SOURCE_DIR})
-include_directories(${CMAKE_SOURCE_DIR}/dependencies/jnext_1_0_8_3/jncore/jnext-extensions/common)
-
-set(connection_srcs
- connection_bps.cpp
- connection_js.cpp
- ../../../dependencies/jnext_1_0_8_3/jncore/jnext-extensions/common/plugin.cpp
-)
-
-add_library(netstatus MODULE ${connection_srcs})
-target_link_libraries(netstatus bps)
-set_target_properties(netstatus PROPERTIES PREFIX "")
-
-install(TARGETS netstatus LIBRARY DESTINATION ".")
-
View
8 ext/connection/native/Makefile
@@ -0,0 +1,8 @@
+LIST=CPU
+ifndef QRECURSE
+QRECURSE=recurse.mk
+ifdef QCONFIG
+QRDIR=$(dir $(QCONFIG))
+endif
+endif
+include $(QRDIR)$(QRECURSE)
View
8 ext/connection/native/arm/Makefile
@@ -0,0 +1,8 @@
+LIST=VARIANT
+ifndef QRECURSE
+QRECURSE=recurse.mk
+ifdef QCONFIG
+QRDIR=$(dir $(QCONFIG))
+endif
+endif
+include $(QRDIR)$(QRECURSE)
View
2 ext/connection/native/arm/o.le-v7/Makefile
@@ -0,0 +1,2 @@
+UNITTEST=yes
+include ../../common.mk
View
1 ext/connection/native/arm/so.le-v7/Makefile
@@ -0,0 +1 @@
+include ../../common.mk
View
22 ext/connection/native/common.mk
@@ -0,0 +1,22 @@
+ifndef QCONFIG
+QCONFIG=qconfig.mk
+endif
+include $(QCONFIG)
+
+NAME=connection
+PLUGIN=yes
+
+include ../../../../meta.mk
+
+SRCS+=connection_bps.cpp \
+ connection_js.cpp
+
+ifeq ($(UNITTEST),yes)
+NAME=test
+SRCS+=test_main.cpp
+USEFILE=
+endif
+
+include $(MKFILES_ROOT)/qtargets.mk
+
+LIBS+=bps
View
2 ext/connection/native/connection_bps.cpp
@@ -41,7 +41,7 @@ ConnectionTypes ConnectionBPS::GetConnectionType()
netstatus_interface_details_t* details;
netstatus_interface_type_t type;
int status;
- ConnectionTypes returnType;
+ ConnectionTypes returnType = UNKNOWN;
netstatus_get_availability(&available);
View
6 ext/connection/native/connection_bps.hpp
@@ -14,8 +14,8 @@
* limitations under the License.
*/
-#ifndef CONNECTION_BPS_H_
-#define CONNECTION_BPS_H_
+#ifndef CONNECTION_BPS_HPP_
+#define CONNECTION_BPS_HPP_
#include <bps/bps.h>
#include <bps/netstatus.h>
@@ -52,4 +52,4 @@ class ConnectionBPS {
} // namespace webworks
-#endif /* CONNECTION_BPS_H_ */
+#endif /* CONNECTION_BPS_HPP_ */
View
0 ...connection/native/unitTests/test_main.cpp → ext/connection/native/test_main.cpp
File renamed without changes.
View
68 ext/connection/native/unitTests/.qnx_internal.mk
@@ -1,68 +0,0 @@
-#VERSION 4.7.0
-cpu_variants:=$(if $(filter arm,$(CPU)),v7,$(if $(filter ppc,$(CPU)),spe))
-
-ifeq ($(filter g, $(VARIANT_LIST)),g)
-DEBUG_SUFFIX=_g
-LIB_SUFFIX=_g
-else
-DEBUG_SUFFIX=$(filter-out $(VARIANT_BUILD_TYPE) le be $(cpu_variants),$(VARIANT_LIST))
-ifeq ($(DEBUG_SUFFIX),)
-DEBUG_SUFFIX=_r
-else
-DEBUG_SUFFIX:=_$(DEBUG_SUFFIX)
-endif
-endif
-
-CPU_VARIANT:=$(CPUDIR)$(subst $(space),,$(foreach v,$(filter $(cpu_variants),$(VARIANT_LIST)),_$(v)))
-
-EXPRESSION = $(firstword $(foreach a, $(1)_$(CPU_VARIANT)$(DEBUG_SUFFIX) $(1)$(DEBUG_SUFFIX) \
- $(1)_$(CPU_VARIANT) $(1), $(if $($(a)),$(a),)))
-MERGE_EXPRESSION= $(foreach a, $(1)_$(CPU_VARIANT)$(2)$(DEBUG_SUFFIX) $(1)$(2)$(DEBUG_SUFFIX) \
- $(1)_$(CPU_VARIANT)$(2) $(1)$(2) , $($(a)))
-
-FIX_LIB_SUFFIXES= \
- $(if $(1), \
- $(if $(filter $(1), -Bstatic -Bdynamic),\
- $(1) \
- $(if $(2),\
- $(call FIX_LIB_SUFFIXES,\
- $(firstword $(2)),$(wordlist 2,$(words $(2)), $(2)),$(1))),\
- $(if $(filter -Bstatic,$(3) ),\
- $($(1):%.so,%.a),$($(1):%.a,%.so)) \
- $(if $(2),\
- $(call FIX_LIB_SUFFIXES,\
- $(firstword $(2)), $(wordlist 2, $(words $(2)), $(2)), $(3)))))
-
-GCC_VERSION:=$($(call EXPRESSION,GCC_VERSION))
-DEFCOMPILER_TYPE:= $($(call EXPRESSION, DEFCOMPILER_TYPE))
-
-EXTRA_LIBVPATH := $(call MERGE_EXPRESSION, EXTRA_LIBVPATH)
-extra_incvpath_tmp:=$(call MERGE_EXPRESSION,EXTRA_INCVPATH,)
-EXTRA_INCVPATH = $(call MERGE_EXPRESSION,EXTRA_INCVPATH,_@$(basename $@)) \
- $(extra_incvpath_tmp)
-LATE_SRCVPATH := $(call MERGE_EXPRESSION, EXTRA_SRCVPATH)
-EXTRA_OBJS := $($(call EXPRESSION,EXTRA_OBJS))
-
-CCFLAGS_D = $(CCFLAGS$(DEBUG_SUFFIX)) $(CCFLAGS_$(CPU_VARIANT)$(DEBUG_SUFFIX)) \
- $(CCFLAGS_@$(basename $@)$(DEBUG_SUFFIX)) \
- $(CCFLAGS_$(CPU_VARIANT)_@$(basename $@)$(DEBUG_SUFFIX))
-LDFLAGS_D = $(LDFLAGS$(DEBUG_SUFFIX)) $(LDFLAGS_$(CPU_VARIANT)$(DEBUG_SUFFIX))
-
-CCFLAGS += $(CCFLAGS_$(CPU_VARIANT)) $(CCFLAGS_@$(basename $@)) \
- $(CCFLAGS_$(CPU_VARIANT)_@$(basename $@)) $(CCFLAGS_D)
-LDFLAGS += $(LDFLAGS_$(CPU_VARIANT)) $(LDFLAGS_D)
-
-LIBS:= $(LIBSOPT) $(patsubst %S_g, %_gS, $(foreach token, $($(call EXPRESSION,LIBS)),$(if $(findstring ^, $(token)), $(subst ^,,$(token))$(LIB_SUFFIX), $(token))))
-ifdef LIBNAMES
-LIBNAMES:= $(subst lib-Bdynamic.a, ,$(subst lib-Bstatic.a, , $(LIBNAMES)))
-LIBNAMES := $(call FIX_LIB_SUFFIXES,$(firstword $(LIBNAMES)),$(wordslist 2, $(words $(LIBNAMES))),-Bdynamic)
-endif
-libopts := $(subst -l-B,-B, $(libopts))
-ifneq ($(LIBS),)
-EXTRA_DEPS += $(wildcard $(foreach a,$(EXTRA_LIBVPATH),$(a)/*.a))
-endif
-
-BUILDNAME:=$($(call EXPRESSION,BUILDNAME))$(if $(suffix $(BUILDNAME)),,$(IMAGE_SUFF_$(BUILD_TYPE)))
-BUILDNAME_SAR:= $(patsubst %$(IMAGE_SUFF_$(BUILD_TYPE)),%S.a,$(BUILDNAME))
-
-POST_BUILD:=$($(call EXPRESSION,POST_BUILD))
View
24 ext/connection/native/unitTests/CMakeLists.txt
@@ -1,24 +0,0 @@
-cmake_minimum_required(VERSION 2.8)
-
-if (CMAKE_COMPILER_IS_GNUCC)
- set(CMAKE_CXX_FLAGS "-Werror -lang-c++ -fexceptions ${CMAKE_CXX_FLAGS}")
- set(CMAKE_C_FLAGS "-Werror ${CMAKE_C_FLAGS}")
-endif ()
-
-include_directories(${CMAKE_SOURCE_DIR})
-include_directories(${CMAKE_SOURCE_DIR}/dependencies/jnext_1_0_8_3/jncore/jnext-extensions/common)
-include_directories(${CMAKE_SOURCE_DIR}/dependencies/JsonCpp/jsoncpp-src-0.5.0/include)
-include_directories(${CMAKE_SOURCE_DIR}/dependencies/gmock-1.5.0/fused-src/)
-
-set(srcs
- test_main.cpp
- ../connection_bps.cpp
- ../connection_js.cpp
- ../../../../dependencies/jnext_1_0_8_3/jncore/jnext-extensions/common/plugin.cpp
- ../../../../dependencies/gmock-1.5.0/fused-src/gmock-gtest-all.cc
-)
-
-add_executable(netstatusTest ${srcs})
-
-target_link_libraries(netstatusTest m bps)
-set_target_properties(netstatusTest PROPERTIES PREFIX "" OUTPUT_NAME "test")
View
8 ext/connection/native/x86/Makefile
@@ -0,0 +1,8 @@
+LIST=VARIANT
+ifndef QRECURSE
+QRECURSE=recurse.mk
+ifdef QCONFIG
+QRDIR=$(dir $(QCONFIG))
+endif
+endif
+include $(QRDIR)$(QRECURSE)
View
1 ext/connection/native/x86/so/Makefile
@@ -0,0 +1 @@
+include ../../common.mk
View
8 ext/io.filetransfer/Makefile
@@ -0,0 +1,8 @@
+LIST=VARIANT
+ifndef QRECURSE
+QRECURSE=recurse.mk
+ifdef QCONFIG
+QRDIR=$(dir $(QCONFIG))
+endif
+endif
+include $(QRDIR)$(QRECURSE)
View
4 ext/io.filetransfer/index.js
@@ -178,11 +178,11 @@ JNEXT.FileTransfer = function () {
};
self.init = function () {
- if (!JNEXT.require("filetransfer")) {
+ if (!JNEXT.require("libfiletransfer")) {
return false;
}
- self.m_id = JNEXT.createObject("filetransfer.FileTransfer");
+ self.m_id = JNEXT.createObject("libfiletransfer.FileTransfer");
if (self.m_id === "") {
return false;
View
2 ext/io.filetransfer/manifest.json
@@ -1,5 +1,5 @@
{
"global": false,
"namespace": "blackberry.io.filetransfer",
- "dependencies": []
+ "dependencies": ["json"]
}
View
28 ext/io.filetransfer/native/CMakeLists.txt
@@ -1,28 +0,0 @@
-cmake_minimum_required(VERSION 2.8)
-
-include_directories(${CMAKE_SOURCE_DIR})
-include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../../ui.dialog/native/)
-include_directories(${CMAKE_SOURCE_DIR}/dependencies/jnext_1_0_8_3/jncore/jnext-extensions/common)
-include_directories(${CMAKE_SOURCE_DIR}/dependencies/JsonCpp/jsoncpp-src-0.5.0/include)
-
-if (CMAKE_COMPILER_IS_GNUCC)
- set(CMAKE_CXX_FLAGS "-fexceptions -fPIC ${CMAKE_CXX_FLAGS}")
- set(CMAKE_C_FLAGS "-fPIC ${CMAKE_C_FLAGS}")
-endif ()
-
-set(filetransfer_srcs
- filetransfer_curl.cpp
- filetransfer_js.cpp
- ../../ui.dialog/native/dialog_bps.cpp
- ../../../dependencies/JsonCpp/jsoncpp-src-0.5.0/src/lib_json/json_reader.cpp
- ../../../dependencies/JsonCpp/jsoncpp-src-0.5.0/src/lib_json/json_value.cpp
- ../../../dependencies/JsonCpp/jsoncpp-src-0.5.0/src/lib_json/json_writer.cpp
- ../../../dependencies/jnext_1_0_8_3/jncore/jnext-extensions/common/plugin.cpp
-)
-
-add_library(filetransfer MODULE ${filetransfer_srcs})
-target_link_libraries(filetransfer bps curl)
-set_target_properties(filetransfer PROPERTIES PREFIX "")
-
-install(TARGETS filetransfer LIBRARY DESTINATION ".")
-
View
8 ext/io.filetransfer/native/Makefile
@@ -0,0 +1,8 @@
+LIST=CPU
+ifndef QRECURSE
+QRECURSE=recurse.mk
+ifdef QCONFIG
+QRDIR=$(dir $(QCONFIG))
+endif
+endif
+include $(QRDIR)$(QRECURSE)
View
8 ext/io.filetransfer/native/arm/Makefile
@@ -0,0 +1,8 @@
+LIST=VARIANT
+ifndef QRECURSE
+QRECURSE=recurse.mk
+ifdef QCONFIG
+QRDIR=$(dir $(QCONFIG))
+endif
+endif
+include $(QRDIR)$(QRECURSE)
View
2 ext/io.filetransfer/native/arm/o.le-v7/Makefile
@@ -0,0 +1,2 @@
+UNITTEST=yes
+include ../../common.mk
View
1 ext/io.filetransfer/native/arm/so.le-v7/Makefile
@@ -0,0 +1 @@
+include ../../common.mk
View
28 ext/io.filetransfer/native/common.mk
@@ -0,0 +1,28 @@
+ifndef QCONFIG
+QCONFIG=qconfig.mk
+endif
+include $(QCONFIG)
+
+NAME=filetransfer
+PLUGIN=yes
+JSON=yes
+
+include ../../../../meta.mk
+
+EXTRA_SRCVPATH+=../../../../ui.dialog/native
+
+SRCS+=filetransfer_curl.cpp \
+ filetransfer_js.cpp \
+ ../../../../ui.dialog/native/dialog_bps.cpp
+
+EXTRA_INCVPATH+=../../../../ui.dialog/native
+
+ifeq ($(UNITTEST),yes)
+NAME=test
+SRCS+=test_main.cpp
+USEFILE=
+endif
+
+LIBS+=bps curl
+
+include $(MKFILES_ROOT)/qtargets.mk
View
9 ext/io.filetransfer/native/filetransfer_curl.cpp
@@ -118,7 +118,7 @@ CURLcode FileTransferCurl::openDialog(CURL *curl, const std::string &windowGroup
int button = dialog->Show(dialogConfig);
- CURLcode result;
+ CURLcode result = CURLE_OK;
if (dialogConfig) {
delete dialogConfig;
@@ -153,7 +153,7 @@ CURLcode FileTransferCurl::openDialog(CURL *curl, const std::string &windowGroup
std::string FileTransferCurl::Upload(FileUploadInfo *uploadInfo)
{
- CURL *curl;
+ CURL *curl = NULL;
CURLcode result;
std::string result_string;
@@ -320,8 +320,8 @@ std::string FileTransferCurl::Upload(FileUploadInfo *uploadInfo)
std::string FileTransferCurl::Download(FileDownloadInfo *downloadInfo)
{
- CURL *curl;
- FILE *fp;
+ CURL *curl = NULL;
+ FILE *fp = NULL;
CURLcode result;
std::string result_string;
bool error = 0;
@@ -488,7 +488,6 @@ size_t FileTransferCurl::DownloadWriteCallback(void *ptr, size_t size, size_t nm
size_t FileTransferCurl::UploadReadCallback(void *ptr, size_t size, size_t nmemb, void *userdata)
{
- char *read_data = static_cast<char *>(ptr);
uploadAttributes *uploadAtt = static_cast<uploadAttributes *>(userdata);
FILE *file = uploadAtt->file;
View
2 ext/io.filetransfer/native/filetransfer_js.cpp
@@ -105,7 +105,7 @@ std::string FileTransfer::StartUploadThread(const std::string& jsonObject)
const Json::Value paramsObject = optionsObject["params"];
const Json::Value::Members paramsKeys = paramsObject.getMemberNames();
- for (int i = 0; i < paramsKeys.size(); ++i) {
+ for (unsigned int i = 0; i < paramsKeys.size(); ++i) {
const std::string key = paramsKeys[i];
upload_info->params.push_back(key);
upload_info->params.push_back(paramsObject[key].asString());
View
16 ...letransfer/native/unitTests/test_main.cpp → ext/io.filetransfer/native/test_main.cpp
@@ -35,7 +35,7 @@ int createTestFile(const char *filePath)
TEST(FileTransfer, DetectsIncorrectUploadFilePath)
{
- CURL *curl;
+ CURL *curl = NULL;
std::string source_file = "/accounts/1000/shared/camera/abcdefg.hij";
std::string target_url = "http://bojap.com/omg/uploader.php";
@@ -61,7 +61,7 @@ TEST(FileTransfer, DetectsIncorrectUploadFilePath)
TEST(FileTransfer, DetectsIncorrectUploadURL)
{
- CURL *curl;
+ CURL *curl = NULL;
std::string source_file = "/accounts/1000/shared/documents/filetransfer_test.txt";
std::string target_url = "http://www.google.com/uploader.php";
@@ -91,7 +91,7 @@ TEST(FileTransfer, DetectsIncorrectUploadURL)
TEST(FileTransfer, DetectsUploadConnectionError)
{
- CURL *curl;
+ CURL *curl = NULL;
std::string source_file = "/accounts/1000/shared/documents/filetransfer_test.txt";
std::string target_url = "http://127.0.0.1/uploader.php";
@@ -121,7 +121,7 @@ TEST(FileTransfer, DetectsUploadConnectionError)
TEST(FileTransfer, AllowsRedirectedUploadURL)
{
- CURL *curl;
+ CURL *curl = NULL;
std::string source_file = "/accounts/1000/shared/documents/filetransfer_test.txt";
std::string target_url = "http://google.com/uploader.php";
@@ -152,7 +152,7 @@ TEST(FileTransfer, AllowsRedirectedUploadURL)
// Tests for non-existent source
TEST(FileTransfer, Detects404DownloadSource)
{
- CURL *curl;
+ CURL *curl = NULL;
std::string source = "http://www.google.com/hello.jpg";
std::string target = "/accounts/1000/shared/camera/hello.jpg";
@@ -175,7 +175,7 @@ TEST(FileTransfer, Detects404DownloadSource)
// Tests for invalid source
TEST(FileTransfer, DetectsInvalidDownloadSource)
{
- CURL *curl;
+ CURL *curl = NULL;
std::string source = "/hello.jpg";
std::string target = "/accounts/1000/shared/camera/hello.jpg";
@@ -198,7 +198,7 @@ TEST(FileTransfer, DetectsInvalidDownloadSource)
// Tests for connetion error
TEST(FileTransfer, DetectsIncorrectDownloadSource)
{
- CURL *curl;
+ CURL *curl = NULL;
std::string source = "http://domain.does.not.exist/hello.jpg";
std::string target = "/accounts/1000/shared/camera/hello.jpg";
@@ -221,7 +221,7 @@ TEST(FileTransfer, DetectsIncorrectDownloadSource)
// Tests for invalid target (permissions error)
TEST(FileTransfer, DetectsInvalidDownloadTargetPermissions)
{
- CURL *curl;
+ CURL *curl = NULL;
std::string source = "http://www.google.ca/ig/images/jfk/google_color.png";
std::string target = "/accounts/hello.jpg";
View
24 ext/io.filetransfer/native/unitTests/CMakeLists.txt
@@ -1,24 +0,0 @@
-cmake_minimum_required(VERSION 2.8)
-
-include_directories(${CMAKE_SOURCE_DIR})
-include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../../../ui.dialog/native/)
-include_directories(${CMAKE_SOURCE_DIR}/dependencies/jnext_1_0_8_3/jncore/jnext-extensions/common)
-include_directories(${CMAKE_SOURCE_DIR}/dependencies/JsonCpp/jsoncpp-src-0.5.0/include)
-include_directories(${CMAKE_SOURCE_DIR}/dependencies/gmock-1.5.0/fused-src/)
-
-if (CMAKE_COMPILER_IS_GNUCC)
- set(CMAKE_CXX_FLAGS "-Werror -fexceptions -lang-c++ ${CMAKE_CXX_FLAGS}")
- set(CMAKE_C_FLAGS "-Werror ${CMAKE_C_FLAGS}")
-endif ()
-
-set(srcs
- test_main.cpp
- ../filetransfer_curl.cpp
- ../../../ui.dialog/native/dialog_bps.cpp
- ../../../../dependencies/gmock-1.5.0/fused-src/gmock-gtest-all.cc
-)
-
-add_executable(filetransferTest ${srcs})
-
-target_link_libraries(filetransferTest m curl bps)
-set_target_properties(filetransferTest PROPERTIES PREFIX "" OUTPUT_NAME "test")
View
8 ext/io.filetransfer/native/x86/Makefile
@@ -0,0 +1,8 @@
+LIST=VARIANT
+ifndef QRECURSE
+QRECURSE=recurse.mk
+ifdef QCONFIG
+QRDIR=$(dir $(QCONFIG))
+endif
+endif
+include $(QRDIR)$(QRECURSE)
View
2 ext/io.filetransfer/native/x86/o/Makefile
@@ -0,0 +1,2 @@
+UNITTEST=yes
+include ../../common.mk
View
1 ext/io.filetransfer/native/x86/so/Makefile
@@ -0,0 +1 @@
+include ../../common.mk
View
8 ext/json/Makefile
@@ -0,0 +1,8 @@
+LIST=VARIANT
+ifndef QRECURSE
+QRECURSE=recurse.mk
+ifdef QCONFIG
+QRDIR=$(dir $(QCONFIG))
+endif
+endif
+include $(QRDIR)$(QRECURSE)
View
0 ext/json/client.js
No changes.
View
0 ext/json/index.js
No changes.
View
5 ext/json/manifest.json
@@ -0,0 +1,5 @@
+{
+ "global": false,
+ "namespace": "json",
+ "dependencies": []
+}
View
8 ext/json/native/Makefile
@@ -0,0 +1,8 @@
+LIST=CPU
+ifndef QRECURSE
+QRECURSE=recurse.mk
+ifdef QCONFIG
+QRDIR=$(dir $(QCONFIG))
+endif
+endif
+include $(QRDIR)$(QRECURSE)
View
8 ext/json/native/arm/Makefile
@@ -0,0 +1,8 @@
+LIST=VARIANT
+ifndef QRECURSE
+QRECURSE=recurse.mk
+ifdef QCONFIG
+QRDIR=$(dir $(QCONFIG))
+endif
+endif
+include $(QRDIR)$(QRECURSE)
View
1 ext/json/native/arm/so.le-v7/Makefile
@@ -0,0 +1 @@
+include ../../common.mk
View
14 ext/json/native/common.mk
@@ -0,0 +1,14 @@
+ifndef QCONFIG
+QCONFIG=qconfig.mk
+endif
+include $(QCONFIG)
+
+NAME=json
+LDFLAGS+=-Wl,-h,libjson.so
+include ../../../../meta.mk
+
+SRCS+=$(WEBWORKS_DIR)/dependencies/JsonCpp/jsoncpp-src-0.5.0/src/lib_json/json_reader.cpp \
+ $(WEBWORKS_DIR)/dependencies/JsonCpp/jsoncpp-src-0.5.0/src/lib_json/json_value.cpp \
+ $(WEBWORKS_DIR)/dependencies/JsonCpp/jsoncpp-src-0.5.0/src/lib_json/json_writer.cpp
+
+include $(MKFILES_ROOT)/qtargets.mk
View
8 ext/json/native/x86/Makefile
@@ -0,0 +1,8 @@
+LIST=VARIANT
+ifndef QRECURSE
+QRECURSE=recurse.mk
+ifdef QCONFIG
+QRDIR=$(dir $(QCONFIG))
+endif
+endif
+include $(QRDIR)$(QRECURSE)
View
1 ext/json/native/x86/so/Makefile
@@ -0,0 +1 @@
+include ../../common.mk
View
43 ext/meta.mk
@@ -0,0 +1,43 @@
+QNX_INCLUDE=$(QNX_TARGET)/usr/include
+QNX_USR_LIB=$(QNX_TARGET)/$(CPUVARDIR)/usr/lib
+QNX_LIB=$(QNX_TARGET)/$(CPUVARDIR)/lib
+
+WEBWORKS_DIR=../../../../..
+
+CCFLAGS+=-Werror
+LDFLAGS+=-Wl,-rpath,./app/native/plugins/jnext,-z,defs,-s
+
+EXTRA_LIBVPATH+=$(QNX_LIB) \
+ $(QNX_USR_LIB) \
+ $(QNX_USR_LIB)/qt4/lib \
+ $(WEBWORKS_DIR)/ext/json/native/$(CPU)/$(VARIANT1)
+
+EXTRA_INCVPATH+=$(QNX_INCLUDE) \
+ $(QNX_INCLUDE)/qt4 \
+ $(QNX_INCLUDE)/qt4/Qt \
+ $(QNX_INCLUDE)/qt4/QtCore \
+ $(WEBWORKS_DIR)/dependencies/jnext_1_0_8_3/jncore/jnext-extensions/common \
+ $(WEBWORKS_DIR)/dependencies/JsonCpp/jsoncpp-src-0.5.0/include
+
+EXTRA_SRCVPATH+=$(WEBWORKS_DIR)/dependencies/JsonCpp/jsoncpp-src-0.5.0/src/lib_json \
+ $(WEBWORKS_DIR)/dependencies/jnext_1_0_8_3/jncore/jnext-extensions/common
+
+ifeq ($(PLUGIN),yes)
+SRCS+=$(WEBWORKS_DIR)/dependencies/jnext_1_0_8_3/jncore/jnext-extensions/common/plugin.cpp
+endif
+
+ifeq ($(JSON),yes)
+ ifeq ($(UNITTEST),yes)
+ SRCS+=$(WEBWORKS_DIR)/dependencies/JsonCpp/jsoncpp-src-0.5.0/src/json_reader.cpp \
+ $(WEBWORKS_DIR)/dependencies/JsonCpp/jsoncpp-src-0.5.0/src/json_value.cpp \
+ $(WEBWORKS_DIR)/dependencies/JsonCpp/jsoncpp-src-0.5.0/src/json_writer.cpp
+ else
+ LDFLAGS+=-ljson
+ endif
+endif
+
+ifeq ($(UNITTEST),yes)
+EXTRA_INCVPATH+=$(WEBWORKS_DIR)/dependencies/gmock-1.5.0/fused-src
+EXTRA_SRCVPATH+=$(WEBWORKS_DIR)/dependencies/gmock-1.5.0/fused-src
+SRCS+=$(WEBWORKS_DIR)/dependencies/gmock-1.5.0/fused-src/gmock-gtest-all.cpp
+endif
View
8 ext/pim.contacts/Makefile
@@ -0,0 +1,8 @@
+LIST=VARIANT
+ifndef QRECURSE
+QRECURSE=recurse.mk
+ifdef QCONFIG
+QRDIR=$(dir $(QCONFIG))
+endif
+endif
+include $(QRDIR)$(QRECURSE)
View
4 ext/pim.contacts/index.js
@@ -114,11 +114,11 @@ JNEXT.PimContacts = function ()
};
self.init = function () {
- if (!JNEXT.require("pimContacts")) {
+ if (!JNEXT.require("libpimcontacts")) {
return false;
}
- self.m_id = JNEXT.createObject("pimContacts.PimContacts");
+ self.m_id = JNEXT.createObject("libpimcontacts.PimContacts");
if (self.m_id === "") {
return false;
View
2 ext/pim.contacts/manifest.json
@@ -1,5 +1,5 @@
{
"global": false,
"namespace": "blackberry.pim.contacts",
- "dependencies": []
+ "dependencies": ["json"]
}
View
25 ext/pim.contacts/native/CMakeLists.txt
@@ -1,25 +0,0 @@
-cmake_minimum_required(VERSION 2.8)
-
-if (CMAKE_COMPILER_IS_GNUCC)
- set(CMAKE_CXX_FLAGS "-Werror -fexceptions -fPIC ${CMAKE_CXX_FLAGS}")
- set(CMAKE_C_FLAGS "-Werror -fPIC ${CMAKE_C_FLAGS}")
-endif ()
-
-set(pimContacts_srcs
- pim_contacts_qt.cpp
- pim_contacts_js.cpp
- ../../../dependencies/JsonCpp/jsoncpp-src-0.5.0/src/lib_json/json_reader.cpp
- ../../../dependencies/JsonCpp/jsoncpp-src-0.5.0/src/lib_json/json_value.cpp
- ../../../dependencies/JsonCpp/jsoncpp-src-0.5.0/src/lib_json/json_writer.cpp
- ../../../dependencies/jnext_1_0_8_3/jncore/jnext-extensions/common/plugin.cpp
-)
-
-include_directories(${CMAKE_SOURCE_DIR})
-include_directories(${CMAKE_SOURCE_DIR}/dependencies/jnext_1_0_8_3/jncore/jnext-extensions/common)
-include_directories(${CMAKE_SOURCE_DIR}/dependencies/JsonCpp/jsoncpp-src-0.5.0/include)
-
-add_definitions(-DXP_UNIX)
-add_library(pimContacts MODULE ${pimContacts_srcs})
-target_link_libraries(pimContacts bbpim)
-
-set_target_properties(pimContacts PROPERTIES PREFIX "")
View
8 ext/pim.contacts/native/Makefile
@@ -0,0 +1,8 @@
+LIST=CPU
+ifndef QRECURSE
+QRECURSE=recurse.mk
+ifdef QCONFIG
+QRDIR=$(dir $(QCONFIG))
+endif
+endif
+include $(QRDIR)$(QRECURSE)
View
8 ext/pim.contacts/native/arm/Makefile
@@ -0,0 +1,8 @@
+LIST=VARIANT
+ifndef QRECURSE
+QRECURSE=recurse.mk
+ifdef QCONFIG
+QRDIR=$(dir $(QCONFIG))
+endif
+endif
+include $(QRDIR)$(QRECURSE)
View
2 ext/pim.contacts/native/arm/o.le-v7/Makefile
@@ -0,0 +1,2 @@
+UNITTEST=yes
+include ../../common.mk
View
1 ext/pim.contacts/native/arm/so.le-v7/Makefile
@@ -0,0 +1 @@
+include ../../common.mk
View
24 ext/pim.contacts/native/common.mk
@@ -0,0 +1,24 @@
+ifndef QCONFIG
+QCONFIG=qconfig.mk
+endif
+include $(QCONFIG)
+
+NAME=pimcontacts
+PLUGIN=yes
+JSON=yes
+
+include ../../../../meta.mk
+
+SRCS+=pim_contacts_qt.cpp \
+ pim_contacts_js.cpp
+
+ifeq ($(UNITTEST),yes)
+NAME=test
+SRCS+=test_main.cpp
+LIBS+=img
+USEFILE=
+endif
+
+include $(MKFILES_ROOT)/qtargets.mk
+
+LIBS+=bbpim QtCore
View
48 ext/pim.contacts/native/pim_contacts_qt.cpp
@@ -125,7 +125,7 @@ Json::Value PimContactsQt::CreateContact(const Json::Value& attributeObj)
bbpim::Contact newContact;
bbpim::ContactBuilder contactBuilder(newContact.edit());
- for (int i = 0; i < attributeKeys.size(); i++) {
+ for (unsigned int i = 0; i < attributeKeys.size(); i++) {
const std::string key = attributeKeys[i];
contactFields.append(Json::Value(key));
addAttributeKind(contactBuilder, attributeObj[key], key);
@@ -175,7 +175,7 @@ Json::Value PimContactsQt::EditContact(bbpim::Contact& contact, const Json::Valu
const Json::Value::Members attributeKeys = attributeObj.getMemberNames();
Json::Value contactFields;
- for (int i = 0; i < attributeKeys.size(); i++) {
+ for (unsigned int i = 0; i < attributeKeys.size(); i++) {
const std::string key = attributeKeys[i];
contactFields.append(Json::Value(key));
syncAttributeKind(contact, attributeObj[key], key);
@@ -208,7 +208,7 @@ Json::Value PimContactsQt::CloneContact(bbpim::Contact& contact, const Json::Val
const Json::Value::Members attributeKeys = attributeObj.getMemberNames();
Json::Value contactFields;
- for (int i = 0; i < attributeKeys.size(); i++) {
+ for (unsigned int i = 0; i < attributeKeys.size(); i++) {
const std::string key = attributeKeys[i];
contactFields.append(Json::Value(key));
syncAttributeKind(newContact, attributeObj[key], key);
@@ -275,9 +275,9 @@ void PimContactsQt::getSortSpecs(const Json::Value& sort)
_sortSpecs.clear();
if (sort.isArray()) {
- for (int j = 0; j < sort.size(); j++) {
+ for (unsigned int j = 0; j < sort.size(); j++) {
bbpim::SortOrder::Type order;
- bbpim::SortColumn::Type sortField;
+ bbpim::SortColumn::Type sortField = bbpim::SortColumn::LastName;
if (sort[j]["desc"].asBool()) {
order = bbpim::SortOrder::Descending;
@@ -309,7 +309,7 @@ QSet<bbpim::ContactId> PimContactsQt::getPartialSearchResults(const Json::Value&
_contactSearchMap.clear();
if (!filter.empty()) {
- for (int j = 0; j < filter.size(); j++) {
+ for (unsigned int j = 0; j < filter.size(); j++) {
QSet<bbpim::ContactId> currentResults = singleFieldSearch(filter[j], contactFields, favorite);
if (currentResults.empty()) {
@@ -347,7 +347,7 @@ QSet<bbpim::ContactId> PimContactsQt::singleFieldSearch(const Json::Value& searc
contactFilter.setIsFavourite(favorite);
}
- for (int i = 0; i < contactFields.size(); i++) {
+ for (unsigned int i = 0; i < contactFields.size(); i++) {
// favorite is always included, no need to include
if (contactFields[i].asString() == "favorite") {
continue;
@@ -464,7 +464,7 @@ Json::Value PimContactsQt::populateContact(bbpim::Contact& contact, const Json::
{
Json::Value contactItem;
- for (int i = 0; i < contactFields.size(); i++) {
+ for (unsigned int i = 0; i < contactFields.size(); i++) {
std::string field = contactFields[i].asString();
std::map<std::string, bbpim::AttributeKind::Type>::const_iterator kindIter = _attributeKindMap.find(field);
@@ -758,7 +758,7 @@ void PimContactsQt::addAttributeKind(bbpim::ContactBuilder& contactBuilder, cons
break;
}
case bbpim::AttributeKind::OrganizationAffiliation: {
- for (int i = 0; i < jsonObj.size(); i++) {
+ for (unsigned int i = 0; i < jsonObj.size(); i++) {
std::stringstream groupKeyStream;
groupKeyStream << i + 1;
@@ -820,12 +820,12 @@ void PimContactsQt::addAttributeKind(bbpim::ContactBuilder& contactBuilder, cons
// Special cases (treated differently in ContactBuilder):
default: {
if (field == "addresses") {
- for (int i = 0; i < jsonObj.size(); i++) {
+ for (unsigned int i = 0; i < jsonObj.size(); i++) {
Json::Value addressObj = jsonObj[i];
addPostalAddress(contactBuilder, addressObj);
}
} else if (field == "photos") {
- for (int i = 0; i < jsonObj.size(); i++) {
+ for (unsigned int i = 0; i < jsonObj.size(); i++) {
Json::Value photoObj = jsonObj[i];
addPhoto(contactBuilder, photoObj);
}
@@ -961,7 +961,7 @@ QList<SubkindValuePair> PimContactsQt::convertGroupedAttributes(const Json::Valu
const Json::Value::Members fields = fieldsObj.getMemberNames();
QList<SubkindValuePair> convertedList;
- for (int i = 0; i < fields.size(); i++) {
+ for (unsigned int i = 0; i < fields.size(); i++) {
const std::string fieldKey = fields[i];
StringToSubKindMap::const_iterator subkindIter = _attributeSubKindMap.find(fieldKey);
@@ -977,7 +977,7 @@ QList<SubkindValuePair> PimContactsQt::convertFieldAttributes(const Json::Value&
{
QList<SubkindValuePair> convertedList;
- for (int i = 0; i < fieldArray.size(); i++) {
+ for (unsigned int i = 0; i < fieldArray.size(); i++) {
Json::Value fieldObj = fieldArray[i];
std::string type = fieldObj.get("type", "").asString();
std::string value = fieldObj.get("value", "").asString();
@@ -995,7 +995,7 @@ QList<SubkindValuePair> PimContactsQt::convertStringArray(const Json::Value& str
{
QList<SubkindValuePair> convertedList;
- for (int i = 0; i < stringArray.size(); i++) {
+ for (unsigned int i = 0; i < stringArray.size(); i++) {
std::string value = stringArray[i].asString();
convertedList.append(SubkindValuePair(subkind, value));
}
@@ -1116,7 +1116,7 @@ void PimContactsQt::syncAttributeGroup(bbpim::ContactBuilder& contactBuilder, bb
{
int i;
- for (i = 0; i < jsonObj.size() && i < savedList.size(); i++) {
+ for (i = 0; i < static_cast<int>(jsonObj.size()) && i < savedList.size(); i++) {
std::stringstream groupKeyStream;
groupKeyStream << i + 1;
@@ -1130,8 +1130,8 @@ void PimContactsQt::syncAttributeGroup(bbpim::ContactBuilder& contactBuilder, bb
contactBuilder = contactBuilder.deleteAttribute(savedList[i][j]);
}
}
- } else if (i < jsonObj.size()) {
- for (; i < jsonObj.size(); i++) {
+ } else if (i < static_cast<int>(jsonObj.size())) {
+ for (; i < static_cast<int>(jsonObj.size()); i++) {
std::stringstream groupKeyStream;
groupKeyStream << i + 1;
@@ -1178,7 +1178,7 @@ void PimContactsQt::syncPostalAddresses(bbpim::ContactBuilder& contactBuilder, Q
{
int i;
- for (i = 0; i < savedList.size() && i < jsonObj.size(); i++) {
+ for (i = 0; i < savedList.size() && i < static_cast<int>(jsonObj.size()); i++) {
Json::Value addressObj = jsonObj[i];
bbpim::ContactPostalAddressBuilder addressBuilder(savedList[i].edit());
@@ -1201,8 +1201,8 @@ void PimContactsQt::syncPostalAddresses(bbpim::ContactBuilder& contactBuilder, Q
for (; i < savedList.size(); i++) {
contactBuilder = contactBuilder.deletePostalAddress(savedList[i]);
}
- } else if (i < jsonObj.size()) {
- for (; i < jsonObj.size(); i++) {
+ } else if (i < static_cast<int>(jsonObj.size())) {
+ for (; i < static_cast<int>(jsonObj.size()); i++) {
addPostalAddress(contactBuilder, jsonObj[i]);
}
}
@@ -1213,13 +1213,13 @@ void PimContactsQt::syncPhotos(bbpim::ContactBuilder& contactBuilder, QList<bbpi
int i;
// We must do the delete first, because there seems to be a problem if we do it after
- if (savedList.size() > jsonObj.size()) {
+ if (savedList.size() > static_cast<int>(jsonObj.size())) {
for (i = jsonObj.size(); i < savedList.size(); i++) {
contactBuilder = contactBuilder.deletePhoto(savedList[i]);
}
}
- for (i = 0; i < savedList.size() && i < jsonObj.size(); i++) {
+ for (i = 0; i < savedList.size() && i < static_cast<int>(jsonObj.size()); i++) {
std::string filepath = jsonObj[i].get("originalFilePath", "").asString();
bool pref = jsonObj[i].get("pref", false).asBool();
@@ -1232,8 +1232,8 @@ void PimContactsQt::syncPhotos(bbpim::ContactBuilder& contactBuilder, QList<bbpi
}
}
- if (i < jsonObj.size()) {
- for (; i < jsonObj.size(); i++) {
+ if (i < static_cast<int>(jsonObj.size())) {
+ for (; i < static_cast<int>(jsonObj.size()); i++) {
addPhoto(contactBuilder, jsonObj[i]);
}
}
View
7 ...m.contacts/native/unitTests/test_main.cpp → ext/pim.contacts/native/test_main.cpp
@@ -81,8 +81,9 @@ TEST(PimContacts, CanFindContacts)
if (result["contacts"].isArray()) {
Json::Value contacts = result["contacts"];
int i = 0;
+ int size = contacts.size();
- EXPECT_EQ(1, contacts.size());
+ EXPECT_EQ(1, size);
EXPECT_EQ("Alexander", contacts[i]["name"]["givenName"].asString());
EXPECT_EQ("Smitherman", contacts[i]["name"]["familyName"].asString());
EXPECT_EQ("work", contacts[i]["emails"][i]["type"].asString());
@@ -96,6 +97,7 @@ TEST(PimContacts, CanFilterNonFavorite)
{
webworks::PimContactsQt pimContacts;
Json::Value args;
+ int size = 0;
args["fields"] = Json::Value();
args["fields"].append(Json::Value("name"));
@@ -119,7 +121,8 @@ TEST(PimContacts, CanFilterNonFavorite)
expected["contacts"] = Json::Value();
EXPECT_EQ(true, result["_success"].asBool());
- EXPECT_EQ(0, result["contacts"].size());
+ size = result["contacts"].size();
+ EXPECT_EQ(0, size);
}
TEST(PimContacts, CanEditContact)
View
25 ext/pim.contacts/native/unitTests/CMakeLists.txt
@@ -1,25 +0,0 @@
-cmake_minimum_required(VERSION 2.8)
-
-if (CMAKE_COMPILER_IS_GNUCC)
- set(CMAKE_CXX_FLAGS "-Werror -fexceptions -lang-c++ ${CMAKE_CXX_FLAGS}")
- set(CMAKE_C_FLAGS "-Werror ${CMAKE_C_FLAGS}")
-endif ()
-
-include_directories(${CMAKE_SOURCE_DIR})
-include_directories(${CMAKE_SOURCE_DIR}/dependencies/gmock-1.5.0/fused-src/)
-include_directories(${CMAKE_SOURCE_DIR}/dependencies/JsonCpp/jsoncpp-src-0.5.0/include)
-
-set(srcs
- test_main.cpp
- ../pim_contacts_qt.cpp
- ../../../../dependencies/JsonCpp/jsoncpp-src-0.5.0/src/lib_json/json_reader.cpp
- ../../../../dependencies/JsonCpp/jsoncpp-src-0.5.0/src/lib_json/json_value.cpp
- ../../../../dependencies/JsonCpp/jsoncpp-src-0.5.0/src/lib_json/json_writer.cpp
- ../../../../dependencies/gmock-1.5.0/fused-src/gmock-gtest-all.cc
-)
-
-add_definitions(-DXP_UNIX)
-add_executable(pimContactsTest ${srcs})
-
-target_link_libraries(pimContactsTest m bbpim QtCore QtSql QtXml img)
-set_target_properties(pimContactsTest PROPERTIES PREFIX "" OUTPUT_NAME "test")
View
8 ext/push/Makefile
@@ -0,0 +1,8 @@
+LIST=VARIANT
+ifndef QRECURSE
+QRECURSE=recurse.mk
+ifdef QCONFIG
+QRDIR=$(dir $(QCONFIG))
+endif
+endif
+include $(QRDIR)$(QRECURSE)
View
4 ext/push/index.js
@@ -100,11 +100,11 @@ JNEXT.Push = function () {
};
self.init = function () {
- if (!JNEXT.require("pushJNext")) {
+ if (!JNEXT.require("libpushjnext")) {
return false;
}
- self.m_id = JNEXT.createObject("pushJNext.Push");
+ self.m_id = JNEXT.createObject("libpushjnext.Push");
if (self.m_id === "") {
return false;
View
2 ext/push/manifest.json
@@ -1,5 +1,5 @@
{
"global": false,
"namespace": "blackberry.push",
- "dependencies": []
+ "dependencies": ["json"]
}
View
26 ext/push/native/CMakeLists.txt
@@ -1,26 +0,0 @@
-cmake_minimum_required(VERSION 2.8)
-
-if (CMAKE_COMPILER_IS_GNUCC)
- set(CMAKE_CXX_FLAGS "-fexceptions -fPIC ${CMAKE_CXX_FLAGS}")
- set(CMAKE_C_FLAGS "-fPIC ${CMAKE_C_FLAGS}")
-endif ()
-
-include_directories(${CMAKE_SOURCE_DIR})
-include_directories(${CMAKE_SOURCE_DIR}/dependencies/jnext_1_0_8_3/jncore/jnext-extensions/common)
-include_directories(${CMAKE_SOURCE_DIR}/dependencies/JsonCpp/jsoncpp-src-0.5.0/include)
-
-set(push_srcs
- push_js.cpp
- push_ndk.cpp
- ../../../dependencies/JsonCpp/jsoncpp-src-0.5.0/src/lib_json/json_reader.cpp
- ../../../dependencies/JsonCpp/jsoncpp-src-0.5.0/src/lib_json/json_value.cpp
- ../../../dependencies/JsonCpp/jsoncpp-src-0.5.0/src/lib_json/json_writer.cpp
- ../../../dependencies/jnext_1_0_8_3/jncore/jnext-extensions/common/plugin.cpp
-)
-
-add_library(pushJNext MODULE ${push_srcs})
-target_link_libraries(pushJNext PushService)
-set_target_properties(pushJNext PROPERTIES PREFIX "")
-
-install(TARGETS pushJNext LIBRARY DESTINATION ".")
-
View
8 ext/push/native/Makefile
@@ -0,0 +1,8 @@
+LIST=CPU
+ifndef QRECURSE
+QRECURSE=recurse.mk
+ifdef QCONFIG
+QRDIR=$(dir $(QCONFIG))
+endif
+endif
+include $(QRDIR)$(QRECURSE)
View
8 ext/push/native/arm/Makefile
@@ -0,0 +1,8 @@
+LIST=VARIANT
+ifndef QRECURSE
+QRECURSE=recurse.mk
+ifdef QCONFIG
+QRDIR=$(dir $(QCONFIG))
+endif
+endif
+include $(QRDIR)$(QRECURSE)
View
2 ext/push/native/arm/o.le-v7/Makefile
@@ -0,0 +1,2 @@
+UNITTEST=yes
+include ../../common.mk
View
1 ext/push/native/arm/so.le-v7/Makefile
@@ -0,0 +1 @@
+include ../../common.mk
View
23 ext/push/native/common.mk
@@ -0,0 +1,23 @@
+ifndef QCONFIG
+QCONFIG=qconfig.mk
+endif
+include $(QCONFIG)
+
+NAME=pushjnext
+PLUGIN=yes
+JSON=yes
+
+include ../../../../meta.mk
+
+SRCS+=push_js.cpp \
+ push_ndk.cpp
+
+ifeq ($(UNITTEST),yes)
+NAME=test
+SRCS+=test_main.cpp
+USEFILE=
+endif
+
+include $(MKFILES_ROOT)/qtargets.mk
+
+LIBS+=PushService
View
2 ext/push/native/push_js.cpp
@@ -56,7 +56,7 @@ std::string Push::InvokeMethod(const std::string& command)
// Parse JSON object
Json::Value obj;
- if (command.length() > index) {
+ if (static_cast<int>(command.length()) > index) {
std::string jsonObject = command.substr(index + 1, command.length());
Json::Reader reader;
View
2 ext/push/native/push_ndk.cpp
@@ -307,7 +307,7 @@ std::string PushNDK::decodeBase64(const std::string& encodedString)
size_t remaining = encodedString.size();
size_t position;
- int i = 0, j = 0, current = 0;
+ int i = 0, current = 0;
unsigned char current_set[4];
std::string decoded_string;
View
6 ext/push/native/unitTests/test_main.cpp → ext/push/native/test_main.cpp
@@ -191,15 +191,17 @@ TEST(PushService, CanExtractPushPayload) {
EXPECT_EQ(expected_isAcknowledgeRequired, payload_obj["isAcknowledgeRequired"].asBool());
// Check payload data (byte array)
- ASSERT_EQ(11, payload_obj["data"].size());
+ int size = payload_obj["data"].size();
+ ASSERT_EQ(11, size);
Json::UInt expected_data[11] = {72, 101, 108, 108, 111, 32, 119, 111, 114, 108, 100};
for (int i = 0; i < 11; i++) {
EXPECT_EQ(expected_data[i], payload_obj["data"][i].asUInt());
}
// Check headers
- EXPECT_EQ(6, payload_obj["headers"].size());
+ size = payload_obj["headers"].size();
+ EXPECT_EQ(6, size);
std::map<std::string, std::string> expected_headers;
expected_headers["Content-Type"] = "text/plain; charset=UTF-8";
View
28 ext/push/native/unitTests/CMakeLists.txt
@@ -1,28 +0,0 @@
-cmake_minimum_required(VERSION 2.8)
-
-if (CMAKE_COMPILER_IS_GNUCC)
- set(CMAKE_CXX_FLAGS "-Werror -lang-c++ -fexceptions ${CMAKE_CXX_FLAGS}")
- set(CMAKE_C_FLAGS "-Werror ${CMAKE_C_FLAGS}")
-endif ()
-
-include_directories(${CMAKE_SOURCE_DIR})
-include_directories(${CMAKE_SOURCE_DIR}/dependencies/jnext_1_0_8_3/jncore/jnext-extensions/common)
-include_directories(${CMAKE_SOURCE_DIR}/dependencies/JsonCpp/jsoncpp-src-0.5.0/include)
-include_directories(${CMAKE_SOURCE_DIR}/dependencies/gmock-1.5.0/fused-src/)
-
-set(srcs
- test_main.cpp
- ../push_js.cpp
- ../push_ndk.cpp
- ../../../../dependencies/JsonCpp/jsoncpp-src-0.5.0/src/lib_json/json_reader.cpp
- ../../../../dependencies/JsonCpp/jsoncpp-src-0.5.0/src/lib_json/json_value.cpp
- ../../../../dependencies/JsonCpp/jsoncpp-src-0.5.0/src/lib_json/json_writer.cpp
- ../../../../dependencies/jnext_1_0_8_3/jncore/jnext-extensions/common/plugin.cpp
- ../../../../dependencies/gmock-1.5.0/fused-src/gmock-gtest-all.cc
-)
-
-add_executable(pushJNextTest ${srcs})
-
-target_link_libraries(pushJNextTest PushService bps)
-set_target_properties(pushJNextTest PROPERTIES PREFIX "" OUTPUT_NAME "test")
-
View
8 ext/push/native/x86/Makefile
@@ -0,0 +1,8 @@
+LIST=VARIANT
+ifndef QRECURSE
+QRECURSE=recurse.mk
+ifdef QCONFIG
+QRDIR=$(dir $(QCONFIG))
+endif
+endif
+include $(QRDIR)$(QRECURSE)
View
2 ext/push/native/x86/o/Makefile
@@ -0,0 +1,2 @@
+UNITTEST=yes
+include ../../common.mk
View
1 ext/push/native/x86/so/Makefile
@@ -0,0 +1 @@
+include ../../common.mk
View
8 ext/ui.dialog/Makefile
@@ -0,0 +1,8 @@
+LIST=VARIANT
+ifndef QRECURSE
+QRECURSE=recurse.mk
+ifdef QCONFIG
+QRDIR=$(dir $(QCONFIG))
+endif
+endif
+include $(QRDIR)$(QRECURSE)
View
4 ext/ui.dialog/index.js
@@ -112,11 +112,11 @@ JNEXT.Dialog = function ()
};
self.init = function () {
- if (!JNEXT.require("dialog")) {
+ if (!JNEXT.require("libdialog")) {
return false;
}
- self.m_id = JNEXT.createObject("dialog.Dialog");
+ self.m_id = JNEXT.createObject("libdialog.Dialog");
if (self.m_id === "") {
return false;
View
2 ext/ui.dialog/manifest.json
@@ -1,5 +1,5 @@
{
"global": false,
"namespace": "blackberry.ui.dialog",
- "dependencies": []
+ "dependencies": ["json"]
}
View
26 ext/ui.dialog/native/CMakeLists.txt
@@ -1,26 +0,0 @@
-cmake_minimum_required(VERSION 2.8)
-
-if (CMAKE_COMPILER_IS_GNUCC)
- set(CMAKE_CXX_FLAGS "-Werror -fexceptions -fPIC ${CMAKE_CXX_FLAGS}")
- set(CMAKE_C_FLAGS "-Werror -fPIC ${CMAKE_C_FLAGS}")
-endif ()
-
-include_directories(${CMAKE_SOURCE_DIR})
-include_directories(${CMAKE_SOURCE_DIR}/dependencies/jnext_1_0_8_3/jncore/jnext-extensions/common)
-include_directories(${CMAKE_SOURCE_DIR}/dependencies/JsonCpp/jsoncpp-src-0.5.0/include)
-
-set(dialog_srcs
- dialog_bps.cpp
- dialog_js.cpp
- ../../../dependencies/JsonCpp/jsoncpp-src-0.5.0/src/lib_json/json_reader.cpp
- ../../../dependencies/JsonCpp/jsoncpp-src-0.5.0/src/lib_json/json_value.cpp
- ../../../dependencies/JsonCpp/jsoncpp-src-0.5.0/src/lib_json/json_writer.cpp
- ../../../dependencies/jnext_1_0_8_3/jncore/jnext-extensions/common/plugin.cpp
-)
-
-add_library(dialog MODULE ${dialog_srcs})
-target_link_libraries(dialog bps)
-set_target_properties(dialog PROPERTIES PREFIX "")
-
-install(TARGETS dialog LIBRARY DESTINATION ".")
-
View
8 ext/ui.dialog/native/Makefile
@@ -0,0 +1,8 @@
+LIST=CPU
+ifndef QRECURSE
+QRECURSE=recurse.mk
+ifdef QCONFIG
+QRDIR=$(dir $(QCONFIG))
+endif
+endif
+include $(QRDIR)$(QRECURSE)
View
8 ext/ui.dialog/native/arm/Makefile
@@ -0,0 +1,8 @@
+LIST=VARIANT
+ifndef QRECURSE
+QRECURSE=recurse.mk
+ifdef QCONFIG
+QRDIR=$(dir $(QCONFIG))
+endif
+endif
+include $(QRDIR)$(QRECURSE)
View
1 ext/ui.dialog/native/arm/so.le-v7/Makefile
@@ -0,0 +1 @@