Chachako
06/23/2022, 9:33 AMDomainObjectCollectionval dependencies = channelFlow {
  project.configurations.configureEach {
    it.dependencies.forEach(::trySend)
  }
}
// On "configureEach" completion
println(dependencies)Sam
06/23/2022, 9:38 AMThe resulting flow completes as soon as the code in the block and all its children completes. Use awaitClose as the last statement to keep it running.https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.flow/channel-flow.html
Chachako
06/23/2022, 9:44 AMDomainObjectCollection.configureEachchannelFlowSam
06/23/2022, 9:46 AMSam
06/23/2022, 9:47 AMproject.afterEvaluateSam
06/23/2022, 9:50 AMresolutionStrategyChachako
06/23/2022, 9:50 AMproject.configurationsproject.afterEvaluateSam
06/23/2022, 10:02 AMconfiguration.incoming.beforeResolveSam
06/23/2022, 10:02 AMconfiguration.incomingChachako
06/23/2022, 10:04 AMproject.afterEvaluateVampire
06/23/2022, 1:24 PMIt is not only a practice, it is a bad practice. And you can never know whether the collection is already complete at that time, becauseis a practiceproject.afterEvaluate
afterEvaluateafterEvaluateafterEvaluateafterEvaluateafterEvaluateafterEvaluateVampire
06/23/2022, 1:25 PMChachako
06/23/2022, 2:51 PMAs you most probably not want to just print all dependencies, please describe what your actual use-case is you are trying to solve, then maybe someone can advice a proper way to solve it. 🙂I actually have a common version catalog file that is very large, so I need a way to get all Gradle in-use dependencies, and write the corresponding dependencies from the common file to
libraries.versions.tomlafterEvaluate