Annotation Type BinaryTasks

  • @Retention(RUNTIME)
    public @interface BinaryTasks
    Declares the tasks to build a custom BinarySpec binary. The following example demonstrates how to register multiple tasks for custom binary using a plugin with a BinaryTasks annotation.
     @Managed interface SampleComponent extends ComponentSpec {}
     @Managed interface SampleBinary extends BinarySpec {}
     apply plugin: MyCustomBinariesPlugin
     class MyCustomBinaryCreationTask extends DefaultTask {
          @TaskAction void build() {
              //building the binary
     class MyCustomBinariesPlugin extends RuleSource {
         void register(TypeBuilder<SampleBinary> builder) {}
         void createBinaryTasks(ModelMap<Task> tasks, SampleBinary binary) {
             tasks.create("${}Task1", MyCustomBinaryCreationTask)
             tasks.create("${}Task2") {
                 dependsOn "${}Task1"