Building » History » Version 5
Sergey Smolov, 01/22/2020 04:37 PM
1 | 1 | Sergey Smolov | h1. Building |
---|---|---|---|
2 | |||
3 | 2 | Sergey Smolov | {{toc}} |
4 | 1 | Sergey Smolov | |
5 | 2 | Sergey Smolov | h2. Prerequisites |
6 | 1 | Sergey Smolov | |
7 | 2 | Sergey Smolov | To build the _Fortress_ library from sources, following components must be installed: |
8 | # *Git* |
||
9 | 5 | Sergey Smolov | # *Java Development Kit (JDK) 1.11* or higher (use "AdoptOpenJDK":https://adoptopenjdk.net/ for Windows and *openjdk-11-jdk* for Ubuntu Linux based OS) |
10 | 1 | Sergey Smolov | |
11 | 2 | Sergey Smolov | For project building we use " *Gradle* ":http://gradle.org system. |
12 | You can either install it, or use wrapper scripts (we use "Gradle 4.10.3":https://docs.gradle.org/4.10.3/release-notes.html in scripts). |
||
13 | Two Gradle wrapper scripts are included in the project repository: one for Linux-based OS (*gradlew*), another for Windows OS (*gradlew.bat*). To make the guide uniform, a "gradle" acronym will be used in the following examples. |
||
14 | 1 | Sergey Smolov | |
15 | 2 | Sergey Smolov | h3. Access to Nexus |
16 | |||
17 | For some cases an access to "ISP RAS Nexus":https://forge.ispras.ru/nexus local repository server may be required via Fortress building. Ask your ISP RAS colleagues for login and password and store them either in _REPO_USER and _REPO_PASSWORD environment variables, or in non-versioned by Git *gradle-local.properties* file of the following format: |
||
18 | 1 | Sergey Smolov | <pre> |
19 | 2 | Sergey Smolov | repoUser=<write your login here> |
20 | repoPassword=<write your password here> |
||
21 | 1 | Sergey Smolov | </pre> |
22 | |||
23 | 2 | Sergey Smolov | h2. Get the project source code |
24 | |||
25 | Clone the project's Git repository |
||
26 | <pre><code class="shell"> |
||
27 | git clone --recursive https://forge.ispras.ru/git/solver-api.git fortress |
||
28 | cd fortress |
||
29 | </code></pre> |
||
30 | |||
31 | 3 | Sergey Smolov | h2. Building from command line |
32 | 2 | Sergey Smolov | |
33 | 1 | Sergey Smolov | To list all Gradle commands run: |
34 | 2 | Sergey Smolov | <pre><code class="shell"> |
35 | 1 | Sergey Smolov | gradle tasks |
36 | 2 | Sergey Smolov | </code></pre> |
37 | |||
38 | To compile both main and test classes run: |
||
39 | <pre><code class="shell"> |
||
40 | gradle assemble |
||
41 | </code></pre> |
||
42 | |||
43 | To run all unit tests run: |
||
44 | <pre><code class="shell"> |
||
45 | gradle test |
||
46 | </code></pre> |
||
47 | |||
48 | 1 | Sergey Smolov | |
49 | 3 | Sergey Smolov | h2. Building from Eclipse IDE |
50 | 1 | Sergey Smolov | |
51 | # Install "Buildship":https://marketplace.eclipse.org/content/buildship-gradle-integration Gradle integration plugin for Eclipse IDE (if Gradle support has not provided by the IDE already). |
||
52 | # Create @init.gradle@ file in the $HOME/.gradle directory and write the following to it: |
||
53 | <pre> |
||
54 | allprojects |
||
55 | { |
||
56 | apply plugin: 'eclipse' |
||
57 | |||
58 | it.eclipse |
||
59 | { |
||
60 | classpath.downloadJavadoc = true |
||
61 | } |
||
62 | } |
||
63 | </pre> |
||
64 | 3 | Sergey Smolov | # Import Fortress sources into Eclipse workspace: |
65 | 1 | Sergey Smolov | * Use the menu item "File/Import...". |
66 | * Choose "Gradle/Gradle Project". |
||
67 | 3 | Sergey Smolov | * Select the "fortress" directory as the root directory, press "Next". |
68 | 1 | Sergey Smolov | * Select the "Gradle wrapper (recommended)" import option. |
69 | * Press the "Finish" button: the project will be opened in the Eclipse IDE. |
||
70 | 3 | Sergey Smolov | |
71 | h2. Building from IntelliJ IDEA |
||
72 | |||
73 | # From Welcome menu select "Import project". |
||
74 | # Select "fortress" directory, then press "OK". |
||
75 | # From "Import project" menu select "Import project from external model" -> Gradle, then press "Finish". |