ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From THUFIR HAWAT <hawat.thu...@gmail.com>
Subject RTFM, literally
Date Wed, 16 Mar 2005 01:18:06 GMT
the build file:

<project name="XHTML" default="package2">

	<property name="outputDir" value="java\classes\" />
	<property name="sourceDir" value="java\src\atreides\xhtml\" />
	<property name="mainClass1" value="HelloWorldSwing" />
	<property name="mainClass2" value="Test16" />
	<property name="pkgPath" value="atreides.xhtml." />
	<property name="jarPath" value="java\src\org\w3c\tidy\Tidy.jar" />

	<target name="clean">
		<delete dir="${outputDir}" />
	</target>

	<target name="prepare" depends="clean">
		<mkdir dir="${outputDir}" />
	</target>

	<target name="compile" depends="prepare">
		<javac srcdir="${sourceDir}"
			destdir="${outputDir}"
			classpath="${jarPath}"
		/>
	</target>

	<target name="manifest1" depends="compile">
		<manifest file="${outputDir}/MANIFEST.MF">
			<attribute name="Main-Class" value="${pkgPath}${mainClass1}" />
		</manifest>
	</target>

	<target name="manifest2" depends="manifest1">
		<manifest file="${outputDir}/MANIFEST.MF">
			<attribute name="Main-Class" value="${pkgPath}${mainClass2}" />
		</manifest>
	</target>

	<target name="package1" depends="manifest2">
		<jar jarfile="${outputDir}/${mainClass1}.jar" />
		<manifest>
		</manifest>
	</target>

	<target name="package2" depends="package1">
		<jar jarfile="${outputDir}/${mainClass2}.jar"
		basedir="${outputDir}"
		manifest="${outputDir}/MANIFEST.MF" />
	</target>
</project> 


going through this, I don't understand the line:

<jar jarfile="${outputDir}/${mainClass1}.jar" />

the outputDir determines the path to the jarfile, named mainClass1?

also, I'm getting an error

D:\>
D:\>
D:\>
D:\>
D:\>
D:\>ant
Buildfile: build.xml

clean:
   [delete] Deleting directory D:\java\classes

prepare:
    [mkdir] Created dir: D:\java\classes

compile:
    [javac] Compiling 2 source files to D:\java\classes

manifest1:

manifest2:

package1:
      [jar] Building MANIFEST-only jar: D:\java\classes\HelloWorldSwing.jar
      [jar] Building jar: D:\java\classes\HelloWorldSwing.jar

BUILD FAILED
D:\build.xml:39: the file attribute is required

Total time: 4 seconds
D:\>

but can't find reference to "the file attribute" in the manual.  I've
found an API for ant at
<http://www.jajakarta.org/ant/ant-1.6.1/docs/ja/manual/api/org/apache/tools/ant/taskdefs/Manifest.html>


besides reading the manual front to back, where can I find out about
this "file attribute" and how "jarfile" works?

thanks,

Thufir

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


Mime
View raw message