We have turned on configuration cache for our project by default. However, some tasks like ktLintFormat, pmd etc. from older plugins (we are yet to update) require us to pass --no-configuration-cache for successful run.
I am looking for ways to determine if --no-configuration-cache has been passed for specific task runs and fail fast and provide pointers via error logs to nudge developers to include the option so that the tasks run successfully. This is required temporarily until we move to versions that support configuration cache.
As it works when not calling those tasks, I guess it is not about things like build listeners, but about things like using project at execution time.
If that’s the case, just call notCompatibleWithConfigurationCache() for those tasks and you should not need to use that flag manually.
You probably have those methods defined in the enclosing script.
So by referencing those methods, you are referencing the enclosing script and that is not CC compatible.
If you for example wrap them in a class - even with then script - and make them static functions, you should be able to use them there in a CC-compatible way.