ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Pavel " <ppereva...@bridium.com>
Subject Re: How to get current project in <script>?
Date Wed, 04 Jul 2001 03:31:03 GMT
In your example "test" means a current project name. My goal
is to have common target which I can include in main build.xml
like this:

<!DOCTYPE project [
     <!ENTITY common SYSTEM "file:../common.xml">
]>

where common.xml has target like this:

<target name="verifyUserInput" description="Validates user input.">
  <script language="javascript"><![CDATA[
  propertyName = project.getProperty("param.verify.property.name");
  input = project.getProperty(propertyName);
  msg = project.getProperty("param.verify.fail.msg");
  fail = project.createTask("fail");
  if (input == null){
    fail.setMessage(msg);
    fail.execute();
  }
  ]]></script>
</target>

So for me it is important to make this target "verifyUserInput" independent from main build.xml
and be able to find in which
project this common target was included.

Thank you,

Paul
---------- Original Message ----------------------------------
From: Diane Holt <holtdl@yahoo.com>
Reply-To: ant-user@jakarta.apache.org
Date: Tue, 3 Jul 2001 19:07:50 -0700 (PDT)

>--- Paul Perevalov <pperevalov@bridium.com> wrote:
>> Hi,
>> 
>> I'd like to know how to get a reference to the current project without
>> knowing its name within a script (javascript).
>
>This works for me:
>
>  projname = test.getUserProperty("ant.project.name")
>
>Diane
>
>=====
>(holtdl@yahoo.com)
>
>
>
>__________________________________________________
>Do You Yahoo!?
>Get personalized email addresses from Yahoo! Mail
>http://personal.mail.yahoo.com/
>

Mime
View raw message