Ant question

From: Tim (nocomment_at_rogers.com)
Date: 12/01/03


Date: Mon, 01 Dec 2003 22:45:20 GMT

I'm trying to use Ant to create a jar file. The folder that contains the
class files also contains the source files. I want to use the fileset
tag to only select the class files. It doesn't seem to be working. Can
anybody see what I'm doing wrong or offer another solution to filter out
what I don't want.

<target name="dist" depends="compile"
         description="generate the distribution" >

        <!-- Put everything in ${build} into the MyProject.jar file -->
          <jar jarfile="${dist}/MyProject.jar" basedir="${build}">
                  <fileset dir="${build}">
                           <include name="*.class"/>
                </fileset>
          </jar>
</target>



Relevant Pages

  • Re: java packages
    ... when compiling this package/JavaClass.java, I did it from the parent directory but called the java files by their package/class names ... This making sure the package statements are correctly ... written in the resulting class files. ... Something that might help the OP here is to use the -d switch to javac, which causes the compiler to place the class files in a separate directory from the source files. ...
    (comp.lang.java.programmer)
  • Re: Help with a basic example
    ... Actually javac doesn't care where you put your source files... ... But since most people organize their source files according to the ... This is obviously not a good thing, as you can't run the class files ...
    (comp.lang.java.help)
  • How do you set the class path for groups of class files in nested directories?
    ... There of course relationships between the class files: ... The source files are in the same kind of directory structure. ... If I just put the /or/nis/acs in the classpath it doesn't seem to ... I can get to work if I package everything, ...
    (comp.lang.java.programmer)
  • Re: Directory Structure for java
    ... Instead, the Java compiler gets the defintions of imported classes from their .class files In this case, A ... compiler scan the source files and emit a list of dependency lines ...
    (comp.lang.java.programmer)
  • help needed - decompiling
    ... I just did a really stupid thing and deleted my source files for a recent ... I just tried DJ Java Decompiler but it hasnt worked very well, ... class files which form approximately 18 java files. ...
    (comp.lang.java.help)