Skip to content

Commit 25f57e3

Browse files
authored
[plugin] Added gradle plugin and fixed typo in docs (#769)
## Summary Added plugin for gradle to force it to use the installed jdk version instead of default (17). Also fixed a small error in documentation for gradle setup ## How was it tested? - compile - in empty directory run `./devbox init` - `./devbox add gradle jdk11` - `./devbox shell` - confirm a gradle.properties file is created with content similar to below: ```gradle.properties org.gradle.java.home=/nix/store/3y1sh00km4c616prn19brd3vj9ikc2h2-zulu11.48.21-ca-jdk-11.0.11 ```
1 parent 4fcdb4a commit 25f57e3

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

docs/app/docs/devbox_examples/languages/java.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ Gradle is a popular, multi-language build tool that is commonly used with JVM pr
5151
mainClassName = 'hello.HelloWorld'
5252
jar {
5353
manifest {
54-
/* assuming main class is in src/main/hello/HelloWorld.java */
54+
/* assuming main class is in src/main/java/hello/HelloWorld.java */
5555
attributes 'Main-Class': 'hello.HelloWorld'
5656
}
5757
}

plugins/gradle.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"name": "gradle",
3+
"version": "0.0.1",
4+
"match": "^(gradle|gradle_[0-9])$",
5+
"readme": "You can customize which JDK gradle will use by specifying the value of `org.gradle.java.home` in gradle.properties file",
6+
"shell": {
7+
"init_hook": [
8+
"[ -s gradle.properties ] || echo org.gradle.java.home=$JAVA_HOME >> gradle.properties"
9+
]
10+
}
11+
}

0 commit comments

Comments
 (0)