Gábor Török
07/05/2023, 8:48 PMgradle.projectsLoaded {
rootProject.buildscript {
dependencies {
classpath(files("some-jar-path.jar"))
}
}
}
gradle.beforeSettings {
// not sure why but the extension methods are not working here as they worked in "projectsLoaded"
buildscript.dependencies.add("classpath", files("some-jar-path.jar"))
}
now with this setup - things in the build.gradle.kts work fine - i can reach all the classes and extension methods i defined in the jar
however in the settings.gradle.kts i have problems:
rootProject.name = "some-project"
println("from settings.gradle.kts - ${MyDumbObject.someProperty}") // shows error: Unresolved reference: MyDumbObject
on the other hand for some reason this works:
rootProject.name = "some-project"
buildscript {
dependencies {
// nothing added here
}
}
println("from settings.gradle.kts - ${MyDumbObject.someProperty}") // no error
is there a way to make this work without including that noop block in the settings.gradle.kts ?