ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From <Jan.Mate...@rzf.fin-nrw.de>
Subject AW: scriptcondition
Date Fri, 30 Oct 2009 06:08:44 GMT
You cant.
  JavaTasks vs. <scriptdef>
  JavaConditions vs. --

But you could write the condition directly:
  JavaTasks vs. <script>
  JavaConditions vs. <scriptcondition>


Jan


<project default="hello">

  <condition property="german">
    <scriptcondition language="javascript">
        self.setValue(
          java.util.Locale.getDefault() == java.util.Locale.GERMANY
        );
    </scriptcondition>
  </condition>
  <target name="hello.de" if="german">
    <echo>Guten Morgen</echo>
  </target>
  <target name="hello.en" unless="german">
    <echo>Good morning</echo>
  </target>
  <target name="hello" depends="hello.de,hello.en"/>

</project>

>-----Urspr√ľngliche Nachricht-----
>Von: ext-simon.steiner@nokia.com [mailto:ext-simon.steiner@nokia.com] 
>Gesendet: Montag, 12. Oktober 2009 11:51
>An: user@ant.apache.org
>Betreff: scriptcondition 
>
>Hi,
>
>How can I write a scriptcondition macro?
>Eg.
>
><scriptdef name="myscriptcondition" language="beanshell">
>
></scriptdef>
>
><if>
>    <myscriptcondition/>
>    <then>
>
>Thanks
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message