1
0
Fork 0
mirror of https://github.com/ethauvin/kobalt.git synced 2025-04-26 08:27:12 -07:00

Refactoring.

This commit is contained in:
Cedric Beust 2015-12-05 08:20:20 -08:00
parent b1860e64e2
commit 13d9a36a6b

View file

@ -2,14 +2,11 @@ package com.beust.kobalt.api
import com.beust.kobalt.Plugins
import com.beust.kobalt.internal.TaskManager
import kotlin.properties.Delegates
abstract public class BasePlugin : IPlugin {
override var taskManager: TaskManager by Delegates.notNull()
override fun accept(project: Project) = true
var plugins: Plugins by Delegates.notNull()
lateinit var context: KobaltContext
var context: KobaltContext by Delegates.notNull()
override fun accept(project: Project) = true
override fun apply(project: Project, context: KobaltContext) {
this.context = context
@ -17,7 +14,9 @@ abstract public class BasePlugin : IPlugin {
protected val projects = arrayListOf<ProjectDescription>()
fun addProject(project: Project, dependsOn: Array<out Project>) {
projects.add(ProjectDescription(project, dependsOn.toList()))
}
fun addProject(project: Project, dependsOn: Array<out Project>) =
projects.add(ProjectDescription(project, dependsOn.toList()))
override lateinit var taskManager: TaskManager
lateinit var plugins: Plugins
}