乡下人产国偷v产偷v自拍,国产午夜片在线观看,婷婷成人亚洲综合国产麻豆,久久综合给合久久狠狠狠9

  • <output id="e9wm2"></output>
    <s id="e9wm2"><nobr id="e9wm2"><ins id="e9wm2"></ins></nobr></s>

    • 分享

      ant實踐——3、運行ANT

       一輝 2007-01-14
      運行Ant非常簡單,當你正確地安裝Ant后,只要輸入ant就可以了。

      沒有指定任何參數(shù)時,Ant會在當前目錄下查詢build.xml文件。如果找到了就用該文件作為buildfile。如果你用 -find 選項。Ant就會在上級目錄中尋找buildfile,直至到達文件系統(tǒng)的根。要想讓Ant使用其他的buildfile,可以用參數(shù) -buildfile file,這里file指定了你想使用的buildfile。

      你也可以設定一些屬性,以覆蓋buildfile中指定的屬性值(參看property task)??梢杂?-Dproperty=value 選項,這里property是指屬性的名稱,而value則是指屬性的值。也可以用這種辦法來指定一些環(huán)境變量的值。你也可以用property task來存取環(huán)境變量。只要將 -DMYVAR=%MYVAR% (Windows)-DMYVAR=$MYVAR (Unix) 傳遞給Ant -你就可以在你的buildfile中用${MYVAR}來存取這些環(huán)境變量。

      還有兩個選項 -quite,告訴Ant運行時只輸出少量的必要信息。而 -verbose,告訴Ant運行時要輸出更多的信息。

      可以指定執(zhí)行一個或多個target。當省略target時,Ant使用標簽<project>的default屬性所指定的target。

      如果有的話,-projecthelp 選項輸出項目的描述信息和項目target的列表。先列出那些有描述的,然后是沒有描述的target。

      命令行選項總結:
      ant [options] [target [target2 [target3] ...]]
      Options:
      -help print this message
      -projecthelp print project help information
      -version print the version information and exit
      -quiet be extra quiet
      -verbose be extra verbose
      -debug print debugging information
      -emacs produce logging information without adornments
      -logfile file use given file for log output
      -logger classname the class that is to perform logging
      -listener classname add an instance of class as a project listener
      -buildfile file use specified buildfile
      -find file search for buildfile towards the root of the filesystem and use the first one found
      -Dproperty=value set property to value
      例子
      ant
      使用當前目錄下的build.xml運行Ant,執(zhí)行缺省的target。
      ant -buildfile test.xml
      使用當前目錄下的test.xml運行Ant,執(zhí)行缺省的target。
      ant -buildfile test.xml dist
      使用當前目錄下的test.xml運行Ant,執(zhí)行一個叫做dist的target。
      ant -buildfile test.xml -Dbuild=build/classes dist
      使用當前目錄下的test.xml運行Ant,執(zhí)行一個叫做dist的target,并設定build屬性的值為build/classes。

      文件


      在Unix上,Ant的執(zhí)行腳本在做任何事之前都會source(讀并計算值)~/.antrc 文件;在Windows上,Ant的批處理文件會在開始時調用%HOME%\antrc_pre.bat,在結束時調用%HOME%\antrc_post.bat。你可以用這些文件配置或取消一些只有在運行Ant時才需要的環(huán)境變量。看下面的例子。

      環(huán)境變量

      包裹腳本(wrapper scripts)使用下面的環(huán)境變量(如果有的話):
      • JAVACMD Java可執(zhí)行文件的絕對路徑。用這個值可以指定一個不同于JAVA_HOME/bin/java(.exe)的JVM。
      • ANT_OPTS 傳遞給JVM的命令行變量-例如,你可以定義屬性或設定Java堆的最大值
      手工運行Ant

      如果你自己動手安裝(DIY)Ant,你可以用下面的命令啟動Ant:
      java -Dant.home=c:\ant org.apache.tools.ant.Main [options] [target]
      這個命令與前面的ant命令一樣。選項和target也和用ant命令時一樣。這個例子假定你的CLASSPATH包含:
      • ant.jar
      • jars/classes for your XML parser
      • the JDK‘s required jar/zip files

        本站是提供個人知識管理的網(wǎng)絡存儲空間,所有內容均由用戶發(fā)布,不代表本站觀點。請注意甄別內容中的聯(lián)系方式、誘導購買等信息,謹防詐騙。如發(fā)現(xiàn)有害或侵權內容,請點擊一鍵舉報。
        轉藏 分享 獻花(0

        0條評論

        發(fā)表

        請遵守用戶 評論公約

        類似文章 更多