cordovaibm-mobilefirstworklight-studio

IBM Worklight 6.1 - Questions about upgrading Cordova in a project


IBM Worklight 6.1.0 is now using Cordova v3.1. The upgrade process for Cordova configuration is automated.

My questions are:

  1. How the auto-upgrade is carried out in worklight?
  2. How do I know whether my Cordova library is updated?
  3. If the update is not carried automatically how to manually update it?

Solution

  • How the auto-upgrade is carried out in worklight?

    After you install/upgrade to a new Worklight Studio version in Eclipse, if you have existing Worklight project already in the workspace then Worklight utilizes internal, custom-written, upgraders to check for the project version and will replace all old files (not just Cordova, but also other Worklight framework files) with new files.


    How do I know whether my Cordova library is updated?

    For the iPhone environment, for example, there is a version file: yourProject\apps\yourApp\iphone\native\CordovaLib\version

    But not all environments have this file so IMO the easiest way would be to use the device.cordova API method:

    1. Put the following code snippet in your common\js\main.js > wlCommonInit() function.
    2. Build & deploy the project
    3. Preview the desired environment in Worklight Console or in a device or simulator/emulator, doesn't matter. You will see an alert with the used Cordova version:

      alert ("Used Cordova version is: " + device.cordova);
      


    If the update is not carried automatically how to manually update it?