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

新手卖家做来赞达网站如何网站做网站

新手卖家做来赞达网站如何,网站做网站,个人网站有哪些网站,为企业做贡献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.yayakq.cn/news/754463/

相关文章:

  • 那个公司建设网站wordpress制作html5
  • 滨江区建设局官方网站公司建网站需要先注册域名
  • 电子商务网站 方案wordpress nofollow
  • 网站如何做淘宝支付宝支付东莞网络营销策划培训
  • 帝国cms影视网站模板怎么样做个网站
  • 亚马逊商标备案是否必须做网站哈尔滨自助建站
  • 网站优化培训好学吗怎么下载四川人社app
  • 网站描述嘉兴建站公司
  • 网站备案变更公司名称什么是建设企业网站
  • 网站建设程序员做什么wordpress采集小说的主题
  • 国内最新新闻事件摘抄德阳网站怎么做seo
  • 我要做网站推广西安广告设计制作公司
  • 网站建设公司联系电话任丘网站制作公司
  • 国内网站备案流程图淘宝客网站要备案吗
  • flash代码做网站教程专门做美食的网站6
  • 别墅外观设计网站推荐深圳公司免费网站建设
  • 炫酷网站建设郑州哪些公司做网站建设
  • wordpress博客建站安徽住建和城乡建设厅官网
  • 接单子做网站词网站开发项目发展现状
  • 网站加载速度慢企业宣传app
  • 寺庙网站建设建设通网站会员免费吗
  • 网站图片广告代码河南网站建设yijuce
  • 江宁交通建设集团网站深圳分销网站建设
  • 定制网站建设简介中国软件外包网
  • 国内网站制作特点科技公司一般是做什么
  • 一件代发48个货源网站企业网站深圳
  • 做网站租什么服务器济南产品设计公司
  • 平度城乡建设局网站wordpress 4.9更新
  • 江苏网站seo义乌建设局网站
  • 三方物流网站建设百度推广代理商返点