Skip to content

Commit 35dcb76

Browse files
milyinCopilot
andauthored
use Gradlew (#467)
* gradlew added * use gradlew in ci * docs(readme): switch remaining gradle commands to wrapper Agent-Logs-Url: https://github.com/eclipse-zenoh/zenoh-java/sessions/8a1e11ab-5586-45f6-93c6-d6225c551eb5 Co-authored-by: milyin <1909657+milyin@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
1 parent ca507eb commit 35dcb76

9 files changed

Lines changed: 366 additions & 28 deletions

File tree

.github/workflows/ci.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,9 @@ jobs:
5555

5656
- name: Setup Gradle
5757
uses: gradle/actions/setup-gradle@v4
58-
with:
59-
gradle-version: 8.12.1
6058

6159
- name: Gradle Test
62-
run: gradle jvmTest --info
60+
run: ./gradlew jvmTest --info
6361

6462
markdown_lint:
6563
runs-on: ubuntu-latest

.github/workflows/publish-android.yml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -58,12 +58,6 @@ jobs:
5858
5959
- name: Setup Gradle
6060
uses: gradle/actions/setup-gradle@v4
61-
with:
62-
gradle-version: 8.12.1
63-
64-
- name: Gradle Wrapper
65-
run: |
66-
gradle wrapper
6761

6862
- name: Set pub mode env var
6963
# Note: This step is intended to allow publishing snapshot packages.

.github/workflows/publish-dokka.yml

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,9 @@ jobs:
2727

2828
- name: Setup Gradle
2929
uses: gradle/actions/setup-gradle@v4
30-
with:
31-
gradle-version: 8.12.1
32-
33-
- name: Gradle Wrapper
34-
run: |
35-
gradle wrapper
3630

3731
- name: Build doc
38-
run: gradle dokkaGenerate
32+
run: ./gradlew dokkaGenerate
3933

4034
- name: Deploy doc
4135
if: ${{ inputs.live-run || false }}

.github/workflows/publish-jvm.yml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -163,12 +163,6 @@ jobs:
163163

164164
- name: Setup Gradle
165165
uses: gradle/actions/setup-gradle@v4
166-
with:
167-
gradle-version: 8.12.1
168-
169-
- name: Gradle Wrapper
170-
run: |
171-
gradle wrapper
172166

173167
- name: Set pub mode env var
174168
# Note: This step is intended to allow publishing snapshot packages.

README.md

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -114,18 +114,23 @@ Basically:
114114

115115
- Rust ([Installation guide](https://doc.rust-lang.org/cargo/getting-started/installation.html))
116116
- Kotlin ([Installation guide](https://kotlinlang.org/docs/getting-started.html#backend))
117-
- Gradle ([Installation guide](https://gradle.org/install/))
118117

119118
and in case of targeting Android you'll also need:
120119

121120
- Android SDK ([Installation guide](https://developer.android.com/about/versions/11/setup-sdk))
122121

122+
## Gradle wrapper
123+
124+
This repository ships a [Gradle wrapper](https://docs.gradle.org/current/userguide/gradle_wrapper.html) (`./gradlew` / `gradlew.bat`), so no system-wide Gradle installation is required. The wrapper pins the build to **Gradle 8.12.1** and verifies the distribution checksum before use, ensuring a reproducible and tamper-evident build environment.
125+
126+
Use `./gradlew` on Unix/macOS/Linux (or `gradlew.bat` on Windows) in place of `gradle` for all commands listed below.
127+
123128
## <img src="jvm.png" alt="JVM" height="50"> JVM
124129

125130
To publish a library for a JVM project into Maven local, run
126131

127132
```bash
128-
gradle publishJvmPublicationToMavenLocal
133+
./gradlew publishJvmPublicationToMavenLocal
129134
```
130135

131136
This will first, trigger the compilation of Zenoh-JNI in release, and second publish the library into maven local, containing the native library
@@ -180,7 +185,7 @@ to install them.
180185
So, in order to publish the library onto Maven Local, run:
181186

182187
```bash
183-
gradle -Pandroid=true publishAndroidReleasePublicationToMavenLocal
188+
./gradlew -Pandroid=true publishAndroidReleasePublicationToMavenLocal
184189
```
185190

186191
This will first trigger the compilation of the Zenoh-JNI for the previously mentioned targets, and secondly will
@@ -215,15 +220,15 @@ Because it's a Kotlin project, we use [Dokka](https://kotlinlang.org/docs/dokka-
215220
In order to build it, run:
216221

217222
```bash
218-
gradle dokkaGenerate
223+
./gradlew dokkaGenerate
219224
```
220225

221226
## Running the tests
222227

223228
To run the tests, run:
224229

225230
```bash
226-
gradle jvmTest
231+
./gradlew jvmTest
227232
```
228233

229234
This will compile the native library on debug mode (if not already available) and run the tests afterward against the JVM target.
@@ -235,7 +240,7 @@ Rust logs are propagated when setting the `RUST_LOG` environment variable.
235240
For instance running the ZPub test as follows:
236241

237242
```bash
238-
RUST_LOG=debug gradle ZPub
243+
RUST_LOG=debug ./gradlew ZPub
239244
```
240245

241246
causes the logs to appear in standard output.

gradle/wrapper/gradle-wrapper.jar

42.6 KB
Binary file not shown.
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
distributionBase=GRADLE_USER_HOME
2+
distributionPath=wrapper/dists
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.12.1-bin.zip
4+
distributionSha256Sum=8d97a97984f6cbd2b85fe4c60a743440a347544bf18818048e611f5288d46c94
5+
networkTimeout=10000
6+
validateDistributionUrl=true
7+
zipStoreBase=GRADLE_USER_HOME
8+
zipStorePath=wrapper/dists

gradlew

Lines changed: 251 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)