ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Hussein Badakhchani" <>
Subject Calling ant tasks from jython
Date Thu, 10 Aug 2006 12:27:34 GMT


I am calling a jython script from my build.xml file using the script
task e.g:


<script language="jython" src="tools/jython/"/>


I want to use ant tasks from While I don't seem to have
any problems retrieving my projects properties it seems that any call I
make to an ant task method requires an extra argument.

For example:


Script called from my build.xml file


import as Mkdir

import as File


# These calls all work file

print "Ant Call Test"

print project.getProperty('build.dir')

print project.getName()



mkdir = Mkdir()


# At this point I get the error




Traceback (innermost last):

File "<string>", line 10, in ?

TypeError: setDir(): expected 2 args; got 1



The setDir method only accepts 1 argument as per the api. 

I have tried passing in an instance of self but I get the following


Mkdir.setDir(self, testDir)


Traceback (innermost last):

  File "<string>", line 10, in ?

TypeError: setDir(): self arg can't be coerced to 


Jython does not tell me what object self cannot be coerced to!


What am I missing here?


Hussein Badakhchani

Middleware Analyst

Infrastructure Support






    You can find us at

This communication is confidential and intended for 
the exclusive use of the addressee only. You should 
not disclose its contents to any other person.
If you are not the intended recipient please notify 
the sender named above immediately.

Registered in England, No 1023742,
Registered Office: Voca Limited
Drake House, Three Rivers Court,
Homestead Road, Rickmansworth,
Hertfordshire, WD3 1FX

This message has been checked for all email viruses by MessageLabs.
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message