<a id="best_practices_index"></a>
# Best Practices Index

The table below provides a complete list of documented Gradle Best Practices.

Use this as a quick reference to track newly added recommendations, check adoption status, or explore areas for improving your build:

<a id="best-practices-table"></a>
| Title | Section | Added in Gradle Version |
| --- | --- | --- |
| [Use Kotlin DSL](best_practices_general.md#use_kotlin_dsl) | General | 8.14 |
| [Use the Latest Minor Version of Gradle](best_practices_general.md#use_latest_minor_versions) | General | 8.14 |
| [Apply Plugins Using the `plugins` Block](best_practices_general.md#use_the_plugins_block) | General | 8.14 |
| [Don’t Assume your Plugin is Applied after Another](best_practices_general.md#dont_assume_plugin_order) | General | 9.4.0 |
| [Do Not Use Internal APIs](best_practices_general.md#do_not_use_internal_apis) | General | 8.14 |
| [Set Build Flags in `gradle.properties`](best_practices_general.md#use_the_gradle_properties_file) | General | 9.0.0 |
| [Name Your Root Project](best_practices_general.md#name_your_root_project) | General | 9.2.0 |
| [Do not use `gradle.properties` in subprojects](best_practices_general.md#do_not_use_gradle_properties_in_subprojects) | General | 9.2.0 |
| [Avoid `afterEvaluate`](best_practices_general.md#avoid_after_evaluate) | General | 9.6.0 |
| [Consider use of `@Incubating` APIs carefully](best_practices_general.md#consider_use_of_incubating_apis_carefully) | General | 9.7.0 |
| [Obtain Loggers via `Logging.getLogger(Class)` outside of Tasks](best_practices_general.md#obtain_loggers_via_logging_get_logger) | General | 9.8.0 |
| [Modularize Your Builds](best_practices_structuring_builds.md#modularize_builds) | Structuring Builds | 9.0.0 |
| [Do Not Put Source Files in the Root Project](best_practices_structuring_builds.md#no_source_in_root) | Structuring Builds | 9.0.0 |
| [Favor `build-logic` Composite Builds for Build Logic](best_practices_structuring_builds.md#favor_composite_builds) | Structuring Builds | 9.0.0 |
| [Avoid Unintentionally Creating Empty Projects](best_practices_structuring_builds.md#avoid_empty_projects) | Structuring Builds | 9.1.0 |
| [Use Convention Plugins for Common Build Logic](best_practices_structuring_builds.md#use_convention_plugins) | Structuring Builds | 9.3.0 |
| [Use Version Catalogs to Centralize Dependency Versions](best_practices_dependencies.md#use_version_catalogs) | Dependencies | 9.0.0 |
| [Name Version Catalog Entries Appropriately](best_practices_dependencies.md#name_version_catalog_entries) | Dependencies | 9.0.0 |
| [Set up your Dependency Repositories in the Settings file](best_practices_dependencies.md#set_up_repositories_in_settings) | Dependencies | 9.0.0 |
| [Don’t Explicitly Depend on the Kotlin Standard Library](best_practices_dependencies.md#dont_depend_on_kotlin_stdlib) | Dependencies | 9.0.0 |
| [Avoid Redundant Dependency Declarations](best_practices_dependencies.md#avoid_duplicate_dependencies) | Dependencies | 9.0.0 |
| [Declare Dependencies using a single GAV (`group:artifact:version`) String](best_practices_dependencies.md#single-gav-string) | Dependencies | 8.14 |
| [Use Content Filtering with multiple Repositories](best_practices_dependencies.md#use_content_filtering) | Dependencies | 9.1.0 |
| [Apply Exclusions Narrowly](best_practices_dependencies.md#apply_exclusions_narrowly) | Dependencies | 9.2.0 |
| [Always Declare Attributes on Consumable and Resolvable Configurations](best_practices_dependencies.md#use_attributes_on_configurations) | Dependencies | 9.7.0 |
| [Avoid DependsOn](best_practices_tasks.md#avoid_depends_on) | Tasks | 8.14 |
| [Favor `@CacheableTask` and `@DisableCachingByDefault` over `cacheIf(Spec)` and `doNotCacheIf(String, Spec)`](best_practices_tasks.md#use_cacheability_annotations) | Tasks | 8.14 |
| [Do not call `get()` on a Provider outside a Task action](best_practices_tasks.md#avoid_provider_get_outside_task_action) | Tasks | 9.1.0 |
| [Group and Describe custom Tasks](best_practices_tasks.md#group_describe_tasks) | Tasks | 9.0.0 |
| [Avoid using eager APIs on File Collections](best_practices_tasks.md#avoid_eager_file_collection_apis) | Tasks | 9.1.0 |
| [Don’t resolve Configurations before Task Execution](best_practices_tasks.md#dont_resolve_configurations_before_task_execution) | Tasks | 9.1.0 |
| [Use `@PathSensitivity.NONE` for file inputs and `@PathSensitivity.RELATIVE` for directories](best_practices_tasks.md#default_path_sensitivities) | Tasks | 9.2.0 |
| [Use unique output files and directories](best_practices_tasks.md#use_unique_output_files_and_directories) | Tasks | 9.3.0 |
| [Don’t hardcode Task names unless they are documented as Public API](best_practices_tasks.md#dont_hardcode_task_names) | Tasks | 9.7.0 |
| [Don’t access a `Project` instance during Task Execution](best_practices_tasks.md#dont_access_project_instance_inside_task) | Tasks | 9.7.0 |
| [Wire lazy task outputs using `map` and `flatMap`](best_practices_tasks.md#map_versus_flatmap) | Tasks | 9.7.0 |
| [Favor collection property types over a `Property` holding a collection](best_practices_tasks.md#favor_collection_properties) | Tasks | 9.8.0 |
| [Prefer the `-bin` Gradle Distribution](best_practices_performance.md#prefer_bin_distribution) | Performance | 9.4.0 |
| [Use UTF-8 File Encoding](best_practices_performance.md#use_utf8_encoding) | Performance | 9.0.0 |
| [Use the Build Cache](best_practices_performance.md#use_build_cache) | Performance | 9.1.0 |
| [Use the Configuration Cache](best_practices_performance.md#use_configuration_cache) | Performance | 9.1.0 |
| [Avoid Expensive Computations in Configuration Phase](best_practices_performance.md#avoid_computations_in_configuration_phase) | Performance | 9.0.0 |
| [Validate the Gradle Distribution SHA-256 Checksum](best_practices_security.md#validate_gradle_checksum) | Security | 9.1.0 |
| [Validate the Gradle Wrapper on every Upgrade](best_practices_security.md#validate_wrapper_checksum) | Security | 9.3.0 |
| [Do not Run `./gradlew` on Untrusted Projects](best_practices_security.md#run_gradle_on_external_projects) | Security | 9.7.0 |
| [Build Output Should Be Byte-for-Byte Reproducible](best_practices_security.md#builds_should_be_reproducible) | Security | 9.7.0 |
| [Build your Published Artifacts Securely](best_practices_security.md#build-published-artifacts-securely) | Security | 9.8.0 |
| [Test your custom Task and Plugins with TestKit](best_practices_testing.md#test_custom_types_with_testkit) | Testing | 9.4.0 |
