You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You can quickly check that your development environment is properly set up to build the project running `./setup.sh` from the project root:
7
+
8
+
```bash
9
+
$ ./setup.sh
10
+
ℹ️ Checking required JVM:
11
+
✅ JAVA_HOME is set to /Users/datadog/.sdkman/candidates/java/8.0.402-zulu.
12
+
✅ JAVA_8_HOME is set to /Users/datadog/.sdkman/candidates/java/8.0.402-zulu.
13
+
✅ JAVA_11_HOME is set to /Users/datadog/.sdkman/candidates/java/11.0.22-zulu.
14
+
✅ JAVA_17_HOME is set to /Users/datadog/.sdkman/candidates/java/17.0.10-zulu.
15
+
✅ JAVA_21_HOME is set to /Users/datadog/.sdkman/candidates/java/21.0.2-zulu.
16
+
✅ JAVA_GRAALVM17_HOME is set to /Users/datadog/.sdkman/candidates/java/17.0.9-graalce.
17
+
ℹ️ Checking git configuration:
18
+
✅ The git command line is installed.
19
+
✅ pre-commit hook is installed in repository.
20
+
✅ git config submodule.recurse is set to true.
21
+
ℹ️ Checking shell configuration:
22
+
✅ File descriptor limit is set to 12800.
23
+
✅ The docker command line is installed.
24
+
✅ The Docker server is running.
25
+
```
26
+
27
+
If the script finds any issue, you can follow the requirements below to install and configure the required tools and [the code contribution guidelines](CONTRIBUTING.md#code-contributions).
28
+
29
+
## Building requirements
30
+
31
+
To build the full project:
32
+
33
+
* JDK version 8 must be installed.
34
+
* JDK version 11 must be installed.
35
+
* JDK version 17 must be installed.
36
+
* JDK version 21 must be installed.
37
+
*`JAVA_8_HOME` must point to the JDK-8 location.
38
+
*`JAVA_11_HOME` must point to the JDK-11 location.
39
+
*`JAVA_17_HOME` must point to the JDK-17 location.
40
+
*`JAVA_21_HOME` must point to the JDK-21 location.
41
+
* The JDK-8 `bin` directory must be the only JDK on the PATH (e.g. `$JAVA_8_HOME/bin`).
42
+
*`JAVA_HOME` may be unset. If set, it must point to JDK-8 (same as `JAVA_8_HOME`).
43
+
* git command line must be installed.
44
+
* A container runtime environment must be available to run all tests (usually Docker Desktop).
45
+
46
+
> [!NOTE]
47
+
> MacOS users, remember that `/usr/libexec/java_home` may control which JDK is in your path.
48
+
49
+
> [!NOTE]
50
+
> ARM users, there is no Oracle JDK v8 for ARM.
51
+
> You might want to use [Azul's Zulu](https://www.azul.com/downloads/?version=java-8-lts&architecture=arm-64-bit&package=jdk#zulu) builds of Java 8.
52
+
> On macOS, they can be installed using `brew tap homebrew/cask-versions && brew install --cask zulu8`.
53
+
> [Amazon Corretto](https://aws.amazon.com/corretto/) builds have also been proven to work.
54
+
55
+
## Building commands
56
+
57
+
To build the project without running tests run:
58
+
59
+
```bash
60
+
./gradlew clean assemble
61
+
```
62
+
63
+
To build the entire project with tests (this can take a very long time) run:
Pull requests for bug fixes are welcome, but before submitting new features or changes to current
4
-
functionality [open an issue](https://github.com/DataDog/dd-trace-java/issues/new)
5
-
and discuss your ideas or propose the changes you wish to make. After a resolution is reached a PR can be submitted for
6
+
functionality, please[open an issue](https://github.com/DataDog/dd-trace-java/issues/new)
7
+
and discuss your ideas or propose the changes you wish to make first. After a resolution is reached a PR can be submitted for
6
8
review.
7
9
8
10
When opening a pull request, please open it as
9
11
a [draft](https://github.blog/2019-02-14-introducing-draft-pull-requests/) to not auto assign reviewers before you feel
10
12
the pull request is in a reviewable state.
11
13
12
-
## Requirements
13
-
14
-
To build the full project:
15
-
16
-
* JDK version 8 must be installed.
17
-
* JDK version 11 must be installed.
18
-
* JDK version 17 must be installed.
19
-
* JDK version 21 must be installed.
20
-
*`JAVA_8_HOME` must point to the JDK-8 location.
21
-
*`JAVA_11_HOME` must point to the JDK-11 location.
22
-
*`JAVA_17_HOME` must point to the JDK-17 location.
23
-
*`JAVA_21_HOME` must point to the JDK-21 location.
24
-
* The JDK-8 `bin` directory must be the only JDK on the PATH (e.g. `$JAVA_8_HOME/bin`).
25
-
*`JAVA_HOME` may be unset. If set, it must point to JDK-8 (same as `JAVA_8_HOME`).
14
+
## Adding instrumentations
26
15
27
-
MacOS users, remember that `/usr/libexec/java_home` may control which JDK is in your path.
16
+
Check [Adding a New Instrumentation](docs/add_new_instrumentation.md) for instructions on adding a new instrumentation.
28
17
29
-
In contrast to the [IntelliJ IDEA set up](#intellij-idea) the default JVM to build and run tests from the command line
30
-
should be Java 8.
18
+
Check [How Instrumentations Work](docs/how_instrumentations_work.md) for a deep dive into how instrumentations work.
31
19
32
-
There is no Oracle JDK v8 for ARM. ARM users might want to
33
-
use [Azul's Zulu](https://www.azul.com/downloads/?version=java-8-lts&architecture=arm-64-bit&package=jdk#zulu)
34
-
builds of Java 8. On macOS, they can be installed
35
-
using `brew tap homebrew/cask-versions && brew install --cask zulu8`. [Amazon Corretto](https://aws.amazon.com/corretto/)
36
-
builds have also been proven to work.
20
+
## Code contributions
37
21
38
-
#Building
22
+
### Development environment quick check
39
23
40
-
To build the project without running tests run:
24
+
Prior contributing to the project, you can quickly check your development environment using the `./setup.sh` command line, and fix any issue found using the [Building documentation](BUILDING.md).
41
25
42
-
```bash
43
-
./gradlew clean assemble
44
-
```
45
-
46
-
To build the entire project with tests (this can take a very long time) run:
47
-
48
-
```bash
49
-
./gradlew clean build
50
-
```
26
+
### Automatic code formatting
51
27
52
-
# Adding Instrumentations
53
-
54
-
See [Adding a New Instrumentation](./docs/add_new_instrumentation.md) for instructions on adding a new instrumentation.
55
-
56
-
See [How Instrumentations Work](./docs/how_instrumentations_work.md) for a deep dive into how instrumentations work.
57
-
58
-
# Automatic code formatting
59
-
60
-
This project includes a `.editorconfig` file for basic editor settings. This file is supported by most common text
61
-
editors.
28
+
This project includes a `.editorconfig` file for basic editor settings.
29
+
This file is supported by most common text editors.
62
30
63
31
We have automatic code formatting enabled in Gradle configuration using [Spotless](https://github.com/diffplug/spotless)
Main goal is to avoid extensive reformatting caused by different IDEs having different opinion about how things should
66
-
be formatted by establishing single 'point of truth'.
34
+
be formatted by establishing single _point of truth_.
67
35
68
-
To reformat all the files that need reformatting.
36
+
To reformat all the files that need reformatting:
69
37
70
38
```bash
71
39
./gradlew spotlessApply
72
40
```
73
41
74
-
To run formatting verify task only.
42
+
To run formatting verify task only:
75
43
76
44
```bash
77
45
./gradlew spotlessCheck
78
46
```
79
47
80
-
## Pre-commit hook
48
+
#### IntelliJ IDEA
49
+
50
+
For IntelliJ IDEA, we suggest the following settings and plugin:
51
+
52
+
In contrast to the [IntelliJ IDEA set up](CONTRIBUTING.md#intellij-idea) the default JVM to build and run tests from the command line should be Java 8.
53
+
* Use Java 8 to build and run tests:
54
+
`Project Structure` > `Project` > `SDK` > Use a JDK 1.8
0 commit comments