On 9/6/05, Michael Traher <[EMAIL PROTECTED]> wrote: > Hi, We use apache ANT for a number of tasks and present a nice interface to > these tasks via CF. > Currently we call ANT using CFEXECUTE i.e. we run the windows ant.exe.
I'm thinkign you're running ant.bat or ant.cmd in the ant/bin directory -- that's what comes with the distribution from apache.org > There are some issues regarding paths and other odd behaviours and it has > always seemed silly that we are calling a java program (ANT) from a java > program (CF) yet we are doing this via ant.exe! Why's that silly? If it works, it works. But if you're really annoyed by it, take a look at the /bin directory -- there's a perl and python wrapper for ant plus the windows batch and Unix shell wrappers. In each one of these simple wrappers, the goal is basically to grab some environment variables so Ant can be run correctly. These are a fine places to start to translate into a CF wrapper. > So anyone of you clever chaps got some pointers to running ant directly > java style? Unless you've got performance/security/etc issues with CFEXEC, I'd keep it simple. > From the apache site I have this > > java -Dant.home=c:\ant org.apache.tools.ant.Main [options] [target] > > but how do I translate that to a <cfobject> and method call? First you're going to have to create the Main object, using <cfobject>, then you'll need to run one of it's methods, probably main(), which takes a Java string array containing all the command line parameters (which means you'll need to create and populate a Java string array). If you need to set Ant properties, you might try the startAnt() function instead. Of course you'll have to create a java.util.properties object to do that. > Thanks for any help > Mike T > PS be gentle - my java knowledge extends only slightly beyond drinking the > stuff. Honestly, I think you're going to create a lot of pain for little gain in this scenario. An alternative approach might be to copy the batch files that run ant and modify them to straighten out your path and other issues -- those batch files do a good job of grabbing env variables and making assumptions, but if you *know* what the parameters are to pass to ant, a simpler batch file that does precisely what you expect might give better results from CFEXEC. -- John Paul Ashenfelter CTO/Transitionpoint (blog) http://www.ashenfelter.com (email) [EMAIL PROTECTED] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Find out how CFTicket can increase your company's customer support efficiency by 100% http://www.houseoffusion.com/banners/view.cfm?bannerid=49 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:217440 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4 Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

