From c96f1183468824962415a12a73884b462db38f10 Mon Sep 17 00:00:00 2001 From: Simon Brandhof Date: Thu, 28 May 2015 14:58:50 +0200 Subject: [PATCH] Drop L10n english plugin --- plugins/sonar-l10n-en-plugin/pom.xml | 76 ------------------- .../sonar/plugins/l10n/EnglishPackPlugin.java | 34 --------- .../org/sonar/plugins/l10n/package-info.java | 23 ------ .../plugins/l10n/EnglishPackPluginTest.java | 32 -------- pom.xml | 1 - sonar-application/pom.xml | 7 -- .../org/sonar/core/platform/PluginInfo.java | 9 ++- .../sonar/core/platform/PluginInfoTest.java | 11 +++ 8 files changed, 19 insertions(+), 174 deletions(-) delete mode 100644 plugins/sonar-l10n-en-plugin/pom.xml delete mode 100644 plugins/sonar-l10n-en-plugin/src/main/java/org/sonar/plugins/l10n/EnglishPackPlugin.java delete mode 100644 plugins/sonar-l10n-en-plugin/src/main/java/org/sonar/plugins/l10n/package-info.java delete mode 100644 plugins/sonar-l10n-en-plugin/src/test/java/org/sonar/plugins/l10n/EnglishPackPluginTest.java diff --git a/plugins/sonar-l10n-en-plugin/pom.xml b/plugins/sonar-l10n-en-plugin/pom.xml deleted file mode 100644 index 49163bca0f7..00000000000 --- a/plugins/sonar-l10n-en-plugin/pom.xml +++ /dev/null @@ -1,76 +0,0 @@ - - - - - 4.0.0 - - - org.codehaus.sonar - sonar - 5.2-SNAPSHOT - ../.. - - - org.codehaus.sonar.plugins - sonar-l10n-en-plugin - sonar-plugin - SonarQube :: Plugins :: English Pack - - - - com.google.code.findbugs - jsr305 - provided - - - org.codehaus.sonar - sonar-plugin-api - provided - - - - org.codehaus.sonar - sonar-testing-harness - test - - - - - - - org.codehaus.sonar - sonar-packaging-maven-plugin - - English Pack - org.sonar.plugins.l10n.EnglishPackPlugin - - - - - org.apache.maven.plugins - maven-surefire-plugin - - ${skipServerTests} - - - - - diff --git a/plugins/sonar-l10n-en-plugin/src/main/java/org/sonar/plugins/l10n/EnglishPackPlugin.java b/plugins/sonar-l10n-en-plugin/src/main/java/org/sonar/plugins/l10n/EnglishPackPlugin.java deleted file mode 100644 index f5ddb9b924e..00000000000 --- a/plugins/sonar-l10n-en-plugin/src/main/java/org/sonar/plugins/l10n/EnglishPackPlugin.java +++ /dev/null @@ -1,34 +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.plugins.l10n; - -import org.sonar.api.SonarPlugin; - -import java.util.Collections; -import java.util.List; - -public final class EnglishPackPlugin extends SonarPlugin { - - @Override - public List getExtensions() { - return Collections.emptyList(); - } -} diff --git a/plugins/sonar-l10n-en-plugin/src/main/java/org/sonar/plugins/l10n/package-info.java b/plugins/sonar-l10n-en-plugin/src/main/java/org/sonar/plugins/l10n/package-info.java deleted file mode 100644 index 332d583940e..00000000000 --- a/plugins/sonar-l10n-en-plugin/src/main/java/org/sonar/plugins/l10n/package-info.java +++ /dev/null @@ -1,23 +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.plugins.l10n; - -import javax.annotation.ParametersAreNonnullByDefault; diff --git a/plugins/sonar-l10n-en-plugin/src/test/java/org/sonar/plugins/l10n/EnglishPackPluginTest.java b/plugins/sonar-l10n-en-plugin/src/test/java/org/sonar/plugins/l10n/EnglishPackPluginTest.java deleted file mode 100644 index f086398dd62..00000000000 --- a/plugins/sonar-l10n-en-plugin/src/test/java/org/sonar/plugins/l10n/EnglishPackPluginTest.java +++ /dev/null @@ -1,32 +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.plugins.l10n; - -import org.junit.Test; - -import static org.assertj.core.api.Assertions.assertThat; - -public class EnglishPackPluginTest { - @Test - public void no_extensions() { - assertThat(new EnglishPackPlugin().getExtensions()).isEmpty(); - } -} diff --git a/pom.xml b/pom.xml index dda04d74a41..d5283bc81c4 100644 --- a/pom.xml +++ b/pom.xml @@ -27,7 +27,6 @@ sonar-plugin-api server sonar-testing-harness - plugins/sonar-l10n-en-plugin plugins/sonar-email-notifications-plugin plugins/sonar-xoo-plugin diff --git a/sonar-application/pom.xml b/sonar-application/pom.xml index ef50d795c6a..2fad3d77928 100644 --- a/sonar-application/pom.xml +++ b/sonar-application/pom.xml @@ -89,13 +89,6 @@ - - org.codehaus.sonar.plugins - sonar-l10n-en-plugin - ${project.version} - sonar-plugin - provided - org.codehaus.sonar.plugins sonar-email-notifications-plugin diff --git a/sonar-core/src/main/java/org/sonar/core/platform/PluginInfo.java b/sonar-core/src/main/java/org/sonar/core/platform/PluginInfo.java index 71edd759fb2..c11a618b0fd 100644 --- a/sonar-core/src/main/java/org/sonar/core/platform/PluginInfo.java +++ b/sonar-core/src/main/java/org/sonar/core/platform/PluginInfo.java @@ -27,6 +27,7 @@ import com.google.common.base.Preconditions; import com.google.common.collect.ComparisonChain; import com.google.common.collect.Ordering; import org.apache.commons.lang.StringUtils; +import org.sonar.api.utils.log.Loggers; import org.sonar.updatecenter.common.PluginManifest; import org.sonar.updatecenter.common.Version; @@ -294,7 +295,13 @@ public class PluginInfo implements Comparable { } public PluginInfo setBasePlugin(@Nullable String s) { - this.basePlugin = s; + if ("l10nen".equals(s)) { + Loggers.get(PluginInfo.class).info("Plugin [{}] still defines 'l10nen' as base plugin. " + + "This metadata can be removed from manifest of l10n plugins since version 5.2.", key); + basePlugin = null; + } else { + basePlugin = s; + } return this; } diff --git a/sonar-core/src/test/java/org/sonar/core/platform/PluginInfoTest.java b/sonar-core/src/test/java/org/sonar/core/platform/PluginInfoTest.java index 28b33ae338b..d64a7323ff7 100644 --- a/sonar-core/src/test/java/org/sonar/core/platform/PluginInfoTest.java +++ b/sonar-core/src/test/java/org/sonar/core/platform/PluginInfoTest.java @@ -207,6 +207,17 @@ public class PluginInfoTest { assertThat(pluginInfo.toString()).isEqualTo("[java / 1.1 / SHA1]"); } + /** + * The English bundle plugin was removed in 5.2. L10n plugins do not need to declare + * it as base plugin anymore + */ + @Test + public void l10n_plugins_should_not_extend_english_plugin() throws Exception { + PluginInfo pluginInfo = new PluginInfo("l10nfr").setBasePlugin("l10nen"); + assertThat(pluginInfo.getBasePlugin()).isNull(); + + } + PluginInfo withMinSqVersion(@Nullable String version) { PluginInfo pluginInfo = new PluginInfo("foo"); if (version != null) { -- 2.39.5