2

From my main build file, I would like to call the same target in multiple other build files. My current solution is to call them separately, like so:

<ant antfile="${lib_src_dir}/mylib1/build.xml" target="build" inheritAll="false"/> <ant antfile="${lib_src_dir}/mylib2/build.xml" target="build" inheritAll="false"/> 

I would like my build file to just call the build target on the build files in all of the subdirectories of ${lib_src_dir}. I know I could use the foreach tasks from ant-contrib, but I'd like to stay away from an external library if possible.

I've tried the following, which didn't work:

<ant antfile="${lib_src_dir}/*/build.xml" target="build" inheritAll="false"/> 
1

2 Answers 2

2

You want the subant task.

Sign up to request clarification or add additional context in comments.

1 Comment

Hah, I just noticed your comment above.
1

Here's what I ended up with, using the subant task:

<subant target="clean"> <fileset dir="${lib_src_dir}" includes="*/build.xml" /> </subant> 

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.