zoukankan      html  css  js  c++  java
  • Ant中的classpath

    Code
        <classpath>
          
    <pathelement path="${classpath}"/>
          
    <fileset dir="lib">
            
    <include name="**/*.jar"/>
          
    </fileset>
          
    <pathelement location="classes"/>
          
    <dirset dir="${build.dir}">
            
    <include name="apps/**/classes"/>
            
    <exclude name="apps/**/*Test*"/>
          
    </dirset>
          
    <filelist refid="third-party_jars"/>
        
    </classpath>

    对于classpath标签的两个属性——path和location:
    按照官网上的解释:
    location的值可以是一个文件(file),也可以是一个相对于当前根目录(project的basedir)的文件夹(directory),或者是一个带有绝对路径的文件(文件夹)
    path则表示的是一系列的用分号(“;”)或冒号(“:”)分隔开的location值。
    
    
    当然,也可以如上所示,在classpath标签中使用fileset、dirset,这样省事不少。

    在上面的代码中还提到了一个filelist标签。它代表了一组文件,相当于一个文件集合。但是这个文件集合中的文件并不是一定会存在。filelist的使用方式如下:

    <filelist 
        
    id="docfiles" 
        dir
    ="${doc.src}"
        files
    ="foo.xml,bar.xml"/> 

    <filelist 
        
    id="docfiles" 
        dir
    ="${doc.src}">
        
    <file name="foo.xml"/>
        
    <file name="bar.xml"/>
    </filelist>

    <!-- 其中的${doc.src}/foo.xml,${doc.src}/bar.xml并不一定会存在地 -->
  • 相关阅读:
    arm基础
    数据的封装
    网络安全基础
    qt5学习笔记
    nginx修改配置
    proteus_base1
    20191022
    20191015
    20191014
    20191013
  • 原文地址:https://www.cnblogs.com/ungshow/p/1365663.html
Copyright © 2011-2022 走看看