I’m trying to use a class available in the buildscript.configurations.classpath. This works fine in the main build.gradle, but when I move the code to a apply from: ‘file.gradle’ it is no longer available.
Reading the Gradle User Guide makes very few references to apply from. If I print out buildscript.configurations.classpath in the git.gradle file, it shows an empty list of dependencies, while it’s looks perfectly find in the build.gradle.
Applied scripts do not inherit anything from their applying script(s) to my knowledge, so the buildscript section of the build.gradle file is not seen by git.gradle.
If you copy the buildscript section from build.gradle into git.gradle, it should work fine. You probably will not even need that buildscript section to remain in build.gradle at all, depending upon whether there are other things you wish to pull directly from your gradle-git classes.
Maybe in the future, there will be some way to apply and have the ability to pre-inject buildscript object configuration details into a script being applied. The dependencies are usually unique, but often the repositories need to be set differently to work in all desired target environments.