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

Pleasantly Fast Gradle Builds

Pleasantly Fast Gradle Builds

Presented at The Developers' Conference 2018

David Tiago Conceição

April 20, 2018
Tweet

More Decks by David Tiago Conceição

Other Decks in Programming

Transcript

  1. BUILD SUCCESSFUL Total time: 41.069 secs Memory BUILD SUCCESSFUL in

    5s 90 actionable tasks: 6 executed, 84 up-to-date
  2. BUILD SUCCESSFUL Total time: 41.069 secs Total methods: 60097 (91.70%

    used) Memory BUILD SUCCESSFUL in 5s 90 actionable tasks: 6 executed, 84 up-to-date Total methods: 84584 (129.07% used)
  3. // build.gradle (app) compile project(':A') compile project(':B') // build.gradle (A)

    compile project(':C') // build.gradle (B) compile project(':D') // ...
  4. // build.gradle (app) implementation project(':A') implementation project(':B') // build.gradle (A)

    implementation project(':C') // build.gradle (B) implementation project(':D') // ...
  5. //build.gradle productFlavors { production { dimension "minSdkVersion" } development {

    dimension "minSdkVersion" minSdkVersion 21 Flavor dimensions
  6. How to know more? • Implementation vs API dependency: https://jeroenmols.com/blog/2017/06/14/androidstudio3

    • Migrate to Android Plugin for Gradle 3.0.0: https://developer.android.com/studio/build/gradle-plugin-3-0-0-migration.html • Faster Android Studio Builds with Dex In Process: https://medium.com/google-developers/faster-android-studio-builds-with-dex-in-process-5988ed8a a37e • Accelerate Clean Builds with Build Cache: https://developer.android.com/studio/build/build-cache.html • Optimize Your Build Speed: https://developer.android.com/studio/build/optimize-your-build.html • Incremental Compilation, the Java Library Plugin, and other performance features in Gradle 3.4: https://blog.gradle.org/incremental-compiler-avoidance • Using Gradle build cache with Kotlin: https://blog.jetbrains.com/kotlin/2018/02/using-gradle-build-cache-with-kotlin/ • Instant Run: How Does it Work?! https://medium.com/google-developers/instant-run-how-does-it-work-294a1633367f