Copying a folder from pluginBasedir to the target project - groovy

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

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

Related

Copy a prebuild file to build folder (SCons)

I want to copy a (prebuild) file from the source folder to the destination folder (variant_dir).
This results in a dependency cycle:
Command('main.elf', 'main.elf', Copy("$TARGET", "$SOURCE"))
How could I specify that the file to copy is located in the source folder (project folder) and the target is in the build folder without using constant values (in SConscript)?
As workaround I renamed the file:
Command('main.elf', 'main.orig', Copy("$TARGET", "$SOURCE"))
This should be the proper syntax for what you want to do:
Command('main.elf', 'main.elf', Copy("$TARGET", "${SOURCE.srcpath}"))
See: http://scons.org/doc/production/HTML/scons-man.html and search for srcpath to see the section on substitution.
That said what you are really asking for is duplicate=partial. I'm not sure if this will work.
Can you specify the elf file with full path on the command line to your tool?
Command('main.elf', 'main.elf',"my_tool $TARGET ${SOURCE.srcpath}")
Or equivalent?

How to create a folder and sub folder

How to create folder using live code. I am using linux operating system my current Directory is
"/home/user1/myproject/"
I want to create folder inside myproject
create folder pathName should work fine

Copying symbolic links but pointing to same files(copied) but different target base directories

I am trying to create a test environment by updating it with another test environment files. Heres my situation:
I have a directory SRC. It has directories "test_bundles" and "tools_bundles" which has all the required builds. Additionally, SRC has "latest" directory which has files "test_bundle_1", "tools_bundle_1" etc. which points to specific builds within directories "test_bundles" and "tools_bundles", i.e., symbolic links.
Now on a different Linux system, I have DEST directory which is regularly updated with contents of "test_bundles" and "tools_bundles" from the SRC directory. I also want to have "latest" directory in DEST that has same files as in "latest" within SRC directory, however, points to builds (these builds are same) inside "test_bundles" and "tools_bundles" within the DEST.
Note that files change their links to different builds and moreover, new files get added to "latest" within SRC as well. So whenever I do copy operation it should update everything.
I dont know what to call this. Am I trying to copy the SRC "latest" to DEST "latest" files (symbolic links) with links to different parent directory structure.
Note that my script is doing good by updating "test_bundles" and "tools_bundles". I just need a way for "latest" files with the test environment uses different base directories.
If the links in latest are relative there is nothing special that
needs to be done - parent directory names do not matter. – Michał
Politowski
Actually its the opposite, the links are not relative rather the
parent directory structure(tree) is different – user3685188
What Michał Politowski surely meant to suggest is that you should make the symbolic links relative in order to have your problem solved - and that is the most sane solution.

Referenced DLL. In root, move to folder

I have several DLLs referenced in my project. On build, they get dumped to the root directory.
How do I set a folder to which to copy these to and have the project reference them from the folder?
Basically, I want my output to have a folder called "whatever" and have my app reference them from the folder instead of the root.
Move your DLLs to the folder (source folder, as you have described). Then set your references to get the DLLs from that folder. (remove current reference, add reference, browse to your preferred folder).
In the /project/references (for the DLLs you have mentioned) set the property "Copy Local" to False.

In scons, how to specify path of the target?

I'm new to scons. I was trying to specify the path of the target. I don't want the executable to be generated in the same folder, in which the SConstruct file resides.
I tried the following:
(Suppose the SConstruct file resides in some folder 'Foo')
env.Program(
#executable name
target="~/Desktop/my_executable",
...
However this creates directories Foo/~/Desktop/ and places the target my_executable into the leaf directory.
How do I get scons to generate the target inside some fixed folder? I'm using linux.

Resources