davydotcom commented on code in PR #15948:
URL: https://github.com/apache/grails-core/pull/15948#discussion_r3604012883


##########
grails-bom/base/build.gradle:
##########
@@ -97,6 +97,23 @@ dependencies {
     }
 }
 
+// Companion cli artifacts (published by the cli-artifact convention plugin) 
are additional
+// publications of existing projects, so the subproject enumeration above 
cannot see them. Each
+// applying project exports its companion coordinate via the `cliArtifactId` 
extra property, which
+// only exists once that project has been evaluated — so the constraints are 
computed lazily, in
+// the mutation window Gradle provides right before the configuration is first 
observed.
+configurations.named('api').configure { apiConfiguration ->
+    apiConfiguration.withDependencies {
+        for (Project subproject : rootProject.subprojects) {
+            def cliArtifactId = subproject.findProperty('cliArtifactId')
+            if (cliArtifactId) {
+                apiConfiguration.dependencyConstraints.add(
+                        
project.dependencies.constraints.create("${subproject.group}:${cliArtifactId}:${projectVersion}"))

Review Comment:
   out of scope comment.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to