Skip to content

Commit

Permalink
update template task to use ant move task internally
Browse files Browse the repository at this point in the history
fixes issue w/ Windows
  • Loading branch information
ervandew committed May 12, 2012
1 parent 450957e commit 7237225
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/java/org/formic/ant/TemplateTask.java
Expand Up @@ -29,6 +29,8 @@
import org.apache.tools.ant.BuildException;
import org.apache.tools.ant.Task;

import org.apache.tools.ant.taskdefs.Move;

import org.apache.velocity.VelocityContext;

import org.apache.velocity.app.Velocity;
Expand Down Expand Up @@ -68,6 +70,7 @@ public void execute()
FileReader reader = null;
FileWriter writer = null;
try{
log("Evaluating template: " + template);
reader = new FileReader(this.template);
writer = new FileWriter(this.out);
VelocityContext context = new VelocityContext(values);
Expand All @@ -80,7 +83,12 @@ public void execute()
}

if (move){
out.renameTo(template);
Move move = new Move();
move.setProject(getProject());
move.setTaskName(getTaskName());
move.setFile(out);
move.setTofile(template);
move.execute();
}
}

Expand Down

0 comments on commit 7237225

Please sign in to comment.