session-ios/BUILDING.md

120 lines
3.6 KiB
Markdown
Raw Normal View History

2017-03-16 00:11:24 +01:00
# Building
We typically develop against the latest stable version of Xcode.
2018-07-20 15:48:22 +02:00
As of this writing, that's Xcode 9.4.
2018-07-20 15:48:22 +02:00
2017-03-16 00:11:24 +01:00
## 1. Clone
Clone the repo to a working directory:
2017-03-16 00:11:24 +01:00
2018-07-20 15:48:22 +02:00
```
2018-08-05 08:10:08 +02:00
git clone --recurse-submodules https://github.com/signalapp/Signal-iOS
2018-07-20 15:48:22 +02:00
```
Since we make use of submodules, you must use `git clone`, rather than
downloading a prepared zip file from Github.
We recommend you fork the repo on GitHub, then clone your fork:
```
git clone --recurse-submodules https://github.com/<USERNAME>/Signal-iOS.git
```
You can then add the Signal repo to sync with upstream changes:
```
2018-08-05 08:10:08 +02:00
git remote add upstream https://github.com/signalapp/Signal-iOS
```
2017-07-21 21:36:19 +02:00
## 2. Dependencies
2017-03-16 00:11:24 +01:00
2017-07-21 21:36:19 +02:00
To build and configure the libraries Signal uses, just run:
2017-03-16 00:11:24 +01:00
```
make dependencies
```
2017-07-21 21:36:19 +02:00
If the above fails to run, or you just want to know more about our
dependency management systems, read the next section, Dependency Details.
Else if the above completed without error - jump ahead to step 3.
2017-03-16 00:11:24 +01:00
### Dependency Details
2018-08-06 19:41:57 +02:00
We have a couple of dependency management tools. We use Carthage for
2017-03-16 00:11:24 +01:00
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
```
2017-03-16 00:11:24 +01:00
If you are having build issues, first make sure your pods are up to date
2017-03-16 00:11:24 +01:00
```
2017-03-16 00:11:24 +01:00
pod repo update
pod install
```
2017-03-16 00:11:24 +01:00
2017-07-21 21:36:19 +02:00
Occasionally, CocoaPods itself will need to be updated. Do this with
2017-03-16 00:11:24 +01:00
```
2017-03-16 00:11:24 +01:00
gem update cocoapods
pod repo update
pod install
```
2017-03-16 00:11:24 +01:00
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:
```
// DO NOT run: `carthage update` or `carthage checkout`.
git submodule update --init
2017-03-16 00:11:24 +01:00
carthage build --platform iOS
```
2017-07-21 21:36:19 +02:00
### Building WebRTC
A prebuilt version of WebRTC.framework resides in our Carthage submodule
and should be installed by the above steps. However, if you'd like to
build it from source, see: https://github.com/signalapp/signal-webrtc-ios
2017-07-21 21:36:19 +02:00
## 3. Xcode
2017-03-16 00:11:24 +01:00
Open the `Signal.xcworkspace` in Xcode.
```
open Signal.xcworkspace
```
In the TARGETS area of the General tab, change the Team drop down to
your own. You will need to do that for all the listed targets, for ex.
Signal, SignalShareExtension, and SignalMessaging. You will need an Apple
Developer account for this.
On the Capabilities tab, turn off Push Notifications and Data Protection,
while keeping Background Modes on. The App Groups capability will need to
remain on in order to access the shared data storage. The App ID needs to
match the SignalApplicationGroup string set in TSConstants.h.
If you wish to test the Documents API, the iCloud capability will need to
be on with the iCloud Documents option selected.
2017-03-16 00:11:24 +01:00
Build and Run and you are ready to go!
## Known issues
2017-07-21 21:36:19 +02:00
Features related to push notifications are known to be not working for
third-party contributors since Apple's Push Notification service pushes
will only work with Open Whisper Systems production code signing
certificate.
2017-03-16 00:11:24 +01:00
If you have any other issues, please ask on the [community forum](https://whispersystems.discoursehosting.net/).