Skip to content

Commit e9f821b

Browse files
committed
Move build instructions to documentation
1 parent 3a616b8 commit e9f821b

File tree

3 files changed

+35
-13
lines changed

3 files changed

+35
-13
lines changed

CONTRIBUTING.md

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ our [HiveMQ Community Repo](https://github.com/hivemq/hivemq-community).
77
## Prerequisites
88

99
We recommend to develop your changes by using [IntelliJ IDEA](https://www.jetbrains.com/idea/).
10-
Therefore, the following guide will focus on creating your changes by using IntelliJ.
10+
Therefore, the following guide will focus on creating your changes using IntelliJ.
1111

1212
Furthermore, the following is needed to make your development efforts as smoothly as possible:
1313
- A Java 11 JDK (we recommend [temurin](https://adoptium.net/de/temurin/releases/?version=11)) => [Set the JDK in IntelliJ](https://www.jetbrains.com/help/idea/sdk.html)
@@ -53,7 +53,7 @@ Furthermore, the following is needed to make your development efforts as smoothl
5353
- Implement your changes under `src/main/java`
5454
- You can use the existing code as a guide
5555
- The project uses Nullability annotations to avoid NullPointerExceptions: `@NotNull`, `@Nullable`.
56-
Every non-primitive parameter/return type/field should be annotated with one of them.
56+
Every non-primitive parameter, return type and field should be annotated with one of them.
5757

5858
## 4. Write tests
5959

@@ -67,10 +67,7 @@ Furthermore, the following is needed to make your development efforts as smoothl
6767

6868
## 5. Build and test
6969

70-
- Before you build mqtt-cli, make sure that
71-
- a Docker daemon is running
72-
- you have installed the native image tooling by using `./gradlew installNativeImageTooling`
73-
- To build mqtt-cli use `./gradlew build`
70+
- See [Building from source](https://hivemq.github.io/mqtt-cli/docs/installation/#building-from-source) for instructions on how to build mqtt-cli
7471
- Before proceeding to the next step, please make sure that your changes build and all tests succeed
7572
- Tip: After building mqtt-cli you can execute the cli by using the generated jar file `java -jar build/libs/mqtt-cli-<version>.jar` (you can also just build this jar by using `./gradlew shadowJar`)
7673
- Tip: To quickly test your changes manually you can directly execute commands from your IDE by going to <i>Run > Edit Configurations...</i> and adding your cli arguments
@@ -80,6 +77,7 @@ Furthermore, the following is needed to make your development efforts as smoothl
8077

8178
## 6. Commit and Push
8279
- Before committing execute `./gradlew licenseFormat` to add license headers to each file
80+
- [Reformat each changed file](https://www.jetbrains.com/help/idea/reformat-and-rearrange-code.html#reformat_file) using the .editorconfig settings of the project
8381
- Commit your changes directly from IntelliJ by pressing `Command` + `K` OR via the command `git commit -m "your commit mesage"`
8482
- Commits should be as atomic as possible
8583
- Commit messages should describe the changes clearly

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
[![GitHub Release](https://img.shields.io/github/v/release/hivemq/mqtt-cli?style=for-the-badge)](https://github.com/hivemq/mqtt-cli/releases)
88
[![GitHub Workflow Status (branch)](https://img.shields.io/github/actions/workflow/status/hivemq/mqtt-cli/.github/workflows/check.yml?branch=master&style=for-the-badge)](https://github.com/hivemq/mqtt-cli/actions/workflows/check.yml?query=branch%3Amaster)
99
[![CLI Downloads](https://img.shields.io/github/downloads/hivemq/mqtt-cli/total?style=for-the-badge)](https://github.com/hivemq/mqtt-cli/releases)
10+
[![CLI License](https://img.shields.io/github/license/hivemq/mqtt-cli?style=for-the-badge)](https://github.com/hivemq/mqtt-cli/blob/develop/LICENSE)
1011

1112
<i>mqtt-cli</i> is a <b>feature-rich MQTT Command Line Interface</b>.
1213

@@ -18,14 +19,15 @@
1819
[Subscribe](#subscribe)
1920
[Shell](#shell)
2021
[Test](#test)
21-
[How to contribute](#how-to-contribute)
22+
[How to Contribute](#how-to-contribute)
2223

2324

2425
</div>
2526

2627
## Getting Started
2728

2829
- [Installation instructions](https://hivemq.github.io/mqtt-cli/docs/installation/)
30+
- [Building from source](https://hivemq.github.io/mqtt-cli/docs/installation/#building-from-source)
2931
- [Full documentation](https://hivemq.github.io/mqtt-cli)
3032

3133
## Publish
@@ -63,6 +65,6 @@
6365
<img align="center" src="./img/test.gif"/>
6466

6567

66-
## How to contribute
68+
## How to Contribute
6769
- If you want to request a feature or report a bug, please [create a GitHub Issue using one of the provided templates](https://github.com/hivemq/mqtt-cli/issues/new/choose)
6870
- If you want to make a contribution to the project, please have a look at the [contribution guide](CONTRIBUTING.md)

docs/_docs/installation.md

Lines changed: 27 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -77,11 +77,33 @@ sudo yum install -y https://github.com/hivemq/mqtt-cli/releases/download/v4.11.0
7777

7878
## Building from source
7979

80-
The MQTT CLI project uses [Gradle](https://gradle.org/) to build. A gradle wrapper configuration is included, so that after cloning the
81-
[repository](https://github.com/hivemq/mqtt-cli) from GitHub, you can simply change into the directory containing the project and execute
80+
- mqtt-cli uses [Gradle](https://gradle.org/) to build.
81+
- To be able to execute integration tests a running **Docker environment** is required
82+
- To be able to build and test the native image a **GraalVM installation** is required. You can set it up
83+
with ``$ ./gradlew installNativeImageTooling``.
8284

83-
```
84-
./gradlew build
85-
```
85+
To do a clean build, issue the following command:
86+
`$ ./gradlew clean build`
87+
88+
This runs the unit tests and compiles a new mqtt-cli-<version>.jar into build/libs.
89+
You can then update an existing MQTT CLI installation by replacing its mqtt-cli-<version>.jar with this one.
90+
91+
The `build.gradle.kts` file contains further instructions for building the platform specific distribution packages.
92+
In a nutshell:
93+
94+
For MacOS/Linux brew:
95+
`$ ./gradlew buildBrewFormula`
96+
97+
For the Debian package:
98+
`$ ./gradlew buildDebianPackage`
99+
100+
For the RPM package:
101+
`$ ./gradlew buildRpmPackage`
102+
103+
For the Windows installer:
104+
`$ ./gradlew buildWindowsZip`
105+
106+
For building a local docker image:
107+
`$ ./gradlew jibDockerBuild`
86108

87109

0 commit comments

Comments
 (0)