你用ant的<depend>吗?任务?

编程入门 行业动态 更新时间:2024-10-13 12:24:24
本文介绍了你用ant的<depend>吗?任务?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

限时送ChatGPT账号..

蚂蚁任务的文档 指出:

依赖任务的性能是取决于许多因素,例如作为类关系的复杂性和有多少类文件已过期.关于是否是的决定重新编译所有类更便宜或使用依赖任务将取决于关于您的项目的大小以及如何你的课程是相互关联的.

The performance of the depend task is dependent on a number of factors such as class relationship complexity and how many class files are out of date. The decision about whether it is cheaper to just recompile all classes or to use the depend task will depend on the size of your project and how interrelated your classes are.

我怀疑在调用之前使用任务可能会加快我正在处理的项目的构建速度,并可能在某些情况下阻止对干净构建的需要.但是,ant 文档对于此任务非常神秘,我可以使用一些说明.我使用包含 src 中大约 16k 个类和 testsrc 中 4k 个类的大型代码库.我们构建了一个包含大约四分之一类的核心 jar 文件,然后是大约 15 个其他依赖于 core.jar 而不是彼此的 jar.我只是想尝试一下,但我们的 build.xml 需要大量清理才能进行此更改,无论如何我想更好地理解任务.

I suspect that using the task before calling may speed up the build for the project I work on, and possibly prevent the need for clean builds in certain cases. However, the ant documentation is very cryptic for this task and I could use some clarification. I work with a large code base containing about 16k classes in src and 4k classes in testsrc. We build a core jar file containing about a quarter of the classes, followed by about 15 other jars that depend on the core.jar and not each other. I would just try it out, but our build.xml requires a lot of clean-up before I can make this change, and I want to understand the task better anyway.

推荐答案

你需要非常小心.有一些事情,比如像这样声明常量:

You need to be very careful with this. There are some things, like declaring constants like this:

public static final int FOO = 1;

依赖于任务(和 javac 本身)并不总是能接受(我不是 100% 确定上面的那个会与 Ant 混淆,但我知道有些事情确实如此).

that the depends on task (and javac itself) don't always pick up on (I am not 100% certain that the one above messes with Ant, but I know some things do).

很久以前我确实使用了依赖任务并很快将其删除,因为我一直需要进行完整构建以确保一切正常.

I did use the depend task a long time ago and quickly removed it as I kept needed to do full builds to ensure that things were sane.

这篇关于你用ant的<depend>吗?任务?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

更多推荐

[db:关键词]

本文发布于:2023-04-20 10:02:05,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/980064.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:你用   ant   lt   depend   gt

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!