gradle 4 0
play

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


  1. 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 | 2

  3. 4.0M DOWNLOADS/ MONTH | 4

  4. #17 OSS PROJECTS 
 WORLD-WIDE | 5

  5. 30 GRADLE ENGINEERS | 6

  6. Gradle 1-min intro

  7. Gradle build execu3on Gradle build scripts Gradle task execu3on Gradle tasks 2-phase build: Configura3on phase → build task graph (DAG) Execu3on phase → execute task graph | 8

  8. Gradle 1-min intro Demo | 9

  9. Incremental builds

  10. Observa3on 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.

  11. 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

  12. Incremental builds Demo | 13

  13. Build cache

  14. Build cache • Reuse outcomes of any previous run (rather than just the last) • Local cache and remote cache • Task output caching | 15

  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)

  16. Build cache Demo | 17

  17. Build cache Remote CI Cache Local Developer Cache | 18

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

  19. Build cache | 20

  20. Build cache Android • Gradle tasks of Android plugin will become cacheable • Caching transformed dependencies possibly in the future | 21

  21. Build cache • 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 | 22

  22. Compile avoidance & incremental compiler

  23. Compile avoidance & incremental compiler Avoid was3ng 3me compiling source classes that 
 do not have to be compiled. | 24

  24. Compile avoidance & incremental compiler app library | 25

  25. Compile avoidance & incremental compiler Demo | 26

  26. Compile avoidance & incremental compiler | 27

  27. Compile avoidance & incremental compiler | 28

  28. Compile avoidance & incremental compiler • hQps:/ /blog.gradle.org/incremental-compiler-avoidance • hQps:/ /docs.gradle.org/current/userguide/java_plugin.html | 29

  29. General performance improvements

  30. General performance improvements • Faster configura3on 3me • Parallel dependency resolu3on • Parallel task / ac3on execu3on by default | 31

  31. Gradle daemon

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

  33. Gradle daemon Demo | 34

  34. Gradle daemon • hQps:/ /docs.gradle.org/current/userguide/gradle_daemon.html | 35

  35. Worker API

  36. Worker API • API to run task ac3ons in parallel safely • Parallel ac3ons cannot mutate shared state • Supports out-of-process and in-process ac3ons | 37

  37. Con"nuous build

  38. Con3nuous build Demo | 39

  39. Con3nuous build • hQps:/ /blog.gradle.org/introducing-con3nuous-build • hQps:/ /docs.gradle.org/current/userguide/con3nuous_build.html | 40

  40. Composite builds

  41. 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 | 42

  42. Composite builds Demo | 43

  43. Composite builds • 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 | 44

  44. New Gradle console

  45. IDE integra"on

  46. IDE integra3on • Project import & synchroniza3on • Task execu3on • Test execu3on • Build execu3on insights Build is the single source of truth! | 47

  47. Tooling API IDE Cmd Line (developer) (build master) Gradle Tooling API Launcher (daemon) Server (cont integra3on) | 48

  48. IDE integra3on Demo | 49

  49. IDE integra3on • hQps:/ /blog.gradle.org/announcing-buildship-2.0 • hQps:/ /marketplace.eclipse.org/content/buildship-gradle- integra3on | 50

  50. Gradle Script Kotlin

  51. 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! | 52

  52. Gradle Script Kotlin • hQps:/ /blog.gradle.org/kotlin-meets-gradle • hQps:/ /github.com/gradle/gradle-script-kotlin | 53

  53. Gradle Profiler

  54. Gradle Profiler • 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 | 55

  55. Gradle Profiler • github.com/gradle/gradle-profiler | 56

  56. Build scans

  57. Build scans • Gain build insights • Improve build performance • Collaborate with colleagues and the community | 58

  58. Build scans Demo | 59

  59. Build scans | 60

  60. Build scans • hQps:/ /gradle.com • hQps:/ /gradle.com/scans/get-started Build scans are a free service for everyone! | 61

  61. Gradle Enterprise

  62. 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! | 63

  63. Gradle Enterprise Demo | 64

  64. Gradle Enterprise • hQps:/ /gradle.com/enterprise Gradle Enterprise is a commercial offering! | 65

  65. Android

  66. Android plugin 2.5 • Close collabora3on between Gradle and Google Android Team | 67

  67. 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 • | 68

  68. Gradle • Incremental builds • Build cache • Compile avoidance & incremental compiler • Worker API • Daemon • Con3nuous builds • Composite builds • Tooling API • Sta3cally-typed DSL • Build scans • Gradle Enterprise Used by | 69

  69. Thank you E3enne Studer

Recommend


More recommend