robocopy in post-build events

This forum is for all Flare issues not related to any of the other categories.
Post Reply
kgdyall
Propeller Head
Posts: 12
Joined: Fri Jun 17, 2016 8:48 am

robocopy in post-build events

Post by kgdyall »

I've been using post-build events to copy files into the Flare output (HTML5). The copy command works fine (and yes, I do use quotes around the file name). I have been working on copying our legal notices into the output, as I don't want to index them. This involves copying a few files and a folder of resources. I initially tried xcopy, but that's deprecated, and the /EXCLUDE flag didn't seem to work. So I tried Robocopy, but nothing happened when I did - it failed silently. Tech Support had nothing they could tell me about why it failed, so maybe someone out there can. Here's the command:

Robocopy "$(ProjectDirectory)\legal" "$(OutputDirectory)" /S /XF "*.docx"

I tried several variations: using the full path to Robocopy, changing case, leaving out the /XF option. The robocopy command works fine if I execute it in a DOS shell with substitution of the actual paths for $(ProjectDirectory) and $(OutputDirectory). I even tried making deliberate errors (such as robocapy) to see if I got any error messages (which I did). So I don't think it's a syntax error, and the files are all present. Any ideas?
GregStenhouse
Sr. Propeller Head
Posts: 330
Joined: Tue May 13, 2008 3:27 pm
Location: Christchurch, New Zealand

Re: robocopy in post-build events

Post by GregStenhouse »

Maybe try putting your Robocopy command in an external script and calling that script via the Flare target post-build event - and pass the output directory as a parameter.

Your target's post build event would be something like:

Code: Select all

"$(ProjectDirectory)post_publish_script.cmd" "$(OutputDirectory)"
And post_publish_script.cmd (in the high level project dir):

Code: Select all

Robocopy "legal" "%1" /S /XF "*.docx"
Where %1 is the output directory parameter.
kgdyall
Propeller Head
Posts: 12
Joined: Fri Jun 17, 2016 8:48 am

Re: robocopy in post-build events

Post by kgdyall »

No, that didn't work either.
oceanclub
Sr. Propeller Head
Posts: 277
Joined: Thu Oct 10, 2013 4:45 am
Location: Dublin

Re: robocopy in post-build events

Post by oceanclub »

I'm wondering if anyone got Robocopy working successful in a pre- or post-build command yet? Have tried myself with no luck.

P
Post Reply