I foolishly agreed to host a live demo and we built a gradle project. This is a workshop I’ve done a few times now.
Gradle_0_to_Her0.pptx2063.9KB
Gradle: Zer0 to Her0
Goals
- Understand and read Gradle builds.
- Gain a foundation for building projects.
- Understand Java/JVM project structure.
- Learn from other builds and enhance your own.
Introduction
What is it?
- All Java programs need to be compiled, referred to as building.
- As Java complexity increased, build systems were created.
- Build systems now orchestrate tests and other activities, becoming developer automation systems.
The Showdown
- Comparison between different build systems.
- Preference for Gradle due to:
- A build language vs. build XML.
- Android's preference for Gradle (and Kotlin).
- Approachability for developers coming from JavaScript build systems.
DEMO
Sections
- Plugins
- Repositories
- Artifactory
- Dependencies
- Settings
- Multi Module
Project Layout
src/main/{java resources} src/test/{java resources}
src/main/kotlin src/main/scala src/test/kotlin src/test/scala
Build
- Distribution: Look in
build/libs
. - Test Report: Available at
build/reports/tests/test/index.html
.
Extra Sections
- Buildscript
- Env
- Plugin Configuration
Other Things
- Gradle properties: Allows configuration for different environments (dev, test, etc.).