Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Rene Groeschke (Gradle Inc.), Gradle 3.0 and b...

CodeFest
January 31, 2018

Rene Groeschke (Gradle Inc.), Gradle 3.0 and beyond, CodeFest 2017

https://2017.codefest.ru/lecture/1156

In this presentation we talk about the newest features in Gradle and how developers and build authors can benefit from it. We start with a general overview of the Gradle build system, before we explore new functionalities like that will boost productivity:
● General performance improvements
● Composite builds
● Functional testing of build logic
● Distributed Cache
● Kotlin Gradle DSL
● Gradle Build Scans

We finish up the talk with an outlook of what the Gradle team is currently working on and what features you can expect to see in Gradle soon.

CodeFest

January 31, 2018
Tweet

More Decks by CodeFest

Other Decks in Programming

Transcript

  1. Gradle heading 4.0 - #CodeFest CodeFest 2017 Gradle 3.0 and

    beyond Gradle heading 4.0 René Gröschke
  2. WHO AM I speaker { name 'René Gröschke' homebase 'Berlin,

    Germany' work 'Principal Engineer @ Gradle Inc.' twitter '@breskeby' github 'breskeby' email '[email protected]' }
  3. GRADLE (THE MANAGEMENT SUMMARY) Multi purpose software automation tool Build,

    automate and deliver better software, faster Cross-platform Language agnostic Apache v2 licensed A Build Tool + Cloud Services
  4. MOMENTUM ~30 full time engineers working on Gradle 3.0 released

    on August 15th 2016 3.4.1 released on March 3rd 2017 3.5-rc-1 released on March 22nd 2017 Releasing every 4 - 6 weeks.
  5. MOTIVATION Current DSL was not designed for performance tooling friendlyness

    Limitations on bringing patterns and techniques from application level to build level
  6. KOTLIN (MANAGEMENT SUMMARY) Statically typed 1.0 released in 2016 Driven

    by pragmatism Invented and maintained by Jetbrains Considerable uptake (particularly in the Android community).
  7. ENTICING OPPORTUNITIES Proper IDE support Code completion Refactoring Documentation lookup

    Crafting DSLs with ease While keeping build scripts clean and declarative
  8. KOTLIN IN GRADLE apply<ApplicationPlugin>() configure<ApplicationPluginConvention> { mainClassName = "samples.HelloWorld" }

    configure<JavaPluginConvention> { setSourceCompatibility(1.7) } repositories { jcenter() } dependencies { testCompile("junit:junit:4.12") }
  9. SOME NUMBERS AGP version + Gradle version AGP 2.2.0 +

    Gradle 2.14.1 AGP 2.3 RC1 + Gradle 3.3 AGP 2.5 Alpha + Gradle Nightly AGP version + Gradle version AGP 2.2.0 + Gradle 2.14.1 AGP 2.3 RC1 + Gradle 3.3 AGP 2.5 Alpha + Gradle Nightly Con guration (i.e. help) ~2 mins ~9 s ~2.5 s 1-line Java change (implementation change) ~2 mins 15 s ~29 s ~6.4 s
  10. COMPOSITE BUILDS Have you ever (tried | suffered from |

    failed on) including an external project into your build for debugging? moving separated projects into a big mono repo to make dev life easier? to test your gradle plugins in dev against real projects?
  11. COMPOSITE BUILDS De ned in the command line: > gradle

    --include-build ../my-utils run Or persistently // settings.gradle rootProject.name='adhoc' includeBuild '../my-app' includeBuild '../my-utils'
  12. MORE JAVA GOODNESS Better incremental java compiler Working on making

    incremental compilation default java-library plugin less classpath leakage better poms than maven apply plugin:'java-library' dependencies { api 'org.apache.commons:commons-math3:3.6.1' implementation 'com.google.guava:guava:21.0' }
  13. GRADLE IS REUSING RESUL TS… from last time
 when we

    ran this build 
on this machine.
  14. BUILD CACHE (WIP) $> gradle --build-cache assemble Build cache is

    an incubating feature. Using directory (/Users/rene/.gradle/caches/build-cache-1) as local build cache, push is e :compileJava FROM-CACHE :processResources :classes :jar :assemble BUILD SUCCESSFUL
  15. DISTRIBUTED BUILD CACHE (WIP) // settings.gradle ext.isCiServer = System.getenv().containsKey("CI") buildCache

    { local { enabled = !isCiServer } remote(HttpBuildCache) { url = 'https://example.com:8123/build-cache/' push = isCiServer } }
  16. DISCOVER … discover how our software is actually being built

    within our entire organization? where our build time is going and make our builds faster?
  17. INTRODUCING GRADLE BUILD SCANS Insights into your build View and

    share via URL Debug, optimize and re ne Communicate via builds Analyze all of your builds
  18. GRADLE INC Motto: Build Happiness Mission: To revolutionize the way

    software is built and shipped. We’re Hiring: Gradle is hiring front-end, back-end, and core software engineers. Visit to apply. gradle.org/jobs
  19. LINKS Android Gradle Plugin improvements: Compiler improvements in Gradle: Gradle

    Build Cache: Gradle Build Scans : Slides and code : http://tools.android.com/tech docs/new-build-system/2-5-alpha-gradle-plugin https://blog.gradle.org/increment compiler-avoidance https://docs.gradle.org/nightly/userguide/userguide_single.html#buil https://gradle.com https://github.com/breskeby/talks/tree/master/010 codefest-novosibirsk/