README.md
author Dirk Zimmermann <dz@pep.security>
Thu, 21 Mar 2019 12:44:24 +0100
branchIOS-1480
changeset 8033 bf94050222a1
parent 7973 5f5183934189
child 8311 b3c93c82ed21
permissions -rw-r--r--
IOS-1480 Close branch.
     1 # How to build
     2 
     3 ## Prerequisites
     4 
     5 ### Package managers
     6 
     7 MacPorts for installing all dependencies:
     8 
     9 Install [MacPorts](https://www.macports.org/) for your
    10 [version of OS X/macOS](https://www.macports.org/install.php).
    11 
    12 ### Dependencies of prerequisites
    13 
    14 For building the engine, you need a working python2 environment
    15 and all dependencies:
    16 
    17 ```
    18 sudo port install python27
    19 sudo port install asn1c
    20 sudo port install py27-lxml
    21 
    22 sudo port install python_select
    23 
    24 sudo port install autoconf
    25 sudo port install libtool
    26 sudo port install automake
    27 
    28 sudo port install gmake
    29 ```
    30 
    31 ### Other dependecies
    32 
    33 #### pEpEngine: [yml2](https://fdik.org/yml/toolchain)
    34 
    35 Clone into your home directory:
    36 
    37 ```
    38 pushd ~
    39 hg clone https://pep.foundation/dev/repos/yml2/
    40 popd
    41 ```
    42 
    43 ## Setup instructions
    44 
    45 ```
    46 mkdir ~/src
    47 cd ~/src
    48 
    49 git clone https://github.com/fdik/libetpan.git
    50 git clone https://pep-security.lu/gitlab/iOS/OpenSSL-for-iPhone.git
    51 git clone https://pep-security.lu/gitlab/iOS/SwipeCellKit.git/
    52 git clone https://pep-security.lu/gitlab/iOS/AppAuth-iOS.git
    53 git clone https://pep-security.lu/gitlab/misc/ldns.git
    54 
    55 hg clone https://pep.foundation/dev/repos/pantomime-iOS/
    56 hg clone https://pep.foundation/dev/repos/netpgp-et
    57 hg clone https://pep.foundation/dev/repos/pEpEngine
    58 hg clone https://pep.foundation/dev/repos/pEpObjCAdapter
    59 hg clone https://pep.foundation/dev/repos/MessageModel/
    60 hg clone https://pep.foundation/dev/repos/libAccountSettings/
    61 
    62 hg clone https://pep-security.ch/dev/repos/pEp_for_iOS/
    63 ```
    64 
    65 ### Build Project
    66 
    67 Open pEpForiOS.xcworkspace and build schema "pEp".
    68 
    69 ### Unit Tests
    70 
    71 Out of the box, most tests expect a local test server:
    72 
    73 ```
    74 cd ~/Downloads
    75 wget http://central.maven.org/maven2/com/icegreen/greenmail-standalone/1.5.9/greenmail-standalone-1.5.9.jar
    76 shasum -a 256 greenmail-standalone-1.5.9.jar
    77 8301b89007e986e8d5e93e2504aad866a58b07b53ac06abb87e6e43eb7646261  greenmail-standalone-1.5.9.jar
    78 java -Dgreenmail.setup.test.all -Dgreenmail.users=test001:pwd@localhost,test002:pwd@localhost,test003:pwd@localhost -jar ~/Downloads/greenmail-standalone-1.5.9.jar
    79 ```
    80 
    81 The non-existing file referenced in the unit test project, ./pEpForiOSTests/TestUtil/SecretTestData.swift, must be
    82 created, with a class named SecretTestData, derived from TestDataBase.
    83 
    84 In `SecretTestData.swift`, you must override `populateVerifiableAccounts`, adding servers that are either registered in the LAS database or provide DNS SRV for IMAP and SMTP in order to test the "automatic account login".
    85 
    86 If you want to run the tests against your own servers, override `populateAccounts` accordingly.
    87 
    88 ### UI Tests
    89 
    90 There is a file referenced in the UI test project, UITestData. You need to create it
    91 (./pEpForiOSUITests/SecretUITestData.swift), and implement it according to the protocol UITestDataProtocol.
    92 
    93 The UI tests will not compile without it.
    94 
    95 ### secret.xcconfig (needed for OAuth2 config secrects and others)
    96 
    97 Create secret.xcconfig @ pEpForiOS/secret.xcconfig, with those contents:
    98 
    99 ```
   100 OAUTH2_GMAIL_CLIENT_ID = some_content
   101 OAUTH2_GMAIL_REDIRECT_URL_SCHEME = some_content
   102 
   103 OAUTH2_YAHOO_CLIENT_ID = some_content
   104 OAUTH2_YAHOO_CLIENT_SECRET = some_content
   105 
   106 ```