Adding an attribute to an ANT task
posted 17 years ago
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
Hi,
I want to add a new attribute lets say category into the Junit task, which has other attributes like fork,haltonerror etc., I want to add this attribute and provide implementation to it, any idea which all source codes I should dig, I am using junit4.0, junit-ext-0.2.4.
1.)Is there a code or configuration in ANT which has list of all attributes of a task.
2.)For providing implementation to the new attribute in the junit task, do I need to modify the JunitTask, JunitRunner and classes of ant-junit.
Any good idea will be highly appreciated.
Thanks
Arup
I want to add a new attribute lets say category into the Junit task, which has other attributes like fork,haltonerror etc., I want to add this attribute and provide implementation to it, any idea which all source codes I should dig, I am using junit4.0, junit-ext-0.2.4.
1.)Is there a code or configuration in ANT which has list of all attributes of a task.
2.)For providing implementation to the new attribute in the junit task, do I need to modify the JunitTask, JunitRunner and classes of ant-junit.
Any good idea will be highly appreciated.
Thanks
Arup
posted 17 years ago
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
Each attribute of an ant task is stored in a field of the class that implements that ant task. So what you would want to do is find the class that implements the junit ant task, extend it, and add a field for your attribute. Then what you do with that attribute value is up to you.
posted 17 years ago
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
Here's the source to a test task I wrote a while ago. It has a single attribute "arg1" for which a setter method needs to be provided. It also shows how to retrieve a property from the build file, and various calls to the project environment. You'd use it with <MyTask arg1="foobar"/>.
[ July 01, 2008: Message edited by: Ulf Dittmer ]
[ July 01, 2008: Message edited by: Ulf Dittmer ]
Arup Kumar
Greenhorn
Posts: 5
posted 17 years ago
-
1 -
-
Number of slices to send:Optional 'thank-you' note:
-
-
Thanks Peter & Ulf, those nuggets are really helpful..
posted 8 years ago
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
[quote
Hi
On similar lines this prog is tried
The details are as under viz., buildfile,java prg and the succesful out put
Since you were able to get the attribute added ,please give the sample code to enable me for a try on this
similarly
Tanks
As
CRMK
=Arup Kumar]Thanks Peter & Ulf, those nuggets are really helpful..
Hi
On similar lines this prog is tried
The details are as under viz., buildfile,java prg and the succesful out put
Since you were able to get the attribute added ,please give the sample code to enable me for a try on this
similarly
Tanks
As
CRMK
=Arup Kumar]Thanks Peter & Ulf, those nuggets are really helpful..
Comal Rajagopalaratnam Muthukumar
Ranch Hand
Posts: 401
posted 8 years ago
Hi
On similar lines this progm is tried
The details are as under viz., buildfile,java prg and the succesful out put
Since you were able to get the attribute added ,please give the sample code to enable me for a try on this
similarly
Tanks
As
CRMK
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
Arup Kumar wrote:Hi,
I want to add a new attribute lets say category into the Junit task, which has other attributes like fork,haltonerror etc., I want to add this attribute and provide implementation to it, any idea which all source codes I should dig, I am using junit4.0, junit-ext-0.2.4.
1.)Is there a code or configuration in ANT which has list of all attributes of a task.
2.)For providing implementation to the new attribute in the junit task, do I need to modify the JunitTask, JunitRunner and classes of ant-junit.
Any good idea will be highly appreciated.
Thanks
Arup
Hi
On similar lines this progm is tried
The details are as under viz., buildfile,java prg and the succesful out put
Since you were able to get the attribute added ,please give the sample code to enable me for a try on this
similarly
Tanks
As
CRMK
| Tongue wrestling. It's not what you think. And here, take this tiny ad. You'll need it. The new gardening playing cards kickstarter is now live! https://www.kickstarter.com/projects/paulwheaton/garden-cards |








