Conor MacNeill wrote:
Should...?!

Sure. I don't give cast-iron guarantees :-)
But now I do.

To prove I attached two Java classes (Root.java and Dependency.java) and
a build.xml where the Root class is the root of a classfileset which
later is used in a jar task. Root holds a reference to Dependency.class:

  public Class dependency = Dependency.class;

Put the three files into a single folder and run

  build deps

See what's in the jar.

Frank-Michael

BTW:
Notice that javac of course handles Dependency as a dependency of Root
(parsing the source code). But not <classfileset...> can't.

public class Root {
    public Class dependencie = Dependency.class;
}
public class Dependency {
  public Object dummy;
}
<project basedir="." default="deps">

  <target name="deps" description="Build a Jar including the dependencies of class Root">
    <javac destdir="." srcdir="." />
    <classfileset id="deps" dir=".">
      <root classname="Root" />
    </classfileset>
    <jar destfile="Deps.jar">
      <fileset refid="deps" />
    </jar>
  </target>

</project>

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

Reply via email to