-
Notifications
You must be signed in to change notification settings - Fork 2
Getting Started
Before you do anything else, you should make sure openjdk-17
is installed and configured:
sudo pacman -Sy jdk-openjdk
sudo archlinux-java set java-17-openjdk
As usual, the windows setup is a little more up to your own discretion, but the easiest way is downloading the following installer and running it:
Just use the gradle wrapper script (see below) to run the commands. It will install the appropriate gradle version automatically.
./gradlew rundev
.\gradlew.bat rundev
To run development of the application you will need a working and preconfigured postgres instance.
services:
postgres:
image: postgres
environment:
POSTGRES_DB: telraam_dev
POSTGRES_USER: ${POSTGRES_USER:-telraam_user}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-iAMs00perSecrEET}
PGDATA: /data/postgres
volumes:
- postgres:/data/postgres
ports:
- "5432:5432"
restart: on-failure
volumes:
postgres:
Install the postgresql
package
sudo -iu postgres
initdb --locale en_US.UTF-8 -D '/var/lib/postgres/data'
exit
sudo systemctl start postgresql.service
sudo -iu postgres
createdb telraam_dev
psql
>>> \c telraam_dev
>>> CREATE USER telraam_user WITH PASSWORD 'iAMs00perSecrEET';
>>> GRANT ALL PRIVILEGES ON DATABASE telraam_dev to telraam_user;
# If you your postgres version is >15 you should also run following command (You can find your current version with: postgres -V):
>>> GRANT USAGE, CREATE ON SCHEMA public TO telraam_user;
There is a prepackaged postgres installation by EDB which you can find here
Run the gradle task to apply the migrations
Below you can find setup instructions for the most common editors. Following these is not required to build or work on the project, but are rather highly recommended steps to make the development experience as smooth as possible. Feel free to add any instructions for more obscure editors.
If you don't know which editor/ide you would like to use, Intellij comes with the highest recommendation. It has extensive gradle integration (and it even manages your gradle install for you), a simply awesome debugger, and a very smooth linter plugin which syncs with the linter settings on the build server.
It is highly recommended to install the SonarLint
plugin. This will make sure your commits will pass the linter checks on the build server.
Just search for it in the Plugin interface.
-
Open the project folder (if you cloned the repo without providing a name, this folder will be called "Telraam")
-
Intellij should prompt you with the message that is has found a gradle script, and ask you to import it. Click
Import gradle project
.- if you missed the prompt, right-click on the
build.gradle
file and selectimport gradle project
.
- if you missed the prompt, right-click on the
-
You should now see a
Gradle
toolbar on the right side of the screen, below theAnt
andDatabase
buttons. From here you can run any gradle task that is configured.- We have provided preset Intellij run configurations in this project, which you should be able to select in the dropdown on the top left, next to the green play button.
-
Try to run the project by either selecting the
Telraam [run]
configuration and clicking the play button, or by running theTelraam->Tasks->application->run
task from the Gradle toolbar. (They do exactly the same thing.)