ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Antoine Levy-Lambert <anto...@antbuild.com>
Subject AW: Environment variables with $$
Date Sun, 28 Sep 2003 17:10:42 GMT
1) $$DESKTOP as part of a property value does  not mean anything special for
ant
2) the interpretation which springs to my mind is : the build file writer
designed this property "providers" so that its value
"${portaldir}/$$DESKTOP/classes/portal/providers/" be usable as an argument
for a shell script. The shell interpreter would then expand the property
value, not ant.

Also, it seems that $$ as part of a property value is understood just the
same as $ by ant :

<project name="testdol">
<property name="twodols" value="twodols$$twodols"/>
<property name="onedol" value="onedol$onedol"/>
<echo>
onedol=${onedol}
twodols=${twodols}
</echo>

</project>

 ant -f testdol.xml
Buildfile: testdol.xml
     [echo]
     [echo] onedol=onedol$onedol
     [echo] twodols=twodols$twodols
BUILD SUCCESSFUL
Total time: 0 seconds




Antoine
-----Ursprungliche Nachricht-----
Von: Duncan Strang [mailto:dstrang@ukeu.com]
Gesendet: Freitag, 26. September 2003 18:31
An: user@ant.apache.org
Betreff: Environment variables with $$


Hi

I have an ant build script that contains the following target

   <target name="init">
      <filter filtersfile="${filtersfile}" />
      <tstamp>
         <format property="build.sdate" pattern="yyMMdd" />
      </tstamp>
      <copy todir="${tmpdir}" filtering="true" >
          <fileset dir="${build}/packages" />
      </copy>
      <property name="providers"
                value="${portaldir}/$$DESKTOP/classes/portal/providers/"
/>
      <echo>Just set a property called providers this has the value
${providers}
   </target>

I'm trying to understand the semantics of the $$DESKTOP bit.
I have similar statements all through my 5000 line build.xml
I have been told that DESKTOP is a 'simple environment variable' however
I have set a variable in my .profile file (Solaris 8) with the value
foobar. I can access this from the shell with echo $DESKTOP, I get
foobar back
When I run the init target I was expecting to get
/myportal/dist/foobar/classes/portal/providers/
Instead I got
/myportal/dist/$DESKTOP/classes/portal/providers/

I have the book 'Java development with ant' by Hatcher and Loughran,
they talk about using the env prefix to access environment variables. I
have searched build.xml and I can find no reference to anything that
looks like it is setting or retrieving an ev.

I have also had a look round the archives, once again all I see is the
env prefix stuff.

Can anyone explain the semantics of $$DESKTOP.

Many Thanks
Duncan




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


Mime
View raw message