ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Edward Ciramella <ecirame...@archivas.com>
Subject Re: Symlink badness. . .
Date Wed, 23 Feb 2005 16:25:57 GMT
Yes - sigh - I've added all this functionality and a series of  
dependencies to test for a symlink and then create them as needed.

I honestly think that branching every folder each time and asking  
people to ignore via client spec is a better solution.


<target name="init" description="Sets up all properties and creates  
symlinks as needed">
   	 <available file="${basedir}/java" type="dir"  
property="dir.java.present"/>
	 <available file="${basedir}/config" type="dir"  
property="dir.config.present"/>
	 <available file="${basedir}/db" type="dir" property="dir.db.present"/>
	 <available file="${basedir}/install" type="dir"  
property="dir.install.present"/>
	 <available file="${basedir}/qa" type="dir" property="dir.qa.present"/>
	 <available file="${basedir}/tools" type="dir"  
property="dir.tools.present"/>
	 <available file="${basedir}/scripts" type="dir"  
property="dir.scripts.present"/>
	 <available file="${basedir}/csrc" type="dir"  
property="dir.csrc.present"/>
   	 <property name="dir.main" location="${basedir}/../main"/>
      <available file="${dir.main}" type="dir"  
property="dir.main.present"/>
      <fail message="The main branch is unavailable, please sync it and  
try again." unless="dir.main.present"/>
      <antcall target="ln-mk-all"/>
      <echo message="setup complete"/>
      <property file="${basedir}/version.properties"/>
      <property name="ver.curr"  
value="${ver.main}.${ver.minr}.${ver.bld}.${ver.ptch}"/>
      <echo message="here is the current version - ${ver.curr}"/>
     </target>


     <!-- - - - - - - - - - - - - - -->
     <!--  Symlink making targets  -->

     <target name="ln-mk-all"  
depends="mk-java-ln,mk-config-ln,mk-db-ln,mk-install-ln,mk-qa-ln,mk- 
tools-ln,mk-scripts-ln,mk-csrc-ln"/>

     <target name="ln-rm-all" description="Removes all symlinks">
      <symlink action="delete" link="${basedir}/java"  
failonerror="false"/>
      <symlink action="delete" link="${basedir}/config"  
failonerror="false"/>
      <symlink action="delete" link="${basedir}/db" failonerror="false"/>
      <symlink action="delete" link="${basedir}/install"  
failonerror="false"/>
      <symlink action="delete" link="${basedir}/qa" failonerror="false"/>
      <symlink action="delete" link="${basedir}/tools"  
failonerror="false"/>
      <symlink action="delete" link="${basedir}/scripts"  
failonerror="false"/>
      <symlink action="delete" link="${basedir}/csrc"  
failonerror="false"/>
     </target>

     <target name="mk-java-ln" unless="dir.java.present">
      <echo message="${basedir}/java does not exist"/>
      <symlink link="${basedir}/java" resource="../main/java"  
overwrite="true" failonerror="false"/>
     </target>
     <target name="mk-config-ln" unless="dir.config.present">
      <echo message="${basedir}/config does not exist"/>
      <symlink link="${basedir}/config" resource="../main/config"  
overwrite="true" failonerror="false"/>
     </target>
     <target name="mk-db-ln" unless="dir.db.present">
      <echo message="${basedir}/db does not exist"/>
      <symlink link="${basedir}/db" resource="../main/db"  
overwrite="true" failonerror="false"/>
     </target>
     <target name="mk-install-ln" unless="dir.install.present">
      <echo message="${basedir}/install does not exist"/>
      <symlink link="${basedir}/install" resource="../main/install"  
overwrite="true" failonerror="false"/>
     </target>
     <target name="mk-qa-ln" unless="dir.qa.present">
      <echo message="${basedir}/qa does not exist"/>
      <symlink link="${basedir}/qa" resource="../main/qa"  
overwrite="true" failonerror="false"/>
     </target>
     <target name="mk-tools-ln" unless="dir.tools.present">
      <echo message="${basedir}/tools does not exist"/>
      <symlink link="${basedir}/tools" resource="../main/tools"  
overwrite="true" failonerror="false"/>
     </target>
     <target name="mk-scripts-ln" unless="dir.scripts.present">
      <echo message="${basedir}/scripts does not exist"/>
      <symlink link="${basedir}/scripts" resource="../main/scripts"  
overwrite="true" failonerror="false"/>
     </target>
     <target name="mk-csrc-ln" unless="dir.csrc.present">
      <echo message="${basedir}/csrc does not exist"/>
      <symlink link="${basedir}/csrc" resource="../main/csrc"  
overwrite="true" failonerror="false"/>
     </target>

     <!-- End Symlink making targets  -->
     <!-- - - - - - - - - - - - - - -->


On Feb 23, 2005, at 11:18 AM, Matt Benson wrote:

> --- Mark Lundquist <mlundquist2@comcast.net> wrote:
> [SNIP]
>>
>> I'm no Ant guru, but here are some suggestions:
>>
>> — you could just punt on <symlink>, and just <exec>
>> an ln -shf...?
>>
>> — or, use <available file=""> and the "unless"
>> attribute on something
>> so that you only make the link if the directory
>> doesn't exist...
>
> I think EJ's ultimate solution is going to involve
> that, but there may be some changes to make to the
> symlink task as well regarding directories and so on,
> just to get the task's behavior in line with the
> expectations raised by its documentation.
>
> -Matt
>>
>> ~Mark
>>
>>
>>
> ---------------------------------------------------------------------
>> To unsubscribe, e-mail:
>> user-unsubscribe@ant.apache.org
>> For additional commands, e-mail:
>> user-help@ant.apache.org
>>
>>
>
>
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam protection around
> http://mail.yahoo.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>
>


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


Mime
View raw message