Copying a folder from pluginBasedir to the target project

三世轮回 提交于 2019-12-13 18:59:36

问题


I want one folder to be copied from my plugin's base directory (pluginBasedir) to the target project when someone installs my plugin. If I keep that folder within web-app, it gets copied. But I want to keep that folder under base directory.

Do I have to ovverride _GrailsPluginDev.groovy script?

Regards, Paras


回答1:


You can use the plugin's _Install script (in the scripts folder). Assuming the folder you want to copy is named 'foo' and the plugin name is 'bar', you can use this:

ant.mkdir dir: "$basedir/foo"
ant.copy(todir: "$basedir/foo") {
   fileset dir: "$barPluginDir/foo"
}


来源:https://stackoverflow.com/questions/2876348/copying-a-folder-from-pluginbasedir-to-the-target-project

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