Skip to content

Commit 2a62d8c

Browse files
committed
Document update-gradle-wrappers script usage and functionality
1 parent dd6dd62 commit 2a62d8c

1 file changed

Lines changed: 49 additions & 0 deletions

File tree

docs/update-gradle-wrappers.md

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
### Update Gradle Wrappers Across All Exercises
2+
3+
This repository contains many independent Gradle projects (one per exercise).
4+
To update all Gradle wrappers to a specific version (e.g., to support Java 25), use the helper script below.
5+
6+
#### Script name
7+
8+
Suggested name: `update-gradle-wrappers` (added under `bin/`).
9+
10+
#### Requirements
11+
12+
- macOS/Linux shell with Bash
13+
- Internet access (the first update will download the target Gradle distribution)
14+
15+
#### Usage
16+
17+
```
18+
bin/update-gradle-wrappers [<gradle-version>]
19+
```
20+
21+
- If omitted, the version defaults to `9.2.1`.
22+
- Example: update everything to Gradle 9.2.1
23+
24+
```
25+
bin/update-gradle-wrappers 9.2.1
26+
```
27+
28+
#### What the script does
29+
30+
1. Uses the fixed seed at `exercises/gradle` and runs:
31+
```
32+
./gradlew wrapper --gradle-version <version>
33+
```
34+
This produces the correct `gradle-wrapper.jar` and `gradle-wrapper.properties` for the requested version.
35+
2. Copies the wrapper files from the seed to every exercise’s `gradle/wrapper/` directory
36+
37+
This aligns with the requested approach: update via Gradle, and ensure consistency by copying the wrapper files everywhere.
38+
39+
#### Notes
40+
41+
- The script uses `exercises/gradle` as the single source of truth (seed) and does not run Gradle in each exercise; it only copies the wrapper files.
42+
- The operation can take time on the first run due to Gradle downloads.
43+
44+
#### Troubleshooting
45+
46+
- If you see permission issues, make the script executable:
47+
```
48+
chmod +x bin/update-gradle-wrappers
49+
```

0 commit comments

Comments
 (0)