This topic provides an overview of LabKey's Gradle-based build system.

General Setup

Before following any of the steps below, you'll need to Set Up a Development Machine, including completing the Gradle Configuration steps.

In the steps below, we use LABKEY_ROOT to refer to the directory into which you checked out your SVN enlistment (i.e., the parent of the server directory).

Your First Gradle Commands

1. Execute a gradle command to show you the set of currently configured projects (modules). You do not need to install gradle and should resist the urge to do so. We use the gradle wrapper to make updating version numbers easier. The gradle wrapper script (either gradlew or gradlew.bat) is included in the SVN sync and is already in the <LABKEY_ROOT> directory.

On the command line, type ./gradle projects (Mac/Linux) or gradlew projects (Windows)

2. Execute a gradle command to build and deploy the application

./gradlew :server:deployApp

This will take some time as it needs to pull down many resources to initialize the local caches. Subsequent builds will be much faster.

Changing the Set of Projects

Gradle uses the <LABKEY_ROOT>/settings.gradle file to determine which projects (modules) are included in the build. To include a different set of projects in your build, you will need to edit this file. By default, only modules in the server/modules directory and the server/test and server/test/modules directories are included in the build. See the file for examples of different ways to include different subsets of the modules.

Commonly Used Gradle Commands

For a list of commonly used Gradle commands, see Build LabKey From Source.

Tips

See Gradle Tips and Tricks.

Cleaning

See the topic Gradle Cleaning.

IntelliJ Setup

Follow these steps in order to make IntelliJ able to find all the source code and elements on the classpath as well as be able to run tests.

Troubleshooting

See the trouble shooting section in Set Up a Dev Machine.

Related Topics

Discussion

Was this content helpful?

Log in or register an account to provide feedback


previousnext
 
expand all collapse all