R
Rhino
I suppose this is largely offtopic since it is not specifically a Java
question but it relates to Java code and I haven't been able to get an
answer on the appropriate Ant mailing list so I hope you can forgive me for
asking here.
---
I'm trying to use classfileset to build a jar for the first time but it
doesn't seem to be recursing the way I expected.
This is my target:
<!--==============================================================
Jar everything together into one big jar.
==============================================================-->
<target name="Jar_all" description="Jar all classes that are needed by Foo
project.">
<classfileset id="reqdClasses" dir="${bin.dir}">
<root classname="mydomain.foo.Foo"/>
</classfileset>
<delete file="${jar.dir}/All.jar" description="delete old jar"/>
<jar destfile="${jar.dir}/All.jar" description="create new jar">
<fileset refid="reqdClasses"/>
</jar>
</target>
When I run it, the jar contains only three class files (and a manifest):
mydomain.foo.Foo.class
mydomain.foo.FooConstants.class
mydomain.foo.FooPreferences.class
mydomain.foo.Foo is indeed the main class of the program and it is indeed
dependent on mydomain.foo.FooConstants and mydomain.foo.FooPreferences.
Unfortunately, none of the classes that *they* depend on are present in the
jar. There are quite a few of them, all belonging to packages starting with
mydomain.common.
I assume that I've written the target incorrectly and have omitted something
that tells Ant to recurse to find the dependencies of the dependencies but I
can't find any clarification of this in the manual.
Could someone please confirm that the classfileset *does* find dependencies
recursively and explain what I need to change in my target to make the
recursion take place?
If classfileset does not recurse, can anyone suggest any other way in which
Ant could be used to build a jar containing my main class and *ALL* of its
dependents, not just the immediate 'children' but all of the
'grandchildren', 'great-grandchildren' etc.?
--
Rhino
---
rhino1 AT sympatico DOT ca
"There are two ways of constructing a software design. One way is to make it
so simple that there are obviously no deficiencies. And the other way is to
make it so complicated that there are no obvious deficiencies." - C.A.R.
Hoare
question but it relates to Java code and I haven't been able to get an
answer on the appropriate Ant mailing list so I hope you can forgive me for
asking here.
---
I'm trying to use classfileset to build a jar for the first time but it
doesn't seem to be recursing the way I expected.
This is my target:
<!--==============================================================
Jar everything together into one big jar.
==============================================================-->
<target name="Jar_all" description="Jar all classes that are needed by Foo
project.">
<classfileset id="reqdClasses" dir="${bin.dir}">
<root classname="mydomain.foo.Foo"/>
</classfileset>
<delete file="${jar.dir}/All.jar" description="delete old jar"/>
<jar destfile="${jar.dir}/All.jar" description="create new jar">
<fileset refid="reqdClasses"/>
</jar>
</target>
When I run it, the jar contains only three class files (and a manifest):
mydomain.foo.Foo.class
mydomain.foo.FooConstants.class
mydomain.foo.FooPreferences.class
mydomain.foo.Foo is indeed the main class of the program and it is indeed
dependent on mydomain.foo.FooConstants and mydomain.foo.FooPreferences.
Unfortunately, none of the classes that *they* depend on are present in the
jar. There are quite a few of them, all belonging to packages starting with
mydomain.common.
I assume that I've written the target incorrectly and have omitted something
that tells Ant to recurse to find the dependencies of the dependencies but I
can't find any clarification of this in the manual.
Could someone please confirm that the classfileset *does* find dependencies
recursively and explain what I need to change in my target to make the
recursion take place?
If classfileset does not recurse, can anyone suggest any other way in which
Ant could be used to build a jar containing my main class and *ALL* of its
dependents, not just the immediate 'children' but all of the
'grandchildren', 'great-grandchildren' etc.?
--
Rhino
---
rhino1 AT sympatico DOT ca
"There are two ways of constructing a software design. One way is to make it
so simple that there are obviously no deficiencies. And the other way is to
make it so complicated that there are no obvious deficiencies." - C.A.R.
Hoare