1 12 package org.eclipse.jdt.apt.core.build; 13 14 import org.eclipse.core.resources.IWorkspace; 15 import org.eclipse.core.resources.IncrementalProjectBuilder; 16 import org.eclipse.core.resources.ResourcesPlugin; 17 import org.eclipse.core.runtime.IProgressMonitor; 18 import org.eclipse.core.runtime.NullProgressMonitor; 19 import org.eclipse.equinox.app.IApplication; 20 import org.eclipse.equinox.app.IApplicationContext; 21 22 35 public class AptBuilder implements IApplication { 36 37 51 public Object start(IApplicationContext context) throws Exception { 52 IWorkspace workspace = ResourcesPlugin.getWorkspace(); 53 IProgressMonitor progressMonitor = new SystemOutProgressMonitor(); 54 workspace.build(IncrementalProjectBuilder.CLEAN_BUILD, progressMonitor); 55 workspace.build(IncrementalProjectBuilder.FULL_BUILD, progressMonitor); 56 57 return IApplication.EXIT_OK; 58 } 59 60 public void stop() { 61 } 63 64 67 private static class SystemOutProgressMonitor extends NullProgressMonitor { 68 69 public void beginTask(String name, int totalWork) { 70 if (name != null && name.length() > 0) 71 System.out.println(name); 72 } 73 74 public void subTask(String name) { 75 if (name != null && name.length() > 0) 76 System.out.println(name); 77 } 78 } 79 80 } 81 | Popular Tags |