ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 23539] New: - Add a relativeTo attribute to the pathconvert task
Date Wed, 01 Oct 2003 11:24:04 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=23539>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=23539

Add a relativeTo attribute to the pathconvert task

           Summary: Add a relativeTo attribute to the pathconvert task
           Product: Ant
           Version: 1.5.4
          Platform: Other
        OS/Version: Other
            Status: NEW
          Severity: Enhancement
          Priority: Other
         Component: Core tasks
        AssignedTo: dev@ant.apache.org
        ReportedBy: stefanf@althingi.is


I would like to specify a relativeTo attribute to the pathconvert task. 
 
This would return the pathset with relative paths from a specific directory.  
This would be useful for example in setting the classpath entry in a jar 
manifest file: 
 
<property name="lib.dir" location="lib"/> 
 
<target name="foo"> 
        <!-- Create a property that contains all the libraries  
              (apart from the JBoss ones) that need to be put  
              in the Class-Path attribute of the EJB jar manifest --> 
 
        <fileset id="ejb.lib" dir="${lib.dir}"  
                       includes="*.jar" excludes="*jboss*"/> 
 
        <!-- 
             It would be very good to be able to specify a  
             relativeTo attribute to the pathconvert task and supply  
             a pathname to which the converted path would be relative  
             to.  The output would then be for example: 
               Relative to ${basedir}: "lib/foo.jar lib/bar.jar" 
               Relative to ${basedir}/lib: "foo.jar bar.jar" 
               Relative to ${basedir}/lib/baz: "../foo.jar ../bar.jar" --> 
        <pathconvert property="ejb.lib.prop" pathsep=" "  
                       refid="ejb.lib"> 
            <!-- The trailing slash is necessary because otherwise I'll 
                 end up with something like "/foo.jar" which will be 
                 regarded as an absolute path.  This will also only work 
                 on linux because I'm using the / character... I'll change 
                 it so that it uses the native path seperator char. --> 
            <map from="${lib.dir}/" to=""/> 
        </pathconvert> 
 
        <!-- Create the server side EJB jar --> 
        <jar destfile="${dist.dir}/${ejb.file.name}" basedir="${build.dir}"> 
            <metainf dir="${ejb.descriptors.src.dir}" includes="ejb-jar.xml"/> 
            <manifest> 
                <attribute name="Class-Path" value="${ejb.lib.prop}"/> 
            </manifest> 
        </jar> 
</target>

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


Mime
View raw message