Skip to content

Commit

Permalink
Log status when a task is executing
Browse files Browse the repository at this point in the history
  • Loading branch information
eyedol committed Jul 13, 2024
1 parent 4178a75 commit 3a23227
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ class PreviewViewModel {
}

fun executeTaskByName(project: Project, taskName: String) {
roborazziLog("executeTaskByName")
roborazziLog("Executing task '$taskName'...")
gradleTask.executeTaskByName(project, taskName)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import com.intellij.openapi.externalSystem.model.ProjectKeys
import com.intellij.openapi.externalSystem.model.execution.ExternalSystemTaskExecutionSettings
import com.intellij.openapi.externalSystem.model.project.ModuleData
import com.intellij.openapi.externalSystem.service.execution.ProgressExecutionMode
import com.intellij.openapi.externalSystem.task.TaskCallback
import com.intellij.openapi.externalSystem.util.ExternalSystemApiUtil
import com.intellij.openapi.externalSystem.util.ExternalSystemUtil
import com.intellij.openapi.fileEditor.FileEditorManager
Expand Down Expand Up @@ -39,7 +40,15 @@ class RoborazziGradleTask {
DefaultRunExecutor.EXECUTOR_ID,
project,
GradleConstants.SYSTEM_ID,
null,
object : TaskCallback {
override fun onSuccess() {
roborazziLog("Task '$taskName' executed successfully")
}

override fun onFailure() {
roborazziLog("Task '$taskName' execution failed")
}
},
ProgressExecutionMode.IN_BACKGROUND_ASYNC,
false
)
Expand Down

0 comments on commit 3a23227

Please sign in to comment.