An open API service indexing awesome lists of open source software.

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

Awesome Lists containing this project

README

          

# XCode Build Script for Carthage
[![GitHub license](https://img.shields.io/badge/license-MIT-lightgrey.svg?style=flat)](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`**

![script-success](https://user-images.githubusercontent.com/15151687/41411863-3951df72-7019-11e8-8271-9c4c9842f80a.png)

**`Frameworks Dependency`**

![project-frameworks](https://user-images.githubusercontent.com/15151687/66711251-31b71b00-edc3-11e9-864f-c85fd9be1c38.png)

**`Build Phases`**

![build-phases](https://user-images.githubusercontent.com/15151687/66711252-3380de80-edc3-11e9-8ffb-ae31f4819e03.png)

## 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