[TIMOB-24453] iOS: Don't include metadata.json when no assets, utilize module version as a compiler flag
GitHub Issue | n/a |
---|---|
Type | Improvement |
Priority | Medium |
Status | Resolved |
Resolution | Fixed |
Resolution Date | 2017-04-14T13:48:23.000+0000 |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | iOS |
Labels | n/a |
Reporter | Hans Knöchel |
Assignee | Hans Knöchel |
Created | 2017-03-05T16:24:01.000+0000 |
Updated | 2017-04-14T13:48:23.000+0000 |
Description
There are many use-cases where developers want the module version inside the module.xcconfig (e.g. when manually linking frameworks like [here](https://github.com/appcelerator-modules/ti.facebook/blob/master/ios/module.xcconfig#L12) or [here](https://github.com/hansemannn/ti.googlesignin/blob/master/iphone/module.xcconfig#L9). Module developers usually bump the version in both the manifest and this file, which can easily cause problems when they forget it (I did twice as well).
Long story short, we would add the compiler flag
TI_MODULE_VERSION
to the generated module.xcconfig
, so people can use the flag with $(TI_MODULE_VERSION)
.
Another thing was that we should only generate the metadata.json
when there are JS files to encrypt. Otherwise, it will generate an empty json file that isn't required and also not generated when using the old build.py (rot in hell).
PR: https://github.com/appcelerator/titanium_mobile/pull/8861 To test:
Create a new iOS module with
appc new -t -p ios
Build the module with
appc run -p ios --build-only
Unzip the generated module
Inspect the
modules/iphone/<module-name>/1.0.0/module.xcconfig
to include theTI_MODULE_VERSION
compiler flag at the top of the file