Tuesday 29 October 2013

Droidcon 2013: Gradle for Android

Hans Dockter, CEO Gradleware & Founder of Gradle @hansd

http://gradle.org

http://tools.android.com/tech-docs/new-build-system

buildTypes

  • automatically picks up different source & resource directories
  • can add code specific (e.g. setting constants)
  • can adjust settings across multiple tasks
  • automatically creates new tasks (e.g. packageTest, packageStaging)
  • allows different dependencies for different types

productFlavors

  • just like build types, but another axis
  • can alter package name
  • extends tasks further (e.g. installFreeTest, installPaidStaging)
  • configure different things than buildTypes (not proguard, etc)

flavorGroups

  • allows unlimited extension
  • e.g. ARM/intel
  • tasks allow you to run groups of things — e.g. test all debug builds

other features

  • gradle wrapper
    • allows specifying the version of gradle in source control
  • additional plugins
    • manymo — devices in the cloud
      • has gradle plugin to run tests against selections of their devices
  • has a rich model & deep API that allows additional scripts in build
    • e.g. real-time warning if a test runs for longer than 20ms
  • can combine with wrapper to have your own custom gradle installation
    • put scripts in .init of gradle installation to apply to all builds
  • Android Studio picking up gradle built types
    • so can switch and see effects in the visual designer
  • in future want to specify virtual devices in gradle
    • so IDE just executes gradle
    • IDE has less to do :-)

No comments: