When developing custom classes & plugins, there are many options to choose from as described in the user guide. Are there any best practices anyone would like to share?
In my case, I need to write stuff that will be shared across hundreds of modules that span several product lines.
- Sometimes, all I need to do is to tweak conventions created by other plugins. Creating a plugin just for this seems like a lot of overhead, but it does give me the ability to version it. I could have everyone “apply from” a static location, but versioning would be trickier.
- When I create new tasks & conventions, I’ve struggled choosing between buildSrc, multi-project, and independent modules sharing a common repo.
- I wanted unit tests for my build, but I found JUnit style tests to be very hard to write and maintain for the plugin. I’m very tempted to drop them altogether in favor of a multi-project build where subprojects are my unit tests.
- buildSrc seems convenient, but the build lifecycle confuses me and I get tired of having the build process the directory when running unit tests.