* Register and describe a {@link TaskExtension}.
*
* @since 3.6
+ * @deprecated since 7.6
*/
@ExtensionPoint
@ScannerSide
@InstantiationStrategy(InstantiationStrategy.PER_TASK)
+@Deprecated
public class TaskDefinition implements Comparable<TaskDefinition> {
static final String KEY_PATTERN = "[a-zA-Z0-9\\-\\_]+";
import org.sonar.api.task.Task;
import org.sonar.api.task.TaskDefinition;
import org.sonar.api.utils.MessageException;
+import org.sonar.api.utils.log.Logger;
+import org.sonar.api.utils.log.Loggers;
import org.sonar.core.extension.CoreExtensionsInstaller;
import org.sonar.core.platform.ComponentContainer;
import org.sonar.scanner.bootstrap.ExtensionInstaller;
import static org.sonar.api.batch.InstantiationStrategy.PER_TASK;
import static org.sonar.core.extension.CoreExtensionsInstaller.noExtensionFilter;
-import static org.sonar.scanner.bootstrap.ExtensionUtils.isInstantiationStrategy;
import static org.sonar.scanner.bootstrap.ExtensionUtils.isDeprecatedScannerSide;
+import static org.sonar.scanner.bootstrap.ExtensionUtils.isInstantiationStrategy;
public class TaskContainer extends ComponentContainer {
+ private static final Logger LOG = Loggers.get(TaskContainer.class);
+
private final Map<String, String> taskProperties;
private final Object[] components;
public void doAfterStart() {
// default value is declared in CorePlugin
String taskKey = StringUtils.defaultIfEmpty(taskProperties.get(CoreProperties.TASK), CoreProperties.SCAN_TASK);
+ if (!taskKey.equals(CoreProperties.SCAN_TASK)) {
+ LOG.warn("Scanner tasks are deprecated");
+ }
// Release memory
taskProperties.clear();
import org.sonar.api.task.TaskDefinition;
import org.sonar.api.utils.MessageException;
import org.sonar.api.utils.log.LogTester;
+import org.sonar.api.utils.log.LoggerLevel;
import org.sonar.scanner.mediumtest.ScannerMediumTester;
import static org.assertj.core.api.Assertions.assertThat;
return value.contains("Available tasks:") && value.contains("fake: Fake description") && value.contains("broken: Broken description");
}
});
+
+ assertThat(logTester.logs(LoggerLevel.WARN)).contains("Scanner tasks are deprecated");
}
@Test