English 中文(简体)
A. 与Antonio不同顾问办公室的不同目标
原标题:Different targets on Different OS with Ant
  • 时间:2010-12-23 16:26:55
  •  标签:
  • ant

我的具体目标是,除非我ant在赖恩(没有有人用Windows)上。

<target name="jar.all" depends="clean,compile.nic,jar,jar.resources"/>

我不想登上Windows的具体目标是:compile.nic

我如何能够这样做?

最佳回答

将财产列入您的汇编。

<target name="compile.nic" if="windowsos">

在达到目标之前使用这种条件

<condition property="windowsos">
  <os family="windows" />
</condition>

<condition property="linuxos">
  <os family="unix" />
</condition>
问题回答

这里是Windows诉UNIX指挥公司的一个真实世界实例。 ELSE改进了以前的答复。

<condition property="maven.executable" value="mvn.bat" else="mvn">
  <os family="windows" />
</condition>

<target name="clean">
  <exec executable="${maven.executable}">
    <arg value="clean" />
  </exec>
</target>

我能否把安特稿的任务交给专门处理?

此外,一些任务支持<条码>s属性。 例如:

<exec executable="cmd" os="windows"/>

您可以使用<条码>s 设定财产的条件,然后通过添加<条码>>>>>>>> 或<条码>无less属性(取决于您如何界定其财产)来达到你的目标。





相关问题
i want to continously run my java threads

I am running my java application where i have used threads... i am running this application using ant command on the terminal.. But when i close my terminal or press ctrl+c,then java program which was ...

Subant targets instead of ant

I m having a problem with subant and have no ideas any more. Can anyone help? Using Ant to replace some strings for other (i.e Productname and Version for "Foo" and "1.2") I used ...

java ant buildfile for project with dependencies

I am new to ant, but am trying to create an ant script that builds my current proeject with another project as a dependency. I have the ant script building my current project, but am unsure how to add ...

Building Apache Hive - impossible to resolve dependencies

I am trying out the Apache Hive as per http://wiki.apache.org/hadoop/Hive/GettingStarted and am getting this error from Ivy: Downloaded file size doesn t match expected Content Length for http://...

Ivy, ant and start scripts

I have a project that uses ant to build and ivy for dependencies. I would like to generate the start scripts for my project, with the classpath, based on the dependencies configured in Ivy, ...

热门标签