I have to following setup which is not usual or defined by Gradle. Usually this should be done via multi-project but I cannot afford it.
build.gradle
\-- folder1
\-- datafile1.gradle
datafile2.gradle
When I apply a plugin (custom one) over build.gradle it is valid only for main file. Files under folder1 does’t seems to have access to objects defined by the plugin.
How can I import object defined in my plugin?
From my testing I found only exposed properties are visible but the rest is not. By this I mean classes. Trying to import something and I end up instantly with NoClassDefinitionException. Not sure how to expose (make visible) classes over all Gradle files.
My knowledge says:
- Loading the plugin should be done from buildscript{}
- Plugin is loaded from cache/repo
- Loading external files (datafile1.gradle and datafile2)
- Loading build.gradle
- DAG is built
I’ve read lot forums and discussions but nothing similar. Most of the topics suggests multi-project build.
Please correct me if I am wrong or such feature is still missing in Gradle.
Any help will be appreciated.