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: include source with jar
Date Thu, 27 Jan 2005 13:00:44 GMT
<jar> does not include source files nor class files.
It includes only files :-)

So you have to specify where the sources are.
<jar manifest="${outputDir}/MANIFEST.MF">
    <fileset dir="${outputDir}"/>

    <fileset dir="${srcDir}"/>
    <!-- or -->
    <zipfileset dir="${srcDir}" prefix="src"/>    
</jar>


Jan


> -----Urspr√ľngliche Nachricht-----
> Von: THUFIR HAWAT [mailto:thufir.hawat@mail.com]
> Gesendet am: Donnerstag, 27. Januar 2005 13:26
> An: user@ant.apache.org
> Betreff: include source with jar
> 
> I'd like to change the .jar file created to include all the 
> source code, but can't find the syntax.  How do I do that, pls?
> 
> 
> 
> <?xml version="1.0" encoding="ISO-8859-1"?>
> <project name="monsters" default="package">
> 
> 	<property name="outputDir" value="C:\java\classes\" />
> 	<property name="sourceDir"
> 	value="C:\java\sources\atreides\monsters\" />
> 	<property name="mainClass" value="TestDriveMonsters" />
> 
> 	<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}"
> 		debug="on" />
> 	</target>
> 
> 	<target name="manifest" depends="compile">
> 		<manifest file="${outputDir}/MANIFEST.MF">
> 			<attribute name="Main-Class" 
> 			value="atreides.monsters.${mainClass}" />
> 		</manifest>
> 	</target>
> 
> 	<target name="package" depends="manifest">
> 		<jar jarfile="${outputDir}/${mainClass}.jar"
> 		basedir="${outputDir}"
> 		manifest="${outputDir}/MANIFEST.MF" />
> 	</target>
> 
> </project>
> 
> -- 
> ___________________________________________________________
> Sign-up for Ads Free at Mail.com
> http://promo.mail.com/adsfreejump.htm
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
> 

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message