Hi guys, my gradle script suddenly is failing to f...
# community-support
a
Hi guys, my gradle script suddenly is failing to find any methods
Copy code
file release.gradle

def devBranch = 'qa'

task codeFreeze() {
    group 'Release'
    description 'Fork release branch of dev branch and bump the version of current dev branch'

    doLast {
        assertCurrentBranchIs(devBranch)
     ...
   }
}

private assertCurrentBranchIs(String branchName) {
    ...
}
This used to work just fine but now it gives error
Could not find method assertCurrentBranchIs() for arguments [qa] on task ':codeFreeze' of type org.gradle.api.DefaultTask
I deleted my ~/.gradle directory and synced again but still same issue. I am on gradle version 8.5
Ok it was due to configuration cache.
v
Exactly. And besides that, legacy script plugins (the things you apply with "apply from") have quite some other quirks anyway and are quite discouraged. 😉
a
Ya I know but this is quite a legacy codebase 🙂
👌 1
v
Did you degrade CC errors to warnings? Because that often causes confusing errors like things being
null
or methods not being found as the actual error was degraded to a warning, but of course still causes a failure then at runtime.
a
Ya we have set the failures to warn for now.
v
Then don't wonder about strange behavior or misbehavior, loudly as well as silently.
That option is not suitable for productive use. It is meant so that you get multiple things and can fix them in bunch. But it should only be enabled as a development tool, not permanently as productive usage.
👍 1