Project

General

Profile

Building » History » Version 6

Sergey Smolov, 01/22/2020 04:39 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 6 Sergey Smolov
h2. Building from "Eclipse IDE":https://www.eclipse.org/ide/
50 1 Sergey Smolov
51 6 Sergey Smolov
* Generate the Eclipse IDE project and classpath files with "Gradle":https://gradle.org:
52
  <pre>$ ./gradlew eclipse</pre>
53
* Create a workspace located in the directory with @fortress@
54
  - Use the menu item @File/Switch Workspace...@
55
  - Browse the directory
56
* Import an existing project called @fortress@ into the workspace
57
  - Use the menu item @File/Import...@
58
  - Choose @General/Existing Projects into Workspace@
59
  - Select the @fortress@ folder as the root directory
60
  - Select the @fortress@ project located in this directory
61
  - Press the @Finish@ button
62 3 Sergey Smolov
63 6 Sergey Smolov
h2. Building from "IntelliJ IDEA":https://www.jetbrains.com/idea/
64 3 Sergey Smolov
65
# From Welcome menu select "Import project".
66 6 Sergey Smolov
# Select @fortress@ directory, then press "OK".
67 3 Sergey Smolov
# From "Import project" menu select "Import project from external model" -> Gradle, then press "Finish".