Slackbot
10/17/2022, 8:59 PMCristianGM
10/17/2022, 9:15 PMrootprojectZak Taccardi
10/17/2022, 9:16 PMProjectDescriptor - which only has APIs for File. And settings scripts do not have access to ObjectFactoryCristianGM
10/17/2022, 9:17 PMgradle.rootProject.layout is the solutionZak Taccardi
10/17/2022, 9:17 PMgradle.rootProject.layout is different, so yes that works, assuming accessing Gradle is okayZak Taccardi
10/17/2022, 9:28 PMCould not create provider for value source Settings_gradle.BuildScanStartParametersValueSource.
> The root project is not yet available for build.
nope 😞Javi
10/17/2022, 9:39 PMproviders.gradleProperty(…)Zak Taccardi
10/17/2022, 9:41 PMProvider<FileContents> for the root gradle.properties within settings.gradle.kts. This requires a RegularFile as inputVampire
10/18/2022, 12:33 AMVampire
10/18/2022, 12:36 AMit's not mine, but I was told thatis the solutiongradle.rootProject.layout
That cannot work as the root project is not yet available when the settings script is evaluated. Hence the exception he got. You could only do it in a delayed action like with
gradle.rootProject { ... } or similar.Zak Taccardi
10/18/2022, 12:36 AMAnze Sodja
10/18/2022, 8:48 AMObjectFactory in settings.gradle.kts in some way, if that helps (from gradle#14171):
import org.gradle.kotlin.dsl.support.serviceOf
...
val objects = gradle.serviceOf<ObjectFactory>()Vampire
10/18/2022, 8:57 AMserviceOf now considered public API @Anze Sodja?
Cédric told me it is internal API even if not in an internal package only meant for implementation of version catalogs when I recommended it in build scripts.Anze Sodja
10/18/2022, 9:03 AMVampire
10/18/2022, 9:11 AMAnze Sodja
10/18/2022, 10:26 AMVampire
10/18/2022, 10:30 AM.internal. in the package name probably. :-(