[Esbox-commits] r2076 - in trunk: org.maemo.esbox.cpp.project org.maemo.esbox.cpp.project/META-INF org.maemo.esbox.cpp.project/src/org/maemo/esbox/internal/cpp/project/core org.maemo.esbox.scratchbox-feature org.maemo.esbox.scratchbox.sb1 org.maemo.esbox.scratchbox.sb1/META-INF org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/core

eswartz at garage.maemo.org eswartz at garage.maemo.org
Tue Sep 1 21:04:27 EEST 2009


Author: eswartz
Date: 2009-09-01 21:04:26 +0300 (Tue, 01 Sep 2009)
New Revision: 2076

Added:
   trunk/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/core/ApplyDoctoolsFixMarkerResolutionGenerator.java
Removed:
   trunk/org.maemo.esbox.cpp.project/src/org/maemo/esbox/internal/cpp/project/core/ApplyDoctoolsFixMarkerResolutionGenerator.java
Modified:
   trunk/org.maemo.esbox.cpp.project/META-INF/MANIFEST.MF
   trunk/org.maemo.esbox.cpp.project/plugin.xml
   trunk/org.maemo.esbox.scratchbox-feature/feature.xml
   trunk/org.maemo.esbox.scratchbox.sb1/META-INF/MANIFEST.MF
   trunk/org.maemo.esbox.scratchbox.sb1/plugin.xml
Log:
Apply revs 2071:2075 from work_Ed branch to fix build break

Modified: trunk/org.maemo.esbox.cpp.project/META-INF/MANIFEST.MF
===================================================================
--- trunk/org.maemo.esbox.cpp.project/META-INF/MANIFEST.MF	2009-09-01 18:02:02 UTC (rev 2075)
+++ trunk/org.maemo.esbox.cpp.project/META-INF/MANIFEST.MF	2009-09-01 18:04:26 UTC (rev 2076)
@@ -23,9 +23,6 @@
  org.eclipse.cdt.core;bundle-version="5.0.2",
  org.maemo.esbox.maemosdk.ui;bundle-version="2.0.0",
  org.maemo.mica.maemosdk.core;bundle-version="2.0.0",
- org.maemo.mica.cpp.project.builder.make;bundle-version="2.0.0",
- org.maemo.mica.cpp.project.builder.autotools;bundle-version="2.0.0",
- org.maemo.esbox.scratchbox.sb1;bundle-version="2.0.0",
- org.maemo.esbox.scratchbox.core;bundle-version="2.0.0"
+ org.maemo.mica.cpp.project.builder.make;bundle-version="2.0.0"
 Bundle-RequiredExecutionEnvironment: J2SE-1.5
 Bundle-ActivationPolicy: lazy

Modified: trunk/org.maemo.esbox.cpp.project/plugin.xml
===================================================================
--- trunk/org.maemo.esbox.cpp.project/plugin.xml	2009-09-01 18:02:02 UTC (rev 2075)
+++ trunk/org.maemo.esbox.cpp.project/plugin.xml	2009-09-01 18:04:26 UTC (rev 2076)
@@ -170,10 +170,6 @@
             class="org.maemo.esbox.internal.cpp.project.core.ConvertCppProjectMarkerResolutionGenerator"
             markerType="org.eclipse.core.resources.problemmarker">
       </markerResolutionGenerator>
-     <markerResolutionGenerator
-            class="org.maemo.esbox.internal.cpp.project.core.ApplyDoctoolsFixMarkerResolutionGenerator"
-            markerType="org.maemo.mica.cpp.project.builder.autotools.autotoolsProblemMarker">
-      </markerResolutionGenerator>
    </extension>
          
   <extension

Deleted: trunk/org.maemo.esbox.cpp.project/src/org/maemo/esbox/internal/cpp/project/core/ApplyDoctoolsFixMarkerResolutionGenerator.java
===================================================================
--- trunk/org.maemo.esbox.cpp.project/src/org/maemo/esbox/internal/cpp/project/core/ApplyDoctoolsFixMarkerResolutionGenerator.java	2009-09-01 18:02:02 UTC (rev 2075)
+++ trunk/org.maemo.esbox.cpp.project/src/org/maemo/esbox/internal/cpp/project/core/ApplyDoctoolsFixMarkerResolutionGenerator.java	2009-09-01 18:04:26 UTC (rev 2076)
@@ -1,172 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Nokia Corporation
- * 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:
- *    Ed Swartz (Nokia) - initial API and implementation
- *******************************************************************************/
-
-package org.maemo.esbox.internal.cpp.project.core;
-
-import java.lang.reflect.InvocationTargetException;
-
-import org.eclipse.core.resources.IMarker;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.IncrementalProjectBuilder;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.jobs.Job;
-import org.eclipse.jface.dialogs.ProgressMonitorDialog;
-import org.eclipse.jface.operation.IRunnableWithProgress;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.ui.IMarkerResolution;
-import org.eclipse.ui.IMarkerResolution2;
-import org.eclipse.ui.IMarkerResolutionGenerator2;
-import org.maemo.esbox.internal.cpp.project.Activator;
-import org.maemo.esbox.scratchbox.sb1.sdk.IScratchbox1SDKTarget;
-import org.maemo.mica.common.core.MicaException;
-import org.maemo.mica.common.core.sdk.ISDKTarget;
-import org.maemo.mica.common.project.core.ProjectManager;
-import org.maemo.mica.common.ui.dialogs.DialogUtils;
-import org.maemo.mica.cpp.project.builder.autotools.MicaAutotoolsConstants;
-import org.maemo.mica.internal.api.common.core.sdk.BaseSDKTarget;
-
-/**
- * Apply a "quick fix" for detected errors about intltool being out of date.
- * This really means, you need to add the "doctools" devkit.
- * @author eswartz
- *
- */
-public class ApplyDoctoolsFixMarkerResolutionGenerator implements
-		IMarkerResolutionGenerator2 {
-
-	private static class FixupDoctoolsMarkerResolution implements
-			IMarkerResolution2 {
-		public String getDescription() {
-			return "Add the doctools devkit to your Scratchbox target.  This provides the approved version of intltool (don't install it inside the target).";
-		}
-
-		public Image getImage() {
-			return null;
-		}
-
-		public String getLabel() {
-			return "Add doctools devkit to target";
-		}
-
-		public void run(final IMarker marker) {
-			ProgressMonitorDialog dialog = new ProgressMonitorDialog(null);
-			try {
-				dialog.run(true, true, new IRunnableWithProgress() {
-
-					public void run(IProgressMonitor monitor)
-							throws InvocationTargetException,
-							InterruptedException {
-						monitor.beginTask("Adding devkit...", IProgressMonitor.UNKNOWN);
-						addDoctoolsDevkit(marker);
-						monitor.worked(1);
-						monitor.done();
-					}
-					
-				});
-				
-			} catch (InvocationTargetException e) {
-				Activator.getErrorLogger().logError("Unexpected error fixing marker", e.getCause());
-				return;
-			} catch (InterruptedException e) {
-				return;
-			}
-			
-			boolean build = DialogUtils.showQuestionDialog(null,
-					"Updated target", 
-					"Added the 'doctools' devkit to the target.\n \nDo you want to rebuild now?");
-			if (build) {
-				Job buildJob = new Job("Rebuild project") {
-
-					@Override
-					protected IStatus run(IProgressMonitor monitor) {
-						try {
-							marker.getResource().getProject().build(IncrementalProjectBuilder.FULL_BUILD,
-									monitor);
-							return Status.OK_STATUS;
-							
-						} catch (CoreException e) {
-							return e.getStatus();
-						}
-					}
-					
-				};
-				buildJob.schedule();
-					
-			}
-			
-		}
-		
-		/**
-		 * @param marker
-		 */
-		private void addDoctoolsDevkit(final IMarker marker) {
-			try {
-				// already checked
-				IResource rsrc = marker.getResource();
-				ISDKTarget target = ProjectManager.getInstance().getSDKTarget(rsrc.getProject());
-				// in case it changed...
-				if (target instanceof IScratchbox1SDKTarget) {
-					IScratchbox1SDKTarget sb1Target = (IScratchbox1SDKTarget) target;
-					// in case out of date
-					((BaseSDKTarget) sb1Target).clearCache();
-					sb1Target.addDevkit("doctools");
-					marker.delete();
-					
-				}
-			} catch (MicaException e) {
-				Activator.getErrorLogger().logAndShowError("Error updating devkits", e);
-			} catch (CoreException e) {
-				Activator.getErrorLogger().logError("Failed to fix marker", e);
-			}
-		}
-	}
-
-	/* (non-Javadoc)
-	 * @see org.eclipse.ui.IMarkerResolutionGenerator2#hasResolutions(org.eclipse.core.resources.IMarker)
-	 */
-	public boolean hasResolutions(IMarker marker) {
-		try {
-			if (marker.getType().equals(MicaAutotoolsConstants.AUTOTOOLS_PROBLEM_MARKER_TYPE)) {
-				Object message = marker.getAttribute(IMarker.MESSAGE);
-				if (message != null && message.toString().contains("Your intltool is too old")) {
-					// make sure doctools is not already present
-					IResource rsrc = marker.getResource();
-					if (rsrc != null) {
-						ISDKTarget target = ProjectManager.getInstance().getSDKTarget(rsrc.getProject());
-						if (target instanceof IScratchbox1SDKTarget) {
-							return true;
-						}
-					}
-				}
-			}
-		} catch (CoreException e) {
-			// marker bugs
-		} catch (MicaException e) {
-			// not a Mica project
-		}
-		return false;
-	}
-
-	/* (non-Javadoc)
-	 * @see org.eclipse.ui.IMarkerResolutionGenerator#getResolutions(org.eclipse.core.resources.IMarker)
-	 */
-	public IMarkerResolution[] getResolutions(IMarker marker) {
-		return new IMarkerResolution[] {
-			new FixupDoctoolsMarkerResolution()
-		};
-	}
-
-	
-
-}

Modified: trunk/org.maemo.esbox.scratchbox-feature/feature.xml
===================================================================
--- trunk/org.maemo.esbox.scratchbox-feature/feature.xml	2009-09-01 18:02:02 UTC (rev 2075)
+++ trunk/org.maemo.esbox.scratchbox-feature/feature.xml	2009-09-01 18:04:26 UTC (rev 2076)
@@ -34,6 +34,7 @@
       <import feature="org.maemo.mica.protocol" version="2.0.0" match="greaterOrEqual"/>
       <import feature="org.maemo.mica.maemosdk" version="2.0.0" match="greaterOrEqual"/>
       <import feature="org.maemo.mica.linux" version="2.0.0" match="greaterOrEqual"/>
+      <import feature="org.maemo.mica.linux.autotools" version="2.0.0" match="greaterOrEqual"/>
    </requires>
 
    <plugin

Modified: trunk/org.maemo.esbox.scratchbox.sb1/META-INF/MANIFEST.MF
===================================================================
--- trunk/org.maemo.esbox.scratchbox.sb1/META-INF/MANIFEST.MF	2009-09-01 18:02:02 UTC (rev 2075)
+++ trunk/org.maemo.esbox.scratchbox.sb1/META-INF/MANIFEST.MF	2009-09-01 18:04:26 UTC (rev 2076)
@@ -12,7 +12,8 @@
  org.maemo.esbox.scratchbox.ui;bundle-version="2.0.0",
  org.maemo.esbox.maemosdk.core;bundle-version="2.0.0",
  org.maemo.mica.linux.packages.core;bundle-version="2.0.0",
- org.maemo.mica.linux.packages.ui;bundle-version="2.0.0"
+ org.maemo.mica.linux.packages.ui;bundle-version="2.0.0",
+ org.maemo.mica.cpp.project.builder.autotools;bundle-version="2.0.0";resolution:=optional
 Bundle-ActivationPolicy: lazy
 Bundle-RequiredExecutionEnvironment: J2SE-1.5
 Bundle-Vendor: INdT / Nokia

Modified: trunk/org.maemo.esbox.scratchbox.sb1/plugin.xml
===================================================================
--- trunk/org.maemo.esbox.scratchbox.sb1/plugin.xml	2009-09-01 18:02:02 UTC (rev 2075)
+++ trunk/org.maemo.esbox.scratchbox.sb1/plugin.xml	2009-09-01 18:04:26 UTC (rev 2076)
@@ -114,5 +114,13 @@
            class="org.maemo.esbox.internal.scratchbox.sb1.core.Scratchbox1PackageManagerProvider">
      </packageManagerProvider>
   </extension>
-    
+
+   <extension
+         point="org.eclipse.ui.ide.markerResolution">
+     <markerResolutionGenerator
+            class="org.maemo.esbox.internal.scratchbox.sb1.core.ApplyDoctoolsFixMarkerResolutionGenerator"
+            markerType="org.maemo.mica.cpp.project.builder.autotools.autotoolsProblemMarker">
+      </markerResolutionGenerator>
+   </extension>
+     
 </plugin>

Copied: trunk/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/core/ApplyDoctoolsFixMarkerResolutionGenerator.java (from rev 2073, branches/work_Ed/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/core/ApplyDoctoolsFixMarkerResolutionGenerator.java)
===================================================================
--- trunk/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/core/ApplyDoctoolsFixMarkerResolutionGenerator.java	                        (rev 0)
+++ trunk/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/core/ApplyDoctoolsFixMarkerResolutionGenerator.java	2009-09-01 18:04:26 UTC (rev 2076)
@@ -0,0 +1,172 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Nokia Corporation
+ * 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:
+ *    Ed Swartz (Nokia) - initial API and implementation
+ *******************************************************************************/
+
+package org.maemo.esbox.internal.scratchbox.sb1.core;
+
+import java.lang.reflect.InvocationTargetException;
+
+import org.eclipse.core.resources.IMarker;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.IncrementalProjectBuilder;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.jface.dialogs.ProgressMonitorDialog;
+import org.eclipse.jface.operation.IRunnableWithProgress;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.ui.IMarkerResolution;
+import org.eclipse.ui.IMarkerResolution2;
+import org.eclipse.ui.IMarkerResolutionGenerator2;
+import org.maemo.esbox.internal.scratchbox.sb1.Activator;
+import org.maemo.esbox.scratchbox.sb1.sdk.IScratchbox1SDKTarget;
+import org.maemo.mica.common.core.MicaException;
+import org.maemo.mica.common.core.sdk.ISDKTarget;
+import org.maemo.mica.common.project.core.ProjectManager;
+import org.maemo.mica.common.ui.dialogs.DialogUtils;
+import org.maemo.mica.cpp.project.builder.autotools.MicaAutotoolsConstants;
+import org.maemo.mica.internal.api.common.core.sdk.BaseSDKTarget;
+
+/**
+ * Apply a "quick fix" for detected errors about intltool being out of date.
+ * This really means, you need to add the "doctools" devkit.
+ * @author eswartz
+ *
+ */
+public class ApplyDoctoolsFixMarkerResolutionGenerator implements
+		IMarkerResolutionGenerator2 {
+
+	private static class FixupDoctoolsMarkerResolution implements
+			IMarkerResolution2 {
+		public String getDescription() {
+			return "Add the doctools devkit to your Scratchbox target.  This provides the approved version of intltool (don't install it inside the target).";
+		}
+
+		public Image getImage() {
+			return null;
+		}
+
+		public String getLabel() {
+			return "Add doctools devkit to target";
+		}
+
+		public void run(final IMarker marker) {
+			ProgressMonitorDialog dialog = new ProgressMonitorDialog(null);
+			try {
+				dialog.run(true, true, new IRunnableWithProgress() {
+
+					public void run(IProgressMonitor monitor)
+							throws InvocationTargetException,
+							InterruptedException {
+						monitor.beginTask("Adding devkit...", IProgressMonitor.UNKNOWN);
+						addDoctoolsDevkit(marker);
+						monitor.worked(1);
+						monitor.done();
+					}
+					
+				});
+				
+			} catch (InvocationTargetException e) {
+				Activator.getErrorLogger().logError("Unexpected error fixing marker", e.getCause());
+				return;
+			} catch (InterruptedException e) {
+				return;
+			}
+			
+			boolean build = DialogUtils.showQuestionDialog(null,
+					"Updated target", 
+					"Added the 'doctools' devkit to the target.\n \nDo you want to rebuild now?");
+			if (build) {
+				Job buildJob = new Job("Rebuild project") {
+
+					@Override
+					protected IStatus run(IProgressMonitor monitor) {
+						try {
+							marker.getResource().getProject().build(IncrementalProjectBuilder.FULL_BUILD,
+									monitor);
+							return Status.OK_STATUS;
+							
+						} catch (CoreException e) {
+							return e.getStatus();
+						}
+					}
+					
+				};
+				buildJob.schedule();
+					
+			}
+			
+		}
+		
+		/**
+		 * @param marker
+		 */
+		private void addDoctoolsDevkit(final IMarker marker) {
+			try {
+				// already checked
+				IResource rsrc = marker.getResource();
+				ISDKTarget target = ProjectManager.getInstance().getSDKTarget(rsrc.getProject());
+				// in case it changed...
+				if (target instanceof IScratchbox1SDKTarget) {
+					IScratchbox1SDKTarget sb1Target = (IScratchbox1SDKTarget) target;
+					// in case out of date
+					((BaseSDKTarget) sb1Target).clearCache();
+					sb1Target.addDevkit("doctools");
+					marker.delete();
+					
+				}
+			} catch (MicaException e) {
+				Activator.getErrorLogger().logAndShowError("Error updating devkits", e);
+			} catch (CoreException e) {
+				Activator.getErrorLogger().logError("Failed to fix marker", e);
+			}
+		}
+	}
+
+	/* (non-Javadoc)
+	 * @see org.eclipse.ui.IMarkerResolutionGenerator2#hasResolutions(org.eclipse.core.resources.IMarker)
+	 */
+	public boolean hasResolutions(IMarker marker) {
+		try {
+			if (marker.getType().equals(MicaAutotoolsConstants.AUTOTOOLS_PROBLEM_MARKER_TYPE)) {
+				Object message = marker.getAttribute(IMarker.MESSAGE);
+				if (message != null && message.toString().contains("Your intltool is too old")) {
+					// make sure doctools is not already present
+					IResource rsrc = marker.getResource();
+					if (rsrc != null) {
+						ISDKTarget target = ProjectManager.getInstance().getSDKTarget(rsrc.getProject());
+						if (target instanceof IScratchbox1SDKTarget) {
+							return true;
+						}
+					}
+				}
+			}
+		} catch (CoreException e) {
+			// marker bugs
+		} catch (MicaException e) {
+			// not a Mica project
+		}
+		return false;
+	}
+
+	/* (non-Javadoc)
+	 * @see org.eclipse.ui.IMarkerResolutionGenerator#getResolutions(org.eclipse.core.resources.IMarker)
+	 */
+	public IMarkerResolution[] getResolutions(IMarker marker) {
+		return new IMarkerResolution[] {
+			new FixupDoctoolsMarkerResolution()
+		};
+	}
+
+	
+
+}



More information about the Esbox-commits mailing list