1 11 package org.eclipse.pde.internal.ui.ant; 12 13 import org.apache.tools.ant.*; 14 import org.eclipse.core.runtime.jobs.*; 15 16 public abstract class BaseExportTask extends Task { 17 18 protected String fDestination; 19 protected String fZipFilename; 20 protected boolean fToDirectory; 21 protected boolean fUseJarFormat; 22 protected boolean fExportSource; 23 protected String fJavacTarget; 24 protected String fJavacSource; 25 26 public BaseExportTask() { 27 } 28 29 32 public void execute() throws BuildException { 33 if (fDestination == null) 34 throw new BuildException("No destination is specified"); 36 if (!fToDirectory && fZipFilename == null) 37 throw new BuildException("No zip file is specified"); 39 getExportJob().schedule(2000); 40 } 41 42 public void setExportType(String type) { 43 fToDirectory = !"zip".equals(type); } 45 46 public void setUseJARFormat(String useJarFormat) { 47 fUseJarFormat = "true".equals(useJarFormat); } 49 50 public void setExportSource(String doExportSource) { 51 fExportSource = "true".equals(doExportSource); } 53 54 public void setDestination(String destination) { 55 fDestination = destination; 56 } 57 58 public void setFilename(String filename) { 59 fZipFilename = filename; 60 } 61 62 public void setTarget(String target) { 63 fJavacTarget = target; 64 } 65 66 public void setSource(String source) { 67 fJavacSource = source; 68 } 69 70 protected abstract Job getExportJob(); 71 } 72 | Popular Tags |