I have a script that is included from a main script via apply from: ‘gradle/scripts/foo.gradle’. How can I have the foo.gradle script reference another script bar.gradle via apply from when bar.gradle is in the same folder as foo.gradle? It seems that all paths are always resolved against the root project.
build.gradle (references gradle/scripts/foo.gradle --> OK) gradle/scripts/foo.gradle (references bar.gradle --> only works if I write apply from: ‘/gradle/scripts/bar.gradle’) gradle/scripts/bar.gradle
Of course, if I reference the script via path relative to the root project it works, but that is not very pretty since the script needs to know where it is located relative to the root project.