- Timestamp:
- 08/03/08 11:27:34 (4 months ago)
- Location:
- lang/java/utiljs/trunk
- Files:
-
- 3 modified
-
src/org/coderepos/utiljs/taskdefs/Hhc.java (modified) (4 diffs)
-
src/org/coderepos/utiljs/taskdefs/JSDoc.java (modified) (4 diffs)
-
test/testcase.xml (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
lang/java/utiljs/trunk/src/org/coderepos/utiljs/taskdefs/Hhc.java
r16717 r17011 3 3 // 親クラスのインポート 4 4 import java.io.*; 5 5 6 import org.apache.tools.ant.*; 6 7 import org.apache.tools.ant.taskdefs.*; 8 import org.apache.tools.ant.types.Commandline; 7 9 8 10 /** … … 12 14 final public class Hhc extends Task 13 15 { 14 // HTML Help Compilerの名称 15 final public String EXECUTABLE = "hhc.exe"; 16 // HTML Help Compilerの標準インストール先 17 final public String EXECUTABLE = "C:\\Program Files\\HTML Help Workshop\\hhc.exe"; 18 16 19 // HTML Help Projectファイル 17 public File hhp= null;20 public File file = null; 18 21 // HTML Help Workショップのインストールパス 19 public File dir = new File("C:\\Program Files\\HTML Help Workshop");22 public File path = null; 20 23 21 24 /** … … 24 27 public void execute() throws BuildException 25 28 { 26 ExecTask task = (ExecTask)getProject().createTask(" ExecTask");29 ExecTask task = (ExecTask)getProject().createTask("exec"); 27 30 28 31 task.setExecutable(EXECUTABLE); 29 task.setDir(getDir()); 32 Commandline.Argument arg = task.createArg(); 33 arg.setLine(getFile().getAbsolutePath()); 30 34 31 35 task.execute(); … … 33 37 34 38 /** setter for HHP **/ 35 public void setHhp(File f){ hhp = f; }; 36 39 public void setFile(File f){ file = f; }; 37 40 /** getter for HHP **/ 38 public File getHhp(){ return hhp; }; 39 40 /** setter for dir **/ 41 public void setDir(File d){ dir = d; }; 42 43 /** getter for dir **/ 44 public File getDir(){ return dir; }; 41 public File getFile(){ return file; }; 42 43 /** setter for path to hhc.exe **/ 44 public void setPath(File p){ path = p; }; 45 /** getter for path to hhc.exe **/ 46 public File getPath(){ return path; }; 45 47 }; -
lang/java/utiljs/trunk/src/org/coderepos/utiljs/taskdefs/JSDoc.java
r16717 r17011 3 3 // import 4 4 import java.io.*; 5 6 import org.coderepos.utiljs.*; 5 7 import org.apache.tools.ant.*; 6 8 import org.apache.tools.ant.taskdefs.*; 9 import org.apache.tools.ant.types.Commandline; 7 10 8 11 /** … … 12 15 final public class JSDoc extends Task 13 16 { 14 /** 15 * Documentationテンプレート 16 */ 17 private String template = new String("sunny"); 17 final public String JARNAME = "jsrun.jar"; 18 final public String JSDOCNAME = "app/run.js"; 18 19 19 /** 20 * 処理内容メッセージ 21 */ 22 private boolean verbose = false; 23 24 /** 25 * JSDoc出力先ディレクト 26 */ 20 /** 全関数の出力オプション **/ 21 private boolean allfunctions = false; 22 /** confファイルの読み込みオプション **/ 23 private File conf = null; 24 /** 出力先ディレクトリ **/ 27 25 private File destDir = null; 28 29 /** 30 * 文字コード 31 */ 26 /** 出力文字コード **/ 32 27 private String encoding = null; 33 34 /** 35 * 許可する拡張子 36 */ 37 private String extention = null; 28 /** JavaScriptソースコードの無視するか否か **/ 29 private boolean nocode = false; 30 /** 出力結果の保存 **/ 31 private File log = null; 32 /** private関数も出力するか? **/ 33 private boolean privateOpt = false; 34 /** 再帰的にディレクトリを探索するか? **/ 35 private int recurse = 0; 36 /** **/ 37 private boolean supress = false; 38 /** 必須:出力テンプレート **/ 39 private File template = null; 40 /** JSDocToolkitのパス **/ 41 private File path = null; 42 /** testオプション **/ 43 private boolean test = false; 44 /** 処理している内容の表示 **/ 45 private String ext = null; 46 /** ヘルプ表示オプション **/ 47 private boolean help = false; 38 48 39 49 /** … … 42 52 public void execute() throws BuildException 43 53 { 54 Arguments args = new Arguments(); 55 56 args.add(getPath().getAbsolutePath() + JSDOCNAME); 57 args.addIf(0 < recurse, "--recurse=" + new Integer(recurse).toString()); 58 args.addIf(help, "--help"); 59 args.addIf(allfunctions, "--allfunctions"); 60 args.addIf(test, "--test"); 61 args.addIf(nocode, "--nocode"); 62 args.addIf(supress, "--supress"); 63 args.addIf(ext != null, ext); 64 44 65 Java task = (Java)getProject().createTask("Java"); 45 // fork = trueにしないと動かない。 66 67 Commandline.Argument arg = task.createArg(); 68 arg.setValue(args.toString()); 69 70 task.setJar(new File(getPath().getAbsolutePath() + JSDOCNAME)); 46 71 task.setFork(true); 47 72 task.execute(); 48 73 }; 49 74 50 /** setter for verbose **/51 public void setVerbose(boolean b){ verbose = b; };52 53 /** getter for verbose **/54 public boolean getVerbose(){ return verbose; };55 56 75 /** setter for encoding **/ 57 76 public void setEncoding(String s){ encoding = s; }; 58 59 77 /** getter for encoding **/ 60 78 public String getEncoding(){ return encoding; }; … … 62 80 /** setter for destDir **/ 63 81 public void setDestDir(File d){ destDir = d; }; 64 65 82 /** getter for destDir **/ 66 83 public File getDestDir(){ return destDir; }; 84 85 /** setter for allfunctions **/ 86 public void setAllfunctions(boolean b){ allfunctions = b; }; 87 /** getter for allfunctions **/ 88 public boolean getAllfunctions(){ return allfunctions; }; 89 90 /** setter for path **/ 91 public void setPath(File d){ path = d; }; 92 /** getter for path **/ 93 public File getPath(){ return path; }; 94 95 /** setter for ext **/ 96 public void setExt(String s){ ext = s; }; 97 /** getter for ext **/ 98 public String getExt(){ return ext; }; 99 100 /** setter for template **/ 101 public void setTemplate(File f){ template = f; }; 102 /** getter for template **/ 103 public File getTemplate(){ return template; }; 104 105 /** setter for log **/ 106 public void setLog(File f){ log = f; }; 107 /** getter for log **/ 108 public File getLog(){ return log; }; 109 110 /** setter for setPrivateOpt **/ 111 public void setPrivateOpt(boolean b){ privateOpt = b; }; 112 /** getter for setPrivateOpt **/ 113 public boolean getPrivateOpt(){ return privateOpt; }; 114 115 /** setter for conf **/ 116 public void setConf(File f){ conf = f; }; 117 /** getter for conf **/ 118 public File getConf(){ return conf; }; 119 120 /** setter for help **/ 121 public void setHelp(boolean b){ help = b; }; 122 /** getter for help **/ 123 public boolean getHelp(){ return help; }; 124 125 /** setter for recurse **/ 126 public void setRecurse(int i){ recurse = i; }; 127 /** getter for recurse **/ 128 public int getRecurse(){ return recurse; }; 129 130 /** setter for test **/ 131 public void setTest(boolean b){ test = b; }; 132 /** getter for test **/ 133 public boolean getTest(){ return test; }; 67 134 }; -
lang/java/utiljs/trunk/test/testcase.xml
r7969 r17011 1 1 <?xml version="1.0" encoding="UTF-8"?> 2 <project name="utiljs" default=" all" basedir="../">2 <project name="utiljs" default="default" basedir="../"> 3 3 4 <taskdef name="yuic" classname="org.coderepos.utiljs.taskdefs.Yuic" classpath="bin;lib/yuicompressor-2.3.5.jar" /> 4 <taskdef resource="utiljs.tasks"> 5 <classpath><fileset dir="lib"><include name="*.jar"/></fileset></classpath> 6 </taskdef> 5 7 6 < !-- Yuic Test -->7 <target name="yuic">8 <target name="default"> 9 <!-- YUICompressor TestCase::01 --> 8 10 <yuic srcDir="test/sample" destDir="result/yuic" /> 11 <!-- YUICompressor TestCase::02 --> 12 <yuic srcDir="test/sample" destDir="result/yuic2" /> 13 <!-- HTMLHelpCompile TestCase::03 --> 14 <hhc file="test/hhc/sample.hhp" /> 9 15 </target> 10 16 11 <target name="yuic2">12 <yuic srcDir="test/sample" destDir="result/yuic2" />13 </target>14 15 <!-- All -->16 <target name="all" depends="yuic,yuic2" />17 18 17 </project>
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)