This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
Hi , I am new to ANT. I have one build.xml file which builds some java files . Now I have to include Jython files to it . I mean i need to compile jython files along with java files. Any idea how to do this ? Also Can any one suggest where i can get some code samples for the same. Thanks, Raj
jythonc does the conversion of jython (python files) to java classes? If so you s'd be able to use "exec" task to run the jythoc executable supplying command line parameters. I guess jythonc s'd be in path / full path to jythonc can also be supplied to exec task. There c'd be better ways of doing this but this is the simplest solution that comes to my mind now. Someone here c'd suggest a better solution.
Joined: Apr 11, 2003
Hi Kartik, If you have idea about code to write in build.xml to compile jython file, please send me one sample. It is true as you said that jythonc creates class files from .py files. Thanks, Raj
Joined: Mar 06, 2001
Originally posted by Raj Sikka: please send me one sample. [/QB]
I dont have Jython installed right now. But you can have a target that c'd look like this. You need to fill up command line args that you want to pass ( can possibly get it by typing jythonc on the command prompt). Supply the path to jythonc as well. If i remember correctly it was a bat file? "dir" is the directory whre you have your python source files.
"exec" just executes the bat file as is with the arguments that you supply using "arg" That said there c'd be better ways of integrating python with your overall project. Rick is the author of a Jython book and we are lucky to have him here and infact he can help too. HTH