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 35685] New: - convert absolute paths to relative paths
Date Mon, 11 Jul 2005 11:19:31 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=35685>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=35685

           Summary: convert absolute paths to relative paths
           Product: Ant
           Version: 1.6.5
          Platform: Other
        OS/Version: other
            Status: NEW
          Severity: enhancement
          Priority: P3
         Component: Core tasks
        AssignedTo: dev@ant.apache.org
        ReportedBy: mnemo@minimum.se


Hi,

At runtime my program is stored like this:

./myprogram.jar
./lib/commons/commons-net.jar
./lib/commons/commons-configuration.jar
./lib/spring/spring_jar1.jar
./lib/spring/spring_jar2.jar
./lib/some/other/jarfile.jar

And I would like my ANT script to create this .jar file plus manifest 
automatically. I tried this target:

<target name="dist" depends="compile">
   <mkdir dir="${build.dist.dir}/lib"/>
   <copy todir="${build.dist.dir}/lib">
      <fileset dir="${lib.runtime.dir}" includes="**/*.jar"/>
   </copy>
   <path id="manifest.classpath.path">
      <fileset dir="${build.dist.dir}" includes="lib/**/*.jar"/>
   </path>
   <pathconvert property="manifest.classpath.prop" pathsep=" ">
      <path refid="manifest.classpath.path"/>
   </pathconvert>
   <property name="manifest.classpath.prop" refid="manifest.classpath.path"/>
   <jar destfile="${build.dist.dir}/${dist.jar.filename}">
      <fileset dir="${build.classes.dir}" includes="**/*.class"/>
      <manifest>
         <attribute name="Built-By" value="${user.name}"/>
         <attribute name="Main-Class" value="${project.main.class}"/>
         <attribute name="Class-Path" value="${manifest.classpath.prop}"/>
      </manifest>
   </jar>
</target>


However, this target only writes absolute paths which is not allowed or 
practical in the manifest Class-Path. I would like to be able to convert 
absolute paths into relative ones (conversion with respect to some given 
basedir). I looked at the pathconvert task and at a bunch of mappers but none 
of them seem to do what I need.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

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


Mime
View raw message