AckAck is a python script that automatically generates a plist based on the licenses in your Carthage, CocoaPods, or SwiftPackageManager folder. When you use the plists in your app, the licenses will show up in the Settings app.
Simply download the ackack.py script and store it in your project root or in a subfolder (e.g. Scripts).
$ wget https://raw.githubusercontent.com/Building42/AckAck/master/ackack.py
$ chmod +x ackack.py
- Make sure that you have a Settings.bundle in your project (otherwise create one with Xcode)
- Make sure that you ran Carthage or CocoaPods (you should have a Carthage/Checkouts or Pods folder)
- Run the script:
./ackack.py
- The script will automatically try to find the input and output folders
- After the script is done, you will have a Acknowledgements.plist and a plist for every license found
Settings.bundle
├── Root.plist
├── Acknowledgements.plist
├── Acknowledgements
│ ├── Charts.plist
│ ├── HTTPParserC.plist
│ ├── Telegraph.plist
You can see the options and other help information by running ./ackack.py --help
.
- Open your project in Xcode
- Click on your project and then Build Phases
- Click the + to add a
New Run Script Phase
- Paste the following in the script field:
cd $SRCROOT
./ackack.py
Things get a little trickier when using SPM because of how Xcode stores the packages. If you plan to integrate with Xcode, set your Run Script Build Phase like so:
DERIVED_DATA_CANDIDATE="${BUILD_ROOT}"
while ! [ -d "${DERIVED_DATA_CANDIDATE}/SourcePackages/checkouts" ]; do
if [ "${DERIVED_DATA_CANDIDATE}" = / ]; then
echo >&2 "error: Unable to locate SourcePackages directory from BUILD_ROOT: '${BUILD_ROOT}'"
exit 1
fi
DERIVED_DATA_CANDIDATE="$(dirname "${DERIVED_DATA_CANDIDATE}")"
done
cd $SRCROOT
./ackack.py --spminput ${DERIVED_DATA_CANDIDATE}
Otherwise, you'll need to specify the --spminput
argument when running AckAck. SPM contents (unless you've specified otherwise) are located in your app's derived data folder under /SourcePackages/checkouts
. The path to that folder usually looks something like this:
/Users/username/Library/Developer/Xcode/DerivedData/AppName-buildUUID/SourcePackages/checkouts