当前位置: 首页 > news >正文

哈尔滨网站建设效果好宁波seo推广公司排名

哈尔滨网站建设效果好,宁波seo推广公司排名,海伦网站建设,工业设计参考网站1 在command line里面运行不带任何参数: Ant Ant首先会在当前目录下寻找build.xml,并运行target中声明为default 属性的tag。 如果想使用其他的build文件作为build xml,可以使用参数-buildfile file 如在上一篇文章的例子中使用: D:/He…

1 在command line里面运行不带任何参数:

Ant

 

Ant首先会在当前目录下寻找build.xml,并运行target中声明为default 属性的tag。

 

如果想使用其他的build文件作为build xml,可以使用参数-buildfile file

如在上一篇文章的例子中使用:

D:/HelloAntWorld>ant -buildfile buildtest.xml
Buildfile: D:/HelloAntWorld/buildtest.xml

init:

compile:
    [javac] D:/HelloAntWorld/buildtest.xml:26: warning: 'includeantruntime' was
not set, defaulting to build.sysclasspath=last; set to false for repeatable buil
ds

jar:

all:

BUILD SUCCESSFUL
Total time: 0 seconds
D:/HelloAntWorld>

 

2 使用参数 -find:

你可以不指定build xml所在的位置,利用-find 命令来搜索。

如 ant -find test.xml

Ant首先需要在当前目录下寻找,如果未找到,则到父目录寻找直到被找到或者到达root目录。

如果在find后面不加文件名,则直接寻找build.xml

 

 

3在编译的时候使用properity,形式:

-Dproperty =value

If you specify a property that is also set in the build file , the value specified on the command line will override the value specified in the build file.

 

结合我们上一篇的例子,使用:

 

D:/HelloAntWorld>ant -Dclassdir=./test/classes
Buildfile: D:/HelloAntWorld/build.xml

init:

compile:
    [javac] D:/HelloAntWorld/build.xml:26: warning: 'includeantruntime' was not
set, defaulting to build.sysclasspath=last; set to false for repeatable builds
    [javac] Compiling 1 source file to D:/HelloAntWorld/test/classes

jar:
      [jar] Building jar: D:/HelloAntWorld/lib/HelloAntWorld.jar

all:

BUILD SUCCESSFUL
Total time: 1 second
D:/HelloAntWorld>

 

在之前生成的目录.class文件在classes下面,现在放在test/classes下面。


01/11/2011  09:40 PM    <DIR>          .
01/11/2011  09:40 PM    <DIR>          ..
01/11/2011  09:40 PM    <DIR>          ${dirs.base}
01/11/2011  03:23 PM               232 .classpath
01/11/2011  03:23 PM               389 .project
01/11/2011  03:24 PM    <DIR>          bin
01/11/2011  04:39 PM             1,042 build.xml
01/11/2011  04:39 PM             1,042 buildtest.xml
01/11/2011  04:40 PM    <DIR>          lib
01/11/2011  03:24 PM    <DIR>          src
01/11/2011  09:34 PM    <DIR>          test
               4 File(s)          2,705 bytes
               7 Dir(s)  449,645,449,216 bytes free

4 关于build过程中的输出:

 

-quiet , which instructs Ant to print less information to the console;

-verbose , which causes Ant to print additional information to the console; 

-debug , which causes Ant to print considerably more additional information.

 

 

D:/HelloAntWorld>ant -quiet
    [javac] D:/HelloAntWorld/build.xml:26: warning: 'includeantruntime' was not
set, defaulting to build.sysclasspath=last; set to false for repeatable builds

BUILD SUCCESSFUL
Total time: 0 seconds

可以看到信息明显减少

 

而下面的例子则可以看到信息明显增多。这个参数在perl和python中也有类似的作用。

D:/HelloAntWorld>ant -verbose
Apache Ant version 1.8.1 compiled on April 30 2010
Trying the default build file: build.xml
Buildfile: D:/HelloAntWorld/build.xml
Detected Java version: 1.4 in: C:/Program Files/IBM/Java142/jre
Detected OS: Windows XP
parsing buildfile D:/HelloAntWorld/build.xml with URI = file:/D:/HelloAntWorld/b
uild.xml
Project base dir set to: D:/HelloAntWorld
Build sequence for target(s) `all' is [init, compile, jar, all]
Complete build sequence is [init, compile, jar, all, clean, ]

init:
parsing buildfile jar:file:/C:/apache-ant-1.8.1/lib/ant.jar!/org/apache/tools/an
t/antlib.xml with URI = jar:file:/C:/apache-ant-1.8.1/lib/ant.jar!/org/apache/to
ols/ant/antlib.xml from a zip file
    [mkdir] Skipping D:/HelloAntWorld/classes because it already exists.
    [mkdir] Skipping D:/HelloAntWorld/lib because it already exists.

compile:
    [javac] D:/HelloAntWorld/build.xml:26: warning: 'includeantruntime' was not
set, defaulting to build.sysclasspath=last; set to false for repeatable builds
    [javac] example/HelloWorld.java omitted as D:/HelloAntWorld/classes/example/
HelloWorld.class is up to date.

jar:
      [jar] example/HelloWorld.class omitted as D:/HelloAntWorld/lib/HelloAntWor
ld.jar:example/HelloWorld.class is up to date.
      [jar] example omitted as D:/HelloAntWorld/lib/HelloAntWorld.jar:example/ i
s up to date.
      [jar] No Implementation-Title set.No Implementation-Version set.No Impleme
ntation-Vendor set.
      [jar] Location: D:/HelloAntWorld/build.xml:18:

all:

BUILD SUCCESSFUL
Total time: 0 seconds

 

 

5 Ant -projecthelp

The

-projecthelp option prints out a list of the build file's targets.

 

D:/HelloAntWorld>ant -projecthelp
Buildfile: D:/HelloAntWorld/build.xml

Main targets:

Other targets:

 all
 clean
 compile
 init
 jar
Default target: all

 

关于Ant执行时候的更多的参数可以参看下面或者help

Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.

C:/Documents and Settings/Administrator>Ant -h
ant [options] [target [target2 [target3] ...]]
Options:
  -help, -h                  print this message
  -projecthelp, -p       print project help information
  -version                  print the version information and exit
  -diagnostics           print information that might be helpful to
                         diagnose or report problems.
  -quiet, -q                be extra quiet
  -verbose, -v           be extra verbose
  -debug, -d             print debugging information
  -emacs, -e             produce logging information without adornments
  -lib <path>            specifies a path to search for jars and classes
  -logfile <file>        use given file for log
    -l     <file>                ''
  -logger <classname>    the class which is to perform logging
  -listener <classname>  add an instance of class as a project listener
  -noinput               do not allow interactive input
  -buildfile <file>      use given buildfile
    -file    <file>              ''
    -f       <file>              ''
  -D<property>=<value>   use value for given property
  -keep-going, -k        execute all targets that do not depend
                         on failed target(s)
  -propertyfile <name>   load all properties from file with -D
                         properties taking precedence
  -inputhandler <class>  the class which will handle input requests
  -find <file>           (s)earch for buildfile towards the root of
    -s  <file>           the filesystem and use it
  -nice  number          A niceness value for the main thread:
                         1 (lowest) to 10 (highest); 5 is the default
  -nouserlib             Run ant without using the jar files from
                         ${user.home}/.ant/lib
  -noclasspath           Run ant without using CLASSPATH
  -autoproxy             Java1.5+: use the OS proxy settings
  -main <class>          override Ant's normal entry point
C:/Documents and Settings/Administrator>

 

 

关于Ant的lib目录:

 

The default directories scanned are ANT_HOME/lib and a user specific directory, ${user.home}/.ant/lib. This arrangement allows the Ant installation to be shared by many users while still allowing each user to deploy additional jars.

 

The order in which jars are added to the classpath is as follows:

  • -lib jars in the order specified by the -lib elements on the command line
  • jars from ${user.home}/.ant/lib (unless -nouserlib is set)
  • jars from ANT_HOME/lib

Note:

On Unix systems ${user.home} maps to the user's home directory whilst on recent versions of Windows it will be somewhere such as C:/Documents and Settings/username/.ant/lib

 

ant -lib one.jar -lib another.jar

不过以上关于lib的描述我还没使用过。等下次遇到再说。

 

 

 

http://www.mmbaike.com/news/44500.html

相关文章:

  • 网站广告赚钱网络优化是干什么的
  • 需要找做网站的品牌推广策略分析
  • 庆阳做网站公司营口建网站的公司
  • phpwind网站百度网页版 入口
  • 湛江专业做网站定制网站建设
  • 计算机网络资源网站建设论文网络营销的4p策略
  • 茂名优化网站建设超云seo优化
  • 网站建设合同付款比例贵州网站seo
  • 农产品网站建设策划宁波网站关键词优化代码
  • 19网站建设推广用哪个平台效果好
  • 网站数据分析报表搜索引擎营销的方法
  • 做信公众号首图的网站百度免费网站制作
  • 大同做网站武汉seo优化排名公司
  • 在哪个网站做视频可以赚钱推广普通话宣传周活动方案
  • 运城网站制作搜一搜排名点击软件
  • 网站板块怎么做台州百度快照优化公司
  • 那样的网站南宁seo关键词排名
  • 企业平台网站制作郑州网络营销学校
  • 回到明朝当王爷如何优化网络环境
  • 杭州企业自助建站百度指数对比
  • 可以做科学模拟实验的网站数据分析师培训机构推荐
  • 六安市建设局网站凡科网小程序
  • 网站备案是每年一次吗晚上必备免费软件大全苹果
  • 高端品牌网站建设服务重庆官网seo分析
  • 网站改版怎么做百度引擎搜索推广
  • 视频网站做app还是h5什么是网络营销工具
  • 浙江住房与城乡建设厅官方网站查询搜索引擎入口google
  • 大成建设株式会社网站泉州网站建设优化
  • 高性能网站建设指南 书最新消息新闻头条
  • 靓号网建站黄页推广引流