Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Rename Directory #11
Currently the move task does not seem able to rename directories. It looks like there was an attempt to fix this just before the 0.91 release, but it was reverted.
Renaming directories (instead of moving the contents of one directory into another) can be an important feature for doing deployments.
Just a bit of background as I believe you are referencing some of the work that I did to the move task that was backed out prior to 0.91 release. That work was to introduce a simplified way of moving entire directories with the move task. It was backed out because there was question/concern with the proposed syntax as well as how it functioned internally. I do have plans of taking another stab at it but it'll take a bit of time.
It's a bit of a wrist cramper but it works.
Hope this adds clarity.
I found that in the documentation, but it doesn't seem to actually work. It in fact seems to do nothing. For example:
<target name="build"> <mkdir dir="a"/> <mkdir dir="a/test"/> <touch file="a/test/stamp" /> <move tofile="b" verbose="true" includeemptydirs="true"> <fileset basedir="a" /> </move> </target>
The mkdir and touch calls do their thing, but when it gets to the move task, it seems to silently decide that there's nothing it needs to do. No messages, warnings, or errors.
If I change tofile to todir, and add an in the fileset, then it moves all the files over, but leaves all the directories behind.
I ended up resorting to calling out to cmd.exe via the exec task for my scenario, esp. since it's important for me that the directory rename be atomic, and not leave partial results behind if there is a file locking error.
pushed a commit
Sep 29, 2013
think your syntax is just wrong. should use todir not to file. try...
On Fri, May 23, 2014 at 11:33 AM, andrewducker firstname.lastname@example.org: