Presentation is loading. Please wait.

Presentation is loading. Please wait.

Building LabKey with Gradle

Similar presentations


Presentation on theme: "Building LabKey with Gradle"— Presentation transcript:

1 Building LabKey with Gradle
Susan Hert, Senior Software Developer Building LabKey with Gradle Release 17.2

2 From Ant to Gradle What’s a Gradle? Why the transition?
What will change? How do you transition? What’s the timeline?

3 An open source build automation system, initially developed for JVM projects, providing:
a Groovy-based, domain-specific language flexibility in configuration and build logic dependency management through repositories integration with IntelliJ, TeamCity, etc.

4 Why the Transition? The ant is knowing and wise, but he doesn't know enough to take a vacation. Clarence Day handle your dependencies.

5 Why the Transition? Dependency management Building more with less
project dependences external dependencies top-level and transitive dependencies handles publishing & retrieving of artifacts Building more with less Shorter, targeted build steps Better up-to-date checks

6 The Players The build tool Configures all build projects and executes all build logic The artifact builder Publishes artifacts and runs integration tests The artifact repository Stores artifacts (e.g., jar files) for use by builders

7 What will change? ant build build.xml standard.modules
unversioned artifacts external jars in version control IntelliJ project in server ./gradlew deployApp build.gradle settings.gradle versioned artifacts external jars downloaded IntelliJ project at root

8 How to Transition Command line IntelliJ project
set up some properties in gradle.properties file use gradle commands and tasks (targets) IntelliJ project Use project at the root level instead of in server Use Gradle window to dynamically create .iml files Build script conversion (possibly optional) build.xml build.gradle

9 Gradle Files gradlew settings.gradle build.gradle gradlePlugin
The Gradle Wrapper, which does all the work settings.gradle Indicates which modules to include in the build build.gradle Configuration of the build steps gradlePlugin jar file with plugins, tasks and utilities for the LabKey server build gradle.properties Not every module has a build.gradle Next: show projects and tasks commands

10 Developer Scenarios Initial build Adding a file-based module
from LabKey distribution from source Adding a file-based module Adding a Java module Working with IntelliJ Cleaning up Be cautious about combining an ant distribution with a Gradle build

11 Versioning - Please note
All examples here are using latest svn trunk gradlePlugin latest 1.0-SNAPSHOT version In other words, what you see here may not work with a 17.1 version of LabKey.

12 Initial Build from Distribution
Get SVN enlistment (or ant clean) Download distribution Copy to dist directory Pick database ./gradlew :server:pickPg OR ./gradlew :server:pickMSSQL Deploy distribution ./gradlew :server:deployDistribution

13 Initial Build from Source
Get SVN enlistment (or ant clean) Pick database ./gradlew :server:pickPg OR ./gradlew :server:pickMSSQL Deploy Application ./gradlew :server:deployApp

14 Adding Your Own Module Apply plugins in build.gradle
Declare dependencies in build.gradle Deploy module

15 Building a File-based LabKey Module
Apply plugins in build.gradle apply plugin: ‘java’ apply plugin: ‘org.labkey.fileModule’ Declare dependencies in build.gradle dependencies { … } Deploy module (from the module directory) ./gradlew :path:to:module:deployModule

16 Building a Java-based LabKey Module
Apply plugins in build.gradle apply plugin: ‘java’ apply plugin: ‘org.labkey.module’ Declare dependencies in build.gradle dependencies { … } Deploy module (from the module directory) ./gradlew :path:to:module:deployModule Applying plugins to subprojects

17 IntelliJ & Gradle Project is located at the root directory
DO NOT use the default “linking of gradle project” from IntelliJ Instead use the sync operation in the Gradle window

18 Cleaning Up Tip: Do not engage in unnecessary cleaning.

19 Build Progression source directory (myModule)
./gradlew module build directory build/modules/myModule ./gradlew deployModule staging and deployment directories build/staging/modules/myModule.module build/deploy/modules/myModule.module

20 Cleaning Up clean - removes a module’s build directory
cleanDeploy - removes the deploy directory cleanStaging - removes the staging directory cleanBuild - removes the entire build directory

21 Transition Timeline Release 17.1 - Gradle introduced to VCS
Version 0.9 of Gradle Plugins has known issues Not all tasks have been converted Documentation still in progress Release Conversion complete Ant and build.xml files will be removed server/.idea directory and *.iml files will be removed

22 Resources LabKey docs ( Gradle docs ( LabKey forum

23 From Ant to Gradle

24 System Overview Source:


Download ppt "Building LabKey with Gradle"

Similar presentations


Ads by Google