Add "idiomatic builds" documentation page with the current best practices #19057
Labels
a:documentation
Documentation content
@idiomatic
in:configuration-model
lazy api, domain object container
in:dependency-declarations
variant notation attributes capability substitution
in:groovy-dsl
in:kotlin-dsl
in:plugin-management
in:writing-tasks
task option
Expected Behavior
There should be a documentation page that could be used as an entry point for the current UP-TO-DATE practices.
For instance,
plugins {..}
even thoughapply(file=...)
might work.Action<...>
instead ofT.() ->..
and Closure configuration blocks.allprojects
, especially for configuring subprojectsbuildscript { classpath {...} }
artifact.name != "mssql-jdbc-9.4.0.jre8.jar"
and use configuration with excludes.Here's the list "things to avoid", however, I'm not sure how to phrase them in "prefer ..."
tasks.named("...") { enabled = false }
if you want exclude an artifact from publication. Configure the outgoing artifacts instead (e.g.configurations[...].outgoing { artifacts.removeIf { ... } }
). If you useTask.enabled = false
, the generated Gradle Metadata file still includes traces of the "skipped" file, so the publication would be inconsistent.That would help to share the best practices.
See the thread in Gradle Slack: https://gradle-community.slack.com/archives/CA7UM03V3/p1637307179136800
Well, there's idiomatic Kotlin: https://www.youtube.com/watch?v=o4emra1xm88
There's idiomatic Python, and so on
There should be an "idiomatic Gradle build" page as well.
There should be a canonical GitHub repository with samples as well
Current Behavior
https://docs.gradle.org/7.3/userguide/structuring_software_products.html#defining_custom_project_types_as_convention_plugins
Context
See https://kotlinlang.org/docs/idioms.html
apache/calcite#2566
The text was updated successfully, but these errors were encountered: