Can't access versionCatalogs defined in /settings.gradle from buildSrc

Hi! I’m trying to access the libs defined in the root settings.gradle from buildSrc/build.gradle.kts but they are marked as unresolved reference in the IDE.

I know I could load a shared toml file from buildSrc. The reason I’m not doing that is because some of the version numbers are generated by code (can be overriden by an env var) instead of being static and one can’t have code in a toml file.

I found this answer but I think it doesn’t apply in my case because I’m not creating a plugin.

Any suggestions?

buildSrc is effectively a separate build from the root project and does not share the same settings.gradle. If you move your common logic into a separate file, then both settings.gradle and buildSrc/settings.gradle can apply it (for example; apply from: 'mydeps.gradle' and apply from: '../mydeps.gradle' respectively).