1 4 package com.inversoft.savant.ant; 5 6 7 import java.io.File ; 8 9 import org.apache.tools.ant.Project; 10 import org.apache.tools.ant.taskdefs.Ant; 11 12 import com.inversoft.savant.LocalProject; 13 import com.inversoft.savant.LocalProjectBuilder; 14 15 16 24 public class AntLocalProjectBuilder implements LocalProjectBuilder { 25 26 private Project antProject; 27 28 29 public AntLocalProjectBuilder(Project antProject) { 30 this.antProject = antProject; 31 } 32 33 34 37 public void build(LocalProject project) { 38 File test = new File (project.getDir(), project.getAntfile()); 40 if (!test.exists()) { 41 return; 42 } 43 44 Ant ant = (Ant) antProject.createTask("ant"); 45 ant.setAntfile(project.getAntfile()); 46 ant.setDir(project.getDir()); 47 ant.setInheritAll(false); 48 ant.setInheritRefs(false); 49 50 if (project.getTarget() != null) { 51 ant.setTarget(project.getTarget()); 52 } 53 54 ant.perform(); 55 } 56 } 57 | Popular Tags |