Reputation: 54811
After reviewing the documentation for Phing on how to write custom tasks using PHP. I was wondering if it was possible to place the PHP source files in my project folder.
The documentation says that the task PHP files have to be placed in classes/phing/tasks/my and then they can be loaded with this command.
<taskdef name="myecho" classname="phing.tasks.my.MyEchoTask" />
It's going to be difficult to keep project specific tasks maintained under version control if the source files are outside my projects folder.
Is it possible to change the location of where they are loaded from?
Upvotes: 2
Views: 1032
Reputation: 525
Additionally, you can specify an include path to your custom task right from your build.xml file.
Where ${srcPath} is a property that defines my project root directory and "build" is where my build.xml file was placed.
Upvotes: 1
Reputation: 2362
If you reference a custom task like this in your build file:
<taskdef name="myecho" classname="my.tasks.MyEchoTask" />
Phing will look in a directory called my/tasks
under your current directory (I believe).
For my own stuff, I have a directory called phing
off of the top level of my source tree and I just place my tasks in that folder and use the classname phing.<MyTaskClassName>
Upvotes: 5