If you're using Carthage as the library dependency manager, you must manually configure the framework path to Build phases and Build settings in XCode after run 'carthage update'. However, using this script after run 'carthage update' eliminates the need to manually configure the framework path.
After carthage update
, this script add a run script
for Carthage to Build Phases, set up frameworks dependency
and add framework search paths
to Build Settings
This script uses Xcodeproj. Install it by performing the following command:
$ [sudo] gem install xcodeproj
Enter the target of your project in @scriptTargets you want to apply the script to.
# Constants
@scriptTargets = []
Enter the path to your project.
# Constants
CARTHAGE_FRAMEWORK_PATH = "YOUR_CARTHAGE_FOLDER_PATH/Carthage/Build/iOS"
# Variables
@project = Xcodeproj::Project.open"YOUR_PROJECT_PATH/YOUR_PROJECT_NAME.xcodeproj"
$ carthage update
$ ruby carthage_build_setup.rb
-
Install Carthage libraries.
$ carthage update $ cd Scripts $ ruby carthage_build_phase_setup.rb
or
$ cd Scripts $ sh carthage_update.sh
-
Open
CarthageScriptExample.xcodeproj
file. -
Press โ + B to build the project.
-
Press check, the build is succeeded
-
Press check, your project Build Phases and Framework Search Paths in Build Settings
Script Success
Frameworks Dependency
Build Phases
These works are available under the MIT license. See the LICENSE file for more info.