Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-23649] Use per-platform moduleAPIVersions in the SDK manifest.json

GitHub Issuen/a
TypeImprovement
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2016-08-04T13:52:25.000+0000
Affected Version/sRelease 6.0.0
Fix Version/sRelease 6.0.0
ComponentsCore
Labelsn/a
ReporterAshraf Abu
AssigneeChristopher Williams
Created2016-07-14T07:38:09.000+0000
Updated2018-08-06T17:49:18.000+0000

Description

We need the ability to version the module API's at the platform level (and not globally). We updated Android/V8 so only need to bump the moduleAPIVersion to 3 there, but retain 2 on iOS. For the SDK, this involves using an object value for "moduleAPIVersion" property. I propose that the object have the platform ids as the keys and the api version as the value, like so:
{
  "name": "6.0.0.v20160717220907",
  "version": "6.0.0",
  "moduleAPIVersion": {
    "iphone": "2",
    "android": "3",
    "mobileweb": "2"
  },
  "timestamp": "7/18/2016 05:13",
  "githash": "e31eb5e",
  "platforms": [
    "iphone",
    "android",
    "mobileweb"
  ]
}

Comments

  1. Kondal Kolipaka 2016-07-18

    [~msamah] [~cng] - moduleAPIVersion is need to be updated to 3 with SDK 6.0 This can be found in manifest.json in titanium mobile SDK home directory.
       {
         "name": "6.0.0.v20160717220907",
         "version": "6.0.0",
         "moduleAPIVersion": "2",
         "timestamp": "7/18/2016 05:13",
         "githash": "e31eb5e",
         "platforms": [
           "iphone",
           "android",
           "mobileweb"
         ]
       }
       
  2. Ashraf Abu 2016-07-18

    Thank you for the findings.
  3. Ashraf Abu 2016-07-18

    Exact location https://github.com/appcelerator/titanium_mobile/blob/02620f76c6fbcfb35f40eb2254380d90f3e81d02/package.json#L5
  4. Ashraf Abu 2016-07-18

    [~cwilliams] for your PR update here: https://github.com/appcelerator/titanium_mobile/commit/881c045d606d1da22a2264e60ce6c6c902181c50#diff-b9cfc7f2cdf78a7f4b91a753d10865a2R5 You also included "moduleApiVersion": 2,. With the new modules having apiversion 3, they aren't detected in studio. Is this something we need to update to 3? And if so, it would render modules with apiversion 2 (both iOS and Android I believe) to not be useable. Please correct me if I'm wrong in understanding this. Basically right now, modules compiled in apiversion 3 aren't detected in Studio.
  5. Christopher Williams 2016-07-18

    Ok, so I see the issue here. Studio is enforcing the moduleAPIVersion value in the SDK's manifest.json matches the moduleAPIVersion in the modules. The problem here is that Studio is the only one enforcing that, and that we need moduleAPIVersion to actually be platform-specific now - since the API didn't change for iOS, but did for Android. See TIMOB-23550 I think we should add an enhancement request to Studio to have it understand the old "global" moduleAPIVersion for the SDK, or a newer platform-specific listing, one that might look like this:
       
       {
         "name": "6.0.0.v20160717220907",
         "version": "6.0.0",
         "moduleAPIVersion": {
           "iphone": "2",
           "android": 3,
           "mobileweb": "2"
         }
         "timestamp": "7/18/2016 05:13",
         "githash": "e31eb5e",
         "platforms": [
           "iphone",
           "android",
           "mobileweb"
         ]
       }
       
  6. Christopher Williams 2016-07-18

    https://github.com/appcelerator/titanium_mobile/pull/8140
  7. Ashraf Abu 2016-08-04

    To test this, use the latest Studio with the latest 6.0.0. Add this module to an Android project https://github.com/appcelerator-modules/ti.imagefactory/releases/tag/android-3.0.0 The v3.0.0 module should appear in the tiapp.xml overview modules when you click the add button and you should be able to add it.
  8. Ashraf Abu 2016-08-04

    Just a note, not sure if it's me but after compiling latest master of TiSDK, the manifest.json file showed:
       {
         "name": "6.0.0",
         "version": "6.0.0",
         "moduleAPIVersion": "[object Object]",
         "timestamp": "8/4/2016 02:21",
         "githash": "6f132a1",
         "platforms": [
           "android",
           "iphone",
           "mobileweb"
         ]
       }
       
    which prevented any ApiVersion 3 module from being used. Instead, it should have shown something like this:-
       {
         "name": "6.0.0",
         "version": "6.0.0",
         "moduleAPIVersion": {
           "android":"3",
           "iphone":"2",
           "mobileweb":"2"
         },
         "timestamp": "8/4/2016 02:21",
         "githash": "6f132a1",
         "platforms": [
           "android",
           "iphone",
           "mobileweb",
         ]
       }
       
    Adding this comment because it seems to be just me for now facing this when compiling the master branch.
  9. Ashraf Abu 2016-08-04

    [~cwilliams] Checked with Kondal, studio checks the values in manifest.json. The PR changes changed the package.json. From what I can see, package.json's values for "moduleApiVersion" is being copied over to manifest.json but it is copying it wrongly. Instead of the correct key values, it's copied as [object Object].
  10. Ashraf Abu 2016-08-04

    [~cwilliams] I reopened the ticket. Please resolve back the ticket if I'm incorrect.
  11. Ashraf Abu 2016-08-04

    Perhaps this needs fixing: https://github.com/appcelerator/titanium_mobile/blob/cedf4838ac5dc7c9d7fcdb77b07ddb8a1f432271/build/packager.js#L104
  12. Ashraf Abu 2016-08-04

    PR for the fix: https://github.com/appcelerator/titanium_mobile/pull/8190 [~cwilliams] for your review. :)
  13. Eric Merriman 2018-08-06

    Cleaning up older fixed issues. If this issue should not have been closed as fixed, please reopen.

JSON Source