ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From marco struck <m.str...@nexolution.de>
Subject what is the right way for scripting ?
Date Tue, 09 Jan 2001 15:04:18 GMT
...I don't know if it really works, but for me it seems to be a better way,
to execute tasks directly from script instead of setup another target,
if you use <script> to do some logical decisions - isn't it ? (see sample !)

this:

    <target name="script">
        <script language="javascript"> <![CDATA[
           function print(msg) {
               echo = TestProject.createTask("echo");
               echo.setMessage(msg);
               echo.execute();
           }
           print("hello world");
        ]]> </script>
    </target>

instead of:

    <target name="prescript">
        <script language="javascript"> <![CDATA[
           function print(msg) {
               echo = TestProject.createTask("echo");
               script.addTask(echo);
               echo.setMessage(msg);
           }
           print("hello world");
        ]]> </script>
    </target>

    <target name="script" depends="prescript" />

--
mit freundlichen grüßen / best regards
marco struck
----------------------------------------------------
email: mailto:m.struck@nexolution.de

public key: http://www.nexolution.de/keys/public/mstruck.asc
fingerprint: CC99 1171 0F0F E7F4 D649  D332 3C84 8C3C E80E 7EAA


Mime
View raw message