1 17 18 package org.apache.tools.ant.taskdefs.optional.ide; 19 20 21 import java.io.File ; 22 import org.apache.tools.ant.BuildException; 23 import org.apache.tools.ant.types.PatternSet; 24 25 104 105 public class VAJExport extends VAJTask { 106 protected File destDir; 108 protected boolean exportSources = true; 109 protected boolean exportResources = true; 110 protected boolean exportClasses = false; 111 protected boolean exportDebugInfo = false; 112 protected boolean useDefaultExcludes = true; 113 protected boolean overwrite = true; 114 115 protected PatternSet patternSet = new PatternSet(); 116 117 120 public PatternSet.NameEntry createExclude() { 121 return patternSet.createExclude(); 122 } 123 124 127 public PatternSet.NameEntry createInclude() { 128 return patternSet.createInclude(); 129 } 130 131 134 public void execute() throws BuildException { 135 if (destDir == null) { 137 throw new BuildException("destdir attribute must be set!"); 138 } 139 140 try { 142 getUtil().exportPackages(destDir, 143 patternSet.getIncludePatterns(getProject()), 144 patternSet.getExcludePatterns(getProject()), 145 exportClasses, exportDebugInfo, 146 exportResources, exportSources, 147 useDefaultExcludes, overwrite); 148 } catch (BuildException ex) { 149 if (haltOnError) { 150 throw ex; 151 } else { 152 log(ex.toString()); 153 } 154 } 155 } 156 157 164 public void setDefaultexcludes(boolean useDefaultExcludes) { 165 this.useDefaultExcludes = useDefaultExcludes; 166 } 167 168 172 public void setDestdir(File destDir) { 173 this.destDir = destDir; 174 } 175 176 183 public void setExcludes(String excludes) { 184 patternSet.setExcludes(excludes); 185 } 186 187 190 public void setExportClasses(boolean doExport) { 191 exportClasses = doExport; 192 } 193 194 198 public void setExportDebugInfo(boolean doExport) { 199 exportDebugInfo = doExport; 200 } 201 202 205 public void setExportResources(boolean doExport) { 206 exportResources = doExport; 207 } 208 209 212 public void setExportSources(boolean doExport) { 213 exportSources = doExport; 214 } 215 216 223 public void setIncludes(String includes) { 224 patternSet.setIncludes(includes); 225 } 226 227 230 public void setOverwrite(boolean doOverwrite) { 231 overwrite = doOverwrite; 232 } 233 234 } 235 | Popular Tags |