Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-12888] Use of parentModule annotation in module fails (Android Modules)

GitHub Issuen/a
TypeBug
PriorityMedium
StatusOpen
ResolutionUnresolved
Affected Version/sn/a
Fix Version/sn/a
Componentsn/a
Labelsn/a
ReporterJeff English
AssigneeUnknown
Created2013-02-27T17:12:39.000+0000
Updated2018-02-28T20:03:32.000+0000

Description

Using the "parentModule" kroll annotation in an Android module allows it to create a namespace hierarchy (e.g. mymodule.database.sql). However, depending on the names that are used for these 'namespaces' the build will fail for the module. This is becoming more important as we create more complex module structures. The error is because the bootstrap.py build script does not always obtain the correct moduleClassName. It needs to get the top-level module classname, but it does this by assuming that entry '0' of the 'keys' hashmap is the module class name (line 376 of bootstrap.py). Since 'keys' is a hashmap (ie. unordered) it is indeterminate what the first entry will be. If entry "0" does not happen to be the class name for the top level module then the build will fail. Depending on the names used for the various module names, it is *possible* that entry "0" of the map will be the class name for the module, but not likely when multiple parentModule annotations are used. This can be reproduced with a simple module that uses one level of parentModule referencing. To reproduce: 1. Unzip the attached nsgood.zip file 2. Build the module (ie. ant) -- should build successfully 3. Run the example application (ie. ant run). Label should display the value "999" that it retrieved from the nested namespace module. 4. Unzip the attached nsbad.zip file 5. Build the module -- should fail the build since it thinks the top-level className is 'ti.ns.z.ZModule' instead of 'ti.ns.NSModule' Note that the only difference between these two modules is the name of the 2nd level module namespace. In the 'good' version it is "AModule" while in the 'bad' version it is "ZModule".

Attachments

FileDateSize
nsbad.zip2013-02-27T18:00:41.000+000012190
nsgood.zip2013-02-27T18:00:41.000+000011937

Comments

No comments

JSON Source