The LabKey Server module build process is designed to be flexible, consistent, and customizable. The process is driven by a manifest file that dictates which module directories to build. Module directories are listed either individually or using wildcards.

A few of the options this enables:

  • Modify your build manifest files to remove modules that you never use, speeding up your build.
  • Add your custom module directories to an existing build location (e.g., /server/modules) to automatically include them in the standard build.
  • Create a custom manifest file. See 'local_settings.gradle' below for an example.

settings.gradle

By default, the standard build tasks use the manifest file "/settings.gradle". You can edit this file to customize the modules that are built. settings.gradle includes a mix of wildcards and individually listed modules.

Wildcard Example. The following builds every module under the localModules directory that is contained in an app directory. Note that app is the parent of the module directories, not the module directory itself.

def excludedModules = ["inProgress"]
// The line below includes all modules under the localModules directory that are contained in a directory "app".
// The modules are subdirectories of app, not app itself.
BuildUtils.includeModules(this.settings, rootDir, [**/localModules/**/app/*], excludedModules);

Module Directory Example. The following builds every module directory in "server/modules":

def excludedModules = ["inProgress"]
// The line below includes all modules in the server/modules directory (except the ones indicated as to be excluded)
BuildUtils.includeModules(this.settings, rootDir, [BuildUtils.SERVER_MODULES_DIR], excludedModules);

Individual Module Example. The following adds the 'workflow' module to the build.

// The line below is an example of how to include a single module
include ":server:optionalModules:workflow"

Custom Module Manifests

You can also create custom module manifest files. For example, the following manifest file 'local_settings.gradle' provides a list of individually named modules:

local_settings.gradle

include ':remoteapi:java'
include ':schemas'
include ':server:internal'
include ':server:api'
include ':server:bootstrap'
include ':server:modules:announcements'
include ':server:modules:audit'
include ':server:modules:core'
include ':server:modules:experiment'
include ':server:modules:filecontent'
include ':server:modules:pipeline'
include ':server:modules:query'
include ':server:modules:wiki'
include ':server:modules:bigiron'
include ':server:modules:dataintegration'
include ':server:modules:elisa'
include ':server:modules:elispotassay'
include ':server:modules:flow'
include ':server:modules:issues'
include ':server:modules:list'
include ':server:modules:luminex'
include ':server:modules:microarray'
include ':server:modules:ms1'
include ':server:modules:ms2'
include ':server:modules:nab'
include ':server:modules:search'
include ':server:modules:study'
include ':server:modules:survey'
include ':server:modules:visualization'
include ':server:customModules:targetedms'
include ':server:customModules:fcsexpress'

The following uses the custom manifest file in the build:

gradlew -c local_settings.gradle deployApp

gradle/settings files

Instead of supplying a local settings file and using the -c option, you can put your setting file in the <LABKEY_HOME>/gradle/settings directory and use the moduleSet property to tell Gradle to pick up this settings file. The property value should be the basename of the settings file you wish to you. For example,

gradlew -PmoduleSet=all
will cause Gradle to incorporate the file <LABKEY_HOME>/gradle/settings/all.gradle to define the set of projects (modules) to include.

Skipping a Module

The build targets can be made to ignore a module if you define the property skipBuild for this project. You can do this by adding a gradle.properties file in the project's directory with the following content

skipBuild

Note that we check only for the presence of this property, not its value.

Related Topics

discussion

Discussion

Search 

Pages 

previousnext
 
expand all collapse all