Is there something I need to do to expose a task from a plugin? I have a tiny plugin with a simple custom task but I can’t create new tasks from it. I can use it as a defined plugin but I want to create tasks using its type in my build file.
Please let me know if you know what I need to do to expose this properly.
Thanks Peter
apply plugin: 'mycustomplugin'
buildscript {
classpath 'com.peterdkahn.customPlugin:0-0-1-SNAPSHOT'
}
...
}
task mytask(type: MyCustomTask) {
}
Plugin
package com.peterdkahn.gradle;
import org.gradle.api.*
class MyCustomPlugin implements Plugin<Project> {
def void apply(Project project) {
project.task('mycustomtask', type: MyCustomTask)
}
}