多应用+插件架构,代码干净,二开方便,首家独创一键云编译技术,文档视频完善,免费商用码云13.8K 广告
# H.2 Targets H.2.1 Example ``` <target if="lang" unless="lang.en" depends="foo1,foo2" name="main" description="This is an example target" > <!-- everything else goes here --> </target> ``` The target defined in the example above is only executed, if the property `${lang}` is set and the property `${lang.en}` is not set. Additionally, it depends on the targets `foo1` and `foo2`. That means, the targets `foo1` and `foo2` are executed before the target `main` is executed. The name of the target is `main` and it also has a description. H.2.2 Attributes Table H.2:聽Parameters NameTypeDescriptionDefaultRequired`depends``String`One or more names of targets that have to be executed before this target can be executed.n/aNo`description``String`A free text description of the target.n/aNo`if``String`The name of the property that is to be set if the target is to be executed.n/aNo`name``String`The name of the targetn/aYes`unless``String`The name of the property that is to be set if the target is not to be executed.n/aNo`hidden``Boolean`Whether or not to include this target in the list of targets generated by `phing -l`FalseNo`logskipped``Boolean`Whether to log message as INFO instead of VERBOSE if target is skippedFalseNo ### Caution The if and unless attributes only enable or disable the target to which they are attached. They do not control whether or not targets that a conditional target depends upon get executed. In fact, they do not even get evaluated until the target is about to be executed, and all its predecessors have already run.