Hi,
Is there a way to internally add/expose import statements when a Plugin is applied instead of requesting the user to explicitly writing them in their build script? At least for specific packages that should be exposed by default for the plugin.
For example, I am developing a plugin in Java that provides several tasks. An example task might be org.compay.project.task.myTask.java
. To be able to invoke my tasks after applying my plugin in the build.gradle script (plugins { id 'myplugin' }
) I need to call import org.company,project.task.*
before invoking any task by their name exclusively (e.g. task(myTask)
). Otherwise I need to provide the fully qualified name for the task (e.g. task(org.compay.project.task.myTask)
).
Is it possible to expose the required or main imports from the plugin application? Is this recommended?
Thanks