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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]