[eclipse-mylyn-builds/f17] Update to upstream 3.7.0 release.

Krzysztof Daniel kdaniel at fedoraproject.org
Tue Mar 27 16:28:12 UTC 2012


commit d079c0e1fb9e45f93779e4577b39da599bdd6f78
Author: Krzysztof Daniel <kdaniel at redhat.com>
Date:   Tue Mar 27 14:54:51 2012 +0200

    Update to upstream 3.7.0 release.

 .gitignore                          |    4 +
 eclipse-mylyn-builds.spec           |   43 +++---
 fix_hudson.core_plugin_java_6.patch |  108 +++++++--------
 fix_hudson_feature.patch            |   26 ++--
 remove_hudson_discovery.patch       |  270 ++++++++++++++++++++++++-----------
 sources                             |    2 +-
 6 files changed, 278 insertions(+), 175 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index cf53e8f..c112c51 100644
--- a/.gitignore
+++ b/.gitignore
@@ -3,3 +3,7 @@ R_3_6_0.tar.bz2
 R_3_6_2.tar.bz2
 R_3_6_3.tar.bz2
 R_3_6_4.tar.bz2
+/R_3_7_0.tar.bz2
+/R_3_7_0
+/noarch
+*.rpm
diff --git a/eclipse-mylyn-builds.spec b/eclipse-mylyn-builds.spec
index 883ef1c..4c1d84f 100644
--- a/eclipse-mylyn-builds.spec
+++ b/eclipse-mylyn-builds.spec
@@ -2,16 +2,16 @@
 %global install_loc         %{_datadir}/eclipse/dropins
 # Taken from update site so we match upstream
 #  http://download.eclipse.org/mylyn/archive/3.6.4/v20110608-1400/
-%global qualifier           v20110908-0706
+%global qualifier           v20120319-0200
 
 Name: eclipse-mylyn-builds
 Summary: Eclipse Mylyn Builds
-Version: 3.6.4
-Release: 2%{?dist}
+Version: 3.7.0
+Release: 1%{?dist}
 License: EPL
 URL: http://www.eclipse.org/mylyn/builds/
 
-Source0: http://git.eclipse.org/c/mylyn/org.eclipse.mylyn.builds.git/snapshot/R_3_6_4.tar.bz2
+Source0: http://git.eclipse.org/c/mylyn/org.eclipse.mylyn.builds.git/snapshot/R_3_7_0.tar.bz2
 
 # This patches hudson.core so as to
 # - remove ecf-based auto-discovery
@@ -27,12 +27,12 @@ Patch2: fix_hudson_feature.patch
 BuildArch: noarch
 
 BuildRequires: java-devel >= 1.6.0
-BuildRequires: eclipse-platform >= 1:3.5.0
-BuildRequires: eclipse-pde >= 1:3.5.0
-BuildRequires: eclipse-mylyn-commons >= 3.6.2
-BuildRequires: eclipse-mylyn >= 3.6.0
-BuildRequires: eclipse-mylyn-context-team >= 3.6.0
-BuildRequires: eclipse-mylyn-versions >= 3.6.0
+BuildRequires: eclipse-platform >= 1:3.7.0
+BuildRequires: eclipse-pde >= 1:3.7.0
+BuildRequires: eclipse-mylyn-commons >= 3.7.0
+BuildRequires: eclipse-mylyn >= 3.7.0
+BuildRequires: eclipse-mylyn-context-team >= 3.7.0
+BuildRequires: eclipse-mylyn-versions >= 3.7.0
 BuildRequires: eclipse-emf
 # Required for RestfulHudsonClient.java. However, this will only
 # work with java 1.6 and up, but that's better than not working at all.
@@ -41,11 +41,11 @@ BuildRequires: ws-jaxme
 # not sure what's best here.
 BuildRequires: xml-commons-apis
 BuildRequires: google-gson >= 1.6.0
-Requires: eclipse-mylyn >= 3.5.0
-Requires: eclipse-mylyn-commons >= 3.6.2
-Requires: eclipse-mylyn-context >= 3.6.0
+Requires: eclipse-mylyn >= 3.7.0
+Requires: eclipse-mylyn-commons >= 3.7.0
+Requires: eclipse-mylyn-context >= 3.7.0
 Requires: eclipse-emf
-Requires: eclipse-mylyn-versions >= 3.6.0
+Requires: eclipse-mylyn-versions >= 3.7.0
 Requires: xml-commons-apis
 
 
@@ -59,8 +59,8 @@ build providers using Eclipse Mylyn.
 %package hudson
 Summary: Mylyn Builds Connector: Hudson/Jenkins
 Requires: java >= 1:1.6.0
-Requires: eclipse-platform >= 1:3.5.0
-Requires: eclipse-mylyn-commons >= 3.6.2
+Requires: eclipse-platform >= 1:3.8.0
+Requires: eclipse-mylyn-commons >= 3.7.0
 Requires: ws-jaxme
 Requires: google-gson >= 1.6.0
 Requires: %{name} = %{version}-%{release}
@@ -71,10 +71,10 @@ Support for the open source Hudson and Jenkins continuous integration servers.
 
 
 %prep
-%setup -q -n R_3_6_4
-%patch0 -p1
-%patch1 -p1
-%patch2 -p1
+%setup -q -n R_3_7_0
+%patch0
+%patch1
+%patch2
 rm -rf orbitDeps
 mkdir orbitDeps
 pushd orbitDeps
@@ -125,6 +125,9 @@ popd
 
 
 %changelog
+* Tue Mar 27 2012 Krzysztof Daniel <kdaniel at redhat.com> 3.7.0-1
+- Update to upstream 3.7.0. release.
+
 * Fri Jan 13 2012 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 3.6.4-2
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
 
diff --git a/fix_hudson.core_plugin_java_6.patch b/fix_hudson.core_plugin_java_6.patch
index eff9298..d167155 100644
--- a/fix_hudson.core_plugin_java_6.patch
+++ b/fix_hudson.core_plugin_java_6.patch
@@ -1,27 +1,41 @@
-diff --git a/org.eclipse.mylyn.hudson.core/.classpath b/org.eclipse.mylyn.hudson.core/.classpath
-index 7e8449de039d0d70f369179c7ddaa5854d8f2304..5d0495ecf1b234e343c974c430841995ba846964 100644
---- a/org.eclipse.mylyn.hudson.core/.classpath
-+++ b/org.eclipse.mylyn.hudson.core/.classpath
-@@ -2,7 +2,7 @@
- <classpath>
- 	<classpathentry kind="src" path="src"/>
- 	<classpathentry kind="src" path="src-gen"/>
--	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
-+	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
- 	<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- 	<classpathentry kind="output" path="bin"/>
- </classpath>
-diff --git a/org.eclipse.mylyn.hudson.core/.settings/org.eclipse.jdt.core.prefs b/org.eclipse.mylyn.hudson.core/.settings/org.eclipse.jdt.core.prefs
-index bbaca6d644cf4d480abb32e3f0ad937f6ed500dd..1bca883a2e53bc15c73e557bef134a9bb6a7a99f 100644
---- a/org.eclipse.mylyn.hudson.core/.settings/org.eclipse.jdt.core.prefs
-+++ b/org.eclipse.mylyn.hudson.core/.settings/org.eclipse.jdt.core.prefs
-@@ -1,4 +1,4 @@
--#Wed Mar 02 16:00:06 PST 2011
-+#Thu Jul 14 11:41:29 EDT 2011
- eclipse.preferences.version=1
- org.eclipse.jdt.core.codeComplete.argumentPrefixes=
- org.eclipse.jdt.core.codeComplete.argumentSuffixes=
-@@ -9,9 +9,9 @@ org.eclipse.jdt.core.codeComplete.localSuffixes=
+--- org.eclipse.mylyn.hudson.core/META-INF/MANIFEST.MF.bak	2012-03-08 11:41:59.000000000 +0100
++++ org.eclipse.mylyn.hudson.core/META-INF/MANIFEST.MF	2012-03-27 14:39:43.122411638 +0200
+@@ -10,10 +10,10 @@
+  org.eclipse.mylyn.commons.core;bundle-version="3.7.0",
+  org.eclipse.mylyn.commons.repositories.core;bundle-version="0.9.0",
+  org.eclipse.mylyn.commons.repositories.http.core;bundle-version="0.9.0",
+- javax.xml.bind;bundle-version="2.1.0",
++ javax.xml.bind,
+  com.sun.xml.bind;bundle-version="2.2.0";resolution:=optional
+ Bundle-ActivationPolicy: lazy
+-Bundle-RequiredExecutionEnvironment: J2SE-1.5
++Bundle-RequiredExecutionEnvironment: JavaSE-1.6
+ Bundle-Localization: plugin
+ Export-Package: org.eclipse.mylyn.hudson.core;x-internal:=true,
+  org.eclipse.mylyn.internal.hudson.core;x-internal:=true,
+@@ -22,13 +22,13 @@
+ Bundle-Activator: org.eclipse.mylyn.internal.hudson.core.HudsonCorePlugin
+ Import-Package: com.google.gson;version="1.6.0",
+  javax.activation,
+- javax.xml.stream;version="1.0.1",
++ javax.xml.stream,
+  org.apache.http;version="4.1.4",
+- org.apache.http.client;version="4.1.2",
+- org.apache.http.client.entity;version="4.1.2",
+- org.apache.http.client.methods;version="4.1.2",
+- org.apache.http.impl.client;version="4.1.2",
+- org.apache.http.cookie;version="4.1.2",
++ org.apache.http.client;version="4.1.3",
++ org.apache.http.client.entity;version="4.1.3",
++ org.apache.http.client.methods;version="4.1.3",
++ org.apache.http.impl.client;version="4.1.3",
++ org.apache.http.cookie;version="4.1.3",
+  org.apache.http.message;version="4.1.4",
+  org.apache.http.protocol;version="4.1.4",
+  org.apache.http.util;version="4.1.4"
+--- org.eclipse.mylyn.hudson.core/.settings/org.eclipse.jdt.core.prefs.bak	2012-03-08 11:41:59.000000000 +0100
++++ org.eclipse.mylyn.hudson.core/.settings/org.eclipse.jdt.core.prefs	2012-03-27 14:37:52.707959396 +0200
+@@ -9,9 +9,9 @@
  org.eclipse.jdt.core.codeComplete.staticFieldPrefixes=
  org.eclipse.jdt.core.codeComplete.staticFieldSuffixes=
  org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
@@ -33,7 +47,7 @@ index bbaca6d644cf4d480abb32e3f0ad937f6ed500dd..1bca883a2e53bc15c73e557bef134a9b
  org.eclipse.jdt.core.compiler.debug.lineNumber=generate
  org.eclipse.jdt.core.compiler.debug.localVariable=generate
  org.eclipse.jdt.core.compiler.debug.sourceFile=generate
-@@ -75,7 +75,7 @@ org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disa
+@@ -75,7 +75,7 @@
  org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
  org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
  org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
@@ -42,36 +56,14 @@ index bbaca6d644cf4d480abb32e3f0ad937f6ed500dd..1bca883a2e53bc15c73e557bef134a9b
  org.eclipse.jdt.core.compiler.taskCaseSensitive=enabled
  org.eclipse.jdt.core.compiler.taskPriorities=NORMAL,HIGH,NORMAL
  org.eclipse.jdt.core.compiler.taskTags=TODO,FIXME,XXX
-@@ -160,10 +160,8 @@ org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true
- org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true
- org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=false
- org.eclipse.jdt.core.formatter.indentation.size=4
--org.eclipse.jdt.core.formatter.insert_new_line_after_annotation=insert
- org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field=insert
- org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert
--org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_member=insert
- org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method=insert
- org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package=insert
- org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=insert
-diff --git a/org.eclipse.mylyn.hudson.core/META-INF/MANIFEST.MF b/org.eclipse.mylyn.hudson.core/META-INF/MANIFEST.MF
-index d2178f668e2d8e2537739df129bb4fb791f52ef3..99afff131517b989d26c76febbd0c02c0be71b53 100644
---- a/org.eclipse.mylyn.hudson.core/META-INF/MANIFEST.MF
-+++ b/org.eclipse.mylyn.hudson.core/META-INF/MANIFEST.MF
-@@ -10,14 +10,14 @@ Require-Bundle: org.eclipse.core.runtime;bundle-version="3.5.0",
-  org.eclipse.mylyn.commons.core;bundle-version="[3.4.0,4.0.0)",
-  org.eclipse.mylyn.commons.net;bundle-version="[3.4.0,4.0.0)",
-  org.eclipse.mylyn.commons.repositories,
-- javax.xml.bind;bundle-version="2.1.0",
-+ javax.xml.bind,
-  com.sun.xml.bind;bundle-version="2.2.0";resolution:=optional
- Bundle-ActivationPolicy: lazy
--Bundle-RequiredExecutionEnvironment: J2SE-1.5
-+Bundle-RequiredExecutionEnvironment: JavaSE-1.6
- Bundle-Localization: plugin
- Export-Package: org.eclipse.mylyn.internal.hudson.core;x-internal:=true,
-  org.eclipse.mylyn.internal.hudson.core.client;x-internal:=true,
-  org.eclipse.mylyn.internal.hudson.model;x-internal:=true
- Bundle-Activator: org.eclipse.mylyn.internal.hudson.core.HudsonCorePlugin
- Import-Package: com.google.gson;version="1.6.0",
-- javax.xml.stream;version="1.0.1"
-+ javax.xml.stream
+--- org.eclipse.mylyn.hudson.core/.classpath.bak	2012-03-08 11:41:59.000000000 +0100
++++ org.eclipse.mylyn.hudson.core/.classpath	2012-03-27 14:37:01.164748276 +0200
+@@ -2,7 +2,7 @@
+ <classpath>
+ 	<classpathentry kind="src" path="src"/>
+ 	<classpathentry kind="src" path="src-gen"/>
+-	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
++	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
+ 	<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ 	<classpathentry kind="output" path="bin"/>
+ </classpath>
diff --git a/fix_hudson_feature.patch b/fix_hudson_feature.patch
index 4018bd6..6d83f3c 100644
--- a/fix_hudson_feature.patch
+++ b/fix_hudson_feature.patch
@@ -1,24 +1,24 @@
-diff --git a/org.eclipse.mylyn.hudson-feature/feature.xml b/org.eclipse.mylyn.hudson-feature/feature.xml
-index f5403faf9409afdd01999a340838f87755be79c5..a253e287fccda3cbc62288a45193273c97079c02 100644
---- a/org.eclipse.mylyn.hudson-feature/feature.xml
-+++ b/org.eclipse.mylyn.hudson-feature/feature.xml
-@@ -32,7 +32,6 @@
-       <import plugin="org.eclipse.mylyn.commons.net" version="3.6.0" match="compatible"/>
-       <import plugin="org.eclipse.mylyn.commons.repositories" version="0.8.0" match="compatible"/>
-       <import plugin="org.eclipse.mylyn.commons.ui" version="3.6.1" match="compatible"/>
+--- org.eclipse.mylyn.hudson-feature/feature.xml.orig	2012-03-08 11:41:59.000000000 +0100
++++ org.eclipse.mylyn.hudson-feature/feature.xml	2012-03-27 14:44:58.750736698 +0200
+@@ -29,7 +29,6 @@
+    </license>
+ 
+    <requires>
 -      <import plugin="com.google.gson" version="1.6.0" match="compatible"/>
        <import plugin="com.sun.xml.bind" version="2.2.0" match="compatible"/>
        <import plugin="javax.xml" version="1.3.4" match="compatible"/>
        <import plugin="javax.xml.bind" version="2.1.0" match="compatible"/>
-@@ -54,4 +53,11 @@
+@@ -51,6 +50,13 @@
+          download-size="0"
+          install-size="0"
           version="0.0.0"
-          unpack="false"/>
-
++         unpack="false"/>
++
 +   <plugin
 +         id="com.google.gson"
 +         download-size="0"
 +         install-size="0"
 +         version="0.0.0"
-+         unpack="false"/>
-+
+          unpack="false"/>
+ 
  </feature>
diff --git a/remove_hudson_discovery.patch b/remove_hudson_discovery.patch
index fab6f4d..50cea87 100644
--- a/remove_hudson_discovery.patch
+++ b/remove_hudson_discovery.patch
@@ -1,7 +1,5 @@
-diff --git a/org.eclipse.mylyn.hudson.ui/plugin.xml b/org.eclipse.mylyn.hudson.ui/plugin.xml
-index 6612ca72a99699db3ccc98a98e7003d2003dd5e6..b6f298555692dc5de5d32591ab7351bd18f8dd62 100644
---- a/org.eclipse.mylyn.hudson.ui/plugin.xml
-+++ b/org.eclipse.mylyn.hudson.ui/plugin.xml
+--- org.eclipse.mylyn.hudson.ui/plugin.xml.bak	2012-03-08 11:41:59.000000000 +0100
++++ org.eclipse.mylyn.hudson.ui/plugin.xml	2012-03-27 14:16:20.168665293 +0200
 @@ -34,11 +34,4 @@
           </description>
        </wizard>
@@ -9,31 +7,76 @@ index 6612ca72a99699db3ccc98a98e7003d2003dd5e6..b6f298555692dc5de5d32591ab7351bd
 -   <extension
 -         point="org.eclipse.mylyn.builds.ui.startup">
 -      <startup
--            class="org.eclipse.mylyn.internal.hudson.ui.HudsonDiscovery">
+-            class="org.eclipse.mylyn.internal.hudson.ui.HudsonStartup">
 -      </startup>
 -   </extension>
 -
  </plugin>
-diff --git a/org.eclipse.mylyn.hudson.ui/src/org/eclipse/mylyn/internal/hudson/ui/HudsonDiscovery.java b/org.eclipse.mylyn.hudson.ui/src/org/eclipse/mylyn/internal/hudson/ui/HudsonDiscovery.java
-deleted file mode 100644
-index 6bbe42ea6a4302b22b84d7d052e992b3cf9ce803..0000000000000000000000000000000000000000
---- a/org.eclipse.mylyn.hudson.ui/src/org/eclipse/mylyn/internal/hudson/ui/HudsonDiscovery.java
-+++ /dev/null
-@@ -1,149 +0,0 @@
+--- org.eclipse.mylyn.hudson.ui/META-INF/MANIFEST.MF.bak	2012-03-08 11:41:59.000000000 +0100
++++ org.eclipse.mylyn.hudson.ui/META-INF/MANIFEST.MF	2012-03-27 14:18:35.118218032 +0200
+@@ -20,5 +20,4 @@
+ Bundle-ActivationPolicy: lazy
+ Bundle-RequiredExecutionEnvironment: J2SE-1.5
+ Bundle-Localization: plugin
+-Export-Package: org.eclipse.mylyn.internal.hudson.ui;x-internal:=true
+ Bundle-Activator: org.eclipse.mylyn.internal.hudson.ui.HudsonUiPlugin
+--- org.eclipse.mylyn.hudson.ui/src/org/eclipse/mylyn/internal/hudson/ui/HudsonUiPlugin.java.bak	2012-03-08 11:41:59.000000000 +0100
++++ org.eclipse.mylyn.hudson.ui/src/org/eclipse/mylyn/internal/hudson/ui/HudsonUiPlugin.java	1970-01-01 01:00:00.000000000 +0100
+@@ -1,35 +0,0 @@
+-/*******************************************************************************
+- * Copyright (c) 2011 Tasktop Technologies.
+- * All rights reserved. This program and the accompanying materials
+- * are made available under the terms of the Eclipse Public License v1.0
+- * which accompanies this distribution, and is available at
+- * http://www.eclipse.org/legal/epl-v10.html
+- *
+- * Contributors:
+- *     Tasktop Technologies - initial API and implementation
+- *******************************************************************************/
+-
+-package org.eclipse.mylyn.internal.hudson.ui;
+-
+-import org.eclipse.ui.plugin.AbstractUIPlugin;
+-import org.osgi.framework.BundleContext;
+-
+-/**
+- * @author Steffen Pingel
+- */
+-public class HudsonUiPlugin extends AbstractUIPlugin {
+-
+-	public static String ID_PLUGIN = "org.eclipse.mylyn.hudson.ui";
+-
+-	public HudsonUiPlugin() {
+-	}
+-
+-	@Override
+-	public void stop(BundleContext context) throws Exception {
+-		if (HudsonStartup.getInstance() != null) {
+-			HudsonStartup.getInstance().stop();
+-		}
+-		super.stop(context);
+-	}
+-
+-}
+--- org.eclipse.mylyn.hudson.ui/src/org/eclipse/mylyn/internal/hudson/ui/HudsonDiscovery.java.bak	2012-03-08 11:41:59.000000000 +0100
++++ org.eclipse.mylyn.hudson.ui/src/org/eclipse/mylyn/internal/hudson/ui/HudsonDiscovery.java	1970-01-01 01:00:00.000000000 +0100
+@@ -1,192 +0,0 @@
 -/*******************************************************************************
-- * Copyright (c) 2010 Itema AS and others.
+- * Copyright (c) 2010, 2011 Itema AS and others.
 - * All rights reserved. This program and the accompanying materials
 - * are made available under the terms of the Eclipse Public License v1.0
 - * which accompanies this distribution, and is available at
 - * http://www.eclipse.org/legal/epl-v10.html
 - *
 - * Contributors:
-- *     Itema AS - initial API and implementation
+- *     Torkild U. Resheim - initial API and implementation
+- *     Torkild U. Resheim - Uniquely identify Jenkins servers, bug 341725
+- *     Torkild U. Resheim - Distinguish between Hudson and Jenkins, bug 353861
+- *     Tasktop Technologies - improvements
 - *******************************************************************************/
 -
 -package org.eclipse.mylyn.internal.hudson.ui;
 -
--import java.net.URI;
 -import java.net.URISyntaxException;
 -import java.util.List;
 -import java.util.UUID;
@@ -51,62 +94,62 @@ index 6bbe42ea6a4302b22b84d7d052e992b3cf9ce803..00000000000000000000000000000000
 -import org.eclipse.ecf.discovery.IServiceProperties;
 -import org.eclipse.ecf.discovery.identity.IServiceID;
 -import org.eclipse.ecf.discovery.identity.IServiceTypeID;
--import org.eclipse.mylyn.builds.core.IBuildServer;
 -import org.eclipse.mylyn.builds.ui.BuildsUi;
--import org.eclipse.mylyn.builds.ui.BuildsUiStartup;
 -import org.eclipse.mylyn.commons.core.StatusHandler;
+-import org.eclipse.mylyn.commons.repositories.core.RepositoryLocation;
 -import org.eclipse.osgi.util.NLS;
 -
 -/**
-- * This class implements a mechanism for discovering Hudson servers through the use of Multicast DNS (MDNS).
+- * This class implements a mechanism for discovering Hudson and Jenkins servers through the use of Multicast DNS (MDNS).
 - * 
-- * @author Torkild U. Resheim
-- * @since 3.5
+- * @author Torkild U. Resheim, Itema AS
+- * @author Steffen Pingel
 - */
--public class HudsonDiscovery extends BuildsUiStartup {
+-public class HudsonDiscovery {
 -
 -	private static final String ECF_DISCOVERY_JMDNS = "ecf.discovery.jmdns"; //$NON-NLS-1$
 -
--	private static final String ECF_SINGLETON_DISCOVERY = "ecf.singleton.discovery"; //$NON-NLS-1$
--
 -	private static final String HUDSON_MDNS_ID = "_hudson._tcp.local._iana"; //$NON-NLS-1$
 -
--	private static final String HUDSON_URL_PROPERTY_ID = "url"; //$NON-NLS-1$
+-	private static final String JENKINS_MDNS_ID = "_jenkins._tcp.local._iana"; //$NON-NLS-1$
 -
--	private static HudsonDiscovery instance;
+-	private static final String URL_PROPERTY = "url"; //$NON-NLS-1$
 -
--	private IContainer container;
+-	/** Server id property name (Jenkins only). */
+-	private static final String SERVER_ID_PROPERTY = "server-id"; //$NON-NLS-1$
 -
--	public static HudsonDiscovery getInstance() {
--		return instance;
--	}
+-	private IContainer container;
 -
 -	public HudsonDiscovery() {
--		instance = this;
 -	}
 -
 -	protected IContainer getContainer() throws ContainerCreateException {
 -		return ContainerFactory.getDefault().createContainer(ECF_DISCOVERY_JMDNS);
 -	}
 -
--	private boolean isNew(URI uri) {
--		List<IBuildServer> servers = BuildsUi.getModel().getServers();
--		for (IBuildServer server : servers) {
--			try {
--				if (new URI(server.getUrl() + "/").normalize().equals(uri)) {
--					return false;
--				}
--			} catch (URISyntaxException e) {
--				// disable, this could get logged very frequently
--//				StatusHandler.log(new Status(IStatus.ERROR, HudsonConnectorUi.ID_PLUGIN,
--//						Messages.HudsonDiscovery_CannotConvertURI, e));
+-	/**
+-	 * Determines whether or not the detected server is a new server or not.
+-	 * 
+-	 * @param url
+-	 *            the server URL
+-	 * @param id
+-	 *            the server identifier
+-	 * @return <code>true</code> if the detected server is new.
+-	 */
+-	private boolean isNew(String url, String id) {
+-		if (url == null) {
+-			return false;
+-		}
+-		List<RepositoryLocation> locations = BuildsUi.getServerLocations();
+-		for (RepositoryLocation location : locations) {
+-			if (location.hasUrl(url) || location.getId().equals(id)) {
+-				return false;
 -			}
 -		}
 -		return true;
 -	}
 -
--	@Override
--	public void lazyStartup() {
+-	public void start() {
 -		try {
 -			container = getContainer();
 -			final IDiscoveryLocator adapter = (IDiscoveryLocator) container.getAdapter(IDiscoveryLocator.class);
@@ -115,29 +158,38 @@ index 6bbe42ea6a4302b22b84d7d052e992b3cf9ce803..00000000000000000000000000000000
 -					IServiceInfo serviceInfo = anEvent.getServiceInfo();
 -					IServiceID serviceId = serviceInfo.getServiceID();
 -					IServiceTypeID serviceTypeId = serviceId.getServiceTypeID();
+-					// Note that Jenkins will claim that it's both Jenkins and
+-					// Hudson for backward compatibility.
+-					if (serviceTypeId.getName().equals(JENKINS_MDNS_ID)) {
+-						IServiceProperties properties = serviceInfo.getServiceProperties();
+-						try {
+-							if (properties.getProperty(URL_PROPERTY) == null) {
+-								notifyMessage(Messages.JenkinsDiscovery_MessageTitle, NLS.bind(
+-										Messages.JenkinsDiscovery_MissingURL, new Object[] { serviceInfo.getLocation()
+-												.getHost() }));
+-							} else {
+-								issueJenkinsNotification(properties);
+-							}
+-						} catch (URISyntaxException e) {
+-							StatusHandler.log(new Status(IStatus.ERROR, HudsonConnectorUi.ID_PLUGIN, NLS.bind(
+-									Messages.Discovery_IncorrectURI,
+-									new Object[] { properties.getProperty(URL_PROPERTY).toString() }), e));
+-						}
+-					}
 -					if (serviceTypeId.getName().equals(HUDSON_MDNS_ID)) {
 -						IServiceProperties properties = serviceInfo.getServiceProperties();
 -						try {
--							if (properties.getProperty(HUDSON_URL_PROPERTY_ID) == null) {
+-							if (properties.getProperty(URL_PROPERTY) == null) {
 -								notifyMessage(Messages.HudsonDiscovery_MessageTitle, NLS.bind(
 -										Messages.HudsonDiscovery_MissingURL, new Object[] { serviceInfo.getLocation()
 -												.getHost() }));
--
 -							} else {
--								String hudsonUrl = properties.getProperty(HUDSON_URL_PROPERTY_ID).toString();
--								URI uri = new URI(hudsonUrl + "/").normalize(); //$NON-NLS-1$
--								if (isNew(uri)) {
--									notifyMessage(
--											Messages.HudsonDiscovery_MessageTitle,
--											NLS.bind(Messages.HudsonDiscovery_MessageText, new Object[] { uri,
--													Messages.HudsonDiscovery_ServerName, uri.toString(),
--													UUID.randomUUID().toString() }));
--								}
+-								issueHudsonNotification(properties);
 -							}
 -						} catch (URISyntaxException e) {
 -							StatusHandler.log(new Status(IStatus.ERROR, HudsonConnectorUi.ID_PLUGIN, NLS.bind(
--									Messages.HudsonDiscovery_IncorrectURI,
--									new Object[] { properties.getProperty(HUDSON_URL_PROPERTY_ID).toString() }), e));
+-									Messages.Discovery_IncorrectURI,
+-									new Object[] { properties.getProperty(URL_PROPERTY).toString() }), e));
 -						}
 -					}
 -				}
@@ -150,10 +202,10 @@ index 6bbe42ea6a4302b22b84d7d052e992b3cf9ce803..00000000000000000000000000000000
 -
 -		} catch (ContainerCreateException e) {
 -			StatusHandler.log(new Status(IStatus.WARNING, HudsonConnectorUi.ID_PLUGIN,
--					Messages.HudsonDiscovery_CouldNotStartService, e));
+-					Messages.Discovery_CouldNotStartService, e));
 -		} catch (ContainerConnectException e) {
 -			StatusHandler.log(new Status(IStatus.WARNING, HudsonConnectorUi.ID_PLUGIN,
--					Messages.HudsonDiscovery_CouldNotStartService, e));
+-					Messages.Discovery_CouldNotStartService, e));
 -		}
 -	}
 -
@@ -168,15 +220,52 @@ index 6bbe42ea6a4302b22b84d7d052e992b3cf9ce803..00000000000000000000000000000000
 -		BuildsUi.serverDiscovered(title, description);
 -	}
 -
+-	private void issueHudsonNotification(IServiceProperties properties) throws URISyntaxException {
+-		String url = properties.getProperty(URL_PROPERTY).toString();
+-		String id = getId(properties);
+-		if (isNew(url, id)) {
+-			notifyMessage(
+-					Messages.HudsonDiscovery_MessageTitle,
+-					NLS.bind(Messages.HudsonDiscovery_MessageText, new Object[] { url,
+-							Messages.HudsonDiscovery_ServerName, url, id }));
+-		}
+-	}
+-
+-	private void issueJenkinsNotification(IServiceProperties properties) throws URISyntaxException {
+-		String url = properties.getProperty(URL_PROPERTY).toString();
+-		String id = getId(properties);
+-		if (isNew(url, id)) {
+-			// Change the first segment (org.eclipse.mylyn.hudson) to the id of 
+-			// the new repository type when we start differentiation between the two
+-			notifyMessage(
+-					Messages.JenkinsDiscovery_MessageTitle,
+-					NLS.bind(Messages.JenkinsDiscovery_MessageText, new Object[] { url,
+-							Messages.JenkinsDiscovery_ServerName, url, id }));
+-		}
+-	}
+-
+-	private String getId(IServiceProperties properties) {
+-		String id = (String) properties.getProperty(SERVER_ID_PROPERTY);
+-		if (id == null) {
+-			id = UUID.randomUUID().toString();
+-		}
+-		return id;
+-	}
+-
 -}
-diff --git a/org.eclipse.mylyn.hudson.ui/src/org/eclipse/mylyn/internal/hudson/ui/HudsonUiPlugin.java b/org.eclipse.mylyn.hudson.ui/src/org/eclipse/mylyn/internal/hudson/ui/HudsonUiPlugin.java
-deleted file mode 100644
-index 6bbe42ea6a4302b22b84d7d052e992b3cf9ce803..0000000000000000000000000000000000000000
---- a/org.eclipse.mylyn.hudson.ui/src/org/eclipse/mylyn/internal/hudson/ui/HudsonUiPlugin.java
-+++ /dev/null
-@@ -1,33 +0,0 @@
+--- org.eclipse.mylyn.hudson.ui/build.properties.bak	2012-03-27 14:48:20.000000000 +0200
++++ org.eclipse.mylyn.hudson.ui/build.properties	2012-03-27 14:48:32.555612843 +0200
+@@ -18,4 +18,4 @@
+                icons/
+ src.includes = about.html
+ 
+-jars.extra.classpath = platform:/plugin/org.eclipse.ecf,platform:/plugin/org.eclipse.ecf.discovery,platform:/plugin/org.eclipse.ecf.provider.discovery,platform:/plugin/org.eclipse.ecf.provider.jmdns
++#jars.extra.classpath = platform:/plugin/org.eclipse.ecf,platform:/plugin/org.eclipse.ecf.discovery,platform:/plugin/org.eclipse.ecf.provider.discovery,platform:/plugin/org.eclipse.ecf.provider.jmdns
+--- org.eclipse.mylyn.hudson.ui/src/org/eclipse/mylyn/internal/hudson/ui/HudsonStartup.java.bak	2012-03-08 11:41:59.000000000 +0100
++++ org.eclipse.mylyn.hudson.ui/src/org/eclipse/mylyn/internal/hudson/ui/HudsonStartup.java	1970-01-01 01:00:00.000000000 +0100
+@@ -1,59 +0,0 @@
 -/*******************************************************************************
-- * Copyright (c) 2011 Tasktop Technologies.
+- * Copyright (c) 2012 Tasktop Technologies and others.
 - * All rights reserved. This program and the accompanying materials
 - * are made available under the terms of the Eclipse Public License v1.0
 - * which accompanies this distribution, and is available at
@@ -188,34 +277,49 @@ index 6bbe42ea6a4302b22b84d7d052e992b3cf9ce803..00000000000000000000000000000000
 -
 -package org.eclipse.mylyn.internal.hudson.ui;
 -
--import org.eclipse.ui.plugin.AbstractUIPlugin;
--import org.osgi.framework.BundleContext;
+-import org.eclipse.core.runtime.IStatus;
+-import org.eclipse.core.runtime.Status;
+-import org.eclipse.mylyn.builds.ui.BuildsUiStartup;
+-import org.eclipse.mylyn.commons.core.StatusHandler;
 -
 -/**
 - * @author Steffen Pingel
 - */
--public class HudsonUiPlugin extends AbstractUIPlugin {
+-public class HudsonStartup extends BuildsUiStartup {
 -
--	public HudsonUiPlugin() {
+-	private static HudsonStartup instance;
+-
+-	public static HudsonStartup getInstance() {
+-		return instance;
 -	}
 -
+-	public HudsonStartup() {
+-		instance = this;
+-	}
+-
+-	private HudsonDiscovery discovery;
+-
 -	@Override
--	public void stop(BundleContext context) throws Exception {
--		if (HudsonDiscovery.getInstance() != null) {
--			HudsonDiscovery.getInstance().stop();
+-	public void lazyStartup() {
+-		if (discovery != null) {
+-			throw new IllegalStateException("Already started"); //$NON-NLS-1$
+-		}
+-		try {
+-			discovery = new HudsonDiscovery();
+-			discovery.start();
+-		} catch (LinkageError e) {
+-			// occurs when the optional ECF depedency is not satisfied 
+-			StatusHandler.log(new Status(IStatus.WARNING, HudsonUiPlugin.ID_PLUGIN,
+-					"ECF integration failed to load. Hudson server auto discovery is not available.", e));
+-			discovery = null;
+-		}
+-	}
+-
+-	public void stop() {
+-		if (discovery != null) {
+-			discovery.stop();
+-			discovery = null;
 -		}
--		super.stop(context);
 -	}
 -
 -}
-diff --git a/org.eclipse.mylyn.hudson.ui/META-INF/MANIFEST.MF b/org.eclipse.mylyn.hudson.ui/META-INF/MANIFEST.MF
-index 6612ca72a99699db3ccc98a98e7003d2003dd5e6..b6f298555692dc5de5d32591ab7351bd18f8dd62 100644
---- a/org.eclipse.mylyn.hudson.ui/META-INF/MANIFEST.MF	2011-08-31 10:16:51.000000000 -0400
-+++ b/org.eclipse.mylyn.hudson.ui/META-INF/MANIFEST.MF	2011-10-13 15:57:26.511385949 -0400
-@@ -19,5 +19,4 @@
- Bundle-ActivationPolicy: lazy
- Bundle-RequiredExecutionEnvironment: J2SE-1.5
- Bundle-Localization: plugin
--Export-Package: org.eclipse.mylyn.internal.hudson.ui;x-internal:=true
--Bundle-Activator: org.eclipse.mylyn.internal.hudson.ui.HudsonUiPlugin
-+Export-Package: org.eclipse.mylyn.internal.hudson.ui;x-internal:=true
diff --git a/sources b/sources
index 164a6d8..d1b1017 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-16d0bf3013a74241247c1e314ca2b608  R_3_6_4.tar.bz2
+31175f7af099c3bb54eedbba8bab4f17  R_3_7_0.tar.bz2


More information about the scm-commits mailing list