gpt4 book ai didi

ant - Ant 1.8.0 版本中的类路径、路径和路径元素记录在哪里?

转载 作者:行者123 更新时间:2023-12-03 06:41:41 25 4
gpt4 key购买 nike

我正在查看 Apache Ant 版本 1.8.0 附带的文档,但找不到记录类路径、路径和路径元素的位置。我找到了一个描述类似路径的结构的页面,但它没有列出这些结构的有效属性或嵌套元素。我在文档中找不到的另一件事是文件列表、文件集、模式集和路径之间的关系以及如何来回转换它们的描述。例如,必须有一种更简单的方法来仅编译一个包中的那些类,同时删除包类上的所有类依赖项并更新文档。

<!-- Get list of files in which we're interested. -->
<fileset id = "java.source.set"
dir = "${src}">
<include name = "**/Package/*.java" />
</fileset>

<!-- Get a COMMA separated list of classes to compile. -->
<pathconvert property = "java.source.list"
refid = "java.source.set"
pathsep = ",">
<globmapper from = "${src}/*.@{src.extent}"
to = "*.class" />
</pathconvert>

<!-- Remove ALL dependencies on package classes. -->
<depend srcdir = "${src}"
destdir = "${build}"
includes = "${java.source.list}"
closure = "yes" />

<!-- Get a list of up to date classes. -->
<fileset id = "class.uptodate.set"
dir = "${build}">
<include name = "**/*.class" />
</fileset>

<!-- Get list of source files for up to date classes. -->
<pathconvert property = "java.uptodate.list"
refid = "class.uptodate.set"
pathsep = ",">
<globmapper from="${build}/*.class" to="*.java" />
</pathconvert>

<!-- Compile only those classes in package that are not up to date. -->
<javac srcdir = "${src}"
destdir = "${build}"
classpathref = "compile.classpath"
includes = "${java.source.list}"
excludes = "${java.uptodate.list}"/>

<!-- Get list of directories of class files for package. --:
<pathconvert property = "class.dir.list"
refid = "java.source.set"
pathsep = ",">
<globmapper from = "${src}/*.java"
to = "${build}*" />
</pathconvert>

<!-- Convert directory list to path. -->
<path id = "class.dirs.path">
<dirset dir = "${build}"
includes = "class.dir.list" />
</path>

<!-- Update package documentation. -->
<jdepend outputfile = "${docs}/jdepend-report.txt">
<classpath refid = "compile.classpath" />
<classpath location = "${build}" />
<classespath>
<path refid = "class.dirs.path" />
</classespath>
<exclude name = "java.*" />
<exclude name = "javax.*" />
</jdepend>

请注意,文件集、路径和逗号分隔列表之间存在大量转换,只是为了获得不同 ant 任务所需的正确“类型”。有没有办法简化这个过程,同时仍然处理复杂目录结构中最少的文件?

最佳答案

这是我能找到的最接近类路径文档的内容。

http://ant.apache.org/manual/using.html#path

关于ant - Ant 1.8.0 版本中的类路径、路径和路径元素记录在哪里?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2526826/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com