Tôi đang xem qua tài liệu đi kèm với Apache Ant phiên bản 1.8.0 và không thể tìm thấy nơi mà classpath, đường dẫn và pathelement được ghi lại. Tôi đã tìm thấy một trang mô tả đường dẫn như cấu trúc nhưng nó không liệt kê các thuộc tính hợp lệ hoặc các phần tử lồng nhau cho các cấu trúc này. Một thứ khác mà tôi không thể tìm thấy trong tài liệu là mô tả về mối quan hệ giữa filelist, fileset, patternset và đường dẫn và cách chuyển đổi chúng qua lại. Ví dụ, phải có một cách dễ dàng hơn để biên dịch chỉ những lớp đó trong một gói trong khi loại bỏ tất cả các phụ thuộc lớp trên các lớp gói và cập nhật tài liệu.Đường dẫn lớp, đường dẫn và đường dẫn được tài liệu trong Ant phiên bản 1.8.0 ở đâu?
<!-- 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}/*[email protected]{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>
Lưu ý có một số chuyển đổi giữa filesets, đường dẫn và danh sách được phân tách bằng dấu phẩy chỉ để có được 'loại' phù hợp cần thiết cho các tác vụ kiến khác nhau. Có cách nào để đơn giản hóa điều này trong khi vẫn xử lý các tệp ít nhất trong cấu trúc thư mục phức tạp?
Tôi ước gì tôi có thể bỏ phiếu lên hơn này. Các trang người đàn ông cho 'ant' hoàn toàn hút. Họ là vô giá trị. – jww