9. Gradle: What is it?
Gradle is a Groovy DSL for creating build scripts
Gradle has a beautiful designed model for Tasks,
Dependencies, Conventions etc.
Gradle understands Ivy and Maven repositories
Gradle can execute Ant scripts and tasks directly
This is a valid Gradle build script:
apply plugin: 'war'
10. Gradle: What does it look like?
build.gradle
apply plugin: 'java'
apply plugin: 'war'
repositories {
mavenCentral()
}
group = 'io.jumpco.samples'
version = '1.0-SNAPSHOT'
sourceCompatibility = 1.8
dependencies {
compile “org.springframework:spring-core:$springVersion”
compile “org.springframework:spring-web:$springVersion”
compile “org.springframework:spring-webmvc:$springVersion”
testCompile group: 'junit', name: 'junit', version: junitVersion
}
settings.gradle
rootProject.name = 'SampleWebApp'
gradle.properties
springVersion=4.2.4.RELEASE
junitVersion=4.11
15. Gradle: Create scripts
gradle init –type basic|pom|java-library
Create build.gradle and other files
− Basic, Java Library, Scala Library, Groovy Library
− Choose test framework
− Convert pom
●
IDE New Gradle Project
●
Checkout lazybones at
https://github.com/pledbrook/lazybones
16. Gradle: Wrapper
gradle wrapper
Creates gradlew, gradlew.bat, gradle folder. Small enough to
checkin.
./gradlew build
Downloads Gradle version and executes build task.
17. Gradle: Other
Gradle UI – Swing application
Gradle Daemon will remain running and will reload only
modified scripts to improve execution time.
--continuous option. Gradle will remain running and trigger
build when input artefacts modified.
New Build Model
19. Gradle: Cases Studies
● 2000 components, 1000 release builds per day
● Nebula. Patched Gradle.
● Enterprise Projects with > 300 modules
● Partial Local build.
● Generate documentation
● Deployment automation
20. Gradle: Summary
● Made for Customisation
● Robust Dependency Management
● Build Reporting
● The same flexible Build Model for both continuous
integration and local development.
● One source of the truth