ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From <Jan.Mate...@rzf.fin-nrw.de>
Subject AW: Using path/refid for manifest classpath
Date Thu, 19 Oct 2006 08:50:15 GMT
For changing the backslash to slash, just set the dirsep-attribute on pathconvert.

For a better way ... there was something DD said ... oh yes: the new (1.7) <manifestclasspath>
task ...


Jan
 

>-----Urspr√ľngliche Nachricht-----
>Von: Lars Monsees [mailto:l.monsees@atlantisgmbh.de] 
>Gesendet: Donnerstag, 19. Oktober 2006 09:35
>An: user@ant.apache.org
>Betreff: Using path/refid for manifest classpath
>
>Hello,
>
>I just started using ANT within Eclipse. I have an application 
>that gets deployed as a JAR file.
>To construct the classpath within the manifest, I first stated 
>all used libs manually in the build.xml but thought that there 
>has to be a better solution to this.
>
>So, I now use a path that gets converted via pathconvert to 
>remove the preceding basedir (second "-->"). This works but 
>the manifest contains a backslash in the classpath: 
>"Class-Path: lib\app-shared-0.3.0.jar".
>
>Here are parts of my build.xml:
>
>	<path id ="external.lib">
>		<fileset dir="${lib}">
>			<include name="**/*.jar"/>
>		</fileset>
>	</path>
>
>
>	<target name="compile" depends="init" 
>description="compile the source">
>		<buildnumber/>
>
>		<!-- Compile the java code from ${src} into ${build} -->
>-->		<javac srcdir="${src}" destdir="${build}"
>classpathref="external.lib"/>
>	</target>
>
>
>	<target name="generateJAR" depends="compile"
>description="generate the jarfile">
>
>		<pathconvert property="dingens" refid="external.lib">
>			<globmapper from="${basedir}\" to=""/>
>		</pathconvert>
>
>		<!-- Create the manifest -->
>		<manifest file="${jar.manifest}">
>
>			<attribute name="Built-By"
>value="${user.name}"/>
>			<attribute name="Main-Class"
>value="${jar.mainclass}"/>
>
>-->			<attribute name="Class-Path"
>value="${dingens}"/>
>		</manifest>
>		<!-- Put everything in ${build} into the jar file -->
>		<jar jarfile="${jar.file}" basedir="${build}"
>manifest="${jar.manifest}"/>
>	</target>
>
>
>
>Although the JAR works I would like to know if there is a 
>better way. I already searched with google, in the faqs and in 
>the wiki.
>
>
>Cheers
>Lars
>
>---------------------------------------------------------------------
>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