session-android/BUILDING.md

69 lines
3.2 KiB
Markdown
Raw Normal View History

2020-04-08 01:05:36 +02:00
Building Session
===============
2013-06-18 11:38:11 +02:00
Basics
------
2013-06-18 11:38:11 +02:00
2020-04-08 01:05:36 +02:00
Session uses [Gradle](http://gradle.org) to build the project and to maintain
dependencies. However, you needn't install it yourself; the
"gradle wrapper" `gradlew`, mentioned below, will do that for you.
2013-06-18 11:38:11 +02:00
2020-05-27 03:49:18 +02:00
Dependencies
---------------
2020-05-27 03:49:18 +02:00
You will need Java 8 set up on your machine.
2020-05-27 03:49:18 +02:00
Ensure that the following packages are installed from the Android SDK manager:
2020-06-03 02:51:40 +02:00
* Android SDK Build Tools (see buildToolsVersion in build.gradle)
* SDK Platform (All API levels)
* Android Support Repository
* Google Repository
2020-06-03 03:23:04 +02:00
2020-05-27 03:49:18 +02:00
In Android studio, this can be done from the Quickstart panel, choose "Configure" then "SDK Manager". In the SDK Tools tab of the SDK Manager, make sure that the "Android Support Repository" is installed, and that the latest "Android SDK build-tools" are installed. Click "OK" to return to the Quickstart panel. You may also need to install API version 28 in the SDK platforms tab.
2020-06-03 03:23:04 +02:00
2020-06-03 02:51:40 +02:00
You will then need to clone and run `./gradlew install` on each of the following repositories IN ORDER:
2020-06-03 02:51:40 +02:00
* https://github.com/loki-project/loki-messenger-android-curve-25519
* https://github.com/loki-project/loki-messenger-android-protocol
* https://github.com/loki-project/loki-messenger-android-meta
* https://github.com/loki-project/session-android-service
2020-06-03 02:51:40 +02:00
This installs these dependencies into a local Maven repository which the main Session Android repository will then draw from.
2020-05-27 03:49:18 +02:00
Setting up a development environment and building from Android Studio
------------------------------------
[Android Studio](https://developer.android.com/sdk/installing/studio.html) is the recommended development environment.
2020-05-27 03:49:18 +02:00
1. Open Android Studio. On a new installation, the Quickstart panel will appear. If you have open projects, close them using "File > Close Project" to see the Quickstart panel.
2. From the Quickstart panel, choose "Checkout from Version Control" then "git".
3. Paste the URL for the session-android project when prompted (https://github.com/loki-project/session-android.git).
4. Android Studio should detect the presence of a project file and ask you whether to open it. Click "yes".
5. Default config options should be good enough.
2020-06-03 03:23:04 +02:00
6. Project initialization and building should proceed.
2020-05-27 03:49:18 +02:00
2020-06-03 02:51:40 +02:00
Building Session from the command line
2020-05-27 03:49:18 +02:00
---------------
2020-06-03 02:51:40 +02:00
The following steps should help you (re)build Session from the command line once all dependencies have been acquired.
2020-05-27 03:49:18 +02:00
1. Checkout the session-android project source with the command:
git clone https://github.com/loki-project/session-android.git
2. Make sure you have the [Android SDK](https://developer.android.com/sdk/index.html) installed.
2020-06-03 02:51:40 +02:00
3. Create a local.properties file at the root of your source checkout and add an sdk.dir entry to it. For example:
2020-05-27 03:49:18 +02:00
sdk.dir=/Application/android-sdk-macosx
4. Execute Gradle:
./gradlew build
Contributing code
-----------------
2020-06-03 03:17:44 +02:00
The bulk of the Session code can be found under src/org/thoughtcrime/securesms/loki on this repo and java/main/java/org/whispersystems/signalservice/loki on the session-android-service repo.
Code contributions should be sent via github as pull requests, from feature branches [as explained here](https://help.github.com/articles/using-pull-requests).