In the User’s Guide, under ‘Writing Custom Plugins’ is the suggestion to place the code in the buildSrc directory, and this works prettty well.
You can put the source for the plugin in the
Gradle will take care of compiling and testing the plugin and making it available on the
classpath of the build script. The plugin is visible to every build script used by the build.
However, it is not visible outside the build, and so you cannot reuse the plugin outside the
build it is defined in.
The one problem with this suggestion is that Eclipse does not allow you to treat the buildSrc/src/main/groovy directory as a sourceFolder if your Gradle project is not a Java project (or Groovy project).
It would a very nice to have if Buildship provided a way to overcome this limitation.