https://github.com/k-lpmg/xcode-build-script-for-carthage
If you're using Carthage, you can easily set up Framework dependency in XCode through this script
https://github.com/k-lpmg/xcode-build-script-for-carthage
carthage dependency framework ios ruby script xcode
Last synced: 8 months ago
JSON representation
If you're using Carthage, you can easily set up Framework dependency in XCode through this script
- Host: GitHub
- URL: https://github.com/k-lpmg/xcode-build-script-for-carthage
- Owner: k-lpmg
- License: mit
- Created: 2018-05-23T07:29:21.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2019-10-13T05:11:32.000Z (over 6 years ago)
- Last Synced: 2025-04-10T16:13:08.007Z (12 months ago)
- Topics: carthage, dependency, framework, ios, ruby, script, xcode
- Language: Ruby
- Homepage:
- Size: 28.3 KB
- Stars: 16
- Watchers: 1
- Forks: 3
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# XCode Build Script for Carthage
[](https://raw.githubusercontent.com/k-lpmg/RealmWrapper/master/LICENSE)
If you're using [Carthage](https://github.com/Carthage/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](https://github.com/Carthage/Carthage) to Build Phases, set up `frameworks dependency` and add `framework search paths` to Build Settings
- [Getting Started](#getting-started)
- [Example](#example)
## Getting Started
#### This script uses [Xcodeproj](https://github.com/CocoaPods/Xcodeproj). Install it by performing the following command:
```console
$ [sudo] gem install xcodeproj
```
#### 1. To use the script, open the ruby file (Source/carthage_build_setup.rb)
> Enter the target of your project in @scriptTargets you want to apply the script to.
```ruby
# Constants
@scriptTargets = []
```
> Enter the path to your project.
```ruby
# Constants
CARTHAGE_FRAMEWORK_PATH = "YOUR_CARTHAGE_FOLDER_PATH/Carthage/Build/iOS"
# Variables
@project = Xcodeproj::Project.open"YOUR_PROJECT_PATH/YOUR_PROJECT_NAME.xcodeproj"
```
#### 2. Move the script file to your project path.
#### 3. Run
```console
$ carthage update
$ ruby carthage_build_setup.rb
```
#### 4. Press check, your project `Build Phases`, `Frameworks` and `Framework Search Paths` in Build Settings
## Example
#### Building Project
1. Install Carthage libraries.
```console
$ carthage update
$ cd Scripts
$ ruby carthage_build_phase_setup.rb
```
or
```console
$ cd Scripts
$ sh carthage_update.sh
```
2. Open **`CarthageScriptExample.xcodeproj`** file.
3. Press ⌘ + B to build the project.
4. Press check, the build is succeeded
5. Press check, your project Build Phases and Framework Search Paths in Build Settings
**`Script Success`**

**`Frameworks Dependency`**

**`Build Phases`**

## LICENSE
These works are available under the MIT license. See the [LICENSE][license] file
for more info.
[ruby]: http://www.ruby-lang.org/en/
[license]: LICENSE