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
*[Clone the repository and set up git](#clone-the-repository-and-set-up-git)
12
+
*[Building the project](#building-the-project)
9
13
10
-
## Development environment quick check
14
+
## Development environment
11
15
12
-
To check that your development environment is properly set up to build the project, run `./setup.sh` on macOS or Linux (or `.\setup.ps1` on Windows) from the project root. Your output should look something like the following:
16
+
### Requirements
17
+
18
+
Requirements to build the full project:
19
+
20
+
* The JDK versions 8, 11, 17 and 21 must be installed.
21
+
* The `JAVA_8_HOME`, `JAVA_11_HOME`, `JAVA_17_HOME`, `JAVA_21_HOME` and `JAVA_GRAALVM17_HOME` must point to their respective JDK location.
22
+
* The JDK-8 `bin` directory must be the only JDK on the PATH (e.g. `$JAVA_8_HOME/bin`).
23
+
* The `JAVA_HOME` environment variable may be unset. If set, it must point to the JDK 8 location (same as `JAVA_8_HOME`).
24
+
* The `git` command line must be installed.
25
+
* A container runtime environment must be available to run all tests (e.g. Docker Desktop).
26
+
27
+
### Quick check
28
+
29
+
To check that your development environment is properly set up to build the project, from the project root run on macOS or Linux:
30
+
```shell
31
+
./setup.sh
32
+
```
33
+
34
+
or on Windows:
35
+
```pwsh
36
+
.\setup.ps1
37
+
```
38
+
39
+
Your output should look something like the following:
13
40
14
41
```
15
42
ℹ️ Checking required JVM:
@@ -29,41 +56,32 @@ To check that your development environment is properly set up to build the proje
29
56
✅ The Docker server is running.
30
57
```
31
58
32
-
If there is any issue with your output, you can check the requirements and/or follow the guide below to install and configure the required tools.
59
+
If there is any issue with your output, check the requirements above and use the following guide to install and configure the required tools.
33
60
34
-
## Environment requirements quick check
35
-
36
-
Requirements to build the full project:
37
-
38
-
* The JDK versions 8, 11, 17 and 21 must be installed.
39
-
* The `JAVA_8_HOME`, `JAVA_11_HOME`, `JAVA_17_HOME`, `JAVA_21_HOME` and `JAVA_GRAALVM17_HOME` must point to their respective JDK location.
40
-
* The JDK-8 `bin` directory must be the only JDK on the PATH (e.g. `$JAVA_8_HOME/bin`).
41
-
* The `JAVA_HOME` environment variable may be unset. If set, it must point to the JDK 8 location (same as `JAVA_8_HOME`).
42
-
* The `git` command line must be installed.
43
-
* A container runtime environment must be available to run all tests (e.g. Docker Desktop).
44
-
45
-
## Development environment set up
46
61
47
62
### Install the required JDKs
48
63
49
64
Download and install Eclipse Temurin JDK versions 8, 11, 17 and 21, and GraalVM.
* Fix the GraalVM installation by [removing the quarantine flag](https://www.graalvm.org/latest/docs/getting-started/macos/):
73
+
```
74
+
sudo xattr -r -d com.apple.quarantine /Library/Java/JavaVirtualMachines/graalvm-<current version of graalvm>
75
+
```
58
76
* Add the required environment variables to your shell using the `export` command. You can permanently install the environment variables by appending the `export` commands into your shell configuration file `~/.zshrc` or `.bashrc` or other.
export JAVA_GRAALVM17_HOME=/Library/Java/JavaVirtualMachines/graalvm-<current version of graalvm>/Contents/Home
83
+
export JAVA_HOME=$JAVA_8_HOME
84
+
```
67
85
* Restart your shell after applying the changes if you appended the commands to your shell configuration file.
68
86
69
87
> [!NOTE]
@@ -72,34 +90,34 @@ export JAVA_HOME=$JAVA_8_HOME
72
90
> [Amazon Corretto](https://aws.amazon.com/corretto/) builds have also been proven to work.
73
91
74
92
> [!NOTE]
75
-
> MacOS users: remember that `/usr/libexec/java_home` may control which JDK is in your path.
76
-
77
-
</details>
93
+
> macOS users: remember that `/usr/libexec/java_home` may control which JDK is in your path.
78
94
79
-
<details>
80
-
<summary>Linux</summary>
95
+
#### Linux
81
96
82
97
* Download and extract JDK 8, 11, 17, and 21 from [Eclipse Temurin releases](https://adoptium.net/temurin/releases/) and GraalVM from [Oracle downloads](https://www.graalvm.org/downloads/).
83
98
* Install the GraalVM native image requirements for native builds by following [the GraalVM official documentation](https://www.graalvm.org/latest/reference-manual/native-image/#prerequisites).
84
99
* Add the required environment variables to your shell using the `export` command. You can permanently install the environment variables by appending the `export` commands into your shell configuration file `~/.zshrc` or `~/.bashrc` or other.
85
-
```shell
86
-
export JAVA_8_HOME=/<path to extracted archive>/jdk8u<current version of JDK 8>
87
-
export JAVA_11_HOME=/<path to extracted archive>/jdk-11.<current version of JDK 11>
88
-
export JAVA_17_HOME=/<path to extracted archive>/jdk-17.<current version of JDK 17>
89
-
export JAVA_21_HOME=/<path to extracted archive>/jdk-21.<current version of JDK 21>
90
-
export JAVA_GRAALVM17_HOME=/<path to extracted archive>/graalvm-jdk-17.<current version of graalvm>/Contents/Home
91
-
export JAVA_HOME=$JAVA_8_HOME
92
-
```
100
+
```shell
101
+
export JAVA_8_HOME=/<path to extracted archive>/jdk8u<current version of JDK 8>
102
+
export JAVA_11_HOME=/<path to extracted archive>/jdk-11.<current version of JDK 11>
103
+
export JAVA_17_HOME=/<path to extracted archive>/jdk-17.<current version of JDK 17>
104
+
export JAVA_21_HOME=/<path to extracted archive>/jdk-21.<current version of JDK 21>
105
+
export JAVA_GRAALVM17_HOME=/<path to extracted archive>/graalvm-jdk-17.<current version of graalvm>/Contents/Home
106
+
export JAVA_HOME=$JAVA_8_HOME
107
+
```
93
108
* Restart your shell after applying the changes if you appended the commands to your shell configuration file.
94
109
95
-
</details>
96
-
97
-
<details>
98
-
<summary>Windows</summary>
110
+
#### Windows
99
111
100
112
Use the `install-jdks-windows.ps1` script to download and install Eclipse Temurin JDK versions 8, 11, 17, and 21, and set the required environment variables.
101
113
102
-
To install the JDKs manually using `winget`, use the following commands. After the JDKs are installed, you can still use `install-jdks-windows.ps1` to add the environment variables.
114
+
> [!NOTE]
115
+
> This scripts currently does _not_ install GraalVM.
116
+
117
+
<details>
118
+
<summary>Manual installation</summary>
119
+
120
+
* To install the JDKs manually, download the installers from [Eclipse Temurin releases](https://adoptium.net/temurin/releases/) and GraalVM from [Oracle downloads](https://www.graalvm.org/downloads/), or use `winget`:
* Download SDKs manually from [Eclipse Temurin releases](https://adoptium.net/temurin/releases/) and GraalVM from [Oracle downloads](https://www.graalvm.org/downloads/).
113
129
* Install the GraalVM native image requirements for native builds by following [the GraalVM official documentation](https://www.graalvm.org/latest/docs/getting-started/windows/#prerequisites-for-native-image-on-windows).
114
130
115
-
To add the required environment variables manually from PowerShell, run this command for each SDK version:
* There is a pre-commit hook setup to verify formatting before committing. It can be activated with the following command:
171
-
```bash
172
-
# On bash-like shells shells or PowerShell
198
+
```shell
173
199
cd dd-trace-java
174
200
cp .githooks/pre-commit .git/hooks/
175
201
```
@@ -182,7 +208,7 @@ Alternatively, download and install Docker Desktop from the offical website: htt
182
208
> This is done both to avoid future merge conflict and ensure uniformity inside the code base.
183
209
184
210
* Configure git to automatically update submodules.
185
-
```bash
211
+
```shell
186
212
git config --local submodule.recurse true
187
213
```
188
214
@@ -197,23 +223,17 @@ Alternatively, download and install Docker Desktop from the offical website: htt
197
223
> [!NOTE]
198
224
> Both git configurations (hooks and submodule) will only be applied to this project and won't apply globally in your setup.
199
225
200
-
### Check your development environment
201
-
202
-
You can confirm that your development environment is properly set up using the [quick check](#development-environment-quick-check) `setup.sh` script on macOS or Linux or `setup.ps1` on Windows.
203
-
204
-
### Build the project
226
+
## Building the project
205
227
206
228
After everything is properly set up, you can move on to the next section to start a build or check [the contribution guidelines](CONTRIBUTING.md).
207
229
208
-
## Project build
209
-
210
230
To build the project without running tests, run:
211
-
```bash
231
+
```shell
212
232
./gradlew clean assemble
213
233
```
214
234
215
235
To build the entire project with tests (this can take a very long time), run:
216
-
```bash
236
+
```shell
217
237
./gradlew clean build
218
238
```
219
239
@@ -223,7 +243,7 @@ To build the entire project with tests (this can take a very long time), run:
223
243
> It is recommended to only run the tests related to your changes locally and leave running the whole test suite to the continuous integration platform.
0 commit comments