Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

It is required to read and at least partially understand the Gradle official documentation on its Build Environment.


Panel
bgColor#f9faff
borderStylesolid
titleContents

Table of Contents

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 and src 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 your PATH or placing a symbolic link somewhere in the system path.

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:

  1. Download an *-all or "complete" distribution zip from https://services.gradle.org/distributions/ or https://gradle.org/releases/
    1. Make sure the zip file contains bin and src
  2. Unzip the distribution
    1. Linux command: unzip gradle.zip -d gradle
  3. Copy the distribution to a suitable system directory.
    1. Windows suggested: C:\gradle-8.1.1
    2. Linux suggested: /opt/gradle-8.1.1
  4. Create a version-less symbolic link. This makes it easy to upgrade. Use the link in PATH and in IDEs.
    1. Unix command: ln -s /opt/gradle-8.1.1/ /opt/gradle
    2. Windows command: mklink C:\gradle C:\gradle-8.1.1
  5. Add Gradle bin folder to the PATH environment variable.
    1. Linux: Add export PATH=$PATH:/opt/gradle/bin to ~/.bashrc

Example commands on a Unix system:

...

MultiExcerptNameGradle quickstart

...

MultiExcerptNamegradle 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):

~/.sdkman/candidates/gradle/8.1.1

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) Does not actually work!

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)

...

titlegradle.properties

...

Optimizing JVM memory for better performance

...

Multiexcerpt
MultiExcerptNamegradle.properties windows example ihmc employee
IHMC Employees:
gradle.properties



Multiexcerpt
MultiExcerptNamegradle.properties windows example
Open Source Only:
gradle.properties



Ubuntu:

Multiexcerpt
MultiExcerptNamegradle.properties ubuntu example ihmc employee
IHMC Employees:
gradle.properties



Multiexcerpt
MultiExcerptNamegradle.properties ubuntu example
Open Source Only:
gradle.properties


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

...