...
It is required to read and at least partially understand the Gradle official documentation on its Build Environment.
Panel | ||||||
---|---|---|---|---|---|---|
| ||||||
|
Installation
Please refer to the official Gradle Installation guide. The important things to keep in mind are:
- Make sure you understand how to upgrade to the latest version.
- Install the source code too. This will allow your IDE to help you more.
- Know where Gradle is installed. Specifically, know the path of the "home" directory. (The one that contains the
bin
,lib
andsrc
folders.) You need to paste this into your IDE configuration. - Have a command line environment in which you can invoke
gradle -version
.- If you have manually installed Gradle, this means you will need to add
<gradle_home>/bin
to yourPATH
or placing a symbolic link somewhere in the system path.
- If you have manually installed Gradle, this means you will need to add
Manual Installation
If you are unsatisfied with the recommended installation methods, you may choose to install Gradle manually. Reasons for this are:
- You are on Windows and are unsatisfied with Chocolately.
- You are on Ubuntu and the system provided Gradle package is out-of-date.
- You don't want to learn how to use SDKMAN!, Homebrew, or Chocolately.
Manual installation steps:
- Download an
*-all
or "complete" distribution zip from https://services.gradle.org/distributions/ or https://gradle.org/releases/- Make sure the zip file contains
bin
andsrc
- Make sure the zip file contains
- Unzip the distribution
- Linux command:
unzip gradle.zip -d gradle
- Linux command:
- Copy the distribution to a suitable system directory.
- Windows suggested:
C:\gradle-8.1.1
- Linux suggested:
/opt/gradle-8.1.1
- Windows suggested:
- Create a version-less symbolic link. This makes it easy to upgrade. Use the link in
PATH
and in IDEs.- Unix command:
ln -s /opt/gradle-8.1.1/ /opt/gradle
- Windows command:
mklink C:\gradle
C:\gradle-8.1.1
- Unix command:
- Add Gradle
bin
folder to thePATH
environment variable.- Linux: Add
export PATH=$PATH:/opt/gradle/bin
to~/.bashrc
- Linux: Add
Example commands on a Unix system:
...
MultiExcerptName | Gradle quickstart |
---|
...
MultiExcerptName | gradle verify |
---|
Verify installation:
SDKMAN! Installation
Alternatively will can use SDKMAN! which is a package manager for Gradle, Java, and many other frameworks on Ubuntu.
See the page on SDKMAN!
Now install Gradle:
sdk install gradle 8.1.1
Note, Gradle will be installed in a hidden folder located at (You may have to press Ctrl + H to view hidden folders in Ubuntu's file explorer):
...
Gradle does not have any official installers. There are many community (package manager) based installation methods, or you can install it manually.
Gradle installation helper scripts
We maintain some helper scripts to install Gradle system-wide for both Ubuntu and Windows. These live in the repository-group repository. There are instructions here.
Configuration
If you have not yet read the Gradle official documentation on the Build Environment, please do so now. This section will mostly contain the important highlights of that document. Gradle properties files are .properties files.
...
You can retrieve the nexus password from 1Password.
NOTE: Bintray and Artifactory are both deprecated, and do not need to be set in your gradle.properties
file.
You can also use your personal IHMC credentials (same as what you use to login to wifi)
Code Block |
---|
nexusUsername=<your wifi username>
nexusPassword=<your wifi password> |
Selecting a JVM
To select the JVM that Gradle runs itself with, set JAVA_HOME
. (This is the version shown with gradle --version
)
To select the JVM that Gradle runs your build code with, set org.gradle.java.home
. On Windows, you will need to use forward slashes "/" instead of backslashes "\". (see here)
...
title | gradle.properties |
---|
...
.
...
Optimizing JVM memory for better performance
...
Multiexcerpt | ||
---|---|---|
| ||
IHMC Employees: |
Multiexcerpt | ||
---|---|---|
| ||
Open Source Only: |
Ubuntu:
Multiexcerpt | ||
---|---|---|
| ||
IHMC Employees: |
Multiexcerpt | ||
---|---|---|
| ||
Open Source Only: |
Working with Gradle
Running Gradle on the command line
It is extremely handy to be prepared to run Gradle from the command line. This requires a Gradle installation. You should be able to, at the very least run
...
Debugging Gradle builds
First, read Running Gradle on the command line.
The first thing to find out is if Gradle configures without errors. Gradle configuration is invoked with the gradle
command without any arguments. Adding --info
and --stacktrace
can give you necessary debugging information. The --debug
option is extremely verbose and it mostly only helpful for plugin developers.
...
Using it, it is sometimes necessary to completely remove Gradle and reinstall in order to upgrade. In some cases, an apt autoremove
might even be necessary.
Please remove it and reinstall.
Dependency Troubleshooting
...