Skip to content

Commit d5b80a3

Browse files
committed
Add readme to explain how to use gradle and setup gradle for newbies.
1 parent 2e120b2 commit d5b80a3

1 file changed

Lines changed: 39 additions & 0 deletions

File tree

USING_GRADLE.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# Using Gradle to Build the project
2+
3+
This project uses gradle to install external dependencies, build the project (jar files), and execute tests.
4+
5+
## Gradle Version
6+
7+
The version of gradle required is Gradle 4.6, or as specified in `/gradle/wrapper/gradle-wrapper.properties`.
8+
9+
## Run tasks using gradlew instead of gradle
10+
11+
Run `./gradlew` instead of the globally installed `gradle` on your machine to execute gradle tasks.
12+
13+
This ensures that the correct version of gradle is used, and also downloads the required version of gradle.
14+
15+
## Tasks
16+
17+
### Build buildJavaCommonsCore
18+
19+
Run `./gradlew buildJavaCommonsCore` to build the JavaCommonsCore module.
20+
21+
### Build the jar packages
22+
23+
Run `./gradlew jar` to build the project and package as a jar.
24+
25+
Run `./gradlew shadowJar` to build the project and package as a shadow jar (dependencies are shaded)
26+
27+
Run `./gradlew fatJar` to build the project and package as a fat jar (dependencies are included, and not shaded)
28+
29+
Run `./gradlew buildAll` to build all 3 jars (jar, shadow jar, and fat jar).
30+
31+
Run `./gradlew testAndBuildAll` to run full test suite and build all 3 jars (jar, shadow jar, and fat jar).
32+
33+
## Setting up the project in IntelliJ
34+
1. Right click "settings.gradle" and click "Import Gradle Project"
35+
2. In the Gradle Tool Window, click the wrench, and then "Gradle Settings"
36+
3. Check "Download external annotations for dependencies" - this will allow code hinting to work
37+
4. Set "Use Gradle from" to "'gradle-wrapper.properties' file" to make sure it runs the correct version of gradle
38+
39+

0 commit comments

Comments
 (0)