Thanks for your help:

> ----- Original Message -----
> From: "Nick Bauman" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Tuesday, January 22, 2002 8:29 AM
> Subject: properties files aren't getting included
> 
> 
>> Am I just being stupid? I have some properties files in my project
>> that ant seems to ignore when making a jar. I looked at the
>> documentation and I searched the archives and couldn't find anything
>> relevant on this subject.
> 
> I assume you have the properties files next to the java source right?

Yes, it's in my src/ in a subpackage, right alongside my code.

> And then you jar up the compiled classes in the build directory, right?

Yup.
 
> If these two guesses are correct, how are you getting the properties
> from the source dir to the build dir?

I'm not. That's the problem, then. I need some kind of parameter to 
the "dist" task to keep the properties with the compiled classes.   
> -steve

here's my ant build.xml:

<project name="foo" default="dist" basedir=".">

<!-- set global properties for this build -->
<property name="src" value="src" />
<property name="build" value="classes"/>
<property name="dist" value="lib"/>
<property name="javadoc" value="${dist}/doc"/>
<property name="rel" value="/usr/local/servlet/lib"/>
<property name="jarfile" value="foo.jar"/>
<property name="project" value="foo"/>
<property name="nightly" value="/usr/local/apache/dr/org/nightly"/>
<property name="build.compiler" value = "jikes"/>
<property name="build.compiler.emacs" value = "true"/>

<target name="default">
<tstamp/>
<mkdir dir="${build}"/>
</target>

<target name="compile" depends="default">
<!-- compile the java code from ${src} into ${build} -->
<javac srcdir="${src}" destdir="${build}" debug="on" deprecation="on">
<classpath>
<pathelement path="${classpath}"/>
<fileset dir="/usr/local/jdk13/jre/lib">
<include name="**/*.jar"/>
</fileset>
<fileset dir="lib">
<include name="**/*.jar"/>
</fileset>
<fileset dir="lib/external-libs">
<include name="**/*.jar"/>
</fileset>
<pathelement location="classes"/>
</classpath>
</javac>
</target>

<target name="dist" depends="compile">
<jar jarfile="${dist}/${jarfile}" basedir="${build}"/>
</target>

<target name="nightly" depends="clean,compile,javadoc">
<!-- Put everything in ${build} into the MyProject-${DSTAMP}.jar file -->
<jar jarfile="${nightly}/${project}-${DSTAMP}.jar" basedir="${build}"/>
</target>

<target name="release" depends="compile">
<jar jarfile="${rel}/${jarfile}" basedir="${build}"/>
</target>

<target name="clean">
<!-- Delete the ${build} and ${dist} directory trees -->
<delete dir="${build}/org"/>
<delete dir="${javadoc}"/>
<delete dir="bak"/>
<delete file="${dist}/${jarfile}"/>
</target>

<target name="javadoc">
<tstamp/>
<mkdir dir="${javadoc}"/>
  <javadoc packagenames="org.*, doc.*"
           sourcepath="src"
           classpath="${classes}:${classpath}"
           destdir="${javadoc}"
           author="true"
           Private="true"
           version="true"
           use="true"
           windowtitle="Foo API"
           doctitle="Foo Javadoc">
  </javadoc>
</target>
</project>

-- 
Nick Bauman 


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to