tree: be924f3485df0829b726d8a1ffd077cbfc3cda80 [path history] [tgz]
  1. apply/
  2. imports/
  3. jetpad-integration/
  4. plugins/
  5. private/
  6. public/
  7. res/
  8. settingsScripts/
  9. src/
  10. stableAidlImports/
  11. build.gradle
  12. dependencies.gradle
  13. gradlew
  14. kotlin-dsl-dependency.gradle
  15. lint.xml
  16. lint_samples.xml
  17. OWNERS
  18. README.md
  19. repos.gradle
  20. settings.gradle
  21. shared-dependencies.gradle
  22. shared.gradle
buildSrc/README.md

This is the buildSrc project. Gradle builds (and tests) this project before the other projects, and Gradle adds its artifacts into the classpath of the other projects when configuring them.

Tests for the buildSrc project are located in the buildSrc-tests project, so that the build doesn't need to wait for those tests to complete

To run these tests you can run ./gradlew :buildSrc-tests:test

For information about Gradle's configuration caching, see:

The buildSrc directory is split into multiple projects based on what needs to be available on the classpath when parsing build.gradle files outside of buildSrc. Any classes that Gradle puts on the classpath for parsing build.gradle files can theoretically overwrite the implementation of tasks in those projects. So, if a class is on that classpath and it changes, then Gradle is not confident that the task is necessarily up-to-date and Gradle will rerun it. So, we move as many classes as possible off of this classpath by applying them from within a separate .gradle script instead.

To verify that classes in private/ don't unnecessarily affect the up-to-datedness status of tasks from outside plugins, try something like this:

  # run a kotlin compilation task
  ./gradlew :core:core:compileDebugKotlin
  # make some unrelated changes in buildSrc:
  sed -i 's/ignoreCase = true/ignoreCase = false/g' buildSrc/private/src/main/kotlin/androidx/build/ErrorProneConfiguration.kt
  # rerun same kotlin compilation task
  ./gradlew :core:core:compileDebugKotlin | cat
  # see that the tasks were up-to-date

See also b/140265324 for more information.