diff options
author | Simon Brandhof <simon.brandhof@gmail.com> | 2013-03-05 16:22:31 +0100 |
---|---|---|
committer | Simon Brandhof <simon.brandhof@gmail.com> | 2013-03-05 16:22:31 +0100 |
commit | 487e90555204c8e656c775efce91c90e98d90e36 (patch) | |
tree | 78feca0526d4e208b97228c5103e6443296a96b3 /sonar-batch | |
parent | 7509fbafb262c92c3603d5b17387c232a5748327 (diff) | |
download | sonarqube-487e90555204c8e656c775efce91c90e98d90e36.tar.gz sonarqube-487e90555204c8e656c775efce91c90e98d90e36.zip |
Revert "SONAR-4069 Remove Task and TaskDefinition from API."
This reverts commit 7509fbafb262c92c3603d5b17387c232a5748327.
Diffstat (limited to 'sonar-batch')
12 files changed, 16 insertions, 125 deletions
diff --git a/sonar-batch/src/main/java/org/sonar/batch/bootstrap/ExtensionInstaller.java b/sonar-batch/src/main/java/org/sonar/batch/bootstrap/ExtensionInstaller.java index a6833247022..211128bde2f 100644 --- a/sonar-batch/src/main/java/org/sonar/batch/bootstrap/ExtensionInstaller.java +++ b/sonar-batch/src/main/java/org/sonar/batch/bootstrap/ExtensionInstaller.java @@ -31,7 +31,7 @@ import org.sonar.api.config.Settings; import org.sonar.api.platform.ComponentContainer; import org.sonar.api.platform.PluginMetadata; import org.sonar.api.resources.Project; -import org.sonar.batch.tasks.TaskDefinition; +import org.sonar.api.task.TaskDefinition; import org.sonar.batch.bootstrapper.EnvironmentInformation; import javax.annotation.Nullable; diff --git a/sonar-batch/src/main/java/org/sonar/batch/bootstrap/TaskBootstrapContainer.java b/sonar-batch/src/main/java/org/sonar/batch/bootstrap/TaskBootstrapContainer.java index ae0b36a5020..39a81ebffdb 100644 --- a/sonar-batch/src/main/java/org/sonar/batch/bootstrap/TaskBootstrapContainer.java +++ b/sonar-batch/src/main/java/org/sonar/batch/bootstrap/TaskBootstrapContainer.java @@ -20,7 +20,7 @@ package org.sonar.batch.bootstrap; import org.sonar.api.batch.bootstrap.ProjectReactor; -import org.sonar.batch.tasks.TaskDefinition; +import org.sonar.api.task.TaskDefinition; import org.sonar.api.utils.SonarException; import org.sonar.batch.scan.ScanTask; import org.sonar.batch.tasks.ListTasksTask; diff --git a/sonar-batch/src/main/java/org/sonar/batch/bootstrap/TaskContainer.java b/sonar-batch/src/main/java/org/sonar/batch/bootstrap/TaskContainer.java index 6158d3b02f1..9c4e23c0a22 100644 --- a/sonar-batch/src/main/java/org/sonar/batch/bootstrap/TaskContainer.java +++ b/sonar-batch/src/main/java/org/sonar/batch/bootstrap/TaskContainer.java @@ -23,8 +23,8 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.sonar.api.config.EmailSettings; import org.sonar.api.resources.ResourceTypes; -import org.sonar.batch.tasks.Task; -import org.sonar.batch.tasks.TaskDefinition; +import org.sonar.api.task.Task; +import org.sonar.api.task.TaskDefinition; import org.sonar.api.utils.SonarException; import org.sonar.batch.DefaultFileLinesContextFactory; import org.sonar.batch.DefaultResourceCreationLock; diff --git a/sonar-batch/src/main/java/org/sonar/batch/scan/ScanTask.java b/sonar-batch/src/main/java/org/sonar/batch/scan/ScanTask.java index f9e03d977d9..f007e92749d 100644 --- a/sonar-batch/src/main/java/org/sonar/batch/scan/ScanTask.java +++ b/sonar-batch/src/main/java/org/sonar/batch/scan/ScanTask.java @@ -22,8 +22,8 @@ package org.sonar.batch.scan; import com.google.common.annotations.VisibleForTesting; import org.sonar.api.platform.ComponentContainer; import org.sonar.api.resources.Project; -import org.sonar.batch.tasks.Task; -import org.sonar.batch.tasks.TaskDefinition; +import org.sonar.api.task.Task; +import org.sonar.api.task.TaskDefinition; import org.sonar.batch.ProjectTree; import org.sonar.batch.tasks.RequiresProject; diff --git a/sonar-batch/src/main/java/org/sonar/batch/tasks/ListTasksTask.java b/sonar-batch/src/main/java/org/sonar/batch/tasks/ListTasksTask.java index 50b8dbb7090..dd08729b2cf 100644 --- a/sonar-batch/src/main/java/org/sonar/batch/tasks/ListTasksTask.java +++ b/sonar-batch/src/main/java/org/sonar/batch/tasks/ListTasksTask.java @@ -19,6 +19,9 @@ */ package org.sonar.batch.tasks; +import org.sonar.api.task.Task; +import org.sonar.api.task.TaskDefinition; + public class ListTasksTask implements Task { public static final String COMMAND = "list-tasks"; diff --git a/sonar-batch/src/main/java/org/sonar/batch/tasks/Task.java b/sonar-batch/src/main/java/org/sonar/batch/tasks/Task.java deleted file mode 100644 index 26b583efb77..00000000000 --- a/sonar-batch/src/main/java/org/sonar/batch/tasks/Task.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Sonar, open source software quality management tool. - * Copyright (C) 2008-2012 SonarSource - * mailto:contact AT sonarsource DOT com - * - * Sonar is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * Sonar is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with Sonar; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02 - */ -package org.sonar.batch.tasks; - - -import org.sonar.api.task.TaskExtension; - -/** - * Implement this interface to provide the behavior of a task. - * @since 3.5 - */ -public interface Task extends TaskExtension { - - void execute(); - -} diff --git a/sonar-batch/src/main/java/org/sonar/batch/tasks/TaskDefinition.java b/sonar-batch/src/main/java/org/sonar/batch/tasks/TaskDefinition.java deleted file mode 100644 index aea3ddaa56e..00000000000 --- a/sonar-batch/src/main/java/org/sonar/batch/tasks/TaskDefinition.java +++ /dev/null @@ -1,84 +0,0 @@ -/* - * Sonar, open source software quality management tool. - * Copyright (C) 2008-2012 SonarSource - * mailto:contact AT sonarsource DOT com - * - * Sonar is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * Sonar is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with Sonar; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02 - */ -package org.sonar.batch.tasks; - -import org.sonar.api.task.TaskComponent; - -/** - * Implement this interface to provide a new task. - * @since 3.5 - */ -public class TaskDefinition implements TaskComponent { - - private String name; - private String description; - private String command; - private Class<? extends Task> task; - - private TaskDefinition() { - - } - - public static TaskDefinition create() { - return new TaskDefinition(); - } - - public String getName() { - return name; - } - - public TaskDefinition setName(String name) { - this.name = name; - return this; - } - - public String getDescription() { - return description; - } - - public TaskDefinition setDescription(String description) { - this.description = description; - return this; - } - - public String getCommand() { - return command; - } - - public TaskDefinition setCommand(String command) { - this.command = command; - return this; - } - - public Class<? extends Task> getTask() { - return task; - } - - public TaskDefinition setTask(Class<? extends Task> task) { - this.task = task; - return this; - } - - @Override - public String toString() { - return "Definition of task " + task + " with command " + command; - } - -} diff --git a/sonar-batch/src/main/java/org/sonar/batch/tasks/Tasks.java b/sonar-batch/src/main/java/org/sonar/batch/tasks/Tasks.java index 1af4cf6f143..82af633c54b 100644 --- a/sonar-batch/src/main/java/org/sonar/batch/tasks/Tasks.java +++ b/sonar-batch/src/main/java/org/sonar/batch/tasks/Tasks.java @@ -24,7 +24,9 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.sonar.api.CoreProperties; import org.sonar.api.config.Settings; +import org.sonar.api.task.Task; import org.sonar.api.task.TaskComponent; +import org.sonar.api.task.TaskDefinition; import org.sonar.api.utils.SonarException; import org.sonar.batch.scan.ScanTask; diff --git a/sonar-batch/src/test/java/org/sonar/batch/bootstrap/ExtensionInstallerTest.java b/sonar-batch/src/test/java/org/sonar/batch/bootstrap/ExtensionInstallerTest.java index 51c9c8b6750..ce31e79b46e 100644 --- a/sonar-batch/src/test/java/org/sonar/batch/bootstrap/ExtensionInstallerTest.java +++ b/sonar-batch/src/test/java/org/sonar/batch/bootstrap/ExtensionInstallerTest.java @@ -32,7 +32,7 @@ import org.sonar.api.config.Settings; import org.sonar.api.platform.ComponentContainer; import org.sonar.api.platform.PluginMetadata; import org.sonar.api.resources.Project; -import org.sonar.batch.tasks.TaskDefinition; +import org.sonar.api.task.TaskDefinition; import org.sonar.api.task.TaskExtension; import org.sonar.batch.bootstrapper.EnvironmentInformation; import org.sonar.batch.tasks.RequiresProject; diff --git a/sonar-batch/src/test/java/org/sonar/batch/bootstrap/TaskContainerTest.java b/sonar-batch/src/test/java/org/sonar/batch/bootstrap/TaskContainerTest.java index 9fae435cb0b..03944ea0d77 100644 --- a/sonar-batch/src/test/java/org/sonar/batch/bootstrap/TaskContainerTest.java +++ b/sonar-batch/src/test/java/org/sonar/batch/bootstrap/TaskContainerTest.java @@ -21,7 +21,7 @@ package org.sonar.batch.bootstrap; import org.junit.Test; import org.sonar.api.platform.ComponentContainer; -import org.sonar.batch.tasks.TaskDefinition; +import org.sonar.api.task.TaskDefinition; import static org.mockito.Matchers.any; import static org.mockito.Matchers.eq; diff --git a/sonar-batch/src/test/java/org/sonar/batch/tasks/ListTasksTaskTest.java b/sonar-batch/src/test/java/org/sonar/batch/tasks/ListTasksTaskTest.java index d4a91ab36ca..d66c0c688ed 100644 --- a/sonar-batch/src/test/java/org/sonar/batch/tasks/ListTasksTaskTest.java +++ b/sonar-batch/src/test/java/org/sonar/batch/tasks/ListTasksTaskTest.java @@ -20,6 +20,7 @@ package org.sonar.batch.tasks; import org.junit.Test; +import org.sonar.api.task.TaskDefinition; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.spy; diff --git a/sonar-batch/src/test/java/org/sonar/batch/tasks/TasksTest.java b/sonar-batch/src/test/java/org/sonar/batch/tasks/TasksTest.java index de478c23cf3..102576ec196 100644 --- a/sonar-batch/src/test/java/org/sonar/batch/tasks/TasksTest.java +++ b/sonar-batch/src/test/java/org/sonar/batch/tasks/TasksTest.java @@ -25,6 +25,8 @@ import org.junit.Test; import org.junit.rules.ExpectedException; import org.sonar.api.CoreProperties; import org.sonar.api.config.Settings; +import org.sonar.api.task.Task; +import org.sonar.api.task.TaskDefinition; import org.sonar.api.utils.SonarException; import org.sonar.batch.scan.ScanTask; |