Previously, when popen was called, the 3 streams (stdin, stderr and stdourt) where never closed. This was the reason of the having an impossible number of open files.
This patch ensure all streams are closed after using them. This means that the ulimit trick is no more necessary
Previously, nib2cib sent the output of plutil to a temp file, then read that file. plutil supports writing to stdout, which avoids the temp file completely, so that is what we do now.
Previously error messages would always be colorized, which doesn't work well if you are piping the output.
Passing --no-colors turns off all colors in the output.
* State *
Previously the Converter class needlessly copied a whole bunch of state from the Nib2Cib class, which was not only poor factoring, but made for easy omissions of state when instantiating a new Converter, such as was done in NSNib.j.
This commit pushes all state not specific to Converter up to Nib2Cib. This allowed removal of redundant code in NSNib -NS_initWithCoder.
* Resources *
Previously it was not possible to use custom images that were located in a framework, because only the app's Resources directory was searched.
This commit automatically searches all frameworks for Resources directories. When a custom image is specified in Xcode, first the app's Resources directory is searched, then all framework Resource directories. Alternately, the specific framework to use can be specified in Xcode by using the form framework@image.
At runtime, the framework is loaded by its identifier (as specified in Info.plist), and if there is no identifier, by searching next to the current AppKit framework.
All of this renders the nib2cib -R option completely obsolete, so it was removed from the NibApplication/Jakefile template.
Previously, NSNib would create a Converter instance for converting table cell views. Unfortunately Converter did not expect to be instantiated more than once, and the singleton SharedConverter was unconditionally being set in the initializer. This might not have caused problems, except that NSNib did not copy all of the shared Converter's state to the copy, especially the resource path, which caused custom images in table cell views to fail.
This commit correctly ensures that the shared Converter instance is set only once, and also copies all of the shared Converter state to the instance that is used for converting the table cell view.
- Added support for User Defined Runtime Attributes in IB.
- Added support for userland NS classes in IB.
- Added support for file-based nib2cib configuration.
- Converted nib2cib to Objective-J from straight Javascript.
- Updated man page for new features.
- Test app.
- When a xib/nib is deleted, the corresponding cib is deleted.
- Fixed the calculation of the output path when given a relative path.
- Works with .nib files now.
- Works with -R option now. NSCustomResource was assuming an image path would always be relative to cwd().
- The Resources directory is always inferred from the input path, so the -R option is usually unnecessary.
- Added --default-theme option.
- Multiple extra themes can be specified with the --theme option.
- Verbose mode displays the inferred application and resources paths, and the source theme used when doing font substitutions.
- Added a man page.
- Themes are read using StaticResource instead of parsing the file myself.
- Error message tweaks.
- The holy grail! I took Klaas' great autonib2cib and rolled it into nib2cib.
- Removed check for stream in CPLogColorize, it isn't necessary and reduces its general-purpose usage.