将文件夹从pluginBasedir复制到目标项目 [英] Copying a folder from pluginBasedir to the target project

查看:132
本文介绍了将文件夹从pluginBasedir复制到目标项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当有人安装我的插件时,我希望将一个文件夹从我的插件的基本目录(pluginBasedir)复制到目标项目。如果我在Web应用程序中保留该文件夹,它将被复制。但我希望将该文件夹保存在基本目录下。

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.

是否必须使用ovverride _GrailsPluginDev.groovy脚本?

Do I have to ovverride _GrailsPluginDev.groovy script?

Regards,
Paras

Regards, Paras

推荐答案

您可以使用插件的_Install脚本(在脚本文件夹中)。假设您要复制的文件夹名为'foo',插件名称为'bar',您可以使用以下命令:

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"
}

这篇关于将文件夹从pluginBasedir复制到目标项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆