1 18 package org.apache.tools.ant.taskdefs.optional; 19 20 import java.io.File ; 21 import org.apache.tools.ant.BuildException; 22 import org.apache.tools.ant.taskdefs.Java; 23 24 36 public class StyleBook extends Java { 37 protected File m_targetDirectory; 40 protected File m_skinDirectory; 41 protected String m_loaderConfig; 42 protected File m_book; 43 46 47 50 public StyleBook() { 51 setClassname("org.apache.stylebook.StyleBook"); 52 setFork(true); 53 setFailonerror(true); 54 } 55 56 61 62 public void setBook(final File book) { 63 m_book = book; 64 } 65 66 67 72 public void setSkinDirectory(final File skinDirectory) { 73 m_skinDirectory = skinDirectory; 74 } 75 76 77 82 public void setTargetDirectory(final File targetDirectory) { 83 m_targetDirectory = targetDirectory; 84 } 85 86 90 public void setLoaderConfig(final String loaderConfig) { 91 m_loaderConfig = loaderConfig; 92 } 93 94 95 99 public void execute() 100 throws BuildException { 101 102 if (null == m_targetDirectory) { 103 throw new BuildException("TargetDirectory attribute not set."); 104 } 105 106 if (null == m_skinDirectory) { 107 throw new BuildException("SkinDirectory attribute not set."); 108 } 109 110 if (null == m_book) { 111 throw new BuildException("book attribute not set."); 112 } 113 114 createArg().setValue("targetDirectory=" + m_targetDirectory); 115 createArg().setValue(m_book.toString()); 116 createArg().setValue(m_skinDirectory.toString()); 117 if (null != m_loaderConfig) { 118 createArg().setValue("loaderConfig=" + m_loaderConfig); 119 } 120 121 super.execute(); 122 } 123 } 124 | Popular Tags |