你使用Ant的<&依靠GT;任务? [英] Do you use ant's <depend> task?

查看:137
本文介绍了你使用Ant的<&依靠GT;任务?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

借助文档蚂蚁的任务规定:

的依赖任务的性能
  取决于许多因素,例如
  作为阶级关系的复杂性和
  有多少类文件已经过时。
  它是否是决定
  便宜,只是重新编译所有类
  或使用取决于任务将取决于
  你的项目的规模,以及如何
  您的相互关联类。

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.

我怀疑是使用任务调用可能加快构建我的工作项目之前,可能prevent需要清洁在某些情况下建立。然而,蚂蚁文档对于这个任务很神秘,我可以使用一些澄清。我用含有约SRC 16K类和4K班testsrc大code的基础工作。我们建立包含有关类的四分之一核心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的<&依靠GT;任务?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆