ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael Ludwig <mil...@gmx.de>
Subject Re: Trouble with <copy> and <DirSet>
Date Fri, 10 Sep 2010 18:52:06 GMT
Aaron Mackley schrieb am 10.09.2010 um 13:06 (-0500):
> With a few adjustments, I got it to work correctly. The following code
> copied the one file (prefs.js) to the randomly generated folder
> location: (I've added some comments for anyone who follows this thread
> later.)

Cool. I copied this, and produced another (otherwise pointless) sample
for illustrative and archival purposes.

<project>
  <property environment="env"/>
  <property name="firefox.dir"
    value="${env.APPDATA}/Mozilla/FireFox/Profiles"/>

  <!-- Random dir where firefox puts the user profile. -->
  <path id="path.firefox.default.profile">
    <dirset dir="${firefox.dir}">
      <include name="**/*.default" />
    </dirset>
  </path>

  <!-- This is the trick to get the string
       value of the @id into a property.   -->

  <property name="firefox.default.profile.dir"
    location="${toString:path.firefox.default.profile}" />

  <echo>${firefox.default.profile.dir}</echo>
</project>

-- 
Michael Ludwig

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


Mime
View raw message