Cam we write java custom task without plugin

(Dheeraj M) #1

Can we create a custom task in java which I can call form gradle without any custom plugin as we do in ant.
In ant we can create custom tasks and call them without any plugin. I have an gradle example to create a custom task under custom plugin and by aplying plugin we can call them from gradle file.
But I want to call tasks created under general src folder under packages, without any plungin. Is that possible?

Dheeraj Manthangode

(davidmichaelkarr) #2

You can definitely define custom tasks without writing a custom plugin. However, I would think you wouldn’t be able to define them in the “src” folder, you’d likely have to use the “buildSrc” directory. Read about using “buildSrc” in the user guide (the distribution comes with a PDF that might be easier to peruse).