diff options
author | Evgeny Mandrikov <mandrikov@gmail.com> | 2011-10-13 17:40:45 +0400 |
---|---|---|
committer | Evgeny Mandrikov <mandrikov@gmail.com> | 2011-10-17 11:54:28 +0400 |
commit | a82b17a9e5b90e8a30a0f8a3697e1a5676f4c573 (patch) | |
tree | 528f5dbe63ae56d13f45d9f8d6f172493ca10bda | |
parent | 320a35b72bf63601722dfc71a3e7ecdca6bdee29 (diff) | |
download | sonarqube-a82b17a9e5b90e8a30a0f8a3697e1a5676f4c573.tar.gz sonarqube-a82b17a9e5b90e8a30a0f8a3697e1a5676f4c573.zip |
SONAR-2834 Move Google Analytics Plugin to the forge
This includes removal of Google Analytics Account from System Info page.
9 files changed, 0 insertions, 261 deletions
diff --git a/plugins/sonar-googleanalytics-plugin/pom.xml b/plugins/sonar-googleanalytics-plugin/pom.xml deleted file mode 100644 index d8761e22e0b..00000000000 --- a/plugins/sonar-googleanalytics-plugin/pom.xml +++ /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 index 5c05b12d12a..00000000000 --- a/plugins/sonar-googleanalytics-plugin/src/main/java/org/sonar/plugins/googleanalytics/GoogleAnalyticsPlugin.java +++ /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 index 7d90741a6f9..00000000000 --- a/plugins/sonar-googleanalytics-plugin/src/main/java/org/sonar/plugins/googleanalytics/GoogleAnalyticsWebFooter.java +++ /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 index 6f88f6d9a30..00000000000 --- a/plugins/sonar-googleanalytics-plugin/src/test/java/org/sonar/plugins/googleanalytics/GoogleAnalyticsPluginTest.java +++ /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 index 1cd7e93b3d0..00000000000 --- a/plugins/sonar-googleanalytics-plugin/src/test/java/org/sonar/plugins/googleanalytics/GoogleAnalyticsWebFooterTest.java +++ /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")); - } - -} @@ -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> diff --git a/sonar-application/pom.xml b/sonar-application/pom.xml index 4f14a8459ec..042c1aaeb14 100644 --- a/sonar-application/pom.xml +++ b/sonar-application/pom.xml @@ -130,12 +130,6 @@ </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> <version>${project.version}</version> <scope>runtime</scope> diff --git a/sonar-server/pom.xml b/sonar-server/pom.xml index 3341f21b830..2681bcd9229 100644 --- a/sonar-server/pom.xml +++ b/sonar-server/pom.xml @@ -403,12 +403,6 @@ </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> <version>${project.version}</version> <scope>provided</scope> diff --git a/sonar-server/src/main/webapp/WEB-INF/app/models/server.rb b/sonar-server/src/main/webapp/WEB-INF/app/models/server.rb index 0e620caf9b2..6ca38cb5fce 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/models/server.rb +++ b/sonar-server/src/main/webapp/WEB-INF/app/models/server.rb @@ -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 |