ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dominique Devienne <DDevie...@lgc.com>
Subject RE: Re[2]: loading build.properties before other properties when it does n't exist before building ...
Date Mon, 09 Sep 2002 22:17:57 GMT
The point is sometime hard to decipher from posts on ant-user ;-)

If I understand the point correctly now, you want users to override be able
to override properties!? I also want something like that, but I also want
users to check in these under CM control. That's why I have the scheme below
which loads many properties files from various locations (it's OK for the
file to be non-existant), with the most often used one being
${basedir}/users/${user.name}. You can have properties specific to a
particular project / machine, or your own global properties.

Hope that helps. --DD

PS: What below is part of my common.xml entity included everywhere.

PS2: <import> is part of the embed proposal, which is compatible with Ant
1.5 (I believe).

  <!-- Provides access to env. vars using ${env.VARNAME} -->
  <property environment="env" />

  <!-- Global and local config files locations. -->
  <property name="global.userconfdir"
            location="${env.COM_LGC_USERS_BUILD_CONFIG_DIR}" />
  <property name="local.userconfdir"
            location="users/${user.name}" />

  <!-- Global, project-specific, and system-project-specific config files.
-->
  <property name="user.configs4" value="build.properties" />
  <property name="user.configs3"
value="${ant.project.name}-${user.configs4}" />
  <property name="user.configs2"
value="${env.COMPUTERNAME}-${user.configs4}" />
  <property name="user.configs1"
value="${env.COMPUTERNAME}-${user.configs3}" />

  <!-- Load user-specific (possibly project-specific) configs,
       first from the global location (if any), then the local one. -->
  <property file="${global.userconfdir}/${user.configs1}" />
  <property file="${global.userconfdir}/${user.configs2}" />
  <property file="${global.userconfdir}/${user.configs3}" />
  <property file="${global.userconfdir}/${user.configs4}" />

  <property file="${local.userconfdir}/${user.configs1}" />
  <property file="${local.userconfdir}/${user.configs2}" />
  <property file="${local.userconfdir}/${user.configs3}" />
  <property file="${local.userconfdir}/${user.configs4}" />

  <!-- Projects own default properties, if any. -->
  <property name="build.properties" location="build.properties" />
  <property file="${build.properties}" />

  <!-- Note that all the property definitions below can be overriden
       in any one of the properties files loaded above!!!
    -->

-----Original Message-----
From: Jacob Kjome [mailto:hoju@visi.com] 
Sent: Monday, September 09, 2002 5:06 PM
To: Ant Users List
Subject: Re[2]: loading build.properties before other properties when it
does n't exist before building ...

Hello Dominique,

Thanks for the suggestion, but that solution misses the point.  

<snip/>

But the point of the sample.build.properties is that each person may
have their own.  Each person can add/change/remove properties from
their own copy of build.properties but we always want to have a
reference available for the standard stuff that goes in
build.properties hence the copy from sample.* to * only if * doesn't
exist.

<snip/>

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


Mime
View raw message