Acknowledgement Generator is a small Ruby script for generating an Acknowledgement section in iOS Apps Settings.bundle.
Preconditions:
In order to use this 'AcknowledgementGenerator' you must have the 'CFPropertyList' gem installed.
https://rubygems.org/gems/CFPropertyList
Setup: (Default - Customize as you see fit)
- Create a 'licenses' directory
- Put each license into that directory, one per file, with filenames that end .license
- Perform any necessary reformatting on the licenses. (eg. remove extra spaces at the beginning of lines, ensure that there are no line breaks mid-paragraph). There should be a blank line in-between each paragraph
- Edit your settings bundle Root.plist to include a child section called 'Acknowledgements'
Usage:
- In Terminal execute: (modefy to suit your needs)
./acknowledgementGenerator.rb "path/to/Settings.bundle" "path/to/licenses"
Execute Script At Build Time
If you want this script to run whenever you build your project, you can add a build phase to your target.
- Select your project file
- Select the target application
- Click the 'Build Phases' tab
- Now from the menu select: Editor > Add Build Phase > Add Run Script Build Phase
- Enter something like the folowing script: (modefy to suit your needs)
if gem list CFPropertyList -i; then
ruby path/to/acknowledgementGenerator.rb "path/to/Settings.bundle" "path/to/licenses"
fi
After you have finished that, you should drag the Run Script build phase to sooner in the build process. You'll want to move it up before Compile Sources so that the updates to your Settings Bundle get compiled and copied over.
Thanks to JosephH @ stackoverflow.
The idea for this scripe, and the setup instructions above comes from his post:
http://stackoverflow.com/questions/6428353/best-way-to-add-license-section-to-ios-settings-bundle/6453507#6453507
Released under the BEER-WARE License. See the LICENSE file for more information.