package plugin

import org.gradle.api.Plugin
import org.gradle.api.Project
import org.gradle.api.Task
import org.gradle.api.tasks.Copy

import org.gradle.kotlin.dsl.*

open class MyPlugin : Plugin<Project> {

    override fun apply(project: Project) {
        project.run {

            tasks {
                "myCopyTask"(Copy::class) {
                    from("build.gradle.kts")
                    into("build/copy")
                }
            }
        }
    }
}

package plugin

import org.gradle.api.Plugin
import org.gradle.api.Project
import org.gradle.api.Task
import org.gradle.api.tasks.Copy

import org.gradle.kotlin.dsl.*

open class MyPlugin : Plugin<Project> {

    override fun apply(project: Project) {
        project.run {

            tasks {
                "myCopyTask"(Copy::class) {
                    group = "sample"
                    from("build.gradle.kts")
                    into("build/copy")
                }
            }
        }
    }
}

Add sample plugin task to sample task group
Add sample plugin task to sample task group

robinverduijn/gradle,gradle/gradle,gradle/gradle-script-kotlin,gradle/gradle,robinverduijn/gradle,robinverduijn/gradle,robinverduijn/gradle,blindpirate/gradle,gradle/gradle,blindpirate/gradle,robinverduijn/gradle,gradle/gradle,gradle/gradle,gradle/gradle,blindpirate/gradle,robinverduijn/gradle,gradle/gradle-script-kotlin,robinverduijn/gradle,blindpirate/gradle,robinverduijn/gradle,gradle/gradle,gradle/gradle,robinverduijn/gradle,blindpirate/gradle,blindpirate/gradle,blindpirate/gradle,blindpirate/gradle,gradle/gradle,gradle/gradle,robinverduijn/gradle,blindpirate/gradle,robinverduijn/gradle,blindpirate/gradle