GRADLE 4.0 ETIENNE STUDER, VP OF PRODUCT TOOLING, GRADLE INC. - - PowerPoint PPT Presentation

gradle 4 0
SMART_READER_LITE
LIVE PREVIEW

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


slide-1
SLIDE 1

GRADLE 4.0

ETIENNE STUDER, VP OF PRODUCT TOOLING, GRADLE INC.

slide-2
SLIDE 2

| 2

E"enne Studer C: Gradle Inc. P: Gradle Enterprise E: e"enne@gradle.com T: @e"ennestuder G: github.com/e"ennestuder

slide-3
SLIDE 3
slide-4
SLIDE 4

| 4

DOWNLOADS/ MONTH

4.0M

slide-5
SLIDE 5

| 5

OSS PROJECTS
 WORLD-WIDE

#17

slide-6
SLIDE 6

| 6

GRADLE ENGINEERS

30

slide-7
SLIDE 7

Gradle 1-min intro

slide-8
SLIDE 8

| 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

slide-9
SLIDE 9

| 9

Demo

Gradle 1-min intro

slide-10
SLIDE 10

Incremental builds

slide-11
SLIDE 11

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

slide-12
SLIDE 12

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

slide-13
SLIDE 13

| 13

Demo

Incremental builds

slide-14
SLIDE 14

Build cache

slide-15
SLIDE 15

| 15

Build cache

  • Reuse outcomes of any previous run (rather than just the last)
  • Local cache and remote cache
  • Task output caching
slide-16
SLIDE 16

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

slide-17
SLIDE 17

| 17

Demo

Build cache

slide-18
SLIDE 18

| 18

Build cache

Remote Cache Local Cache CI Developer

slide-19
SLIDE 19

| 19

Build cache

buildCache { local { enabled = !isCI } remote(HttpBuildCache) { url = ‘https://my.ge.server/cache/' push = isCI } }

slide-20
SLIDE 20

| 20

Build cache

slide-21
SLIDE 21

| 21

Build cache

Android

  • Gradle tasks of Android plugin will become cacheable
  • Caching transformed dependencies possibly in the future
slide-22
SLIDE 22

| 22

  • hQps:/

/blog.gradle.org/introducing-gradle-build-cache

  • hQps:/

/docs.gradle.org/3.5/userguide/build_cache.html

  • High-performant, scalable build cache implementa3on

available in Gradle Enterprise

  • hQps:/

/gradle.com/build-cache

Build cache

slide-23
SLIDE 23

Compile avoidance & incremental compiler

slide-24
SLIDE 24

| 24

Avoid was3ng 3me compiling source classes that
 do not have to be compiled.

Compile avoidance & incremental compiler

slide-25
SLIDE 25

| 25

Compile avoidance & incremental compiler

app library

slide-26
SLIDE 26

| 26

Demo

Compile avoidance & incremental compiler

slide-27
SLIDE 27

| 27

Compile avoidance & incremental compiler

slide-28
SLIDE 28

| 28

Compile avoidance & incremental compiler

slide-29
SLIDE 29

| 29

  • hQps:/

/blog.gradle.org/incremental-compiler-avoidance

  • hQps:/

/docs.gradle.org/current/userguide/java_plugin.html

Compile avoidance & incremental compiler

slide-30
SLIDE 30

General performance improvements

slide-31
SLIDE 31

| 31

  • Faster configura3on 3me
  • Parallel dependency resolu3on
  • Parallel task / ac3on execu3on by default

General performance improvements

slide-32
SLIDE 32

Gradle daemon

slide-33
SLIDE 33

| 33

Gradle builds executed much more quickly by a long-lived background process that avoids expensive bootstrapping and leverages caching.

Gradle daemon

slide-34
SLIDE 34

| 34

Demo

Gradle daemon

slide-35
SLIDE 35

| 35

  • hQps:/

/docs.gradle.org/current/userguide/gradle_daemon.html

Gradle daemon

slide-36
SLIDE 36

Worker API

slide-37
SLIDE 37

| 37

Worker API

  • API to run task ac3ons in parallel safely
  • Parallel ac3ons cannot mutate shared state
  • Supports out-of-process and in-process ac3ons
slide-38
SLIDE 38

Con"nuous build

slide-39
SLIDE 39

| 39

Demo

Con3nuous build

slide-40
SLIDE 40

| 40

  • hQps:/

/blog.gradle.org/introducing-con3nuous-build

  • hQps:/

/docs.gradle.org/current/userguide/con3nuous_build.html

Con3nuous build

slide-41
SLIDE 41

Composite builds

slide-42
SLIDE 42

| 42

Composite builds

  • Fix a bug in a library through app using project
  • Break down a monolith into mul3ple repos
  • Consume latests state of libraries in integra3ons builds
slide-43
SLIDE 43

| 43

Demo

Composite builds

slide-44
SLIDE 44

| 44

  • hQps:/

/blog.gradle.org/introducing-composite-builds

  • hQps:/

/blog.jetbrains.com/idea/2017/03/webinar-recording- composite-builds-with-gradle

  • hQps:/

/docs.gradle.org/current/userguide/ composite_builds.html

Composite builds

slide-45
SLIDE 45

New Gradle console

slide-46
SLIDE 46

IDE integra"on

slide-47
SLIDE 47

| 47

IDE integra3on

  • Project import & synchroniza3on
  • Task execu3on
  • Test execu3on
  • Build execu3on insights

Build is the single source of truth!

slide-48
SLIDE 48

| 48

Tooling API

Launcher Tooling API Server Cmd Line

(build master) (cont integra3on)

Gradle (daemon) IDE

(developer)

slide-49
SLIDE 49

| 49

Demo

IDE integra3on

slide-50
SLIDE 50

| 50

  • hQps:/

/blog.gradle.org/announcing-buildship-2.0

  • hQps:/

/marketplace.eclipse.org/content/buildship-gradle- integra3on

IDE integra3on

slide-51
SLIDE 51

Gradle Script Kotlin

slide-52
SLIDE 52

| 52

Gradle Script Kotlin

  • Syntax highligh3ng
  • Quick documenta3on
  • Naviga3on to source
  • Auto-comple3on / content assist
  • Refactoring
  • High execu3on 3me performance

Build code is no different to applica5on code!

slide-53
SLIDE 53

| 53

  • hQps:/

/blog.gradle.org/kotlin-meets-gradle

  • hQps:/

/github.com/gradle/gradle-script-kotlin

Gradle Script Kotlin

slide-54
SLIDE 54

Gradle Profiler

slide-55
SLIDE 55

| 55

  • Profiling and benchmarking
  • DSL to describe scenarios (tasks, Gradle version, etc.)
  • Profiles for Build scans, YourKit, Chrome Trace, etc.
  • Build life-cycle insights derived from build opera3ons

Gradle Profiler

slide-56
SLIDE 56

| 56

  • github.com/gradle/gradle-profiler

Gradle Profiler

slide-57
SLIDE 57

Build scans

slide-58
SLIDE 58

| 58

Build scans

  • Gain build insights
  • Improve build performance
  • Collaborate with colleagues and the community
slide-59
SLIDE 59

| 59

Build scans

Demo

slide-60
SLIDE 60

| 60

Build scans

slide-61
SLIDE 61

| 61

  • hQps:/

/gradle.com

  • hQps:/

/gradle.com/scans/get-started

Build scans

Build scans are a free service for everyone!

slide-62
SLIDE 62

Gradle Enterprise

slide-63
SLIDE 63

| 63

Gradle Enterprise

  • Query scans
  • Compare scans
  • Use a high-performance, scalable build cache
  • Host within your firewall

Gain deep build insights within your company and teams!

slide-64
SLIDE 64

| 64

Gradle Enterprise

Demo

slide-65
SLIDE 65

| 65

  • hQps:/

/gradle.com/enterprise

Gradle Enterprise

Gradle Enterprise is a commercial offering!

slide-66
SLIDE 66

Android

slide-67
SLIDE 67

| 67

Android plugin 2.5

  • Close collabora3on between Gradle and Google Android Team
slide-68
SLIDE 68

| 68

Android plugin 2.5

  • No more dependency resolu3on at configura3on 3me
  • Parallel dependency resolu3on (ar3facts / metadata download)
  • Dependencies always only downloaded once per build
  • Variant-aware dependency management
  • More fine-grained parallelism
  • Compile avoidance
  • Explicit annota3on-processor declara3on
  • Linear growth when new variants are added
  • Android tasks will be cacheable
slide-69
SLIDE 69

| 69

  • Incremental builds
  • Build cache
  • Compile avoidance & incremental compiler
  • Worker API
  • Daemon
  • Con3nuous builds
  • Composite builds
  • Tooling API
  • Sta3cally-typed DSL
  • Build scans
  • Gradle Enterprise

Gradle

Used by

slide-70
SLIDE 70

Thank you

E3enne Studer