[TIMOB-18261] iOS: Correct missing newlines at ends of header files
GitHub Issue | n/a |
---|---|
Type | Story |
Priority | Medium |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2014-12-18T17:42:27.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Release 4.0.0 |
Components | iOS |
Labels | n/a |
Reporter | Ingo Muschenetz |
Assignee | Ingo Muschenetz |
Created | 2014-12-18T12:05:18.000+0000 |
Updated | 2017-03-13T21:18:01.000+0000 |
Description
It appears that some of our header files are missing newlines and triggering Apple warnings. While this should no longer be an issue when using C++ 11, it appears to still cause warnings with default Apple settings:
http://stackoverflow.com/questions/72271/no-newline-at-end-of-file-compiler-warning
To find:
#!/usr/bin/env bash
for i in $(find . -type f -name "*.h") ; do \
if diff /dev/null "$i" | tail -1 | \
grep '^\\ No newline' > /dev/null; then echo $i; \
fi; done
Run this in the titanium_mobile/iphone directory
Taken from http://stackoverflow.com/questions/3261925/how-to-fix-no-newline-at-end-of-file-compiler-warning-for-lots-of-files
To fix:
#!/usr/bin/env bash
for i in $(find . -type f -name "*.h") ; do echo $i; \
if diff /dev/null "$i" | tail -1 | \
grep '^\\ No newline' > /dev/null; then echo >> "$i"; \
fi; done
PR (master): https://github.com/appcelerator/titanium_mobile/pull/6506
Closing ticket as fixed.