Running yuicompressor with Ant

jashaw
jashaw used Ask the Experts™
on
I use Ant in Netbeans to run yuicompressor over a set of javascript files as part of my PHP project build process.

I already have it running beautifully on all the .js files in a single directory, but I want to also run it over this sort of structure:

 /A/B/C/a.js
 /A/B/D/b.js
 /A/B/E/c.js
 /A/B/F/d.js
 /A/B/G/e.js

and end up with minified files like this:

 /A/B/C/a-min.js
 /A/B/D/b-min.js
 /A/B/E/c-min.js
 /A/B/F/d-min.js
 /A/B/G/e-min.js

I can't get my head around the Ant build file stuff needed to select the input files and map the output files to do this.
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Top Expert 2016
Commented:
Try using a fileset in your compression task:


<fileset dir="/A/B" >
	<include name="**/*.js" />
</fileset>

Open in new window

Author

Commented:
Perfect!

Thanks
Top Expert 2016

Commented:
:-)

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial