aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-batch
diff options
context:
space:
mode:
authorJulien HENRY <julien.henry@sonarsource.com>2014-04-02 15:25:32 +0200
committerJulien HENRY <julien.henry@sonarsource.com>2014-04-02 15:26:12 +0200
commit70a37f2d96558b7533c32058b0cacbac06795b51 (patch)
tree1d249f27e37709221b86415b24d3d66ce7e220fb /sonar-batch
parent7a15515ddd9fca246a0d16be76a517777b30ab40 (diff)
downloadsonarqube-70a37f2d96558b7533c32058b0cacbac06795b51.tar.gz
sonarqube-70a37f2d96558b7533c32058b0cacbac06795b51.zip
SONAR-5192 Remove support of deprecated SQ Runner properties
Diffstat (limited to 'sonar-batch')
-rw-r--r--sonar-batch/src/main/java/org/sonar/batch/scan/ProjectReactorBuilder.java34
-rw-r--r--sonar-batch/src/test/java/org/sonar/batch/scan/ProjectReactorBuilderTest.java10
-rw-r--r--sonar-batch/src/test/resources/org/sonar/batch/scan/ProjectReactorBuilderTest/simple-project-with-deprecated-props/libs/lib1.txt1
-rw-r--r--sonar-batch/src/test/resources/org/sonar/batch/scan/ProjectReactorBuilderTest/simple-project-with-deprecated-props/libs/lib2.txt1
-rw-r--r--sonar-batch/src/test/resources/org/sonar/batch/scan/ProjectReactorBuilderTest/simple-project-with-deprecated-props/sonar-project.properties8
-rw-r--r--sonar-batch/src/test/resources/org/sonar/batch/scan/ProjectReactorBuilderTest/simple-project-with-deprecated-props/sources/Fake.java1
6 files changed, 0 insertions, 55 deletions
diff --git a/sonar-batch/src/main/java/org/sonar/batch/scan/ProjectReactorBuilder.java b/sonar-batch/src/main/java/org/sonar/batch/scan/ProjectReactorBuilder.java
index 5bf0455cfd4..e1a6fd31e53 100644
--- a/sonar-batch/src/main/java/org/sonar/batch/scan/ProjectReactorBuilder.java
+++ b/sonar-batch/src/main/java/org/sonar/batch/scan/ProjectReactorBuilder.java
@@ -20,7 +20,6 @@
package org.sonar.batch.scan;
import com.google.common.annotations.VisibleForTesting;
-import com.google.common.collect.ImmutableMap;
import com.google.common.collect.Lists;
import org.apache.commons.io.IOUtils;
import org.apache.commons.io.filefilter.AndFileFilter;
@@ -79,20 +78,6 @@ public class ProjectReactorBuilder {
private static final String PROPERTY_LIBRARIES = "sonar.libraries";
/**
- * Old deprecated properties, replaced by the same ones preceded by "sonar."
- */
- private static final String PROPERTY_OLD_SOURCES = "sources";
- private static final String PROPERTY_OLD_TESTS = "tests";
- private static final String PROPERTY_OLD_BINARIES = "binaries";
- private static final String PROPERTY_OLD_LIBRARIES = "libraries";
- private static final Map<String, String> DEPRECATED_PROPS_TO_NEW_PROPS = ImmutableMap.of(
- PROPERTY_OLD_SOURCES, PROPERTY_SOURCES,
- PROPERTY_OLD_TESTS, PROPERTY_TESTS,
- PROPERTY_OLD_BINARIES, PROPERTY_BINARIES,
- PROPERTY_OLD_LIBRARIES, PROPERTY_LIBRARIES
- );
-
- /**
* Array of all mandatory properties required for a project without child.
*/
private static final String[] MANDATORY_PROPERTIES_FOR_SIMPLE_PROJECT = {
@@ -368,7 +353,6 @@ public class ProjectReactorBuilder {
@VisibleForTesting
protected static void checkMandatoryProperties(Properties props, String[] mandatoryProps) {
- replaceDeprecatedProperties(props);
StringBuilder missing = new StringBuilder();
for (String mandatoryProperty : mandatoryProps) {
if (!props.containsKey(mandatoryProperty)) {
@@ -472,24 +456,6 @@ public class ProjectReactorBuilder {
}
}
- /**
- * Replaces the deprecated properties by the new ones, and logs a message to warn the users.
- */
- @VisibleForTesting
- protected static void replaceDeprecatedProperties(Properties props) {
- for (Entry<String, String> entry : DEPRECATED_PROPS_TO_NEW_PROPS.entrySet()) {
- String key = entry.getKey();
- if (props.containsKey(key)) {
- String newKey = entry.getValue();
- LOG.warn("/!\\ The '{}' property is deprecated and is replaced by '{}'. Don't forget to update your files.", key, newKey);
- String value = props.getProperty(key);
- props.remove(key);
- props.put(newKey, value);
- }
- }
-
- }
-
@VisibleForTesting
protected static void mergeParentProperties(Properties childProps, Properties parentProps) {
List<String> moduleIds = Lists.newArrayList(getListFromProperty(parentProps, PROPERTY_MODULES));
diff --git a/sonar-batch/src/test/java/org/sonar/batch/scan/ProjectReactorBuilderTest.java b/sonar-batch/src/test/java/org/sonar/batch/scan/ProjectReactorBuilderTest.java
index 1ea32a24d0b..a427a5da689 100644
--- a/sonar-batch/src/test/java/org/sonar/batch/scan/ProjectReactorBuilderTest.java
+++ b/sonar-batch/src/test/java/org/sonar/batch/scan/ProjectReactorBuilderTest.java
@@ -59,16 +59,6 @@ public class ProjectReactorBuilderTest {
}
@Test
- public void shouldDefineSimpleProjectWithDeprecatedProperties() throws IOException {
- ProjectDefinition projectDefinition = loadProjectDefinition("simple-project-with-deprecated-props");
-
- assertThat(projectDefinition.getSourceDirs()).contains("sources");
- assertThat(projectDefinition.getLibraries()).contains(
- TestUtils.getResource(this.getClass(), "simple-project-with-deprecated-props/libs/lib2.txt").getAbsolutePath(),
- TestUtils.getResource(this.getClass(), "simple-project-with-deprecated-props/libs/lib2.txt").getAbsolutePath());
- }
-
- @Test
public void shouldFailOnInvalidProjectKey() throws IOException {
thrown.expect(IllegalStateException.class);
thrown.expectMessage("Invalid project key 'A key with spaces'.\nAllowed characters are alphanumeric, '-', '_', '.' and ':', with at least one non-digit.");
diff --git a/sonar-batch/src/test/resources/org/sonar/batch/scan/ProjectReactorBuilderTest/simple-project-with-deprecated-props/libs/lib1.txt b/sonar-batch/src/test/resources/org/sonar/batch/scan/ProjectReactorBuilderTest/simple-project-with-deprecated-props/libs/lib1.txt
deleted file mode 100644
index 81d4e95a0b6..00000000000
--- a/sonar-batch/src/test/resources/org/sonar/batch/scan/ProjectReactorBuilderTest/simple-project-with-deprecated-props/libs/lib1.txt
+++ /dev/null
@@ -1 +0,0 @@
-lib1 \ No newline at end of file
diff --git a/sonar-batch/src/test/resources/org/sonar/batch/scan/ProjectReactorBuilderTest/simple-project-with-deprecated-props/libs/lib2.txt b/sonar-batch/src/test/resources/org/sonar/batch/scan/ProjectReactorBuilderTest/simple-project-with-deprecated-props/libs/lib2.txt
deleted file mode 100644
index 7dacac0fd9a..00000000000
--- a/sonar-batch/src/test/resources/org/sonar/batch/scan/ProjectReactorBuilderTest/simple-project-with-deprecated-props/libs/lib2.txt
+++ /dev/null
@@ -1 +0,0 @@
-lib2 \ No newline at end of file
diff --git a/sonar-batch/src/test/resources/org/sonar/batch/scan/ProjectReactorBuilderTest/simple-project-with-deprecated-props/sonar-project.properties b/sonar-batch/src/test/resources/org/sonar/batch/scan/ProjectReactorBuilderTest/simple-project-with-deprecated-props/sonar-project.properties
deleted file mode 100644
index 1b2b5963888..00000000000
--- a/sonar-batch/src/test/resources/org/sonar/batch/scan/ProjectReactorBuilderTest/simple-project-with-deprecated-props/sonar-project.properties
+++ /dev/null
@@ -1,8 +0,0 @@
-sonar.projectKey=com.foo.project
-sonar.projectName=Foo Project
-sonar.projectVersion=1.0-SNAPSHOT
-sonar.projectDescription=Description of Foo Project
-
-# Those are the deprecated properties
-sources=sources
-libraries=libs/*.txt
diff --git a/sonar-batch/src/test/resources/org/sonar/batch/scan/ProjectReactorBuilderTest/simple-project-with-deprecated-props/sources/Fake.java b/sonar-batch/src/test/resources/org/sonar/batch/scan/ProjectReactorBuilderTest/simple-project-with-deprecated-props/sources/Fake.java
deleted file mode 100644
index b2e6462a3f9..00000000000
--- a/sonar-batch/src/test/resources/org/sonar/batch/scan/ProjectReactorBuilderTest/simple-project-with-deprecated-props/sources/Fake.java
+++ /dev/null
@@ -1 +0,0 @@
-Fake