From 4568f2f6593b70ebb4c3e00dc2da5b3d5dacd046 Mon Sep 17 00:00:00 2001 From: Cedric Beust Date: Fri, 1 Jan 2016 10:28:22 -0800 Subject: [PATCH] Unused parameter. --- .../main/kotlin/com/beust/kobalt/api/TaskContributor.kt | 2 +- .../kotlin/com/beust/kobalt/internal/IncrementalManager.kt | 6 ++---- .../main/kotlin/com/beust/kobalt/internal/TaskManager.kt | 7 +++---- 3 files changed, 6 insertions(+), 9 deletions(-) diff --git a/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/api/TaskContributor.kt b/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/api/TaskContributor.kt index 41762a26..e958ccba 100644 --- a/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/api/TaskContributor.kt +++ b/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/api/TaskContributor.kt @@ -50,7 +50,7 @@ class TaskContributor @Inject constructor(val incrementalManager: IncrementalMan runBefore = runBefore.map { variant.toTask(it) }, runAfter = runAfter.map { variant.toTask(it) }, alwaysRunAfter = alwaysRunAfter.map { variant.toTask(it) }, - closure = incrementalManager.toIncrementalTaskClosure(plugin, taskName, runTask))) + closure = incrementalManager.toIncrementalTaskClosure(taskName, runTask))) } } diff --git a/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/internal/IncrementalManager.kt b/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/internal/IncrementalManager.kt index 6673389a..f8609910 100644 --- a/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/internal/IncrementalManager.kt +++ b/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/internal/IncrementalManager.kt @@ -2,7 +2,6 @@ package com.beust.kobalt.internal import com.beust.kobalt.IncrementalTaskInfo import com.beust.kobalt.TaskResult -import com.beust.kobalt.api.IPlugin import com.beust.kobalt.api.Project import com.beust.kobalt.misc.KFiles import com.beust.kobalt.misc.log @@ -75,11 +74,11 @@ class IncrementalManager(val fileName: String = IncrementalManager.BUILD_INFO_FI * @return a closure that invokes that method and decide whether to run the task or not based * on the content of that IncrementalTaskInfo */ - fun toIncrementalTaskClosure(plugin: IPlugin, taskName: String, method: (Project) -> IncrementalTaskInfo) + fun toIncrementalTaskClosure(shortTaskName: String, method: (Project) -> IncrementalTaskInfo) : (Project) -> TaskResult { return { project: Project -> val iit = method(project) - val taskName = project.name + ":" + taskName + val taskName = project.name + ":" + shortTaskName var upToDate = false var taskOutputChecksum : String? = null inputChecksumFor(taskName)?.let { inputChecksum -> @@ -90,7 +89,6 @@ class IncrementalManager(val fileName: String = IncrementalManager.BUILD_INFO_FI upToDate = true } else { logIncremental(1, "Incremental task $taskName output is out of date, running it") - } } } else { diff --git a/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/internal/TaskManager.kt b/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/internal/TaskManager.kt index e3e790ad..12f8da14 100644 --- a/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/internal/TaskManager.kt +++ b/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/internal/TaskManager.kt @@ -252,10 +252,9 @@ public class TaskManager @Inject constructor(val args: Args, val incrementalMana */ fun toTaskAnnotation(method: Method, plugin: IPlugin, ta: IncrementalTask) = TaskAnnotation(method, plugin, ta.name, ta.description, ta.runBefore, ta.runAfter, ta.alwaysRunAfter, - incrementalManager.toIncrementalTaskClosure(plugin, ta.name, - { project -> - method.invoke(plugin, project) as IncrementalTaskInfo - })) + incrementalManager.toIncrementalTaskClosure(ta.name, { project -> + method.invoke(plugin, project) as IncrementalTaskInfo + })) class PluginDynamicTask(val plugin: IPlugin, val task: DynamicTask)