1 18 19 package org.apache.tools.ant.taskdefs.optional.vss; 20 21 import java.io.File ; 22 import java.text.SimpleDateFormat ; 23 24 import org.apache.tools.ant.BuildException; 25 import org.apache.tools.ant.types.Commandline; 26 import org.apache.tools.ant.types.EnumeratedAttribute; 27 28 33 public class MSVSSHISTORY extends MSVSS { 34 35 39 Commandline buildCmdLine() { 40 Commandline commandLine = new Commandline(); 41 42 if (getVsspath() == null) { 44 String msg = "vsspath attribute must be set!"; 45 throw new BuildException(msg, getLocation()); 46 } 47 48 commandLine.setExecutable(getSSCommand()); 52 commandLine.createArgument().setValue(COMMAND_HISTORY); 53 54 commandLine.createArgument().setValue(getVsspath()); 56 commandLine.createArgument().setValue(FLAG_AUTORESPONSE_DEF); commandLine.createArgument().setValue(getVersionDate()); 60 commandLine.createArgument().setValue(getVersionLabel()); 62 commandLine.createArgument().setValue(getRecursive()); 64 commandLine.createArgument().setValue(getStyle()); 66 commandLine.createArgument().setValue(getLogin()); 68 commandLine.createArgument().setValue(getOutput()); 70 71 return commandLine; 72 } 73 74 79 public void setRecursive(boolean recursive) { 80 super.setInternalRecursive(recursive); 81 } 82 83 88 public void setUser(String user) { 89 super.setInternalUser(user); 90 } 91 92 97 public void setFromDate(String fromDate) { 98 super.setInternalFromDate(fromDate); 99 } 100 101 106 public void setToDate(String toDate) { 107 super.setInternalToDate(toDate); 108 } 109 110 115 public void setFromLabel(String fromLabel) { 116 super.setInternalFromLabel(fromLabel); 117 } 118 119 124 public void setToLabel(String toLabel) { 125 super.setInternalToLabel(toLabel); 126 } 127 128 134 public void setNumdays(int numd) { 135 super.setInternalNumDays(numd); 136 } 137 138 143 public void setOutput(File outfile) { 144 if (outfile != null) { 145 super.setInternalOutputFilename(outfile.getAbsolutePath()); 146 } 147 } 148 149 157 public void setDateFormat(String dateFormat) { 158 super.setInternalDateFormat(new SimpleDateFormat (dateFormat)); 159 } 160 161 172 public void setStyle(BriefCodediffNofile attr) { 173 String option = attr.getValue(); 174 if (option.equals(STYLE_BRIEF)) { 175 super.setInternalStyle(FLAG_BRIEF); 176 } else if (option.equals(STYLE_CODEDIFF)) { 177 super.setInternalStyle(FLAG_CODEDIFF); 178 } else if (option.equals(STYLE_DEFAULT)) { 179 super.setInternalStyle(""); 180 } else if (option.equals(STYLE_NOFILE)) { 181 super.setInternalStyle(FLAG_NO_FILE); 182 } else { 183 throw new BuildException("Style " + attr + " unknown.", getLocation()); 184 } 185 } 186 187 190 public static class BriefCodediffNofile extends EnumeratedAttribute { 191 195 public String [] getValues() { 196 return new String [] {STYLE_BRIEF, STYLE_CODEDIFF, STYLE_NOFILE, STYLE_DEFAULT}; 197 } 198 } 199 } 200 | Popular Tags |