gradle-doctor

Introduction: The right prescription for your Gradle build.
More: Author   ReportBugs   
Tags:

CircleCI

The right prescription for your Gradle build.

Usage

buildscript {
  dependencies {
    classpath "com.osacky.doctor:doctor-plugin:0.2.1"
  }
}

// Must be applied in the project root.
apply plugin: "com.osacky.doctor"

Features

Configurable Warnings

  • Warn when build spends more than 10% of the time garbage collecting.
  • Warn when connection to maven repositories is slowing down the build.
  • Warn when build cache connection speed is slowing down the build.

Here are the configuration options with their defaults:

doctor {
  /**
   * Throw an exception when multiple Gradle Daemons are running.
   */
  disallowMultipleDaemons = false
  /**
   * Ensure that we are using JAVA_HOME to build with this Gradle.
   */
  ensureJavaHomeMatches = true
  /**
   * Ensure we have JAVA_HOME set.
   */
  ensureJavaHomeIsSet = true
  /**
   * Show a message if the download speed is less than this many megabytes / sec.
   */
  downloadSpeedWarningThreshold = .5f
  /**
   * The level at which to warn when a build spends more than this percent garbage collecting.
   */
  GCWarningThreshold = 0.10f
  /**
   * Print a warning to the console if we spend more than this amount of time with Dagger annoation processors.
   */
  daggerThreshold = 5000
  /**
   * By default, Gradle caches test results. This can be dangerous if tests rely on timestamps, dates, or other files
   * which are not declared as inputs.
   */
  enableTestCaching = true
  /**
   * By default, Gradle treats empty directories as inputs to compilation tasks. This can cause cache misses.
   */
  failOnEmptyDirectories = true
  /**
   * Do not allow building all apps simultaneously. This is likely not what the user intended.
   */
  allowBuildingAllAndroidAppsSimultaneously = false
}

Configuration extension code is here.

Publishing

./gradlew publishToMavenCentral
Apps
About Me
GitHub: Trinea
Facebook: Dev Tools