-
Notifications
You must be signed in to change notification settings - Fork 434
Refine the dependencies.constraints {} DSL #1091
Conversation
by generating accessors for known configurations by adding `classpath` accessor for buildscript.dependencies.constraints by adding a configuration scope with string invoke operators Signed-off-by: Paul Merlin <paul@gradle.com>
* | ||
* @see [DependencyConstraintHandler] | ||
*/ | ||
class DependencyConstraintHandlerScope(val constraints: DependencyConstraintHandler) : DependencyConstraintHandler by constraints { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this be annotated with @Incubating
the same way the underlying API is?
Signed-off-by: Paul Merlin <paul@gradle.com>
package org.gradle.kotlin.dsl.integration | ||
|
||
import org.gradle.kotlin.dsl.fixtures.AbstractIntegrationTest | ||
import org.gradle.kotlin.dsl.fixtures.containsMultiLineString |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❌ Group imports
"direct-block:string-invoke", | ||
"direct-block:string-invoke-with-action" | ||
).forEach { dep -> | ||
build("dependencyInsight", "--configuration", "compileClasspath", "--dependency", dep).apply { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❌ Have you considered alternatives to avoid running that many builds?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The dependencyInsight
report is the sole one giving the required information and it can only target one dependency at a time. Those builds will reuse the daemon.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fair enough.
Signed-off-by: Paul Merlin <paul@gradle.com>
by generating accessors for known configurations
by adding
classpath
accessor forbuildscript.dependencies.constraints {}
by adding a configuration scope with string invoke operators
Note that the configuration scope with support for the string invoke syntax can only be used by explicitly resolving the
dependencies.constraints
property (the extra parentheses above).This happens because DependencyHandler.constraints(Action) would shadow a Kotlin extension providing the specialized configuration scope: