Avatar of abcast
abcast
 asked on

using ant to call 2 other buildfiles

I have already looked at the core tasks section in the ant manual.  The examples provided do not seem to run, and appear to be poor examples at that.

I have two buildfiles:
test/build.xml
test1/build.xml

my basedir can be "."

How can I construct a buildfile that will call these two buildfiles?
Java

Avatar of undefined
Last Comment
CEHJ

8/22/2022 - Mon
CEHJ

You don't normally do that with Ant. It would be better to call more than one *target*
abcast

ASKER
ok, in each target section, how do I reference another buildfile?
ASKER CERTIFIED SOLUTION
Ajay-Singh

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
abcast

ASKER
What does the "target" mean in this case?  I have read the coretasks doc, and copied the example, but it doesn't seem to work.
I started with Experts Exchange in 2004 and it's been a mainstay of my professional computing life since. It helped me launch a career as a programmer / Oracle data analyst
William Peck
Ajay-Singh

target is the target you want to call from the build file. If you want to call default target, you don't need this at all.
abcast

ASKER
this doesn't seem to work.  no errors, but the antfile is never called.
abcast

ASKER
actually, it is working.  however, the target buildfile isn't running the same as if I run it stand-alone
Get an unlimited membership to EE for less than $4 a week.
Unlimited question asking, solutions, articles and more.
Ajay-Singh

> however, the target buildfile isn't running the same as if I run it stand-alone
How is this different?
abcast

ASKER
If I run the master buildfile, the jar file generated by the target buildfile is generate in the base directory of the master buildfile.  This is not what I want.
Ajay-Singh

you can change the working folder of the ant files,

<ant antfile="build1.xml" dir="dir1" />
Experts Exchange is like having an extremely knowledgeable team sitting and waiting for your call. Couldn't do my job half as well as I do without it!
James Murphy
abcast

ASKER
...and I just realized that my target buildfile is generate a jar with two of every file.  As you can tell, I'm new to ant.
abcast

ASKER
looks like that worked...
SOLUTION
Log in to continue reading
Log In
Sign up - Free for 7 days
Get an unlimited membership to EE for less than $4 a week.
Unlimited question asking, solutions, articles and more.
CEHJ

:-)
Get an unlimited membership to EE for less than $4 a week.
Unlimited question asking, solutions, articles and more.