Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-19797] CLI: Support accessing XML values from tiapp.xml's platform-specific sections at runtime.

GitHub Issuen/a
TypeImprovement
PriorityHigh
StatusOpen
ResolutionUnresolved
Affected Version/sn/a
Fix Version/sn/a
ComponentsAndroid, CLI, Hyperloop, iOS, Tooling, Windows
Labelscb-tooling, titaniumlib
ReporterChristopher Williams
AssigneeChris Barber
Created2015-10-26T15:33:43.000+0000
Updated2020-03-06T21:35:41.000+0000

Description

Currently the CLi's XML parsing of tiapp.xml only handles known tags. We've used a series of generic properties tags before to get properties into the runtime. For platform-specific ones, we've just used prefix names of "ti.android.". We've started to move to preferring platform-specific properties to be under the root tag for a a platform in the xml:
<tiapp ...
    <ios>
        <run-on-main-thread>true</run-on-main-thread>
    </ios>
...
</tiapp>
However, we have no means of accessing those values at runtime, and we need to handle the tags specially in CLi code for each platform. Ideally we'd be able to have some straight XML->JSON serialization for access in the CLI code from each platform so we could do:
var runOnMainThread = tiapp.ios[run-on-main-thread]
And we need some way to access this data at runtime. Maybe hack the properties into the properties file/json to generate "properties" with namespaced keys, like "tiapp.ios.run-on-main-thread"?

Comments

  1. Chris Barber 2015-10-26

    We should use properties for things like "run-on-main-thread". We already have a mechanism for injecting properties into an app. All we would need to do is look for properties inside the platform specific tags and have the platform build commands mix the global and platform-specific properties together.

JSON Source