]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-2834 Move Google Analytics Plugin to the forge
authorEvgeny Mandrikov <mandrikov@gmail.com>
Thu, 13 Oct 2011 13:40:45 +0000 (17:40 +0400)
committerEvgeny Mandrikov <mandrikov@gmail.com>
Mon, 17 Oct 2011 07:54:28 +0000 (11:54 +0400)
This includes removal of Google Analytics Account from System Info page.

plugins/sonar-googleanalytics-plugin/pom.xml [deleted file]
plugins/sonar-googleanalytics-plugin/src/main/java/org/sonar/plugins/googleanalytics/GoogleAnalyticsPlugin.java [deleted file]
plugins/sonar-googleanalytics-plugin/src/main/java/org/sonar/plugins/googleanalytics/GoogleAnalyticsWebFooter.java [deleted file]
plugins/sonar-googleanalytics-plugin/src/test/java/org/sonar/plugins/googleanalytics/GoogleAnalyticsPluginTest.java [deleted file]
plugins/sonar-googleanalytics-plugin/src/test/java/org/sonar/plugins/googleanalytics/GoogleAnalyticsWebFooterTest.java [deleted file]
pom.xml
sonar-application/pom.xml
sonar-server/pom.xml
sonar-server/src/main/webapp/WEB-INF/app/models/server.rb

diff --git a/plugins/sonar-googleanalytics-plugin/pom.xml b/plugins/sonar-googleanalytics-plugin/pom.xml
deleted file mode 100644 (file)
index d8761e2..0000000
+++ /dev/null
@@ -1,53 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
-  <modelVersion>4.0.0</modelVersion>
-
-  <parent>
-    <groupId>org.codehaus.sonar</groupId>
-    <artifactId>sonar</artifactId>
-    <version>2.12-SNAPSHOT</version>
-    <relativePath>../..</relativePath>
-  </parent>
-
-  <groupId>org.codehaus.sonar.plugins</groupId>
-  <artifactId>sonar-googleanalytics-plugin</artifactId>
-  <packaging>sonar-plugin</packaging>
-
-  <name>Sonar :: Plugins :: Google Analytics</name>
-
-  <dependencies>
-    <dependency>
-      <groupId>org.codehaus.sonar</groupId>
-      <artifactId>sonar-plugin-api</artifactId>
-      <scope>provided</scope>
-    </dependency>
-
-    <dependency>
-      <groupId>org.codehaus.sonar</groupId>
-      <artifactId>sonar-testing-harness</artifactId>
-      <scope>test</scope>
-    </dependency>
-  </dependencies>
-
-  <build>
-    <testResources>
-      <testResource>
-        <directory>${basedir}/src/main/resources</directory>
-      </testResource>
-      <testResource>
-        <directory>${basedir}/src/test/resources</directory>
-      </testResource>
-    </testResources>
-    <plugins>
-      <plugin>
-        <groupId>org.codehaus.sonar</groupId>
-        <artifactId>sonar-packaging-maven-plugin</artifactId>
-        <configuration>
-          <pluginName>Google analytics</pluginName>
-          <pluginClass>org.sonar.plugins.googleanalytics.GoogleAnalyticsPlugin</pluginClass>
-          <pluginDescription><![CDATA[Add the <a href="http://www.google.com/analytics/">Google Analytics</a> tracking script to the Sonar web application]]></pluginDescription>
-        </configuration>
-      </plugin>
-    </plugins>
-  </build>
-</project>
diff --git a/plugins/sonar-googleanalytics-plugin/src/main/java/org/sonar/plugins/googleanalytics/GoogleAnalyticsPlugin.java b/plugins/sonar-googleanalytics-plugin/src/main/java/org/sonar/plugins/googleanalytics/GoogleAnalyticsPlugin.java
deleted file mode 100644 (file)
index 5c05b12..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Sonar, open source software quality management tool.
- * Copyright (C) 2008-2011 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * Sonar 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.
- *
- * Sonar 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 Sonar; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02
- */
-package org.sonar.plugins.googleanalytics;
-
-import org.sonar.api.*;
-
-import java.util.ArrayList;
-import java.util.List;
-
-@Properties({
-    @Property(
-        key = CoreProperties.GOOGLE_ANALYTICS_ACCOUNT_PROPERTY,
-        name = "Account key",
-        description = "Example : UA-1234567-8")
-})
-public class GoogleAnalyticsPlugin extends SonarPlugin {
-
-  public List<Class<? extends Extension>> getExtensions() {
-    List<Class<? extends Extension>> list = new ArrayList<Class<? extends Extension>>();
-    list.add(GoogleAnalyticsWebFooter.class);
-    return list;
-  }
-
-}
diff --git a/plugins/sonar-googleanalytics-plugin/src/main/java/org/sonar/plugins/googleanalytics/GoogleAnalyticsWebFooter.java b/plugins/sonar-googleanalytics-plugin/src/main/java/org/sonar/plugins/googleanalytics/GoogleAnalyticsWebFooter.java
deleted file mode 100644 (file)
index 7d90741..0000000
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * Sonar, open source software quality management tool.
- * Copyright (C) 2008-2011 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * Sonar 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.
- *
- * Sonar 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 Sonar; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02
- */
-package org.sonar.plugins.googleanalytics;
-
-import org.apache.commons.configuration.Configuration;
-import org.sonar.api.CoreProperties;
-import org.sonar.api.web.Footer;
-
-public class GoogleAnalyticsWebFooter implements Footer {
-
-  private Configuration configuration;
-
-  public GoogleAnalyticsWebFooter(Configuration configuration) {
-    this.configuration = configuration;
-  }
-
-  protected String getIdAccount() {
-    return configuration.getString(CoreProperties.GOOGLE_ANALYTICS_ACCOUNT_PROPERTY, "");
-  }
-
-  public String getKey() {
-    return "webfooter_" + CoreProperties.GOOGLE_ANALYTICS_PLUGIN;
-  }
-
-  public String getHtml() {
-    String id = getIdAccount();
-    if (id != null && !"".equals(id)) {
-      return "<script type=\"text/javascript\">\n" +
-          "var gaJsHost = ((\"https:\" == document.location.protocol) ? \"https://ssl.\" : \"http://www.\");\n" +
-          "document.write(unescape(\"%3Cscript src='\" + gaJsHost + \"google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E\"));\n" +
-          "</script>\n" +
-          "<script type=\"text/javascript\">\n" +
-          "var pageTracker = _gat._getTracker(\"" + id + "\");\n" +
-          "pageTracker._initData();\n" +
-          "pageTracker._trackPageview();\n" +
-          "</script>";
-    }
-    return null;
-  }
-
-  @Override
-  public String toString() {
-    return getKey();
-  }
-
-}
diff --git a/plugins/sonar-googleanalytics-plugin/src/test/java/org/sonar/plugins/googleanalytics/GoogleAnalyticsPluginTest.java b/plugins/sonar-googleanalytics-plugin/src/test/java/org/sonar/plugins/googleanalytics/GoogleAnalyticsPluginTest.java
deleted file mode 100644 (file)
index 6f88f6d..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Sonar, open source software quality management tool.
- * Copyright (C) 2008-2011 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * Sonar 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.
- *
- * Sonar 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 Sonar; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02
- */
-package org.sonar.plugins.googleanalytics;
-
-import static org.hamcrest.Matchers.greaterThan;
-import static org.junit.Assert.assertThat;
-
-import org.junit.Test;
-
-public class GoogleAnalyticsPluginTest {
-
-  @Test
-  public void testGetExtensions() throws Exception {
-    assertThat(new GoogleAnalyticsPlugin().getExtensions().size(), greaterThan(0));
-  }
-
-}
diff --git a/plugins/sonar-googleanalytics-plugin/src/test/java/org/sonar/plugins/googleanalytics/GoogleAnalyticsWebFooterTest.java b/plugins/sonar-googleanalytics-plugin/src/test/java/org/sonar/plugins/googleanalytics/GoogleAnalyticsWebFooterTest.java
deleted file mode 100644 (file)
index 1cd7e93..0000000
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Sonar, open source software quality management tool.
- * Copyright (C) 2008-2011 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * Sonar 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.
- *
- * Sonar 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 Sonar; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02
- */
-package org.sonar.plugins.googleanalytics;
-
-import static org.hamcrest.Matchers.containsString;
-import static org.hamcrest.Matchers.nullValue;
-import static org.junit.Assert.assertThat;
-
-import org.apache.commons.configuration.BaseConfiguration;
-import org.apache.commons.configuration.Configuration;
-import org.junit.Before;
-import org.junit.Test;
-import org.sonar.api.CoreProperties;
-
-public class GoogleAnalyticsWebFooterTest {
-
-  private Configuration conf;
-  private GoogleAnalyticsWebFooter footer;
-
-  @Before
-  public void setUp() {
-    conf = new BaseConfiguration();
-    footer = new GoogleAnalyticsWebFooter(conf);
-  }
-
-  @Test
-  public void shouldNotReturnFooterIfNotConfigured() {
-    assertThat(footer.getHtml(), nullValue());
-  }
-
-  @Test
-  public void shouldReturnHtml() {
-    conf.setProperty(CoreProperties.GOOGLE_ANALYTICS_ACCOUNT_PROPERTY, "UA-1234567-8");
-    String html = footer.getHtml();
-    assertThat(html, containsString("google-analytics.com"));
-    assertThat(html, containsString("UA-1234567-8"));
-  }
-
-}
diff --git a/pom.xml b/pom.xml
index 6111683adb4551f160667e196b9f7fbe2d071a50..47888d7c8ba65fc4aab5a82950783bb74713a2c8 100644 (file)
--- a/pom.xml
+++ b/pom.xml
@@ -41,7 +41,6 @@
     <module>plugins/sonar-pmd-plugin</module>
     <module>plugins/sonar-cobertura-plugin</module>
     <module>plugins/sonar-surefire-plugin</module>
-    <module>plugins/sonar-googleanalytics-plugin</module>
     <module>plugins/sonar-findbugs-plugin</module>
     <module>plugins/sonar-cpd-plugin</module>
     <module>plugins/sonar-squid-java-plugin</module>
index 4f14a8459ecd9ee0e2ddcd15cd4d8622ff086908..042c1aaeb14f5db45e82936879bed5f7ec0fe354 100644 (file)
       <version>${project.version}</version>
       <scope>runtime</scope>
     </dependency>
-    <dependency>
-      <groupId>org.codehaus.sonar.plugins</groupId>
-      <artifactId>sonar-googleanalytics-plugin</artifactId>
-      <version>${project.version}</version>
-      <scope>runtime</scope>
-    </dependency>
     <dependency>
       <groupId>org.codehaus.sonar.plugins</groupId>
       <artifactId>sonar-findbugs-plugin</artifactId>
index 3341f21b830707682acded8b9c9176a9b896e1ff..2681bcd922917a42a55a187d76ed51f2a64b3ae3 100644 (file)
           <version>${project.version}</version>
           <scope>provided</scope>
         </dependency>
-        <dependency>
-          <groupId>org.codehaus.sonar.plugins</groupId>
-          <artifactId>sonar-googleanalytics-plugin</artifactId>
-          <version>${project.version}</version>
-          <scope>provided</scope>
-        </dependency>
         <dependency>
           <groupId>org.codehaus.sonar.plugins</groupId>
           <artifactId>sonar-findbugs-plugin</artifactId>
index 0e620caf9b2aa06dd677d32b318898436d210883..6ca38cb5fceb474aae26047f4d4bcf5c1c8c2e7f 100644 (file)
@@ -74,7 +74,6 @@ class Server
     add_property(sonar_info, 'Automatic User Creation') {sonar_property(org.sonar.api.CoreProperties.CORE_AUTHENTICATOR_CREATE_USERS)}
     add_property(sonar_info, 'Allow Users to Sign Up') {sonar_property(org.sonar.api.CoreProperties.CORE_ALLOW_USERS_TO_SIGNUP_PROPERTY)}
     add_property(sonar_info, 'Force Authentication') {sonar_property(org.sonar.api.CoreProperties.CORE_FORCE_AUTHENTICATION_PROPERTY)}
-    add_property(sonar_info, 'Google Analytics Account') {sonar_property('sonar.google-analytics.account')}
     sonar_info
   end