Apply custom gradle plugin locally in the same project

女生的网名这么多〃 提交于 2019-12-06 05:23:14

Mixing the code for your gradle plugin with the project code the plugin is supposed to help build is probably a bad idea.

You should check out the gradle documentation on organizing your build logic and specifically I would have probably started by sticking your plugin source in the buildSrc directory.

If you put your plugin source in a directory called buildSrc as per the documentation above, it will be automatically compiled and included in your build classpath. It will also not be deleted when you clean your project. All you really need is the apply plugin: x statement.

It should be noted that even though buildSrc is convenient, it is still there for the development phase of your plugin. If you intend to use the plugin more often, in more places, or otherwise share it, it is probably good to actually build a jar with the plugin.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!