- 
                Notifications
    
You must be signed in to change notification settings  - Fork 5k
 
Closed as not planned
Closed as not planned
Copy link
Labels
closed:not-fixedIndicates the issue was not fixed and is not planned to beIndicates the issue was not fixed and is not planned to be
Description
Current Behavior
Such build logic makes adding dependencies to a test suit impossible:
configurations.configureEach {
    if (isCanBeResolved && !isCanBeConsumed) {
        allDependencies.configureEach { // <-- removing this logic solves the problem
        }
    }
}
Project configuration fails with
FAILURE: Build failed with an exception.
* Where:
Build file '[redacted]/test-suites-dependencies/build.gradle.kts' line: 26
* What went wrong:
Could not create domain object 'myAwesomeTests' (JvmTestSuite)
> The value for property 'dependencies.implementation' property 'dependencies' is final and cannot be changed any further.
Expected Behavior
It's possible to iterate over declared dependencies and add dependencies to test suites, or at least the error message is not so cryptic and more actionable
Context (optional)
We use such build logic in the Kotlin repo to add dependency constrains dynamically via a convention plugin
This used to work on Gradle versions below 8.6
Steps to Reproduce
https://github.com/ALikhachev/gradle-reproducers/tree/main/test-suites-dependencies
Gradle version
8.6, 8.7
Gradle version that used to work
8.5
Build scan URL (optional)
No response
Your Environment (optional)
No response
CristianGM
Metadata
Metadata
Assignees
Labels
closed:not-fixedIndicates the issue was not fixed and is not planned to beIndicates the issue was not fixed and is not planned to be