[TIMOB-19797] CLI: Support accessing XML values from tiapp.xml's platform-specific sections at runtime.
GitHub Issue | n/a |
---|---|
Type | Improvement |
Priority | High |
Status | Open |
Resolution | Unresolved |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | Android, CLI, Hyperloop, iOS, Tooling, Windows |
Labels | cb-tooling, titaniumlib |
Reporter | Christopher Williams |
Assignee | Chris Barber |
Created | 2015-10-26T15:33:43.000+0000 |
Updated | 2020-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"?
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.