You are viewing a plain text version of this content. The canonical link for it is here.
Posted to scm@geronimo.apache.org by sp...@apache.org on 2006/09/12 18:20:12 UTC

svn commit: r442633 - in /geronimo/devtools/eclipse-plugin/trunk/maven-plugins/maven-geronimodevtools-plugin/src/main/java/org/apache/geronimo/eclipse/devtools: DownloadMojo.java InstallPluginDependenciesMojo.java

Author: sppatel
Date: Tue Sep 12 09:20:11 2006
New Revision: 442633

URL: http://svn.apache.org/viewvc?view=rev&rev=442633
Log:
GERONIMODEVTOOLS-92 support builds on additional platforms

Modified:
    geronimo/devtools/eclipse-plugin/trunk/maven-plugins/maven-geronimodevtools-plugin/src/main/java/org/apache/geronimo/eclipse/devtools/DownloadMojo.java
    geronimo/devtools/eclipse-plugin/trunk/maven-plugins/maven-geronimodevtools-plugin/src/main/java/org/apache/geronimo/eclipse/devtools/InstallPluginDependenciesMojo.java

Modified: geronimo/devtools/eclipse-plugin/trunk/maven-plugins/maven-geronimodevtools-plugin/src/main/java/org/apache/geronimo/eclipse/devtools/DownloadMojo.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/maven-plugins/maven-geronimodevtools-plugin/src/main/java/org/apache/geronimo/eclipse/devtools/DownloadMojo.java?view=diff&rev=442633&r1=442632&r2=442633
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/maven-plugins/maven-geronimodevtools-plugin/src/main/java/org/apache/geronimo/eclipse/devtools/DownloadMojo.java (original)
+++ geronimo/devtools/eclipse-plugin/trunk/maven-plugins/maven-geronimodevtools-plugin/src/main/java/org/apache/geronimo/eclipse/devtools/DownloadMojo.java Tue Sep 12 09:20:11 2006
@@ -72,7 +72,7 @@
 	 * @parameter expression="${settings.localRepository}/eclipse/install.props"
 	 */
 	private File propsFile;
-	
+
 	/**
 	 * @parameter expression="${overwrite}";
 	 */
@@ -92,7 +92,7 @@
 
 	/*
 	 * (non-Javadoc)
-	 * 
+	 *
 	 * @see org.apache.maven.plugin.Mojo#execute()
 	 */
 	public void execute() throws MojoExecutionException, MojoFailureException {
@@ -133,8 +133,8 @@
 
 		load();
 		int identifier = generateInstallIdentifier(images);
-		
-	
+
+
 		boolean extract = false;
 		if("false".equals(overwrite)) {
 			extract = false;
@@ -143,7 +143,7 @@
 		} else {
 			extract = shouldExtract(identifier);
 		}
-		
+
 		if (extract) {
 			clean();
 			Iterator i = images.iterator();
@@ -176,14 +176,31 @@
 
 	private String getPlatformUrlSuffix() {
 		String os = System.getProperty("os.name");
+		String arch = System.getProperty("os.arch");
+		getLog().info("SDKPlatform:  os.name=" + os + ", os.arch=" + arch);
 		if (os.startsWith("Windows")) {
-			return "win32.zip";
+         if (arch.equalsIgnoreCase("x86_64") || arch.equalsIgnoreCase("amd64"))
+            return "win32-x86_64.zip";
+         else
+			   return "win32.zip";
 		} else if (os.startsWith("Linux")) {
-			return "linux-gtk.tar.gz";
+         if (arch.equalsIgnoreCase("x86_64") || arch.equalsIgnoreCase("amd64"))
+            return "linux-gtk-x86_64.tar.gz";
+         else if (arch.startsWith("ppc"))
+            return "linux-gtk-ppc.tar.gz";
+         else
+			   return "linux-gtk.tar.gz";
 		} else if (os.startsWith("Mac")) {
 			return "macosx-carbon.tar.gz";
-		}
-		return "win32.zip";
+		} else if (os.startsWith("SunOS")) {
+         if (arch.startsWith("x86") || arch.startsWith("amd"))
+            return "solaris-gtk-x86.zip";
+         else
+             return "solaris-gtk.zip";
+		} else if (os.startsWith("AIX")) {
+         return "aix-motif.zip";
+      } else  // flag that we don't know which Eclipse SDK to use
+		   return "unknown.zip";
 	}
 
 	private File getRepositoryDestination(URL url) {

Modified: geronimo/devtools/eclipse-plugin/trunk/maven-plugins/maven-geronimodevtools-plugin/src/main/java/org/apache/geronimo/eclipse/devtools/InstallPluginDependenciesMojo.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/maven-plugins/maven-geronimodevtools-plugin/src/main/java/org/apache/geronimo/eclipse/devtools/InstallPluginDependenciesMojo.java?view=diff&rev=442633&r1=442632&r2=442633
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/maven-plugins/maven-geronimodevtools-plugin/src/main/java/org/apache/geronimo/eclipse/devtools/InstallPluginDependenciesMojo.java (original)
+++ geronimo/devtools/eclipse-plugin/trunk/maven-plugins/maven-geronimodevtools-plugin/src/main/java/org/apache/geronimo/eclipse/devtools/InstallPluginDependenciesMojo.java Tue Sep 12 09:20:11 2006
@@ -1,13 +1,13 @@
 /**
  * Copyright 2004, 2005 The Apache Software Foundation or its licensors, as
  * applicable
- * 
+ *
  * Licensed under the Apache License, Version 2.0 (the "License"); you may not
  * use this file except in compliance with the License. You may obtain a copy of
  * the License at
- * 
+ *
  * http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
  * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
@@ -42,14 +42,14 @@
 /**
  * This maven plugin installs to the local maven repository eclipse plugin
  * dependencies for a pom from an eclipse distribution.
- * 
+ *
  * Plugins dependencies are defined with the "org.eclipse.plugins" groupId.
- * 
+ *
  * The artifactId is the bundle id. If the bundle is a directory, then all jars
  * inside the bundle will be installed. The bundle id can be appendend with "." +
  * the name of the jar inside the bundle, excluding the ".jar" extension in
  * order to explicitly define a jar dependency.
- * 
+ *
  * @goal install
  */
 public class InstallPluginDependenciesMojo extends AbstractMojo {
@@ -104,7 +104,7 @@
 
 	/*
 	 * (non-Javadoc)
-	 * 
+	 *
 	 * @see org.apache.maven.plugin.Mojo#execute()
 	 */
 	public void execute() throws MojoExecutionException, MojoFailureException {
@@ -156,13 +156,27 @@
 		fragment.setVersion(swtDependency.getVersion());
 		String id = swtDependency.getArtifactId();
 		String platform = System.getProperty("os.name");
+		String arch = System.getProperty("os.arch");
 		if (platform.startsWith("Windows")) {
-			fragment.setArtifactId(id.concat(".win32.win32.x86"));
+         fragment.setArtifactId(id.concat(".win32.win32.x86"));
 		} else if (platform.startsWith("Linux")) {
-			fragment.setArtifactId(id.concat(".gtk.linux.x86"));
+         if (arch.equalsIgnoreCase("x86_64") || arch.equalsIgnoreCase("amd64"))
+            fragment.setArtifactId(id.concat(".gtk.linux.x86_64"));
+         else if (arch.startsWith("ppc"))
+            fragment.setArtifactId(id.concat(".gtk.linux.ppc"));
+         else
+			   fragment.setArtifactId(id.concat(".gtk.linux.x86"));
 		} else if (platform.startsWith("Mac")) {
 			fragment.setArtifactId(id.concat(".carbon.macosx"));
+		} else if (platform.startsWith("SunOS")) {
+         if (arch.startsWith("x86") || arch.startsWith("amd"))
+            fragment.setArtifactId(id.concat(".gtk.solaris.x86"));
+         else
+            fragment.setArtifactId(id.concat(".gtk.solaris.sparc"));
+		} else if (platform.startsWith("AIX")) {
+			fragment.setArtifactId(id.concat(".motif.aix.ppc"));
 		}
+		getLog().info("SWTFragment:  " + fragment.toString());
 		return fragment;
 	}
 
@@ -225,11 +239,11 @@
 
 	/**
 	 * Converts eclipse qualifier convention to maven convention.
-	 * 
+	 *
 	 * major.minor.revision.qualifier is converted to major.minor.revision-build
 	 * where build is the eclipse qualifier with all non-numeric characters
 	 * removed.
-	 * 
+	 *
 	 * @param version
 	 * @return
 	 */