From 6a4c6915a2381136457a6c0211586ec67193b0eb Mon Sep 17 00:00:00 2001 From: Michael Kirk Date: Wed, 15 Mar 2017 19:11:24 -0400 Subject: [PATCH] Update build instructions // FREEBIE --- BUILDING.md | 64 +++++++++++++++++++++++++++++++++++++++-------------- 1 file changed, 47 insertions(+), 17 deletions(-) diff --git a/BUILDING.md b/BUILDING.md index 7163a66df..d0459e1d0 100644 --- a/BUILDING.md +++ b/BUILDING.md @@ -1,55 +1,85 @@ -## Building +# Building -1) Clone the repo to a working directory +## 1. Clone -2) [CocoaPods](http://cocoapods.org) is used to manage dependencies. Pods are setup easily and are distributed via a ruby gem. Follow the simple instructions on the website to setup. After setup, run the following command from the toplevel directory of Signal-iOS to download the dependencies for Signal-iOS: +Clone the repo to a working directory + +## 2. Depenencies + +### tldr; + +Build and configure dependencies. + + +``` +make dependencies +``` + +### Dependency Details + +We have a couple of dependency management tools. We us Carthage for +managing frameworks, but because some of our dependencies are not yet +framework compatible, we use Cocoapods to manage the remainder in a +static library. + +2.1) [CocoaPods](http://cocoapods.org) is used to manage the dependencies in our static library. Pods are setup easily and are distributed via a ruby gem. Follow the simple instructions on the website to setup. After setup, run the following command from the toplevel directory of Signal-iOS to download the dependencies for Signal-iOS: ``` pod install ``` + If you are having build issues, first make sure your pods are up to date + ``` -pod update +pod repo update pod install ``` + occasionally, CocoaPods itself will need to be updated. Do this with + ``` -sudo gem update +gem update cocoapods +pod repo update +pod install ``` -3) Some dependencies are added via carthage. However, our prebuilt WebRTC.framework also resides in the Carthage directory. +2.2) Framework dependencies are built and managed using [Carthage](https://github.com/Carthage/Carthage). Our prebuilt WebRTC.framework also resides in the Carthage/Build directory. + +If you don't have carthage, here are the [install instructions](https://github.com/Carthage/Carthage#installing-carthage). + +Once Carthage is installed, run: -Run: ``` // DO NOT run: `carthage update` or `carthage checkout`. git submodule update --init -carthage build +carthage build --platform iOS ``` -If you don't have carthage, here are install instructions: -``` -https://github.com/Carthage/Carthage#installing-carthage -``` +## 3. XCode -4) Open the `Signal.xcworkspace` in Xcode. +Open the `Signal.xcworkspace` in Xcode. ``` open Signal.xcworkspace ``` -5) In the Signal target on the General tab, change the Team drop down to your own. On the Capabilities tab turn off Push Notifications and Data Protection. Only Background Modes should remain on. +In the Signal target on the General tab, change the Team drop down to +your own. On the Capabilities tab turn off Push Notifications and Data +Protection. Only Background Modes should remain on. -6) Some of our build scripts, like running tests, expect your Derived +Some of our build scripts, like running tests, expect your Derived Data directory to be `$(PROJECT_DIR)/build`. In Xcode, go to `Preferences-> Locations`, and set the "Derived Data" dropdown to "Relative" and the text field value to "build". -7) Build and Run and you are ready to go! +Build and Run and you are ready to go! ## Known issues Features related to push notifications are known to be not working for third-party contributors since Apple's Push Notification service pushs will only work with Open Whisper Systems production code signing certificate. +If you have any other issues, please ask on the [community forum](https://whispersystems.discoursehosting.net/). + ### Building WebRTC A prebuilt version of WebRTC.framework resides in our Carthage submodule (see above). @@ -73,6 +103,6 @@ https://webrtc.org/native-code/ios/ # 3. Build webrtc cd src tools-webrtc/ios/build_ios_libs.sh - # 4. Move the WebRTC.framework into Signal-iOS's Carthage directory + # 4. Move the WebRTC.framework into Signal-iOS's Carthage directory mv out_ios_libs/WebRTC.framework /Carthage/Build/iOS/