public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] gentoo-x86 commit in dev-util/eclipse-sdk/files/3.3/fedora: eclipse-pde.build-add-package-build.patch eclipse-libupdatebuild2.patch eclipse-fileinitializer.patch
@ 2008-01-21 12:31 Jean-Noel Rivasseau (elvanor)
  0 siblings, 0 replies; 2+ messages in thread
From: Jean-Noel Rivasseau (elvanor) @ 2008-01-21 12:31 UTC (permalink / raw
  To: gentoo-commits

elvanor     08/01/21 12:31:07

  Added:                eclipse-pde.build-add-package-build.patch
                        eclipse-libupdatebuild2.patch
                        eclipse-fileinitializer.patch
  Log:
  Eclipse 3.3.1.1 version bump, minor syntax changes for 3.2.1-r2 ebuild.
  (Portage version: 2.1.3.19)

Revision  Changes    Path
1.1                  dev-util/eclipse-sdk/files/3.3/fedora/eclipse-pde.build-add-package-build.patch

file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/dev-util/eclipse-sdk/files/3.3/fedora/eclipse-pde.build-add-package-build.patch?rev=1.1&view=markup
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/dev-util/eclipse-sdk/files/3.3/fedora/eclipse-pde.build-add-package-build.patch?rev=1.1&content-type=text/plain

Index: eclipse-pde.build-add-package-build.patch
===================================================================
Index: templates/package-build/build.properties
===================================================================
RCS file: templates/package-build/build.properties
diff -N templates/package-build/build.properties
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ templates/package-build/build.properties	1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,12 @@
+buildDirectory=${sourceDirectory}/build
+buildLabel=rpmBuild
+archivePrefix=eclipse
+skipFetch=true
+javacFailOnError=true
+collectingFolder=eclipse
+archivesFormat=*,*,*-zip
+zipargs=-y
+javacDebugInfo=true
+archiveName=${id}.zip
+runPackager=false
+baseLocation=/usr/share/eclipse
Index: templates/package-build/customTargets-assemble-target.xml
===================================================================
RCS file: templates/package-build/customTargets-assemble-target.xml
diff -N templates/package-build/customTargets-assemble-target.xml
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ templates/package-build/customTargets-assemble-target.xml	1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,12 @@
+<project>
+	<!-- ===================================================================== -->
+	<!-- Targets to assemble the built elements for particular configurations  -->
+	<!-- These generally call the generated assemble scripts (named in -->
+	<!-- ${assembleScriptName}) but may also add pre and post processing -->
+	<!-- Add one target for each root element and each configuration -->
+	<!-- ===================================================================== -->
+
+	<target name="assemble.@id@">
+		<ant antfile="${assembleScriptName}" dir="${buildDirectory}"/>
+	</target>
+</project>
Index: templates/package-build/customTargets.xml
===================================================================
RCS file: templates/package-build/customTargets.xml
diff -N templates/package-build/customTargets.xml
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ templates/package-build/customTargets.xml	1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,144 @@
+<project name="Build specific targets and properties" default="noDefault">
+
+	<fail unless="type" message="Please set the ${type} property to 'feature', 'plugin' or 'fragment'." />
+	<fail unless="id" message="Please set the ${id} property to the feature, plugin or fragment id of the plugin you are building." />
+	<fail unless="sourceDirectory" message="Please set the ${sourceDirectory} property to the directory that has the source plugins." />
+
+	<!-- we need to do this because you can't expand variables in target names -->	
+	<copy file="${builder}/customTargets-assemble-target.xml" tofile="${buildDirectory}/customTargets-${id}-assemble-target.xml" /> 
+	<replace file="${buildDirectory}/customTargets-${id}-assemble-target.xml" token="@id@" value="${id}" />
+	<import file="${buildDirectory}/customTargets-${id}-assemble-target.xml" />
+
+	<!-- ===================================================================== -->
+	<!-- Run a given ${target} on all elements being built -->
+	<!-- Add on <ant> task for each top level element being built. -->
+	<!-- ===================================================================== -->
+	<target name="allElements">
+		<ant antfile="${genericTargets}" target="${target}">
+			<property name="type" value="${type}" />
+			<property name="id" value="${id}" />
+		</ant>
+	</target>
+
+	
+	<!-- ===================================================================== -->
+	<!-- Check out map files from correct repository -->
+	<!-- ===================================================================== -->
+	<target name="getMapFiles">
+	</target>
+
+	<!-- ===================================================================== -->
+
+	<target name="clean" unless="noclean">
+		<antcall target="allElements">
+			<param name="target" value="cleanElement" />
+		</antcall>
+	</target>
+
+	<!-- ===================================================================== -->
+	<!-- Steps to do before setup -->
+	<!-- ===================================================================== -->
+	<target name="preSetup">
+	</target>
+
+	<!-- ===================================================================== -->
+	<!-- Steps to do after setup but before starting the build proper -->
+	<!-- ===================================================================== -->
+	<target name="postSetup">
+	</target>
+
+	<!-- ===================================================================== -->
+	<!-- Steps to do before fetching the build elements -->
+	<!-- ===================================================================== -->
+	<target name="preFetch">
+	</target>
+
+	<!-- ===================================================================== -->
+	<!-- Steps to do after fetching the build elements -->
+	<!-- ===================================================================== -->
+	<target name="postFetch">
+	</target>
+
+	<!-- ===================================================================== -->
+	<!-- Steps to do before generating the build scripts. -->
+	<!-- ===================================================================== -->
+	<target name="preGenerate">
+		<!-- Eclipse expects the feature projects to be in the 'features' directory and 
+   		plugin projects to be in the 'plugins' directory. The build infrastructure 
+		normally arranges the projects during the fetch stage. Since we aren't doing
+ 		the fetch stage, we have to manually arrange the files -->
+		<exec dir="${builder}" executable="/bin/sh">
+			<arg line="prepare-build-dir.sh ${sourceDirectory} ${buildDirectory}" />
+		</exec> 
+
+	</target>
+
+	<!-- ===================================================================== -->
+	<!-- Steps to do after generating the build scripts. -->
+	<!-- ===================================================================== -->
+	<target name="postGenerate">
+		<antcall target="clean" />
+	</target>
+
+	<!-- ===================================================================== -->
+	<!-- Steps to do before running the build.xmls for the elements being built. -->
+	<!-- ===================================================================== -->
+	<target name="preProcess">
+	</target>
+
+	<!-- ===================================================================== -->
+	<!-- Steps to do after running the build.xmls for the elements being built. -->
+	<!-- ===================================================================== -->
+	<target name="postProcess">
+	</target>
+
+	<!-- ===================================================================== -->
+	<!-- Steps to do before running assemble. -->
+	<!-- ===================================================================== -->
+	<target name="preAssemble">
+	</target>
+
+	<!-- ===================================================================== -->
+	<!-- Steps to do after  running assemble. -->
+	<!-- ===================================================================== -->
+	<target name="postAssemble">
+	</target>
+
+	<!-- ===================================================================== -->
+	<!-- Steps to do before running package. -->
+	<!-- ===================================================================== -->
+	<target name="prePackage">
+	</target>
+
+	<!-- ===================================================================== -->
+	<!-- Steps to do after  running package. -->
+	<!-- ===================================================================== -->
+	<target name="postPackage">
+	</target>
+
+	<!-- ===================================================================== -->
+	<!-- Steps to do after the build is done. -->
+	<!-- ===================================================================== -->
+	<target name="postBuild">
+	</target>
+
+	<!-- ===================================================================== -->
+	<!-- Steps to do to test the build results -->
+	<!-- ===================================================================== -->
+	<target name="test">
+	</target>
+
+	<!-- ===================================================================== -->
+	<!-- Steps to do to publish the build results -->
+	<!-- ===================================================================== -->
+	<target name="publish">
+	</target>
+
+	<!-- ===================================================================== -->
+	<!-- Default target                                                        -->
+	<!-- ===================================================================== -->
+	<target name="noDefault">
+		<echo message="You must specify a target when invoking this file" />
+	</target>
+
+</project>
Index: templates/package-build/prepare-build-dir.sh
===================================================================
RCS file: templates/package-build/prepare-build-dir.sh
diff -N templates/package-build/prepare-build-dir.sh
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ templates/package-build/prepare-build-dir.sh	1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,77 @@
+#!/bin/sh
+
+if [ $# -ne 2 ]; then 
+  echo "usage: $0 <path to source dir> <path to build dir>"
+  exit 1
+fi
+
+if [ ! -d $1 ]; then
+  echo "usage: $0 <path to source dir> <path to build dir>"
+  exit 1
+fi
+
+SOURCEDIR=$1
+BUILDDIR=$2
+
+echo "preparing files in $1 for buildfile generation ..."
+mkdir -p $BUILDDIR
+
+# make some ant build files to extract the id from the feature.xml, plugin.xml or the fragment.xml
+mkdir -p $BUILDDIR/tmp
+BUILDFILE=$BUILDDIR/tmp/build.xml
+
+echo "<project default=\"main\">
+	<target name=\"main\">
+               	<xmlproperty file=\"@type@.xml\" collapseAttributes=\"true\"/>
+		<fail unless=\"@type@.id\" message=\"feature.id not set\"/>
+               	<echo message=\"\${@type@.id}\" />
+        </target>
+</project>" > $BUILDFILE
+
+for type in feature plugin fragment; do
+  CURBUILDFILE=$BUILDDIR/tmp/$type-build.xml
+  cat $BUILDFILE | sed "s|@type@|$type|" > $CURBUILDFILE
+done
+
+# make the directories eclipse is expecting 
+echo "  making the 'features' and 'plugins' directories"
+mkdir -p $BUILDDIR/features $BUILDDIR/plugins
+
+# make symlinks for the features
+FEATURES=$(find $SOURCEDIR -name feature.xml)
+for f in $FEATURES; do
+  PROJECTDIR=$(dirname $f)
+  PROJECTNAME=$(ant -Dbasedir=$PROJECTDIR -f $BUILDDIR/tmp/feature-build.xml 2>&1 | grep echo | cut --delimiter=' ' -f 7)
+  if [ -z $PROJECTNAME ]; then
+    echo "ERROR: could not determine the feature id for $PROJECTDIR"
+    exit 1
+  fi
+
+  echo "  making symlink: $BUILDDIR/features/$PROJECTNAME -> $PROJECTDIR"
+  ln -sf $PROJECTDIR $BUILDDIR/features/$PROJECTNAME
+done
+
+# make symlinks for plugins and fragments
+PLUGINDIRS=$(find $SOURCEDIR -name plugin.xml -o -name fragment.xml -o -name MANIFEST.MF | sed "s/plugin.xml//g" | sed "s/fragment.xml//g" | sed "s/META-INF\/MANIFEST.MF//" | sort | uniq)
+for dir in $PLUGINDIRS; do
+  PROJECTNAME=""
+  if [ -e $dir/META-INF/MANIFEST.MF ]; then
+    PROJECTNAME=$(grep Bundle-SymbolicName $dir/META-INF/MANIFEST.MF | cut --delimiter=';' -f 1 | cut --delimiter=' ' -f 2)
+  elif [ -e $dir/plugin.xml ]; then
+    PROJECTNAME=$(ant -Dbasedir=$dir -f $BUILDDIR/tmp/plugin-build.xml 2>&1 | grep echo | cut --delimiter=' ' -f 7)
+  elif [ -e $dir/fragment.xml ]; then
+    PROJECTNAME=$(ant -Dbasedir=$dir -f $BUILDDIR/tmp/fragment-build.xml 2>&1 | grep echo | cut --delimiter=' ' -f 7)
+  fi
+
+  if [ -z $PROJECTNAME  ]; then
+    echo "ERROR: could not determine the plugin or fragment id for $dir"
+    exit 1
+  fi
+
+  echo "  making symlink: $BUILDDIR/plugins/$PROJECTNAME -> $dir"
+  ln -sf $dir $BUILDDIR/plugins/$PROJECTNAME
+
+done 
+
+rm -rf $BUILDDIR/tmp
+echo done 



1.1                  dev-util/eclipse-sdk/files/3.3/fedora/eclipse-libupdatebuild2.patch

file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/dev-util/eclipse-sdk/files/3.3/fedora/eclipse-libupdatebuild2.patch?rev=1.1&view=markup
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/dev-util/eclipse-sdk/files/3.3/fedora/eclipse-libupdatebuild2.patch?rev=1.1&content-type=text/plain

Index: eclipse-libupdatebuild2.patch
===================================================================
--- plugins/org.eclipse.update.core.linux/src/build.xml.orig	2006-01-27 15:35:35.000000000 -0500
+++ plugins/org.eclipse.update.core.linux/src/build.xml	2006-01-27 15:36:07.000000000 -0500
@@ -5,7 +5,7 @@
   <!-- Set a meaningful default value for when it is not. -->
   <property name="eclipse-home" value="${basedir}/../.."/>
   <property name="jdk-path" value="${java.home}"/>  
-  <property name="destination" value="${eclipse-home}/org.eclipse.update.core.linux/os/linux/x86/"/>
+  <property name="destination" value="${eclipse-home}/org.eclipse.update.core.linux/os/linux/${installArch}/"/>
   <property name="obj-path" value="${eclipse-home}/org.eclipse.update.core.linux/src/"/>
   <property name="src-path" value="${eclipse-home}/org.eclipse.update.core.linux/src/"/>  
   



1.1                  dev-util/eclipse-sdk/files/3.3/fedora/eclipse-fileinitializer.patch

file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/dev-util/eclipse-sdk/files/3.3/fedora/eclipse-fileinitializer.patch?rev=1.1&view=markup
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/dev-util/eclipse-sdk/files/3.3/fedora/eclipse-fileinitializer.patch?rev=1.1&content-type=text/plain

Index: eclipse-fileinitializer.patch
===================================================================
Index: plugin.xml
===================================================================
RCS file: /cvsroot/eclipse/org.eclipse.core.runtime/plugin.xml,v
retrieving revision 1.68
diff -u -r1.68 plugin.xml
--- plugin.xml	4 Mar 2005 22:18:54 -0000	1.68
+++ plugin.xml	7 Nov 2005 20:22:09 -0000
@@ -6,4 +6,22 @@
    <extension-point id="adapters" name="%adaptersName" schema="schema/adapters.exsd"/>
    <extension-point id="preferences" name="%preferencesName" schema="schema/preferences.exsd"/>
    <extension-point id="contentTypes" name="%contentTypesName" schema="schema/contentTypes.exsd"/>
+   <extension-point id="initializers" name="%initializersName" schema="schema/initializers.exsd"/>
+
+
+   <extension
+         id="initializer"
+         name="%initializerApp"
+         point="org.eclipse.core.runtime.applications">
+        <application>
+           <run class="org.eclipse.core.internal.runtime.Initializer"/>
+        </application>
+   </extension>
+   <extension id="fileInitializer"
+         point="org.eclipse.core.runtime.initializers">
+		<initializer>
+           <initialize class="org.eclipse.core.internal.runtime.FileInitializer"/>
+        </initializer>
+   </extension>
+ 
 </plugin>
Index: src/org/eclipse/core/internal/runtime/Messages.java
===================================================================
RCS file: /cvsroot/eclipse/org.eclipse.core.runtime/src/org/eclipse/core/internal/runtime/Messages.java,v
retrieving revision 1.18
diff -u -r1.18 Messages.java
--- src/org/eclipse/core/internal/runtime/Messages.java	20 Oct 2005 18:31:04 -0000	1.18
+++ src/org/eclipse/core/internal/runtime/Messages.java	7 Nov 2005 20:22:09 -0000
@@ -106,6 +106,14 @@
 	public static String plugin_instantiateClassError;
 	public static String plugin_loadClassError;
 
+	// initializer
+	public static String initializer_error;
+	
+	// file initializer
+	public static String fileInitializer_fileNotFound;
+	public static String fileInitializer_IOError;
+	public static String fileInitializer_missingFileName;
+	
 	static {
 		// load message values from bundle file
 		reloadMessages();
@@ -114,4 +122,4 @@
 	public static void reloadMessages() {
 		NLS.initializeMessages(BUNDLE_NAME, Messages.class);
 	}
-}
\ No newline at end of file
+}
Index: src/org/eclipse/core/internal/runtime/messages.properties
===================================================================
RCS file: /cvsroot/eclipse/org.eclipse.core.runtime/src/org/eclipse/core/internal/runtime/messages.properties,v
retrieving revision 1.106
diff -u -r1.106 messages.properties
--- src/org/eclipse/core/internal/runtime/messages.properties	20 Oct 2005 18:31:04 -0000	1.106
+++ src/org/eclipse/core/internal/runtime/messages.properties	7 Nov 2005 20:22:09 -0000
@@ -54,6 +54,13 @@
 provider_invalid = Problem creating the provider registered by {0}.
 product_notFound = Product {0} could not be found.
 
+### Initializer
+initializer_error=There was a problem running the application {0}.
+
+### File Initiializer
+fileInitializer_fileNotFound={0}: The file {1} was not found.
+fileInitializer_IOError={0}: There was an error reading {1}.
+
 ### Compatibility - parsing/resolving
 parse_badPrereqOnFrag = Fragment \"{0}\" requires non-existent plug-in \"{1}\".  Fragment ignored.
 parse_duplicateFragment = Duplicate fragment found with id \"{0}\" and version \"{1}\".
Index: src/org/eclipse/core/runtime/Platform.java
===================================================================
RCS file: /cvsroot/eclipse/org.eclipse.core.runtime/src/org/eclipse/core/runtime/Platform.java,v
retrieving revision 1.90
diff -u -r1.90 Platform.java
--- src/org/eclipse/core/runtime/Platform.java	26 Aug 2005 19:39:21 -0000	1.90
+++ src/org/eclipse/core/runtime/Platform.java	7 Nov 2005 20:22:09 -0000
@@ -95,6 +95,15 @@
 	public static final String OPTION_STARTTIME = PI_RUNTIME + "/starttime"; //$NON-NLS-1$
 
 	/**
+	 * The simple identifier constant (value "<code>initializers</code>") of
+	 * the extension point of the Core Runtime plug-in where plug-ins declare
+	 * their the existence of initialization code.
+	 * 
+	 * @since 3.1
+	 */
+
+	public static final String PT_INITIALIZERS = "initializers"; //$NON-NLS-1$
+	/** 
 	 * Name of a preference for configuring the performance level for this system.
 	 *
 	 * <p>
Index: schema/initializers.exsd
===================================================================
RCS file: schema/initializers.exsd
diff -N schema/initializers.exsd
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ schema/initializers.exsd	1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,138 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!-- Schema file written by PDE -->
+<schema targetNamespace="org.eclipse.core.runtime">
+<annotation>
+      <appInfo>
+         <meta.schema plugin="org.eclipse.core.runtime" id="initializers" name="Plug-in Initializers"/>
+      </appInfo>
+      <documentation>
+         Platform runtime supports plug-ins which would like to 
+be initialized. That is, plug-ins that needs to be initialized when
+the initialization application is being run should provide an extension
+to this extension-point.
+The initializers are run when the org.eclipse.core.runtime.initializer application
+is being run. The initializers are run in any order.
+      </documentation>
+   </annotation>
+
+   <element name="extension">
+      <complexType>
+         <sequence>
+            <element ref="initializer"/>
+         </sequence>
+         <attribute name="point" type="string" use="required">
+            <annotation>
+               <documentation>
+                  
+               </documentation>
+            </annotation>
+         </attribute>
+         <attribute name="id" type="string" use="required">
+            <annotation>
+               <documentation>
+                  
+               </documentation>
+            </annotation>
+         </attribute>
+         <attribute name="name" type="string">
+            <annotation>
+               <documentation>
+                  
+               </documentation>
+               <appInfo>
+                  <meta.attribute translatable="true"/>
+               </appInfo>
+            </annotation>
+         </attribute>
+      </complexType>
+   </element>
+
+   <element name="initializer">
+      <complexType>
+         <sequence>
+            <element ref="initialize"/>
+         </sequence>
+      </complexType>
+   </element>
+
+   <element name="initialize">
+      <complexType>
+         <sequence>
+            <element ref="initialize"/>
+         </sequence>
+         <attribute name="class" type="string" use="required">
+            <annotation>
+               <documentation>
+                  
+               </documentation>
+               <appInfo>
+                  <meta.attribute kind="java" basedOn="org.eclipse.core.runtime.IPlatformRunnable"/>
+               </appInfo>
+            </annotation>
+         </attribute>
+      </complexType>
+   </element>
+
+   <annotation>
+      <appInfo>
+         <meta.section type="since"/>
+      </appInfo>
+      <documentation>
+         3.1
+      </documentation>
+   </annotation>
+
+   <annotation>
+      <appInfo>
+         <meta.section type="examples"/>
+      </appInfo>
+      <documentation>
+         Following is an example of initializer declaration:
+&lt;p&gt;
+&lt;pre&gt;
+   &lt;extension id=&quot;myInitializer&quot; point=&quot;org.eclipse.core.runtime.initializers&quot;&gt;
+      &lt;initializer&gt;
+         &lt;initialize class=&quot;myInitializer.Doit&quot;/&gt;
+      &lt;/initializer&gt;
+   &lt;/extension&gt;
+&lt;/pre&gt;
+&lt;/p&gt;
+      </documentation>
+   </annotation>
+
+   <annotation>
+      <appInfo>
+         <meta.section type="apiInfo"/>
+      </appInfo>
+      <documentation>
+         The value of the class attribute must represent an 
+implementor of 
+&lt;samp&gt;org.eclipse.core.runtime.IPlatformRunnable&lt;/samp&gt;.
+      </documentation>
+   </annotation>
+
+   <annotation>
+      <appInfo>
+         <meta.section type="implementation"/>
+      </appInfo>
+      <documentation>
+         [Enter information about supplied implementation of this extension point.]
+      </documentation>
+   </annotation>
+
+   <annotation>
+      <appInfo>
+         <meta.section type="copyright"/>
+      </appInfo>
+      <documentation>
+         Copyright (c) 2005 IBM Corporation and others.&lt;br&gt;
+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 
+&lt;a 
+href=&quot;http://www.eclipse.org/legal/epl-v10.html&quot;&gt;http://www.eclipse.org/legal/epl-v10.html&lt;/a&gt;
+      </documentation>
+   </annotation>
+
+</schema>
Index: src/org/eclipse/core/internal/runtime/FileInitializer.java
===================================================================
RCS file: src/org/eclipse/core/internal/runtime/FileInitializer.java
diff -N src/org/eclipse/core/internal/runtime/FileInitializer.java
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ src/org/eclipse/core/internal/runtime/FileInitializer.java	1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,186 @@
+package org.eclipse.core.internal.runtime;
+
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.net.URL;
+import java.util.Collections;
+import java.util.Enumeration;
+import java.util.Iterator;
+import java.util.LinkedList;
+import java.util.Properties;
+import java.util.Set;
+import java.util.regex.Pattern;
+
+import org.eclipse.core.runtime.IPlatformRunnable;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.osgi.util.NLS;
+import org.osgi.framework.Bundle;
+
+/**
+ * <p>
+ * This application extracts files to their "localURL". The file patterns that you
+ * want to extract should be specified in a file in a properties format like this:
+ * 
+ * <pre>
+ * .* = *.so,about.html
+ * org.eclipse.team.core.cvs = *.html
+ * </pre>
+ * 
+ * This application should be run through the generic initializer mechanism and 
+ * not run directly.
+ * </p>
+ * 
+ * <p>
+ * To run this application, do something like:
+ * </p>
+ * 
+ * <p>
+ * <code>
+ * java -cp startup.jar org.eclipse.core.launcher.Main -application org.eclipse.core.runtime.initializer [-justThisArchOSWS] -fileInitializer &lt;fileWithFilePatternsToExtract&gt;
+ * </code>
+ * </p>
+ * 
+ * <p>
+ * <ul>
+ * <li> 
+ * Note: Only the files that are extracted will be printed to the console. If you
+ * want to debug things, use the -consolelog option in
+ * org.eclipse.core.launcher.Main
+ * </li>
+ * </ul>
+ * </p>
+ * 
+ * @see Initializer
+ * @see Platform#asLocalURL(URL)
+ * @since 3.1
+ */
+public class FileInitializer implements IPlatformRunnable {
+	
+	private LinkedList extractedFiles;
+	private boolean justThisArchOSWS;
+	
+	public Object run(Object args) throws Exception {
+		Properties bundleAndFilePatterns = getBundleAndFileNamePatterns((String[]) args);
+		Set bundlePatterns = bundleAndFilePatterns.keySet();
+		
+		// don't do anything if bundleAndFilePatterns is empty
+		if (bundleAndFilePatterns == null || bundleAndFilePatterns.size() == 0) {
+			return IPlatformRunnable.EXIT_OK;
+		}
+		
+		justThisArchOSWS = getJustThisArchOSWS((String[]) args);
+		
+		Bundle[] installedBundles = InternalPlatform.getDefault().getBundleContext().getBundles();
+		extractedFiles = new LinkedList();
+
+		// foreach(bundle pattern)
+		for (Iterator bundlePatternIter = bundlePatterns.iterator(); bundlePatternIter.hasNext();) {
+			Object bundlePattern = bundlePatternIter.next();
+			Object fileNamePattern = bundleAndFilePatterns.get(bundlePattern);
+			// foreach(filename pattern)
+			String[] fileNamePatterns = ((String) fileNamePattern).split(","); //$NON-NLS-1$
+			for (int i = 0; i < fileNamePatterns.length; i++) {
+				fileNamePatterns[i] = fileNamePatterns[i].trim();
+			}
+			// foreach(bundle)
+			for (int i = 0; i < installedBundles.length; i++) {
+				String bundleName = installedBundles[i].getSymbolicName();
+				// if(bundle matches pattern) check fileNamePattern(s)
+				if(Pattern.matches((String) bundlePattern, bundleName)) {
+					for (int j = 0; j < fileNamePatterns.length; j++) {
+						extractMatchingFilesFromBundle(fileNamePatterns[j], installedBundles[i]);
+					}
+				}
+			}
+		} // end for
+		return IPlatformRunnable.EXIT_OK;
+	}
+
+	private void extractMatchingFilesFromBundle(String fileNamePattern, Bundle bundle) throws IOException {
+		Enumeration e = bundle.findEntries("/", fileNamePattern, true); //$NON-NLS-1$
+
+		while(e != null && e.hasMoreElements()) {
+			URL fileURL = (URL) e.nextElement();
+			if (justThisArchOSWS) {
+				Path filePath = new Path(fileURL.getPath());
+				
+				String[] path = filePath.segments();
+				// check to see if the file should be extracted to the current os/arch
+				if (path.length == 4 && path[0].equals("os") && !(path[1].equals(Platform.getOS()) && path[2].equals(Platform.getOSArch()))) { //$NON-NLS-1$
+					continue;
+				}
+				// check to see if the file is should be extracted to the current ws
+				if (path.length == 3 && path[0].equals("ws") && !path[1].equals(Platform.getWS())) { //$NON-NLS-1$
+					continue;
+				}
+			}
+			
+			// the call to Platform.asLocalURL(URL) does the actual extraction
+			URL localURL = Platform.asLocalURL(fileURL);
+			if (localURL != null) {
+				String localURLPath = localURL.getPath();
+				
+				// only print the path if it hasn't been printed yet
+				int index = Collections.binarySearch(extractedFiles, localURLPath);
+				if (index < 0) {
+					extractedFiles.add(-(index + 1), localURLPath);
+					System.out.println("FileInitializer: " + localURLPath); //$NON-NLS-1$
+				}
+			}
+		}
+	}
+
+	private final String ARG_FILE = "-fileInitializer"; //$NON-NLS-1$
+	
+	private Properties getBundleAndFileNamePatterns(String[] argsArray) {
+		
+		for (int i = 0; i < argsArray.length; i++) {
+			if (argsArray[i].equalsIgnoreCase(ARG_FILE)) {
+
+				// the "file patterns" file was not specified
+				if (argsArray.length < i + 2) {
+					String msg = NLS.bind(Messages.fileInitializer_missingFileName, this.getClass().getName());
+					IStatus status = new Status(IStatus.ERROR, Platform.PI_RUNTIME, Platform.PLUGIN_ERROR, msg, null);
+					InternalPlatform.getDefault().log(status);
+					return null;
+				}
+				
+				try {
+					FileInputStream fin = new FileInputStream(argsArray[i + 1]);
+					Properties bundleAndFileNameProperties = new Properties();
+					bundleAndFileNameProperties.load(fin);
+					fin.close();
+					return bundleAndFileNameProperties;
+				} catch (FileNotFoundException e1) {
+					String msg = NLS.bind(Messages.fileInitializer_fileNotFound, this.getClass().getName(), argsArray[i + 1]);
+					IStatus status = new Status(IStatus.ERROR, Platform.PI_RUNTIME, Platform.PLUGIN_ERROR, msg, null);
+					InternalPlatform.getDefault().log(status);
+					return null;
+				} catch (IOException e) {
+					String msg = NLS.bind(Messages.fileInitializer_IOError, this.getClass().getName(), argsArray[i + 1]);
+					IStatus status = new Status(IStatus.ERROR, Platform.PI_RUNTIME, Platform.PLUGIN_ERROR, msg, e);
+					InternalPlatform.getDefault().log(status);
+					return null;
+				}
+			}
+		}
+		
+		// ARG_FILE wasn't found
+		return null;
+	}
+	
+	private final String ARG_JUSTTHISARCHOSWS = "-justThisArchOSWS"; //$NON-NLS-1$
+	
+	private boolean getJustThisArchOSWS(String[] argsArray) {
+		for (int i = 0; i < argsArray.length; i++) {
+			if (argsArray[i].equalsIgnoreCase(ARG_JUSTTHISARCHOSWS)) {
+				return true;
+			}
+		}
+		return false;
+	}
+}
Index: src/org/eclipse/core/internal/runtime/Initializer.java
===================================================================
RCS file: src/org/eclipse/core/internal/runtime/Initializer.java
diff -N src/org/eclipse/core/internal/runtime/Initializer.java
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ src/org/eclipse/core/internal/runtime/Initializer.java	1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,49 @@
+/*******************************************************************************
+* Copyright (c) 2005 Red Hat, Inc. 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:
+*     IBM  - Initial implementation
+*******************************************************************************/
+package org.eclipse.core.internal.runtime;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.core.runtime.IExtension;
+import org.eclipse.core.runtime.IExtensionPoint;
+import org.eclipse.core.runtime.IPlatformRunnable;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.osgi.util.NLS;
+
+public class Initializer implements IPlatformRunnable {
+
+	public Object run(Object args) throws Exception {
+		IExtensionPoint xpt = Platform.getExtensionRegistry().getExtensionPoint(Platform.PI_RUNTIME, Platform.PT_INITIALIZERS);
+		if (xpt == null)
+			return IPlatformRunnable.EXIT_OK;
+		
+		IExtension[] exts = xpt.getExtensions();
+		for (int i = 0; i < exts.length; i++) {
+			IConfigurationElement[] configs = exts[i].getConfigurationElements();
+			IPlatformRunnable initializer = null;
+			if (configs.length != 0) {
+				try {
+					initializer = (IPlatformRunnable) configs[0].createExecutableExtension("initialize"); //$NON-NLS-1$
+					initializer.run(args);
+				} catch(CoreException e) {
+					String msg = NLS.bind(Messages.initializer_error, exts[i].getExtensionPointUniqueIdentifier());
+					IStatus status = new Status(IStatus.ERROR, Platform.PI_RUNTIME, Platform.PLUGIN_ERROR, msg, e);
+					InternalPlatform.getDefault().log(status);
+					return null;
+				}
+			}
+		}
+		return IPlatformRunnable.EXIT_OK;
+	}
+
+}



-- 
gentoo-commits@lists.gentoo.org mailing list



^ permalink raw reply	[flat|nested] 2+ messages in thread

* [gentoo-commits] gentoo-x86 commit in dev-util/eclipse-sdk/files/3.3/fedora: eclipse-pde.build-add-package-build.patch eclipse-libupdatebuild2.patch eclipse-fileinitializer.patch
@ 2011-04-04  8:56 Alistair Bush (ali_bush)
  0 siblings, 0 replies; 2+ messages in thread
From: Alistair Bush (ali_bush) @ 2011-04-04  8:56 UTC (permalink / raw
  To: gentoo-commits

ali_bush    11/04/04 08:56:08

  Removed:              eclipse-pde.build-add-package-build.patch
                        eclipse-libupdatebuild2.patch
                        eclipse-fileinitializer.patch
  Log:
  Cleanup eclipse-sdk.
  
  (Portage version: 2.1.9.45/cvs/Linux x86_64)



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-04-04  8:56 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-04-04  8:56 [gentoo-commits] gentoo-x86 commit in dev-util/eclipse-sdk/files/3.3/fedora: eclipse-pde.build-add-package-build.patch eclipse-libupdatebuild2.patch eclipse-fileinitializer.patch Alistair Bush (ali_bush)
  -- strict thread matches above, loose matches on Subject: below --
2008-01-21 12:31 Jean-Noel Rivasseau (elvanor)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox