matrei commented on code in PR #16069:
URL: https://github.com/apache/grails-core/pull/16069#discussion_r3699677644
##########
gradle/functional-test-config.gradle:
##########
@@ -17,49 +17,53 @@
* under the License.
*/
-rootProject.subprojects
+def substitutableProjects = rootProject.subprojects
.findAll { !(it.name in testProjects) && !(it.name in docProjects) &&
!(it.name in cliProjects) }
- .each { project.evaluationDependsOn(it.path) }
+ .collect {
+ project.evaluationDependsOn(it.path)
+ return [
+ project: it,
+ artifactId: it.findProperty('pomArtifactId') ?: it.name,
+ cliArtifactId: it.findProperty('cliArtifactId')
+ ]
+ }
configurations.configureEach {
resolutionStrategy.dependencySubstitution {
// Test projects will often include dependencies from local projects.
This will ensure any dependencies
// included will be substituted with the local projects in this
repository instead of pulling upstream.
- for (def possibleProject : rootProject.subprojects) {
- if (!(possibleProject.name in testProjects) &&
!(possibleProject.name in docProjects) && !(possibleProject.name in
cliProjects)) {
- def artifactId = possibleProject.findProperty('pomArtifactId')
?: possibleProject.name
- def substitutedArtifact = "$possibleProject.group:$artifactId"
- //TODO: This does not handle libraries that are both test
fixtures & a libraries like grails-data-mongodb,
- // see grails-test-examples-mongodb-base, &
grails-test-examples-mongodb-hibernate5 for project() workaround
- if (possibleProject.name == 'grails-bom') {
- substitute module(substitutedArtifact) using
platform(project(':grails-bom'))
- }
- else if(possibleProject.name == 'grails-geb') {
- def selector = it.variant(module(substitutedArtifact)) {
VariantSelectionDetails details ->
- details.capabilities {
ModuleDependencyCapabilitiesHandler handler ->
-
handler.requireCapability("${substitutedArtifact}-test-fixtures" as String)
- }
- }
-
- def replacement =
it.variant(project(":$possibleProject.name")) { v ->
- v.capabilities {
it.requireCapability("${substitutedArtifact}-test-fixtures") }
+ for (def substitution : substitutableProjects) {
+ def possibleProject = substitution.project
+ def substitutedArtifact =
"$possibleProject.group:${substitution.artifactId}"
+ //TODO: This does not handle libraries that are both test fixtures
& a libraries like grails-data-mongodb,
Review Comment:
TODO comment was not changed in this PR
--
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]