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

Plugin for Gradle 3.0

Plugin for Gradle 3.0

The Android Plugin for Gradle 3.0.0 is a major upgrade that brings significant performance improvements to large multi-module projects. In order to bring about these improvements, there are some breaking changes in the plugin behavior, DSL, and APIs.

Chintan Rathod

November 05, 2017
Tweet

More Decks by Chintan Rathod

Other Decks in Technology

Transcript

  1. Update Gradle Plugin version Required Gradle version 2.0.0 - 2.1.2

    2.10 - 2.13 2.1.3 - 2.2.3 2.14.1+ 2.3.0+ 3.3+ 3.0.0+ 4.1+
  2. Speed Android plugin version + Gradle version Android plugin 2.2.0

    + Gradle 2.14.1 Android plugin 2.3.0 + Gradle 3.3 Android plugin 3.0.0 + Gradle 4.1 1-line Java change (implementation change) ~2 mins 15 s ~29 s ~6.4 s
  3. Optimization - Faster incremental build speed due to per-class dexing

    - Gradle's new dependency configurations: implementation, api, compileOnly, and runtimeOnly
  4. Optimization - Faster incremental build speed due to per-class dexing

    - Gradle's new dependency configurations: implementation, api, compileOnly, and runtimeOnly - Better parallelism for multi-module projects
  5. Optimization - Faster incremental build speed due to per-class dexing

    - Gradle's new dependency configurations: implementation, api, compileOnly, and runtimeOnly - Better parallelism for multi-module projects - Improved build speeds (cached outputs)
  6. Flavor dimensions flavorDimensions "api", "mode" productFlavors { demo { dimension

    "mode" applicationIdSuffix ".demo" versionNameSuffix "-demo" } full { dimension "mode" applicationIdSuffix ".full" versionNameSuffix "-full" } minApi24 { dimension "api" minSdkVersion 24 versionCode 30000 + android.defaultConfig.versionCode versionNameSuffix "-minApi24" } minApi21 { dimension "api" minSdkVersion 21 versionCode 10000 + android.defaultConfig.versionCode versionNameSuffix "-minApi21" } }
  7. New Features - Variant-aware dependency management - Jack is now

    deprecated and no longer required - Support for language-specific APKs
  8. Behavioral Changes - You no longer need to specify a

    version for the build tools - Enable PNG crunching in the buildTypes block
  9. Behavioral Changes - You no longer need to specify a

    version for the build tools - Enable PNG crunching in the buildTypes block android { buildTypes { release { // Disables PNG crunching for the release build type. crunchPngs false } } }