GRADLE 4.0
ETIENNE STUDER, VP OF PRODUCT TOOLING, GRADLE INC.
GRADLE 4.0 ETIENNE STUDER, VP OF PRODUCT TOOLING, GRADLE INC. - - PowerPoint PPT Presentation
GRADLE 4.0 ETIENNE STUDER, VP OF PRODUCT TOOLING, GRADLE INC. E"enne Studer C: Gradle Inc. P: Gradle Enterprise E: e"enne@gradle.com T: @e"ennestuder G: github.com/e"ennestuder | 2 4.0M DOWNLOADS/ MONTH | 4 #17 OSS
GRADLE 4.0
ETIENNE STUDER, VP OF PRODUCT TOOLING, GRADLE INC.
| 2
E"enne Studer C: Gradle Inc. P: Gradle Enterprise E: e"enne@gradle.com T: @e"ennestuder G: github.com/e"ennestuder
| 4
DOWNLOADS/ MONTH
| 5
OSS PROJECTS WORLD-WIDE
| 6
GRADLE ENGINEERS
Gradle 1-min intro
| 8
Gradle build execu3on
Gradle build scripts Gradle tasks Gradle task execu3on 2-phase build: Configura3on phase → build task graph (DAG) Execu3on phase → execute task graph
| 9
Gradle 1-min intro
Incremental builds
Typically, not much changes in the build between consecu3ve invoca3ons of the build. When liQle changes in the build, liQle work should be done by the build. Reuse outcomes of the previous run.
Observa3on
Task inputs and outputs
Only run a task if its input or outputs have changed since the previous run. Inputs —> Task —> Outputs Example for Compile task: Task inputs: source files, compiler flags, etc. Task output: class files
| 13
Incremental builds
Build cache
| 15
Build cache
Calculate cache key from inputs, use output as cache value Inputs —> Task —> Output Example for Compile task: Cache key: hash(source files, compiler flags, etc.) Cache value: fileTree(class files)
Build cache
| 17
Build cache
| 18
Build cache
Remote Cache Local Cache CI Developer
| 19
Build cache
buildCache { local { enabled = !isCI } remote(HttpBuildCache) { url = ‘https://my.ge.server/cache/' push = isCI } }
| 20
Build cache
| 21
Build cache
Android
| 22
/blog.gradle.org/introducing-gradle-build-cache
/docs.gradle.org/3.5/userguide/build_cache.html
available in Gradle Enterprise
/gradle.com/build-cache
Build cache
Compile avoidance & incremental compiler
| 24
Avoid was3ng 3me compiling source classes that do not have to be compiled.
Compile avoidance & incremental compiler
| 25
Compile avoidance & incremental compiler
app library
| 26
Compile avoidance & incremental compiler
| 27
Compile avoidance & incremental compiler
| 28
Compile avoidance & incremental compiler
| 29
/blog.gradle.org/incremental-compiler-avoidance
/docs.gradle.org/current/userguide/java_plugin.html
Compile avoidance & incremental compiler
General performance improvements
| 31
General performance improvements
Gradle daemon
| 33
Gradle builds executed much more quickly by a long-lived background process that avoids expensive bootstrapping and leverages caching.
Gradle daemon
| 34
Gradle daemon
| 35
/docs.gradle.org/current/userguide/gradle_daemon.html
Gradle daemon
Worker API
| 37
Worker API
Con"nuous build
| 39
Con3nuous build
| 40
/blog.gradle.org/introducing-con3nuous-build
/docs.gradle.org/current/userguide/con3nuous_build.html
Con3nuous build
Composite builds
| 42
Composite builds
| 43
Composite builds
| 44
/blog.gradle.org/introducing-composite-builds
/blog.jetbrains.com/idea/2017/03/webinar-recording- composite-builds-with-gradle
/docs.gradle.org/current/userguide/ composite_builds.html
Composite builds
New Gradle console
IDE integra"on
| 47
IDE integra3on
Build is the single source of truth!
| 48
Tooling API
Launcher Tooling API Server Cmd Line
(build master) (cont integra3on)
Gradle (daemon) IDE
(developer)
| 49
IDE integra3on
| 50
/blog.gradle.org/announcing-buildship-2.0
/marketplace.eclipse.org/content/buildship-gradle- integra3on
IDE integra3on
Gradle Script Kotlin
| 52
Gradle Script Kotlin
Build code is no different to applica5on code!
| 53
/blog.gradle.org/kotlin-meets-gradle
/github.com/gradle/gradle-script-kotlin
Gradle Script Kotlin
Gradle Profiler
| 55
Gradle Profiler
| 56
Gradle Profiler
Build scans
| 58
Build scans
| 59
Build scans
| 60
Build scans
| 61
/gradle.com
/gradle.com/scans/get-started
Build scans
Build scans are a free service for everyone!
Gradle Enterprise
| 63
Gradle Enterprise
Gain deep build insights within your company and teams!
| 64
Gradle Enterprise
| 65
/gradle.com/enterprise
Gradle Enterprise
Gradle Enterprise is a commercial offering!
Android
| 67
Android plugin 2.5
| 68
Android plugin 2.5
| 69
Gradle
Used by
Thank you
E3enne Studer