[jboss-cvs] jbosside/releng/org.jboss.ide.eclipse.releng/src/org/jboss/ide/eclipse/releng ...

Marshall Culpepper mculpepper at jboss.com
Mon Sep 11 14:30:37 EDT 2006


  User: mculpepper
  Date: 06/09/11 14:30:37

  Modified:    releng/org.jboss.ide.eclipse.releng/src/org/jboss/ide/eclipse/releng 
                        CalculateFeatureDependenciesTask.java
  Log:
  apparently distinguising plugins just by platform wasn't granular enough as the platform feature includes all SWT variants and requires you to select by platform/OS/WS...
  
  Revision  Changes    Path
  1.3       +43 -8     jbosside/releng/org.jboss.ide.eclipse.releng/src/org/jboss/ide/eclipse/releng/CalculateFeatureDependenciesTask.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: CalculateFeatureDependenciesTask.java
  ===================================================================
  RCS file: /cvsroot/jboss/jbosside/releng/org.jboss.ide.eclipse.releng/src/org/jboss/ide/eclipse/releng/CalculateFeatureDependenciesTask.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -b -r1.2 -r1.3
  --- CalculateFeatureDependenciesTask.java	7 Sep 2006 16:26:34 -0000	1.2
  +++ CalculateFeatureDependenciesTask.java	11 Sep 2006 18:30:37 -0000	1.3
  @@ -21,12 +21,13 @@
   import org.dom4j.io.SAXReader;
   
   /**
  - * This task's purpose is to calculate the set of dependencies for the passed-in feature. This task is recurisve and will look at each plugin.xml/MANIFEST.MF whether inside JAR or folder.
  + * This task's purpose is to calculate the set of dependencies for the passed-in feature.
  + * This task is recursive and will look at each plugin.xml/MANIFEST.MF whether inside JAR or folder.
    * After calculating the dependencies, the given property will be filled with a comma-delimited list of dependencies (usable with ant-contrib).
    * Note that this task will exclude any plugins found to be included with the standard Eclipse SDK distribution.
    * Usage:
    * <code>
  - * &lt;calculateFeatureDependencies feature="org.jboss.ide.eclipse.feature" eclipseInstallDir="C:/eclipse" pluginList="dependencyList"/&gt;
  + * &lt;calculateFeatureDependencies feature="org.jboss.ide.eclipse.feature" eclipseInstallDir="C:/eclipse" pluginList="pluginList" featureList="featureList"/&gt;
    * </code>
    * 
    * Optional attribute: addOptional.
  @@ -128,20 +129,28 @@
   			Element pluginElement = (Element) iter.next();
   			String pluginName = pluginElement.attributeValue("id");
   			String os = pluginElement.attributeValue("os");
  +			String arch = pluginElement.attributeValue("arch");
  +			String ws = pluginElement.attributeValue("ws");
   			
   			if (os == null || os.equals(getPlatformOS()))
   			{
  +				if (arch == null || arch.equals(getPlatformArch()))
  +				{
  +					if (ws == null || ws.equals(getPlatformWS()))
  +					{
   				if (!pluginSet.contains(pluginName)) {
  -//					System.out.println("adding feature plugin \"" + pluginName + "\" to feature \"" + featureName + "\" dependency set");
  +		//					System.out.println("adding feature plugin \"" + pluginName + "\" to feature \"" + featureName + "\" dependency set");
   					addPluginDependenciesToSet(pluginName, pluginSet);
   				}
   			}
   		}		
   	}
  +		}		
  +	}
   	
  -	private static String getPlatformOS()
  +	// Emulation of org.eclipse.core.resources.Platform.getOS() (so we can run standalone)
  +	private static String getPlatformOS ()
   	{
  -		// simplified re-implementation of Platform.getOS() so we don't have to rely on eclipse classes
   		String osName = System.getProperty("os.name");
   		if (osName.indexOf("Windows") != -1)
   			return "win32";
  @@ -160,6 +169,32 @@
   		else return "unknown";
   	}
   	
  +	// Emulation of org.eclipse.core.resources.Platform.getOSArch() (so we can run standalone)
  +	private static String getPlatformArch ()
  +	{
  +		String archName = System.getProperty("os.arch");
  +		if (archName.equals("i386") || archName.equals("i686") || archName.equals("x86") || archName.equals("Pentium"))
  +			return "x86";
  +		else if (archName.equals("ppc"))
  +			return "ppc";
  +		else if (archName.equals("sparc"))
  +			return "sparc";
  +		else return "unknown";
  +	}
  +	
  +	// Emulation of org.eclipse.resources.Platform.getWS() (so we can run standalone)
  +	private static String getPlatformWS ()
  +	{
  +		String osName = System.getProperty("os.name");
  +		if (osName.indexOf("Windows") != -1)
  +			return "win32";
  +		else if (osName.indexOf("Linux") != -1)
  +			return "gtk";
  +		else if (osName.indexOf("Mac OS X") != -1)
  +			return "carbon";
  +		else return "unknown";
  +	}
  +	
   	private void addPluginDependenciesToSet (String pluginName, Set set)
   		throws BuildException
   	{
  
  
  



More information about the jboss-cvs-commits mailing list