ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Nico Seessle" <Nico.Sees...@epost.de>
Subject Re: script task
Date Tue, 02 Jan 2001 10:07:17 GMT
----- Original Message -----
From: "Marco Struck" <M.Struck@PopNet.de>
To: <ant-user@jakarta.apache.org>
Sent: Tuesday, January 02, 2001 10:22 AM
Subject: 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 ?
>

The following objects are available in the script-context:

- properties, accessible by their names
- user properties, accessible by their names
- targets, accessible by their names
- "references" (elements having an id?) , accessible by their names

(everything is available only if it has an valid java-name (i.e. no dots)

> 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:
>

Should be, since you can call myProject.getProperty('prop1'); ... (replace
myProject with the *real* name of your project). And you can use properties
with dots included if you use it like this.

This is from a "real" build-file:

    <script language="javascript"> <![CDATA[
        var buildNumber =
parseInt(VAMOS50.getProperty('product.build.minor'));
        if (isNaN(buildNumber)) buildNumber = 0;
        buildNumber = buildNumber + 1;
        VAMOS50.setProperty('product.build.minor', buildNumber);
    ]]></script>

Nico





Mime
View raw message