https://github.com/codeeagle/rocketboot
Speed up you app's launching when you using Carthage or Punic to manager your Third-Party frameworks
https://github.com/codeeagle/rocketboot
carthage cocoa-animono punic
Last synced: about 1 month ago
JSON representation
Speed up you app's launching when you using Carthage or Punic to manager your Third-Party frameworks
- Host: GitHub
- URL: https://github.com/codeeagle/rocketboot
- Owner: CodeEagle
- License: mit
- Created: 2017-06-19T04:44:56.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2018-01-07T12:12:26.000Z (about 8 years ago)
- Last Synced: 2025-12-30T11:49:06.514Z (3 months ago)
- Topics: carthage, cocoa-animono, punic
- Language: Swift
- Homepage:
- Size: 6.7 MB
- Stars: 7
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# RocketBoot
Speed up you app's launching when you using Carthage or Punic to manager your Third-Party frameworks
# what is it?
Move all dynamic frameworks symbols into the main executable for [Carthage](https://github.com/Carthage/Carthage) and [Punic](https://github.com/schwa/punic), like [cocoapods-amimono](https://github.com/Ruenzuo/cocoapods-amimono) for cocoapods
# Requirements
`Swift 4`
# RocketBoot.yaml
```
tool: punic # carthage or punic, default is punic
xcode9: true # true or false, default is true
repos:
# xcodeproj Name; Scheme Name; Optional Tag, if using carthage and not setting tag, will using the latest tag build;
# - [ Alamofire, Alamofire iOS ] or - [ Alamofire, Alamofire iOS, 4.0.0 ]
```
# Installtion
```
git clone git@github.com:CodeEagle/RocketBoot.git
cd RocketBoot && make install
```
# Usage
when done running `rocketboot`, a folder `RocketBoot` is generated
Integrated `RocketBoot/RocketBoot.xcconfig` to your project
# Tests
```
make test
```
# ⚠️
This program not copying any resources from sub frameworks, such as `*.storyboard`, `*.bundle`, `*.assets`, need manual handle resources copying
__This program is not working for dynamic framework that contains a static library __
__You'd better not copying any `*.assets` from your sub frameworks to your main project__, because it will making your main project's launching.xib not showing image.
_workaround_
Wrap all your framework's resources into `*.bundle` and just copy it to main project will work fine
[Cocoapods copy resources script](https://github.com/CocoaPods/CocoaPods/blob/ad59b03dfe7def01f541634e6ce9b46edb989b19/lib/cocoapods/generator/copy_resources_script.rb#L97)
example
```
#!/bin/sh
set -e
CARTHAGE_CHECKOUT_ROOT=${SRCROOT}/Carthage/Checkouts
CARTHAGE_BUILD_ROOT=${SRCROOT}/Carthage/Build/iOS
mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
RESOURCES_TO_COPY=${SRCROOT}/Scripts/resources-to-copy-${TARGETNAME}.txt
> "$RESOURCES_TO_COPY"
XCASSET_FILES=()
case "${TARGETED_DEVICE_FAMILY}" in
1,2)
TARGET_DEVICE_ARGS="--target-device ipad --target-device iphone"
;;
1)
TARGET_DEVICE_ARGS="--target-device iphone"
;;
2)
TARGET_DEVICE_ARGS="--target-device ipad"
;;
3)
TARGET_DEVICE_ARGS="--target-device tv"
;;
4)
TARGET_DEVICE_ARGS="--target-device watch"
;;
*)
TARGET_DEVICE_ARGS="--target-device mac"
;;
esac
install_resource()
{
if [[ "$1" = /* ]] ; then
RESOURCE_PATH="$1"
else
RESOURCE_PATH="${CARTHAGE_CHECKOUT_ROOT}/$1"
fi
if [[ ! -e "$RESOURCE_PATH" ]] ; then
cat << EOM
error: Resource "$RESOURCE_PATH" not found. Run 'pod install' to update the copy resources script.
EOM
exit 1
fi
case $RESOURCE_PATH in
*.storyboard)
echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}"
ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS}
;;
*.xib)
echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}"
ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS}
;;
*.framework)
echo "mkdir -p ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
mkdir -p "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
echo "rsync -av $RESOURCE_PATH ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
rsync -av "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
;;
*.xcdatamodel)
echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH"`.mom\""
xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodel`.mom"
;;
*.xcdatamodeld)
echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd\""
xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd"
;;
*.xcmappingmodel)
echo "xcrun mapc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm\""
xcrun mapc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm"
;;
*.xcassets)
ABSOLUTE_XCASSET_FILE="$RESOURCE_PATH"
XCASSET_FILES+=("$ABSOLUTE_XCASSET_FILE")
;;
*)
echo "$RESOURCE_PATH" >> "$RESOURCES_TO_COPY"
;;
esac
}
OTHER_BUNDLE=("${CARTHAGE_CHECKOUT_ROOT}/TOCropViewController/TOCropViewController/languages.bundle" "${CARTHAGE_CHECKOUT_ROOT}/IQKeyboardManager/IQKeyboardManagerSwift/Resources/IQKeyboardManager.bundle")
intall_all() {
for name in "${OTHER_BUNDLE[@]}"
do
echo "install_resource $name"
install_resource $name
done
}
intall_all
mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
if [[ "${ACTION}" == "install" ]] && [[ "${SKIP_INSTALL}" == "NO" ]]; then
mkdir -p "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
fi
rm -f "$RESOURCES_TO_COPY"
```