aboutsummaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorStas Vilchik <vilchiks@gmail.com>2015-03-09 15:43:05 +0100
committerStas Vilchik <vilchiks@gmail.com>2015-03-09 15:43:05 +0100
commit0de35e885e368d4f8698fb76b8138c6bf2008026 (patch)
tree9ae9c42cf431b81e1c97bccfe012da098865c7fc /plugins
parentfb9f54a03332f1bdf5ffb08906e575f35a860a9c (diff)
parentb62e3e85e99579a4ef56e24331296122d28f68c7 (diff)
downloadsonarqube-0de35e885e368d4f8698fb76b8138c6bf2008026.tar.gz
sonarqube-0de35e885e368d4f8698fb76b8138c6bf2008026.zip
Merge branch 'master' into branch-5.2
Conflicts: server/sonar-server/src/main/java/org/sonar/server/platform/ServerComponents.java server/sonar-web/src/main/less/components.less
Diffstat (limited to 'plugins')
-rw-r--r--plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/size.html.erb4
-rw-r--r--plugins/sonar-xoo-plugin/src/main/java/org/sonar/xoo/XooPlugin.java26
-rw-r--r--plugins/sonar-xoo-plugin/src/main/java/org/sonar/xoo/extensions/XooProjectBuilder.java55
3 files changed, 64 insertions, 21 deletions
diff --git a/plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/size.html.erb b/plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/size.html.erb
index 9e0797f8005..7811e848f0d 100644
--- a/plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/size.html.erb
+++ b/plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/size.html.erb
@@ -50,7 +50,7 @@
<tr>
<td>
<% if language_key.eql? '<null>' %>
- <%= message('other') -%>
+ <%= message('unknown') -%>
<% else %>
<% language = languages.find { |l| l.getKey()==language_key.to_s } -%>
<%= language ? language.getName() : language_key -%>
@@ -80,7 +80,7 @@
<%
language_key = ncloc_language_dist_hash.first[0]
if language_key.eql? '<null>' %>
- <%= message('other') -%>
+ <%= message('unknown') -%>
<% else %>
<% language = languages.find { |l| l.getKey()==language_key.to_s } -%>
<%= language ? language.getName() : language_key -%>
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 df3a7b5c64e..8aa011ef873 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
@@ -20,23 +20,9 @@
package org.sonar.xoo;
import org.sonar.api.SonarPlugin;
-import org.sonar.xoo.lang.DependencySensor;
-import org.sonar.xoo.lang.MeasureSensor;
-import org.sonar.xoo.lang.SymbolReferencesSensor;
-import org.sonar.xoo.lang.SyntaxHighlightingSensor;
-import org.sonar.xoo.lang.XooCpdMapping;
-import org.sonar.xoo.lang.XooTokenizer;
-import org.sonar.xoo.rule.ChecksSensor;
-import org.sonar.xoo.rule.CreateIssueByInternalKeySensor;
-import org.sonar.xoo.rule.DeprecatedResourceApiSensor;
-import org.sonar.xoo.rule.OneIssueOnDirPerFileSensor;
-import org.sonar.xoo.rule.OneIssuePerLineSensor;
-import org.sonar.xoo.rule.RandomAccessSensor;
-import org.sonar.xoo.rule.XooFakeExporter;
-import org.sonar.xoo.rule.XooFakeImporter;
-import org.sonar.xoo.rule.XooFakeImporterWithMessages;
-import org.sonar.xoo.rule.XooQualityProfile;
-import org.sonar.xoo.rule.XooRulesDefinition;
+import org.sonar.xoo.extensions.XooProjectBuilder;
+import org.sonar.xoo.lang.*;
+import org.sonar.xoo.rule.*;
import org.sonar.xoo.scm.XooBlameCommand;
import org.sonar.xoo.scm.XooScmProvider;
@@ -81,7 +67,9 @@ public class XooPlugin extends SonarPlugin {
OneIssuePerLineSensor.class,
OneIssueOnDirPerFileSensor.class,
- CreateIssueByInternalKeySensor.class
- );
+ CreateIssueByInternalKeySensor.class,
+
+ // Other
+ XooProjectBuilder.class);
}
}
diff --git a/plugins/sonar-xoo-plugin/src/main/java/org/sonar/xoo/extensions/XooProjectBuilder.java b/plugins/sonar-xoo-plugin/src/main/java/org/sonar/xoo/extensions/XooProjectBuilder.java
new file mode 100644
index 00000000000..0ec5bcd0f1e
--- /dev/null
+++ b/plugins/sonar-xoo-plugin/src/main/java/org/sonar/xoo/extensions/XooProjectBuilder.java
@@ -0,0 +1,55 @@
+/*
+ * 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.xoo.extensions;
+
+import org.sonar.api.batch.bootstrap.ProjectBuilder;
+import org.sonar.api.batch.bootstrap.ProjectDefinition;
+import org.sonar.api.config.Settings;
+
+import java.io.File;
+
+public class XooProjectBuilder extends ProjectBuilder {
+
+ private Settings settings;
+
+ public XooProjectBuilder(Settings settings) {
+ this.settings = settings;
+ }
+
+ @Override
+ public void build(Context context) {
+ if (!settings.getBoolean("sonar.xoo.enableProjectBuilder")) {
+ return;
+ }
+ ProjectDefinition root = context.projectReactor().getRoot();
+
+ ProjectDefinition module = ProjectDefinition.create()
+ .setKey(root.getKey() + ":module1")
+ .setName("Module 1");
+
+ module.setBaseDir(new File(root.getBaseDir(), "module1"));
+ module.setWorkDir(new File(root.getWorkDir(), "module1"));
+
+ module.setSources("src");
+
+ root.addSubProject(module);
+ }
+
+}