When we create a custom task by extending DefaultTask, the custom task is available to build script. But, same custom task if we create extending Test , it won’t work. e.g: custom Tasks as below:
public class MyTestType1 extends DefaultTask { }
public class MyTestType2 extends Test { }
Now, if in build file if we have task as below:
task myTask (type : MyTestType1) { } — This works task myTask (type : MyTestType2) { } — This won’t work
Error’s out as below: > Could not create task of type 'MyTestType2 '.
Please let us know if we are missing anything here…
would like to add some check operations before and after actual test execution. This is true for all test tasks so want to have custom task which is subclass of Test.