1 package org.ashkelon; 2 3 import org.apache.tools.ant.*; 4 import org.apache.tools.ant.types.*; 5 import java.io.*; 6 7 10 public class AshkelonTask extends Task 11 { 12 private String cmd; 13 private String apifile = ""; 14 15 20 21 public void setCmd(AshkelonCmd cmd) 22 { 23 this.cmd = cmd.getValue(); 24 } 25 public void setApifile(File file) 26 { 27 this.apifile = file.getAbsolutePath(); 28 log("api file is: "+apifile); 29 } 30 31 public void execute() 32 { 33 if ("add".equals(cmd)) 34 { 35 String [] args = new String [1]; 36 args[0] = "@" + apifile; 37 Ashkelon.addapiCmd(args); 38 } 39 } 40 41 public static class AshkelonCmd extends EnumeratedAttribute 42 { 43 public String [] getValues() 44 { 45 return new String [] {"add", "reset", "list", "remove", "updaterefs"}; 46 } 47 } 48 } 49 | Popular Tags |