aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-plugin-api
diff options
context:
space:
mode:
authorSimon Brandhof <simon.brandhof@sonarsource.com>2014-09-26 10:22:14 +0200
committerSimon Brandhof <simon.brandhof@sonarsource.com>2014-09-26 10:22:14 +0200
commitb99cd6861da25440322c4bd5ed15bd2e626851dc (patch)
tree3859097d3aa9f5a5943b7355c74c2adfb9171e1c /sonar-plugin-api
parentc9fbb6a04bc2001bd9fb8519cb127c6c1ed56d29 (diff)
downloadsonarqube-b99cd6861da25440322c4bd5ed15bd2e626851dc.tar.gz
sonarqube-b99cd6861da25440322c4bd5ed15bd2e626851dc.zip
Revert "SONAR-5644, SONAR-5473 Create new SCM extension point and fetch SCM data using WS"
This reverts commit 78fbdc2a8445e9131a10d2210b88d0e4d9927a14.
Diffstat (limited to 'sonar-plugin-api')
-rw-r--r--sonar-plugin-api/src/main/java/org/sonar/api/CoreProperties.java10
-rw-r--r--sonar-plugin-api/src/main/java/org/sonar/api/batch/fs/InputFileFilter.java1
-rw-r--r--sonar-plugin-api/src/main/java/org/sonar/api/batch/scm/BlameLine.java102
-rw-r--r--sonar-plugin-api/src/main/java/org/sonar/api/batch/scm/ScmProvider.java61
-rw-r--r--sonar-plugin-api/src/main/java/org/sonar/api/batch/scm/package-info.java24
-rw-r--r--sonar-plugin-api/src/main/java/org/sonar/api/batch/sensor/measure/internal/DefaultMeasure.java16
-rw-r--r--sonar-plugin-api/src/main/java/org/sonar/api/measures/Measure.java15
7 files changed, 1 insertions, 228 deletions
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/CoreProperties.java b/sonar-plugin-api/src/main/java/org/sonar/api/CoreProperties.java
index b0d48001837..7016d777d8a 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/CoreProperties.java
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/CoreProperties.java
@@ -615,14 +615,4 @@ public interface CoreProperties {
* @since 4.5
*/
String LANGUAGE_SPECIFIC_PARAMETERS_SIZE_METRIC_KEY = "size_metric";
-
- /**
- * @since 5.0
- */
- String SCM_ENABLED_KEY = "sonar.scm.enabled";
-
- /**
- * @since 5.0
- */
- String SCM_PROVIDER_KEY = "sonar.scm.provider";
}
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/batch/fs/InputFileFilter.java b/sonar-plugin-api/src/main/java/org/sonar/api/batch/fs/InputFileFilter.java
index 91836823e43..1ece5081290 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/batch/fs/InputFileFilter.java
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/batch/fs/InputFileFilter.java
@@ -27,6 +27,7 @@ import org.sonar.api.BatchExtension;
*/
public interface InputFileFilter extends BatchExtension {
+ // TODO requires a context (FileSystem) ?
boolean accept(InputFile f);
}
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/batch/scm/BlameLine.java b/sonar-plugin-api/src/main/java/org/sonar/api/batch/scm/BlameLine.java
deleted file mode 100644
index 2303b90f794..00000000000
--- a/sonar-plugin-api/src/main/java/org/sonar/api/batch/scm/BlameLine.java
+++ /dev/null
@@ -1,102 +0,0 @@
-/*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2014 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * SonarQube 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.
- *
- * SonarQube 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 this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
-package org.sonar.api.batch.scm;
-
-import java.util.Date;
-
-/**
- * @since 5.0
- */
-public class BlameLine {
-
- private Date date;
- private String revision;
- private String author;
- private String committer;
-
- /**
- * @param date of the commit
- * @param revision of the commit
- * @param author will also be used as committer identification
- */
- public BlameLine(Date date, String revision, String author) {
- this(date, revision, author, author);
- }
-
- /**
- *
- * @param date of the commit
- * @param revision of the commit
- * @param author the person who wrote the line
- * @param committer the person who committed the change
- */
- public BlameLine(Date date, String revision, String author, String committer) {
- setDate(date);
- setRevision(revision);
- setAuthor(author);
- setCommitter(committer);
- }
-
- public String getRevision() {
- return revision;
- }
-
- public void setRevision(String revision) {
- this.revision = revision;
- }
-
- public String getAuthor() {
- return author;
- }
-
- public void setAuthor(String author) {
- this.author = author;
- }
-
- public String getCommitter() {
- return committer;
- }
-
- public void setCommitter(String committer) {
- this.committer = committer;
- }
-
- /**
- * @return the commit date
- */
- public Date getDate() {
- if (date != null)
- {
- return (Date) date.clone();
- }
- return null;
- }
-
- public void setDate(Date date) {
- if (date != null)
- {
- this.date = new Date(date.getTime());
- }
- else
- {
- this.date = null;
- }
- }
-}
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/batch/scm/ScmProvider.java b/sonar-plugin-api/src/main/java/org/sonar/api/batch/scm/ScmProvider.java
deleted file mode 100644
index 1fd3327d7c3..00000000000
--- a/sonar-plugin-api/src/main/java/org/sonar/api/batch/scm/ScmProvider.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2014 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * SonarQube 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.
- *
- * SonarQube 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 this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
-package org.sonar.api.batch.scm;
-
-import org.sonar.api.BatchExtension;
-import org.sonar.api.batch.InstantiationStrategy;
-import org.sonar.api.batch.fs.InputFile;
-
-import java.io.File;
-import java.util.List;
-
-/**
- * @since 5.0
- */
-@InstantiationStrategy(InstantiationStrategy.PER_BATCH)
-public interface ScmProvider extends BatchExtension {
-
- /**
- * Unique identifier of the provider. Can be used in SCM URL to define the provider to use.
- */
- String key();
-
- /**
- * Does this provider able to manage files located in this directory.
- * Used by autodetection.
- */
- boolean supports(File baseDir);
-
- /**
- * Compute blame of the provided files. Computation can be done in parallel.
- * If there is an error that prevent to blame a file then an exception should be raised.
- */
- void blame(Iterable<InputFile> files, BlameResultHandler handler);
-
- /**
- * Callback for the provider to return results of blame per file.
- */
- public static interface BlameResultHandler {
-
- void handle(InputFile file, List<BlameLine> lines);
-
- }
-
-}
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/batch/scm/package-info.java b/sonar-plugin-api/src/main/java/org/sonar/api/batch/scm/package-info.java
deleted file mode 100644
index 03eafe5f6e9..00000000000
--- a/sonar-plugin-api/src/main/java/org/sonar/api/batch/scm/package-info.java
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2014 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * SonarQube 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.
- *
- * SonarQube 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 this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
-@ParametersAreNonnullByDefault
-package org.sonar.api.batch.scm;
-
-import javax.annotation.ParametersAreNonnullByDefault;
-
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/batch/sensor/measure/internal/DefaultMeasure.java b/sonar-plugin-api/src/main/java/org/sonar/api/batch/sensor/measure/internal/DefaultMeasure.java
index 29b5c92bc2c..fee7172f9ea 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/batch/sensor/measure/internal/DefaultMeasure.java
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/batch/sensor/measure/internal/DefaultMeasure.java
@@ -42,7 +42,6 @@ public class DefaultMeasure<G extends Serializable> implements Measure<G> {
private Metric<G> metric;
private G value;
private boolean saved = false;
- private boolean fromCore = false;
public DefaultMeasure() {
this.storage = null;
@@ -85,21 +84,6 @@ public class DefaultMeasure<G extends Serializable> implements Measure<G> {
return this;
}
- /**
- * For internal use.
- */
- public boolean isFromCore() {
- return fromCore;
- }
-
- /**
- * For internal use. Used by core components to bypass check that prevent a plugin to store core measures.
- */
- public DefaultMeasure<G> setFromCore() {
- this.fromCore = true;
- return this;
- }
-
@Override
public void save() {
Preconditions.checkNotNull(this.storage, "No persister on this object");
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/measures/Measure.java b/sonar-plugin-api/src/main/java/org/sonar/api/measures/Measure.java
index 9a75236a501..af202228252 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/measures/Measure.java
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/measures/Measure.java
@@ -63,7 +63,6 @@ public class Measure<G extends Serializable> implements Serializable {
protected Requirement requirement;
protected Integer personId;
protected PersistenceMode persistenceMode = PersistenceMode.FULL;
- private boolean fromCore;
public Measure(String metricKey) {
this.metricKey = metricKey;
@@ -688,20 +687,6 @@ public class Measure<G extends Serializable> implements Serializable {
&& isZeroVariation(variation1, variation2, variation3, variation4, variation5);
}
- /**
- * For internal use
- */
- public boolean isFromCore() {
- return fromCore;
- }
-
- /**
- * For internal use
- */
- public void setFromCore(boolean fromCore) {
- this.fromCore = fromCore;
- }
-
private static boolean isZeroVariation(Double... variations) {
for (Double variation : variations) {
if (!((variation == null) || NumberUtils.compare(variation, 0.0) == 0)) {