开发者

Odd value for "depends" on target definition

开发者 https://www.devze.com 2023-04-01 13:05 出处:网络
I just inherited some code that has this construct: <target name=\"foo\" depends=\"-read.SOME.STRING, bar1, bar2\">

I just inherited some code that has this construct:

 <target name="foo" depends="-read.SOME.STRING, bar1, bar2">

What does the "-read.SOME.STRING" mean? Never seen that before, and cannot find anything in the docs that refers to a "-read".

Thanks, -开发者_Python百科T


There's nothing particularly special about a dependent target that begins with a -, except that they can't be invoked directly from the Ant command line. This is because any such string on the command line is interpreted as an option for Ant and not as a target name. Targets with leading-minus names are sometimes used for internal targets that are not supposed to be run directly on their own. For example some steps in Android buildfiles and Netbeans buildfiles are so named.

When Ant is run by other means - from an IDE for example - the target can be called. It can also be required to run by means of a dependency like the one you have here. What this means is before running target foo, targets named -read.SOME.STRING, bar1 and bar2 must be run. The actual order they run in might also depend on the dependencies of those targets. For example, if bar2 depends on bar1, bar1 must run before bar2.

There's a write up in the Ant Manual: Targets page.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号