本練習顯示如何編輯 Apache Ant Script,來發佈 Web 和報告。
開始之前,您必須先完成練習 2:建立及配置 Ant Script。
<project default="foo"> <target name="foo"> <!-- =================================================================== modelPath: 必要的參數,至要發佈之模型的完整路徑 (FQP) outputFolder: 必要的參數,至要發佈之目的地資料夾的完整路徑 (FQP) =================================================================== --> <com.ibm.xtools.publish.CLModelPublish modelPath="C:\Documents and Settings\user1\ws1\SimpleUMLProject\SimpleUMLModel.emx" outputFolder="C:\myWebs\FooWeb" overwriteExisting="true" preview="false" showIcons="true" diagramImageFormat="gif" detailLevel="full" errorHandling="ignore"/> <!-- =================================================================== modelPath: 必要的參數,要發佈之模型的完整路徑 (FQP) targetOutputFolder: 必要的參數,發佈目的資料夾的完整路徑 (FQP) targetOutputFile: 必要的參數,報告的檔案名稱 =================================================================== --> <com.ibm.xtools.publish.CLReportPublish modelPath="C:\Documents and Settings\user1\ws1\SimpleUMLProject\SimpleUMLModel.emx" targetOutputFolder="c:\myRpts\simpleRpt" targetOutputFile="metric.pdf" reportName="Sample UML Metric Report" overwriteExisting="true" autoShowPublishedOutput="false" errorHandling="ignore"/> </target> </project>
現在您可以開始進行練習 4:測試及設定自動執行 Ant Script。