diff options
author | Duarte Meneses <duarte.meneses@sonarsource.com> | 2021-12-20 10:49:11 -0600 |
---|---|---|
committer | sonartech <sonartech@sonarsource.com> | 2021-12-21 20:03:11 +0000 |
commit | 32a5fecb407c19060301d2364d12002135b2aefe (patch) | |
tree | 74bf77a96333d521a35372228400ab0478ada08c /plugins/sonar-xoo-plugin | |
parent | dfe37e01a74c746c860250627ec3a28fdb0eea8d (diff) | |
download | sonarqube-32a5fecb407c19060301d2364d12002135b2aefe.tar.gz sonarqube-32a5fecb407c19060301d2364d12002135b2aefe.zip |
SONAR-15836 Language files are not automatically published
Diffstat (limited to 'plugins/sonar-xoo-plugin')
5 files changed, 99 insertions, 0 deletions
diff --git a/plugins/sonar-xoo-plugin/src/main/java/org/sonar/xoo/Xoo.java b/plugins/sonar-xoo-plugin/src/main/java/org/sonar/xoo/Xoo.java index ca7aaf5d9ab..2d1ce7aec7c 100644 --- a/plugins/sonar-xoo-plugin/src/main/java/org/sonar/xoo/Xoo.java +++ b/plugins/sonar-xoo-plugin/src/main/java/org/sonar/xoo/Xoo.java @@ -49,4 +49,9 @@ public class Xoo implements Language { public String[] getFileSuffixes() { return config.getStringArray(FILE_SUFFIXES_KEY); } + + @Override + public boolean publishAllFiles() { + return true; + } } diff --git a/plugins/sonar-xoo-plugin/src/main/java/org/sonar/xoo/Xoo2.java b/plugins/sonar-xoo-plugin/src/main/java/org/sonar/xoo/Xoo2.java index f4907b3810b..05af9b85916 100644 --- a/plugins/sonar-xoo-plugin/src/main/java/org/sonar/xoo/Xoo2.java +++ b/plugins/sonar-xoo-plugin/src/main/java/org/sonar/xoo/Xoo2.java @@ -45,4 +45,9 @@ public class Xoo2 implements Language { public String[] getFileSuffixes() { return XOO_SUFFIXES; } + + @Override + public boolean publishAllFiles() { + return true; + } } diff --git a/plugins/sonar-xoo-plugin/src/main/java/org/sonar/xoo/Xoo3NoAutoPublish.java b/plugins/sonar-xoo-plugin/src/main/java/org/sonar/xoo/Xoo3NoAutoPublish.java new file mode 100644 index 00000000000..f21994eb10b --- /dev/null +++ b/plugins/sonar-xoo-plugin/src/main/java/org/sonar/xoo/Xoo3NoAutoPublish.java @@ -0,0 +1,52 @@ +/* + * SonarQube + * Copyright (C) 2009-2021 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program 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. + * + * This program 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.xoo; + +import org.sonar.api.resources.Language; + +public class Xoo3NoAutoPublish implements Language { + public static final String KEY = "xoo3"; + public static final String NAME = "Xoo3"; + public static final String FILE_SUFFIX = ".xoo3"; + + private static final String[] XOO_SUFFIXES = { + FILE_SUFFIX + }; + + @Override + public String getKey() { + return KEY; + } + + @Override + public String getName() { + return NAME; + } + + @Override + public String[] getFileSuffixes() { + return XOO_SUFFIXES; + } + + @Override + public boolean publishAllFiles() { + return false; + } +} diff --git a/plugins/sonar-xoo-plugin/src/main/java/org/sonar/xoo/Xoo3QualityProfileDefinition.java b/plugins/sonar-xoo-plugin/src/main/java/org/sonar/xoo/Xoo3QualityProfileDefinition.java new file mode 100644 index 00000000000..489790ed1c9 --- /dev/null +++ b/plugins/sonar-xoo-plugin/src/main/java/org/sonar/xoo/Xoo3QualityProfileDefinition.java @@ -0,0 +1,35 @@ +/* + * SonarQube + * Copyright (C) 2009-2021 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program 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. + * + * This program 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.xoo; + +import org.sonar.api.server.profile.BuiltInQualityProfilesDefinition; + +public class Xoo3QualityProfileDefinition implements BuiltInQualityProfilesDefinition { + + private static final String PROFILE_NAME = "Sonar way"; + + @Override + public void define(Context context) { + NewBuiltInQualityProfile profile = context.createBuiltInQualityProfile(PROFILE_NAME, Xoo3NoAutoPublish.KEY); + profile.setDefault(true); + profile.done(); + } + +} diff --git a/plugins/sonar-xoo-plugin/src/main/java/org/sonar/xoo/XooPlugin.java b/plugins/sonar-xoo-plugin/src/main/java/org/sonar/xoo/XooPlugin.java index aba5d5bdf11..0ade397f3fd 100644 --- a/plugins/sonar-xoo-plugin/src/main/java/org/sonar/xoo/XooPlugin.java +++ b/plugins/sonar-xoo-plugin/src/main/java/org/sonar/xoo/XooPlugin.java @@ -109,6 +109,8 @@ public class XooPlugin implements Plugin { .build(), Xoo.class, Xoo2.class, + Xoo3NoAutoPublish.class, + Xoo3QualityProfileDefinition.class, XooRulesDefinition.class, XooBuiltInQualityProfilesDefinition.class, XooSonarWayProfile.class, |