ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Marco Struck <M.Str...@PopNet.de>
Subject AW: script task
Date Tue, 02 Jan 2001 09:55:28 GMT
ok ok ok - it works,

    <target name="prescript">
        <script language="javascript"> <![CDATA[

        function print(msg) {
            echo = TestProject.createTask("echo");
            script.addTask(echo);
            echo.setMessage(msg);
        }

        properties = TestProject.getProperties();
        propertyKeys = properties.keys();
        
        while (propertyKeys.hasMoreElements()) {
            key = propertyKeys.nextElement()
            print(key + " = " + properties.get(key));
        }

        ]]> </script>
    </target>

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



-----Urspr√ľngliche Nachricht-----
Von: Marco Struck [mailto:M.Struck@PopNet.de]
Gesendet am: Dienstag, 2. Januar 2001 10:22
An: 'ant-user@jakarta.apache.org'
Betreff: script task

hi,

we are able to use the <script> task at last again.
but could somebody tell me which objects I am able to access from script ?

I've seen, that it's possible to access the project object, but what is
about environments,
properties and so on ?!

is it possible to check variables with <script>, instead of this construct:

 <target name="check_customer.name" unless="customer.name">
     <fail message="Error: Missing property customer.name" />
 </target>

 <target name="check_customer.project" unless="customer.project">
    <fail message="Error: Missing property customer.project" />
 </target>

 <target name="check_customer.psi" unless="customer.psi">
    <fail message="Error: Missing property customer.psi" />
 </target>

 <target name="create" depends="check_customer.name, check_customer.project,
check_customer.psi">
       ....


Mime
View raw message