Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-14661] Cannot have a plugin if the project is for both Android and iOS

GitHub Issuen/a
TypeBug
PriorityCritical
StatusClosed
ResolutionWon't Fix
Resolution Date2013-08-07T18:25:17.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsAndroid, Tooling
Labelsandroid, androidbuild, cb-verified, iOS, plugin
ReporterSteve Trautman
AssigneeChris Barber
Created2013-07-23T15:53:19.000+0000
Updated2017-03-23T22:45:59.000+0000

Description

You effectively cannot have any plugin if the project is for both Android and iOS. Android currently requires python plugins. iOS currently requires js plugins. I ported an old python plugin to a new js plugin for iOS (thanks to the example at http://appersonlabs.com/2013/04/12/titanium-build-plugins-in-sdk-3-x-x/) and it worked great. Then I tried to build for Android, and it failed the build saying the plugin is missing. So I created a essentially empty python plugin in that folder:
def compile(config)
    #don't do anything
    #when android gets on board with js plugins, delete me!
    myconfig = config
I then discovered that the Android build actually calls the new js plugin if present, but the function parameters aren't set. I was able to work around this in the js plugin by checking to make sure the parameters aren't null before proceeding. It then calls the empty python plugin as usual, as well as all of my other legacy python plugins (that don't have also .js files in them). But then the iOS plugin silently ceased to be executed. The iOS build silently ignores a js plugin if it also has a python file present. The developer put a comment in the code at about line 292 of /titatium-sdk/lib/titanium.js:
// we don't support plugins that have both a plugin.py and new .js files
It would have spared me the time of digging through titanium's code if the developer had put that comment into a log entry. But I digress. Hopefully the easiest fix is also the best one (in my outside-looking-in opinion): the exact opposite of what is done in the js cli at line 292 above should be done here. Instead of ignoring the js plugin, it should ignore the python file with a debug or warn message. It should not be an error or fail the build. In fact, the js cli already ignores the python plugins, so perhaps all that needs to be done here is to not ignore a js plugin when a py plugin is present. I understand if you didn't have time to port android to js along with iOS, but you have effectively broken plugins for both platforms, and that is disappointing to me. It's been coming up on a year since the js cli was released. That's a long time for you to leave us hanging without a prior functionality, or documentation of the new plugin api. When will android be ported to the new js cli? When you will document the new js plugin api?

Comments

  1. Chris Barber 2013-08-07

    This is a non-issue. The Android rewrite is underway and is scheduled for release 3.2.0.
  2. Lee Morris 2017-03-23

    Closing ticket as Won't Fix with reference to the above comments.

JSON Source