README.md
author Xavier Algarra <xavier@pep-project.org>
Tue, 19 Feb 2019 14:16:26 +0100
branchIOS-1455
changeset 7721 eb61f00eb149
parent 7643 930dbd472228
child 7776 1211c30a5059
child 7801 7358aed93ea1
permissions -rw-r--r--
IOS-1455 frameworks fix
     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 0
    24 
    25 sudo port install autoconf
    26 sudo port install libtool
    27 sudo port install automake
    28 
    29 sudo port install gmake
    30 ```
    31 
    32 ### Other dependecies
    33 
    34 #### pEpEngine: [yml2](https://fdik.org/yml/toolchain)
    35 
    36 Clone into your home directory:
    37 
    38 ```
    39 pushd ~
    40 hg clone https://pep.foundation/dev/repos/yml2/
    41 popd
    42 ```
    43 
    44 ## Setup instructions
    45 
    46 ```
    47 mkdir ~/src
    48 cd ~/src
    49 
    50 git clone https://github.com/fdik/libetpan.git
    51 git clone https://pep-security.lu/gitlab/iOS/OpenSSL-for-iPhone.git
    52 git clone https://pep-security.lu/gitlab/iOS/SwipeCellKit.git/
    53 git clone https://pep-security.lu/gitlab/iOS/AppAuth-iOS.git
    54 git clone https://pep-security.lu/gitlab/misc/ldns.git
    55 
    56 hg clone https://pep.foundation/dev/repos/pantomime-iOS/
    57 hg clone https://pep.foundation/dev/repos/netpgp-et
    58 hg clone https://pep.foundation/dev/repos/pEpEngine
    59 hg clone https://pep.foundation/dev/repos/pEpObjCAdapter
    60 hg clone https://pep.foundation/dev/repos/MessageModel/
    61 hg clone https://pep.foundation/dev/repos/libAccountSettings/
    62 
    63 hg clone https://pep-security.ch/dev/repos/pEp_for_iOS/
    64 
    65 # Temp hot fix
    66 cd ~/ldns
    67 git checkout IOS-749
    68 cd ..
    69 cd ~/SwipeCellKit
    70 git checkout master
    71 ```
    72 
    73 ### Build Project
    74 
    75 Open pEpForiOS.xcworkspace and build schema "pEp".
    76 
    77 ### Unit Tests
    78 
    79 Out of the box, most tests expect a local test server:
    80 
    81 ```
    82 cd ~/Downloads
    83 wget http://central.maven.org/maven2/com/icegreen/greenmail-standalone/1.5.9/greenmail-standalone-1.5.9.jar
    84 shasum -a 256 greenmail-standalone-1.5.9.jar
    85 8301b89007e986e8d5e93e2504aad866a58b07b53ac06abb87e6e43eb7646261  greenmail-standalone-1.5.9.jar
    86 java -Dgreenmail.setup.test.all -Dgreenmail.users=test001:pwd@localhost,test002:pwd@localhost,test003:pwd@localhost -jar ~/Downloads/greenmail-standalone-1.5.9.jar
    87 ```
    88 
    89 The non-existing file referenced in the unit test project, ./pEpForiOSTests/TestUtil/SecretTestData.swift, must be
    90 created, with a class named SecretTestData, derived from TestDataBase.
    91 
    92 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".
    93 
    94 If you want to run the tests against your own servers, override `populateAccounts` accordingly.
    95 
    96 ### UI Tests
    97 
    98 There is a file referenced in the UI test project, UITestData. You need to create it
    99 (./pEpForiOSUITests/SecretUITestData.swift), and implement it according to the protocol UITestDataProtocol.
   100 
   101 The UI tests will not compile without it.
   102 
   103 ### secret.xcconfig (needed for OAuth2 config secrects and others)
   104 
   105 Create secret.xcconfig @ pEpForiOS/secret.xcconfig, with those contents:
   106 
   107 ```
   108 OAUTH2_GMAIL_CLIENT_ID = some_content
   109 OAUTH2_GMAIL_REDIRECT_URL_SCHEME = some_content
   110 
   111 OAUTH2_YAHOO_CLIENT_ID = some_content
   112 OAUTH2_YAHOO_CLIENT_SECRET = some_content
   113 
   114 ```