Before build you have to place telegramBot_dev.properties
in to src/main/resources/
directory.
This file must contains the following lines:
# Token for bot's authorizing (https://core.telegram.org/bots/api#authorizing-your-bot).
bot.token=[Telegram Bot API token]
# Datetime format (https://docs.oracle.com/javase/8/docs/api/java/time/format/DateTimeFormatter.html)
bot.datetime.format="yyyy-MM-dd HH:mm:ss.SSS"
# Timeout pooling queries for bot
bot.timeout=1000
# Key which is used for access to Googleapis.
google.api.key = [key]
# Default latitude and longitude
location.default.latitude = 52.31
location.default.longitude = 85.10
# Default username for these who have no username
username.default = unknown
# Default messages for services
service.start.message = Please, send your location if you want to get your local time.
You can read about datetime format there.
For build the application with Gradle you need to run this command in console (be sure that you are in the root directory of the project):
$ gradle build
Also you can build the application with Gradle via Docker's container:
$ make build
But you must be sure that your user can to read/write in to /var/run/docker.sock
(or any because it depends from your distro) it reaching of user's adding to docker
group.
For running of the application you need to type and enter this command (be sure that you are in the root directory of the project):
$ gradle bootRun
Also you can run this application via docker-container. For this you have to run this command:
$ make run
It runs application via openjdk:alpine
container.
For running of the tests for this application you should to run the next command:
$ make test
It runs tests, shows process of the testing and shows information about summary coverage at the end of the process.
Also you can run the application with Gradle via Docker's container:
$ make run
Reports about code coverage and tests result are available by this paths:
# code coverage
<project dir>/build/reports/jacoco
# test results
<project dir>/build/reports/tests
For generate of JavaDoc via Docker-container you need to run the next command:
$ make docs
Generated documentation will be available by this path: <project dir>/build/docs/
.
You can check your code with help of PMD code analyzer via docker-container. For this needs type the next command:
$ make lint
Also, this analyzer generates report which available by this path: <project dir>/build/reports/pmd
.