You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@felix.apache.org by ri...@apache.org on 2009/07/13 15:26:06 UTC

svn commit: r793581 [22/23] - in /felix/trunk/sigil: ./ bld-ivy/ bld-ivy/example/ bld-ivy/example/dependence/ bld-ivy/example/dependence/dependee/ bld-ivy/example/dependence/dependee/src/ bld-ivy/example/dependence/dependee/src/standalone/ bld-ivy/exam...

Added: felix/trunk/sigil/org.cauldron.sigil.ui/src/org/cauldron/sigil/ui/wizard/SigilNewResourceWizard.java
URL: http://svn.apache.org/viewvc/felix/trunk/sigil/org.cauldron.sigil.ui/src/org/cauldron/sigil/ui/wizard/SigilNewResourceWizard.java?rev=793581&view=auto
==============================================================================
--- felix/trunk/sigil/org.cauldron.sigil.ui/src/org/cauldron/sigil/ui/wizard/SigilNewResourceWizard.java (added)
+++ felix/trunk/sigil/org.cauldron.sigil.ui/src/org/cauldron/sigil/ui/wizard/SigilNewResourceWizard.java Mon Jul 13 13:25:46 2009
@@ -0,0 +1,57 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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 License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.cauldron.sigil.ui.wizard;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.ui.INewWizard;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.ide.IDE;
+import org.eclipse.ui.wizards.newresource.BasicNewResourceWizard;
+
+/**
+ * @author dave
+ *
+ */
+public abstract class SigilNewResourceWizard extends BasicNewResourceWizard implements INewWizard {
+
+    protected void selectRevealAndShow(IFile file) {
+        selectAndReveal(file);
+    
+        // Open editor on new file.
+        IWorkbenchWindow dw = getWorkbench().getActiveWorkbenchWindow();
+        try {
+            if (dw != null) {
+                IWorkbenchPage page = dw.getActivePage();
+                if (page != null) {
+                    IDE.openEditor(page, file, true);
+                }
+            }
+        }
+        catch (PartInitException e) {
+            MessageDialog.openError(Display.getCurrent().getActiveShell(), "Initialisation error",
+                    "Failed to open " + file);
+        }
+    }
+
+}
\ No newline at end of file

Added: felix/trunk/sigil/org.cauldron.sigil.ui/src/org/cauldron/sigil/ui/wizard/WorkspaceContentProvider.java
URL: http://svn.apache.org/viewvc/felix/trunk/sigil/org.cauldron.sigil.ui/src/org/cauldron/sigil/ui/wizard/WorkspaceContentProvider.java?rev=793581&view=auto
==============================================================================
--- felix/trunk/sigil/org.cauldron.sigil.ui/src/org/cauldron/sigil/ui/wizard/WorkspaceContentProvider.java (added)
+++ felix/trunk/sigil/org.cauldron.sigil.ui/src/org/cauldron/sigil/ui/wizard/WorkspaceContentProvider.java Mon Jul 13 13:25:46 2009
@@ -0,0 +1,110 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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 License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.cauldron.sigil.ui.wizard;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.cauldron.sigil.SigilCore;
+import org.eclipse.core.resources.IContainer;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.IWorkspace;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.jface.viewers.ITreeContentProvider;
+import org.eclipse.jface.viewers.Viewer;
+
+public class WorkspaceContentProvider implements ITreeContentProvider {
+	
+	private final boolean includeNonSigil;
+	private final boolean includeClosed;
+
+	public WorkspaceContentProvider(boolean includeNonSigil, boolean includeClosed) {
+		this.includeNonSigil = includeNonSigil;
+		this.includeClosed = includeClosed;
+	}
+
+	public Object[] getChildren(Object parentElement) {
+		Object[] result = null;
+		
+		if(parentElement instanceof IWorkspace) {
+			IProject[] projects = ((IWorkspace) parentElement).getRoot().getProjects();
+			if(includeNonSigil && includeClosed) {
+				result = projects;
+			} else {
+				List<IProject> includedProjects = new ArrayList<IProject>(projects.length);
+				for (IProject project : projects) {
+					if(!includeClosed && !project.isOpen()) {
+						continue;
+					}
+					
+					if(!includeNonSigil) {
+						try {
+							if(project.getNature(SigilCore.NATURE_ID) == null) {
+								continue;
+							}
+						} catch (CoreException e) {
+							continue;
+						}
+					}
+					
+					includedProjects.add(project);
+				}
+				result = includedProjects.toArray(new IProject[includedProjects.size()]);
+			}
+		} else if(parentElement instanceof IContainer) {
+			try {
+				IResource[] members = ((IContainer) parentElement).members();
+				List<IResource> children = new ArrayList<IResource>(members.length);
+				for (int i = 0; i < members.length; i++) {
+				    if (members[i].getType() != IResource.FILE) {
+				        children.add(members[i]);
+				    }
+				}
+				result = children.toArray(new IResource[children.size()]);
+			} catch (CoreException e) {
+				// Shouldn't happen
+			}
+		}
+		
+		return result;
+	}
+
+	public Object getParent(Object element) {
+		if(element instanceof IResource) {
+			return ((IResource) element).getParent();
+		}
+		return null;
+	}
+
+	public boolean hasChildren(Object element) {
+		return (element instanceof IContainer) && ((IContainer) element).isAccessible();
+	}
+
+	public Object[] getElements(Object inputElement) {
+		return getChildren(inputElement);
+	}
+
+	public void dispose() {
+	}
+
+	public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
+	}
+}

Added: felix/trunk/sigil/org.cauldron.sigil.ui/src/org/cauldron/sigil/ui/wizard/project/SigilProjectWizard.java
URL: http://svn.apache.org/viewvc/felix/trunk/sigil/org.cauldron.sigil.ui/src/org/cauldron/sigil/ui/wizard/project/SigilProjectWizard.java?rev=793581&view=auto
==============================================================================
--- felix/trunk/sigil/org.cauldron.sigil.ui/src/org/cauldron/sigil/ui/wizard/project/SigilProjectWizard.java (added)
+++ felix/trunk/sigil/org.cauldron.sigil.ui/src/org/cauldron/sigil/ui/wizard/project/SigilProjectWizard.java Mon Jul 13 13:25:46 2009
@@ -0,0 +1,136 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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 License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.cauldron.sigil.ui.wizard.project;
+
+import org.cauldron.sigil.SigilCore;
+import org.cauldron.sigil.ui.wizard.SigilNewResourceWizard;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IWorkspace;
+import org.eclipse.core.resources.IWorkspaceRunnable;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.core.runtime.IExecutableExtension;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.OperationCanceledException;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.wizards.newresource.BasicNewProjectResourceWizard;
+
+/**
+ * @author dave
+ *
+ */
+public class SigilProjectWizard extends SigilNewResourceWizard implements IExecutableExtension {
+
+    private SigilProjectWizardFirstPage firstPage;
+    private SigilProjectWizardSecondPage secondPage;
+    
+    private String name;
+    
+    public static final IPath SIGIL_PROJECT_PATH = new Path( SigilCore.SIGIL_PROJECT_FILE );
+	private IConfigurationElement config;
+    
+    public void init(IWorkbench workbench, IStructuredSelection currentSelection) {
+        super.init(workbench, currentSelection);
+
+        firstPage = new SigilProjectWizardFirstPage();
+        firstPage.setInitialProjectName(name);
+        secondPage = new SigilProjectWizardSecondPage(firstPage);
+        
+        addPage(firstPage);
+        addPage(secondPage);
+    }
+    
+    private void finishPage(IProgressMonitor monitor) throws CoreException, InterruptedException {
+        secondPage.performFinish(monitor);
+        
+        IProject newProject = firstPage.getProjectHandle();
+        
+        if ( newProject != null && newProject.exists() ) {
+            IFile file = newProject.getFile( SigilProjectWizard.SIGIL_PROJECT_PATH );
+            
+            selectRevealAndShow( file ); 
+           
+            new Job("Check OSGi Install" ) {
+				@Override
+				protected IStatus run(IProgressMonitor monitor) {
+                    // prompt for osgi home if not already set.
+            		SigilCore.getInstallManager().getDefaultInstall();
+            		return Status.OK_STATUS;
+				}
+            }.schedule();
+        }
+    }
+
+    /* (non-Javadoc)
+     * @see org.eclipse.jface.wizard.Wizard#performFinish()
+     */
+    @Override
+    public boolean performFinish() {
+        IWorkspace workspace = ResourcesPlugin.getWorkspace();
+        
+        IWorkspaceRunnable op= new IWorkspaceRunnable() {
+            public void run(IProgressMonitor monitor) throws CoreException {
+                try {
+                    finishPage(monitor);
+                } catch (InterruptedException e) {
+                    throw new OperationCanceledException(e.getMessage());
+                }
+            }
+        };
+        
+        try {
+            workspace.run(op, Job.getJobManager().createProgressGroup());
+        }
+        catch (CoreException e) {
+            SigilCore.error( "Failed to complete project wizard", e);
+            return false;
+        }
+        
+        BasicNewProjectResourceWizard.updatePerspective(config);
+        return true;
+    }
+
+	public void setName(String name) {
+		this.name = name;
+	}
+	
+	public String getName() {
+		return name;
+	}
+    
+    @Override
+    public boolean performCancel() {
+    	secondPage.performCancel();
+    	return super.performCancel();
+    }
+
+	public void setInitializationData(IConfigurationElement config, String propertyName, Object data)
+			throws CoreException {
+		this.config = config;
+	}
+}

Added: felix/trunk/sigil/org.cauldron.sigil.ui/src/org/cauldron/sigil/ui/wizard/project/SigilProjectWizardFirstPage.java
URL: http://svn.apache.org/viewvc/felix/trunk/sigil/org.cauldron.sigil.ui/src/org/cauldron/sigil/ui/wizard/project/SigilProjectWizardFirstPage.java?rev=793581&view=auto
==============================================================================
--- felix/trunk/sigil/org.cauldron.sigil.ui/src/org/cauldron/sigil/ui/wizard/project/SigilProjectWizardFirstPage.java (added)
+++ felix/trunk/sigil/org.cauldron.sigil.ui/src/org/cauldron/sigil/ui/wizard/project/SigilProjectWizardFirstPage.java Mon Jul 13 13:25:46 2009
@@ -0,0 +1,171 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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 License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.cauldron.sigil.ui.wizard.project;
+
+import org.eclipse.core.resources.IWorkspace;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.jface.fieldassist.ControlDecoration;
+import org.eclipse.jface.fieldassist.FieldDecoration;
+import org.eclipse.jface.fieldassist.FieldDecorationRegistry;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.ModifyEvent;
+import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Group;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.ui.dialogs.WizardNewProjectCreationPage;
+import org.osgi.framework.Version;
+
+/**
+ * @author dave
+ *
+ */
+public class SigilProjectWizardFirstPage extends WizardNewProjectCreationPage {
+
+	private volatile String description = "";
+	private volatile Version version = new Version(1, 0, 0);
+	private volatile String vendor = "";
+	private volatile String name = "";
+	
+	private Text txtDescription;
+    private Text txtVersion;
+	private Text txtVendor;
+	private Text txtName;
+
+	public SigilProjectWizardFirstPage() {
+        super("newSigilProjectPage");
+        setTitle( "Sigil Project" );
+        setDescription( "Create a new Sigil project" );
+    }
+
+    public boolean isInWorkspace() {
+        IWorkspace workspace = ResourcesPlugin.getWorkspace();
+        
+        IPath defaultDefaultLocation = workspace.getRoot().getLocation();
+        
+        return defaultDefaultLocation.isPrefixOf( getLocationPath() );
+    }
+    
+    @Override
+    public boolean isPageComplete() {
+    	boolean result = super.isPageComplete();
+    	return result;
+    }
+    
+    @Override
+    public void createControl(Composite parent) {
+    	FieldDecoration infoDecor = FieldDecorationRegistry.getDefault().getFieldDecoration(FieldDecorationRegistry.DEC_INFORMATION);
+    	
+    	// Create controls
+    	super.createControl(parent);
+    	Composite control = (Composite) getControl();
+    	
+    	Group grpProjectSettings = new Group(control, SWT.NONE);
+    	grpProjectSettings.setText("Project Settings");
+    	
+    	new Label(grpProjectSettings, SWT.NONE).setText("Version:");
+    	txtVersion = new Text(grpProjectSettings, SWT.BORDER);
+    	
+    	new Label(grpProjectSettings, SWT.NONE).setText("Name:");
+    	txtName = new Text(grpProjectSettings, SWT.BORDER);
+    	
+    	ControlDecoration txtNameDecor = new ControlDecoration(txtName, SWT.LEFT | SWT.CENTER);
+    	txtNameDecor.setImage(infoDecor.getImage());
+    	txtNameDecor.setDescriptionText("Defines a human-readable name for the bundle");
+    	
+    	new Label(grpProjectSettings, SWT.NONE).setText("Description:");
+    	txtDescription = new Text(grpProjectSettings, SWT.BORDER);
+    	
+    	ControlDecoration txtDescDecor = new ControlDecoration(txtDescription, SWT.LEFT | SWT.CENTER);
+    	txtDescDecor.setImage(infoDecor.getImage());
+    	txtDescDecor.setDescriptionText("Defines a short human-readable description for the bundle");
+    	
+    	new Label(grpProjectSettings, SWT.NONE).setText("Provider:");
+    	txtVendor = new Text(grpProjectSettings, SWT.BORDER);
+    	
+    	ControlDecoration txtVendorDecor = new ControlDecoration(txtVendor, SWT.LEFT | SWT.CENTER);
+    	txtVendorDecor.setImage(infoDecor.getImage());
+    	txtVendorDecor.setDescriptionText("The name of the company, organisation or individual providing the bundle");
+    	    	
+    	// Set values
+    	txtDescription.setText(description);
+    	txtVersion.setText(version.toString());
+    	txtVendor.setText(vendor);
+    	txtName.setText(name);
+    	
+    	// Add listeners
+    	ModifyListener txtModListener = new ModifyListener() {
+			public void modifyText(ModifyEvent e) {
+				description = txtDescription.getText();
+				vendor = txtVendor.getText();
+				name = txtName.getText();
+				
+				validateSettings();
+			}
+    	};
+    	txtDescription.addModifyListener(txtModListener);
+    	txtVersion.addModifyListener(txtModListener);
+    	txtVendor.addModifyListener(txtModListener);
+    	txtName.addModifyListener(txtModListener);
+    	
+    	// Layout
+    	control.setLayout(new GridLayout());
+    	grpProjectSettings.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
+    	grpProjectSettings.setLayout(new GridLayout(2, false));
+    	txtDescription.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
+    	txtVersion.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
+    	txtVendor.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
+    	txtName.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
+    }
+
+    private void validateSettings() {
+    	try {
+			version = new Version(txtVersion.getText());
+		} catch (IllegalArgumentException e) {
+			version = null;
+			setErrorMessage("Invalid version");
+			setPageComplete(false);
+			return;
+		}
+		
+		setErrorMessage(null);
+		setPageComplete(true);
+	}
+
+	public Version getVersion() {
+		return version;
+	}
+
+	public String getVendor() {
+		return vendor;
+	}
+	
+	public String getDescription() {
+		return description;
+	}
+	
+	public String getName() {
+		return name;
+	}
+}

Added: felix/trunk/sigil/org.cauldron.sigil.ui/src/org/cauldron/sigil/ui/wizard/project/SigilProjectWizardSecondPage.java
URL: http://svn.apache.org/viewvc/felix/trunk/sigil/org.cauldron.sigil.ui/src/org/cauldron/sigil/ui/wizard/project/SigilProjectWizardSecondPage.java?rev=793581&view=auto
==============================================================================
--- felix/trunk/sigil/org.cauldron.sigil.ui/src/org/cauldron/sigil/ui/wizard/project/SigilProjectWizardSecondPage.java (added)
+++ felix/trunk/sigil/org.cauldron.sigil.ui/src/org/cauldron/sigil/ui/wizard/project/SigilProjectWizardSecondPage.java Mon Jul 13 13:25:46 2009
@@ -0,0 +1,265 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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 License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.cauldron.sigil.ui.wizard.project;
+
+import java.net.URI;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+import org.cauldron.sigil.SigilCore;
+import org.cauldron.sigil.model.eclipse.ISigilBundle;
+import org.cauldron.sigil.model.project.ISigilProjectModel;
+import org.eclipse.core.resources.IFolder;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.IWorkspace;
+import org.eclipse.core.resources.IWorkspaceRunnable;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.core.runtime.OperationCanceledException;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.SubProgressMonitor;
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.jdt.core.IClasspathEntry;
+import org.eclipse.jdt.core.JavaCore;
+import org.eclipse.jdt.ui.PreferenceConstants;
+import org.eclipse.jdt.ui.wizards.JavaCapabilityConfigurationPage;
+import org.osgi.framework.Version;
+
+/**
+ * @author dave
+ *
+ */
+public class SigilProjectWizardSecondPage extends JavaCapabilityConfigurationPage {
+    
+    private SigilProjectWizardFirstPage firstPage;
+    private IProject currentProject;
+    private URI currentProjectLocation;
+    private boolean created;
+    
+    public SigilProjectWizardSecondPage(SigilProjectWizardFirstPage firstPage) {
+        this.firstPage = firstPage;
+    }
+
+    @Override
+    public void setVisible(boolean visible) {
+    	super.setVisible(visible);
+        if (visible) {
+            changeToNewProject();
+        } else {
+            removeProject();
+        }
+    }
+    
+    @Override
+    protected boolean useNewSourcePage() {
+        return true;
+    }
+    
+    protected void performFinish(IProgressMonitor monitor) throws CoreException, InterruptedException {
+    	changeToNewProject();
+        updateProject(monitor);
+    }
+    
+    private void changeToNewProject() {
+    	if ( !created ) {
+            IWorkspace workspace = ResourcesPlugin.getWorkspace();
+            
+            IWorkspaceRunnable op= new IWorkspaceRunnable() {
+                public void run(IProgressMonitor monitor) throws CoreException {
+                    try {
+                        updateProject(monitor);
+                    } catch (InterruptedException e) {
+                        throw new OperationCanceledException(e.getMessage());
+                    }
+                }
+            };
+            
+            try {
+                workspace.run(op, Job.getJobManager().createProgressGroup());
+                setErrorMessage(null);
+                setPageComplete(true);
+                created = true;
+            }
+            catch (CoreException e) {
+            	SigilCore.error("Failed to run workspace job", e);
+            }        
+    	}
+    }
+    
+    private void removeProject() {
+        if (currentProject == null || !currentProject.exists()) {
+            return;
+        }
+        
+        IWorkspaceRunnable op= new IWorkspaceRunnable() {
+            public void run(IProgressMonitor monitor) throws CoreException {
+                doRemoveProject(monitor);
+            }
+        };
+    
+        IWorkspace workspace = ResourcesPlugin.getWorkspace();
+        
+        try {
+            workspace.run(op, Job.getJobManager().createProgressGroup());
+        }
+        catch (CoreException e) {
+        	SigilCore.error("Failed to run workspace job", e);
+        }
+        finally {
+        	created = false;
+        }
+    }
+    
+    private void updateProject(IProgressMonitor monitor) throws CoreException, InterruptedException {
+        currentProject = firstPage.getProjectHandle();
+        currentProjectLocation= getProjectLocationURI();
+        
+        String description = firstPage.getDescription();
+        Version projectVersion = firstPage.getVersion();
+        String vendor = firstPage.getVendor();
+        String name = firstPage.getName();
+        
+        createProject( currentProject, currentProjectLocation, monitor);
+
+        IPath src = createSourcePath();
+        
+        IPath output = getOutputLocation();
+        
+        if ( output.segmentCount() == 0 ) {
+        	output = new Path( currentProject.getName() ).append( "build" ).append( "classes" );
+        }
+        
+        IClasspathEntry[] entries = getProjectClassPath(src);
+        
+    	SigilCore.makeSigilProject(currentProject, monitor);
+    	
+        init(JavaCore.create(currentProject), output.makeRelative(), entries, false);
+
+        configureJavaProject(new SubProgressMonitor(monitor, 3));
+        
+        configureSigilProject( currentProject, description, projectVersion, vendor, name, src, monitor );
+    }
+    
+	private IPath createSourcePath() throws CoreException {
+        IPath projectPath = currentProject.getFullPath();
+        IPath src = new Path( "src" );
+        IFolder f = currentProject.getFolder( src );
+        if ( !f.getLocation().toFile().exists() ) {
+        	f.create(true, true, null);
+        }
+        
+        return projectPath.append(src);
+	}
+
+	final void doRemoveProject(IProgressMonitor monitor) throws CoreException {
+        final boolean noProgressMonitor= (currentProjectLocation == null); // inside workspace
+        
+        if (monitor == null || noProgressMonitor) {
+            monitor= new NullProgressMonitor();
+        }
+        monitor.beginTask("Remove project", 3); 
+        try {
+            try {
+                boolean removeContent= currentProject.isSynchronized(IResource.DEPTH_INFINITE);
+                currentProject.delete(removeContent, false, new SubProgressMonitor(monitor, 2));
+                
+            } finally {
+            }
+        } finally {
+            monitor.done();
+            currentProject= null;
+        }        
+    }
+        
+    private IClasspathEntry[] getProjectClassPath(IPath src) throws CoreException {
+        List<IClasspathEntry> cpEntries= new ArrayList<IClasspathEntry>();
+        cpEntries.add(JavaCore.newSourceEntry(src));
+        cpEntries.addAll(Arrays.asList(getDefaultClasspathEntry()));
+        cpEntries.add(JavaCore.newContainerEntry(new Path(SigilCore.CLASSPATH_CONTAINER_PATH)));
+        IClasspathEntry[] entries= cpEntries.toArray(new IClasspathEntry[cpEntries.size()]);
+        
+        return entries;
+    }
+    
+    private IClasspathEntry[] getDefaultClasspathEntry() {
+        IClasspathEntry[] defaultJRELibrary= PreferenceConstants.getDefaultJRELibrary();
+        /*String compliance= firstPage.getCompilerCompliance();
+        IPath jreContainerPath= new Path(JavaRuntime.JRE_CONTAINER);
+        if (compliance == null || defaultJRELibrary.length > 1 || !jreContainerPath.isPrefixOf(defaultJRELibrary[0].getPath())) {
+            // use default
+            return defaultJRELibrary;
+        }
+        IVMInstall inst= firstPage.getJVM();
+        if (inst != null) {
+            IPath newPath= jreContainerPath.append(inst.getVMInstallType().getId()).append(inst.getName());
+            return new IClasspathEntry[] { JavaCore.newContainerEntry(newPath) };
+        }*/
+        return defaultJRELibrary;
+    }
+    
+    
+    private void configureSigilProject( IProject project, String description, Version projectVersion, String vendorName, String bundleName, IPath src, IProgressMonitor monitor ) throws CoreException {
+        ISigilProjectModel sigil = SigilCore.create(project);
+        IClasspathEntry cp = JavaCore.newSourceEntry(src);
+        String encodedClasspath = sigil.getJavaModel().encodeClasspathEntry(cp );
+        
+        ISigilBundle bundle = sigil.getBundle();
+        bundle.addClasspathEntry(encodedClasspath);
+        
+        if(description != null) {
+        	bundle.getBundleInfo().setDescription(description);
+        }
+		if(projectVersion != null) {
+        	bundle.setVersion(projectVersion);
+        }
+		if(vendorName != null) {
+			bundle.getBundleInfo().setVendor(vendorName);
+		}
+		if(bundleName != null) {
+			bundle.getBundleInfo().setName(bundleName);
+		}
+        sigil.save(monitor);
+    }
+    
+    
+    private URI getProjectLocationURI() throws CoreException {
+        if (firstPage.isInWorkspace()) {
+            return null;
+        }
+        return firstPage.getLocationURI();
+    }
+    
+    @Override
+    public boolean isPageComplete() {
+    	boolean result = super.isPageComplete();
+    	return result;
+    }
+    
+    protected void performCancel() {
+    	if(currentProject != null) {
+    		removeProject();
+    	}
+    }
+}

Added: felix/trunk/sigil/org.cauldron.sigil.ui/src/org/cauldron/sigil/ui/wizard/repository/RepositoryWizard.java
URL: http://svn.apache.org/viewvc/felix/trunk/sigil/org.cauldron.sigil.ui/src/org/cauldron/sigil/ui/wizard/repository/RepositoryWizard.java?rev=793581&view=auto
==============================================================================
--- felix/trunk/sigil/org.cauldron.sigil.ui/src/org/cauldron/sigil/ui/wizard/repository/RepositoryWizard.java (added)
+++ felix/trunk/sigil/org.cauldron.sigil.ui/src/org/cauldron/sigil/ui/wizard/repository/RepositoryWizard.java Mon Jul 13 13:25:46 2009
@@ -0,0 +1,48 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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 License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.cauldron.sigil.ui.wizard.repository;
+
+import org.cauldron.sigil.model.repository.IRepositoryModel;
+import org.eclipse.jface.wizard.IWizardPage;
+import org.eclipse.jface.wizard.Wizard;
+
+public class RepositoryWizard extends Wizard {
+	
+	private IRepositoryModel model;
+	
+	@Override
+	public boolean performFinish() {
+		for ( IWizardPage page : getPages() ) {
+			if ( page instanceof RepositoryWizardPage ) {
+				RepositoryWizardPage rwp = (RepositoryWizardPage) page;
+				rwp.storeFields();
+			}
+		}
+		return true;
+	}
+	
+	public IRepositoryModel getModel() {
+		return model;
+	}
+
+	public void init(IRepositoryModel model) {
+		this.model = model;
+	}
+}

Added: felix/trunk/sigil/org.cauldron.sigil.ui/src/org/cauldron/sigil/ui/wizard/repository/RepositoryWizardPage.java
URL: http://svn.apache.org/viewvc/felix/trunk/sigil/org.cauldron.sigil.ui/src/org/cauldron/sigil/ui/wizard/repository/RepositoryWizardPage.java?rev=793581&view=auto
==============================================================================
--- felix/trunk/sigil/org.cauldron.sigil.ui/src/org/cauldron/sigil/ui/wizard/repository/RepositoryWizardPage.java (added)
+++ felix/trunk/sigil/org.cauldron.sigil.ui/src/org/cauldron/sigil/ui/wizard/repository/RepositoryWizardPage.java Mon Jul 13 13:25:46 2009
@@ -0,0 +1,109 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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 License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.cauldron.sigil.ui.wizard.repository;
+
+import java.util.ArrayList;
+
+import org.cauldron.sigil.model.repository.IRepositoryModel;
+import org.eclipse.jface.preference.FieldEditor;
+import org.eclipse.jface.preference.StringFieldEditor;
+import org.eclipse.jface.wizard.WizardPage;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.ModifyEvent;
+import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+
+public abstract class RepositoryWizardPage extends WizardPage {
+
+	private StringFieldEditor nameEditor;
+	private ArrayList<FieldEditor> editors = new ArrayList<FieldEditor>();
+	private RepositoryWizard wizard;
+	
+	protected RepositoryWizardPage(String pageName, RepositoryWizard parent) {
+		super(pageName);
+		setTitle(pageName);
+		this.wizard = parent;
+	}
+	
+	public abstract void createFieldEditors();
+
+	public void addField(FieldEditor editor) {
+		editors.add( editor );
+	}
+	
+	public void createControl(Composite parent) {
+		Composite control = new Composite(parent, SWT.NONE);
+		setControl(control);
+		
+		if ( getModel().getType().isDynamic() ) {
+			nameEditor = new StringFieldEditor("name", "Name:", control);
+			nameEditor.setStringValue(getModel().getName());
+			nameEditor.getTextControl(getFieldEditorParent()).addModifyListener( new ModifyListener() {
+				public void modifyText(ModifyEvent e) {
+					checkPageComplete();
+				}
+			});
+		}
+		
+		createFieldEditors();
+
+		int cols = nameEditor == null ? 0 : nameEditor.getNumberOfControls();
+		for ( FieldEditor e : editors ) {
+			cols = Math.max(cols, e.getNumberOfControls());
+		}
+		
+		control.setLayout( new GridLayout(cols, false) );
+		
+		if ( nameEditor != null ) {
+			nameEditor.fillIntoGrid(getFieldEditorParent(), cols);
+		}
+
+		for ( FieldEditor e : editors ) {
+			e.fillIntoGrid(getFieldEditorParent(), cols);
+			e.setPreferenceStore(getModel().getPreferences());
+			e.load();
+		}
+		
+		checkPageComplete();
+	}
+
+	protected void checkPageComplete() {
+		if ( nameEditor != null ) {
+			setPageComplete(nameEditor.getStringValue().length() > 0);
+		}
+	}
+
+	public IRepositoryModel getModel() {
+		return wizard.getModel();
+	}
+
+	protected Composite getFieldEditorParent() {
+		return (Composite) getControl();
+	}
+
+	public void storeFields() {
+		getModel().setName(nameEditor.getStringValue());
+		for ( FieldEditor e : editors ) {
+			e.store();
+		}
+	}
+	
+}

Added: felix/trunk/sigil/org.cauldron.sigil.updatesite/.project
URL: http://svn.apache.org/viewvc/felix/trunk/sigil/org.cauldron.sigil.updatesite/.project?rev=793581&view=auto
==============================================================================
--- felix/trunk/sigil/org.cauldron.sigil.updatesite/.project (added)
+++ felix/trunk/sigil/org.cauldron.sigil.updatesite/.project Mon Jul 13 13:25:46 2009
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>org.cauldron.sigil.updatesite</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>org.eclipse.pde.UpdateSiteBuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>org.eclipse.pde.UpdateSiteNature</nature>
+	</natures>
+</projectDescription>

Added: felix/trunk/sigil/org.cauldron.sigil.updatesite/site.xml
URL: http://svn.apache.org/viewvc/felix/trunk/sigil/org.cauldron.sigil.updatesite/site.xml?rev=793581&view=auto
==============================================================================
--- felix/trunk/sigil/org.cauldron.sigil.updatesite/site.xml (added)
+++ felix/trunk/sigil/org.cauldron.sigil.updatesite/site.xml Mon Jul 13 13:25:46 2009
@@ -0,0 +1,107 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements.  See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership.  The ASF licenses this file
+  to you 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 License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+<site>
+   <feature url="features/org.cauldron.sigil.core_0.3.0.jar" id="org.cauldron.sigil.core" version="0.3.0">
+      <category name="Sigil"/>
+   </feature>
+   <feature url="features/org.cauldron.sigil.core_0.3.1.jar" id="org.cauldron.sigil.core" version="0.3.1">
+      <category name="Sigil"/>
+   </feature>
+   <feature url="features/org.cauldron.sigil.core_0.3.2.jar" id="org.cauldron.sigil.core" version="0.3.2">
+      <category name="Sigil"/>
+   </feature>
+   <feature url="features/org.cauldron.sigil.core_0.3.3.jar" id="org.cauldron.sigil.core" version="0.3.3">
+      <category name="Sigil"/>
+   </feature>
+   <feature url="features/org.cauldron.sigil.core_0.3.4.jar" id="org.cauldron.sigil.core" version="0.3.4">
+      <category name="Sigil"/>
+   </feature>
+   <feature url="features/org.cauldron.sigil.core_0.3.5.jar" id="org.cauldron.sigil.core" version="0.3.5">
+      <category name="Sigil"/>
+   </feature>
+   <feature url="features/org.cauldron.sigil.core_0.3.6.jar" id="org.cauldron.sigil.core" version="0.3.6">
+      <category name="Sigil"/>
+   </feature>
+   <feature url="features/org.cauldron.sigil.core_0.3.7.jar" id="org.cauldron.sigil.core" version="0.3.7">
+      <category name="Sigil"/>
+   </feature>
+   <feature url="features/org.cauldron.sigil.core_0.3.8.jar" id="org.cauldron.sigil.core" version="0.3.8">
+      <category name="Sigil"/>
+   </feature>
+   <feature url="features/org.cauldron.sigil.core_0.3.9.jar" id="org.cauldron.sigil.core" version="0.3.9">
+      <category name="Sigil"/>
+   </feature>
+   <feature url="features/org.cauldron.sigil.core_0.3.10.jar" id="org.cauldron.sigil.core" version="0.3.10">
+      <category name="Sigil"/>
+   </feature>
+   <feature url="features/org.cauldron.sigil.core_0.3.11.jar" id="org.cauldron.sigil.core" version="0.3.11">
+      <category name="Sigil"/>
+   </feature>
+   <feature url="features/org.cauldron.sigil.core_0.3.12.jar" id="org.cauldron.sigil.core" version="0.3.12">
+      <category name="Sigil"/>
+   </feature>
+   <feature url="features/org.cauldron.sigil.core_0.3.13.jar" id="org.cauldron.sigil.core" version="0.3.13">
+      <category name="Sigil"/>
+   </feature>
+   <feature url="features/org.cauldron.sigil.core_0.3.14.jar" id="org.cauldron.sigil.core" version="0.3.14">
+      <category name="Sigil"/>
+   </feature>
+   <feature url="features/org.cauldron.sigil.core_0.3.15.jar" id="org.cauldron.sigil.core" version="0.3.15">
+      <category name="Sigil"/>
+   </feature>
+   <feature url="features/org.cauldron.sigil.core_0.3.16.jar" id="org.cauldron.sigil.core" version="0.3.16">
+      <category name="Sigil"/>
+   </feature>
+   <feature url="features/org.cauldron.sigil.core_0.3.17.jar" id="org.cauldron.sigil.core" version="0.3.17">
+      <category name="Sigil"/>
+   </feature>
+   <feature url="features/org.cauldron.sigil.core_0.3.18.jar" id="org.cauldron.sigil.core" version="0.3.18">
+      <category name="Sigil"/>
+   </feature>
+   <feature url="features/org.cauldron.sigil.core_0.4.0.jar" id="org.cauldron.sigil.core" version="0.4.0">
+      <category name="Sigil"/>
+   </feature>
+   <feature url="features/org.cauldron.sigil.core_0.4.1.jar" id="org.cauldron.sigil.core" version="0.4.1">
+      <category name="Sigil"/>
+   </feature>
+   <feature url="features/org.cauldron.sigil.core_0.4.2.jar" id="org.cauldron.sigil.core" version="0.4.2">
+      <category name="Sigil"/>
+   </feature>
+   <feature url="features/org.cauldron.sigil.core_0.4.3.jar" id="org.cauldron.sigil.core" version="0.4.3">
+      <category name="Sigil"/>
+   </feature>
+   <feature url="features/org.cauldron.sigil.core_0.4.4.jar" id="org.cauldron.sigil.core" version="0.4.4">
+      <category name="Sigil"/>
+   </feature>
+   <feature url="features/org.cauldron.sigil.core_0.4.5.jar" id="org.cauldron.sigil.core" version="0.4.5">
+      <category name="Sigil"/>
+   </feature>
+   <feature url="features/org.cauldron.sigil.core_0.4.6.jar" id="org.cauldron.sigil.core" version="0.4.6">
+      <category name="Sigil"/>
+   </feature>
+   <feature url="features/org.cauldron.sigil.core_0.4.7.jar" id="org.cauldron.sigil.core" version="0.4.7">
+      <category name="Sigil"/>
+   </feature>
+   <category-def name="Sigil" label="Sigil">
+      <description>
+         Sigil is an SDK for developing applications to be deployed on the Newton framework (http://newton.codecauldron.org)
+      </description>
+   </category-def>
+</site>

Added: felix/trunk/sigil/org.cauldron.sigil.utils/.classpath
URL: http://svn.apache.org/viewvc/felix/trunk/sigil/org.cauldron.sigil.utils/.classpath?rev=793581&view=auto
==============================================================================
--- felix/trunk/sigil/org.cauldron.sigil.utils/.classpath (added)
+++ felix/trunk/sigil/org.cauldron.sigil.utils/.classpath Mon Jul 13 13:25:46 2009
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
+	<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+	<classpathentry kind="src" path="src"/>
+	<classpathentry kind="output" path="bin"/>
+</classpath>

Added: felix/trunk/sigil/org.cauldron.sigil.utils/.project
URL: http://svn.apache.org/viewvc/felix/trunk/sigil/org.cauldron.sigil.utils/.project?rev=793581&view=auto
==============================================================================
--- felix/trunk/sigil/org.cauldron.sigil.utils/.project (added)
+++ felix/trunk/sigil/org.cauldron.sigil.utils/.project Mon Jul 13 13:25:46 2009
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>org.cauldron.sigil.utils</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>org.eclipse.jdt.core.javabuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.pde.ManifestBuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.pde.SchemaBuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>org.eclipse.pde.PluginNature</nature>
+		<nature>org.eclipse.jdt.core.javanature</nature>
+	</natures>
+</projectDescription>

Added: felix/trunk/sigil/org.cauldron.sigil.utils/.settings/org.eclipse.jdt.core.prefs
URL: http://svn.apache.org/viewvc/felix/trunk/sigil/org.cauldron.sigil.utils/.settings/org.eclipse.jdt.core.prefs?rev=793581&view=auto
==============================================================================
--- felix/trunk/sigil/org.cauldron.sigil.utils/.settings/org.eclipse.jdt.core.prefs (added)
+++ felix/trunk/sigil/org.cauldron.sigil.utils/.settings/org.eclipse.jdt.core.prefs Mon Jul 13 13:25:46 2009
@@ -0,0 +1,7 @@
+#Tue Aug 12 11:45:38 BST 2008
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.5

Added: felix/trunk/sigil/org.cauldron.sigil.utils/META-INF/MANIFEST.MF
URL: http://svn.apache.org/viewvc/felix/trunk/sigil/org.cauldron.sigil.utils/META-INF/MANIFEST.MF?rev=793581&view=auto
==============================================================================
--- felix/trunk/sigil/org.cauldron.sigil.utils/META-INF/MANIFEST.MF (added)
+++ felix/trunk/sigil/org.cauldron.sigil.utils/META-INF/MANIFEST.MF Mon Jul 13 13:25:46 2009
@@ -0,0 +1,12 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: Sigil Utils Plug-in
+Bundle-SymbolicName: org.cauldron.sigil.utils;singleton:=true
+Bundle-Version: 0.8.0.qualifier
+Require-Bundle: org.eclipse.core.runtime
+Bundle-ActivationPolicy: lazy
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
+Import-Package: org.eclipse.core.expressions,
+ org.eclipse.core.resources,
+ org.eclipse.ui
+Export-Package: org.cauldron.sigil.utils

Added: felix/trunk/sigil/org.cauldron.sigil.utils/build.properties
URL: http://svn.apache.org/viewvc/felix/trunk/sigil/org.cauldron.sigil.utils/build.properties?rev=793581&view=auto
==============================================================================
--- felix/trunk/sigil/org.cauldron.sigil.utils/build.properties (added)
+++ felix/trunk/sigil/org.cauldron.sigil.utils/build.properties Mon Jul 13 13:25:46 2009
@@ -0,0 +1,5 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+               .,\
+               plugin.xml

Added: felix/trunk/sigil/org.cauldron.sigil.utils/plugin.xml
URL: http://svn.apache.org/viewvc/felix/trunk/sigil/org.cauldron.sigil.utils/plugin.xml?rev=793581&view=auto
==============================================================================
--- felix/trunk/sigil/org.cauldron.sigil.utils/plugin.xml (added)
+++ felix/trunk/sigil/org.cauldron.sigil.utils/plugin.xml Mon Jul 13 13:25:46 2009
@@ -0,0 +1,47 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements.  See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership.  The ASF licenses this file
+  to you 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 License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+<?eclipse version="3.2"?>
+<plugin>
+   <extension
+         point="org.eclipse.core.expressions.propertyTesters">
+      <propertyTester
+            class="org.cauldron.sigil.utils.properties.EditorPropertyTester"
+            id="org.cauldron.sigil.utils.editorPropertyTester"
+            namespace="org.cauldron.sigil"
+            properties="isEditorOfType"
+            type="org.eclipse.ui.IWorkbenchPart">
+      </propertyTester>
+      <propertyTester
+            class="org.cauldron.sigil.utils.properties.PartKindPropertyTester"
+            id="org.cauldron.sigil.runtime.PartKindPropertyTester"
+            namespace="org.cauldron.sigil"
+            properties="partKind,partId"
+            type="org.eclipse.ui.IWorkbenchPart">
+      </propertyTester>
+      <propertyTester
+            class="org.cauldron.sigil.utils.properties.ResourceTypePropertyTester"
+            id="org.cauldron.sigil.utils.ResourcePropertyTester"
+            namespace="org.cauldron.sigil"
+            properties="isResourceOfType"
+            type="org.eclipse.core.resources.IResource">
+      </propertyTester>
+   </extension>
+
+</plugin>

Added: felix/trunk/sigil/org.cauldron.sigil.utils/src/org/cauldron/sigil/utils/GlobCompiler.java
URL: http://svn.apache.org/viewvc/felix/trunk/sigil/org.cauldron.sigil.utils/src/org/cauldron/sigil/utils/GlobCompiler.java?rev=793581&view=auto
==============================================================================
--- felix/trunk/sigil/org.cauldron.sigil.utils/src/org/cauldron/sigil/utils/GlobCompiler.java (added)
+++ felix/trunk/sigil/org.cauldron.sigil.utils/src/org/cauldron/sigil/utils/GlobCompiler.java Mon Jul 13 13:25:46 2009
@@ -0,0 +1,54 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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 License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.cauldron.sigil.utils;
+
+import java.util.regex.Pattern;
+
+public class GlobCompiler {
+	public static final Pattern compile(String glob) {
+		char[] chars = glob.toCharArray();
+		if ( chars.length > 0 ) {
+			StringBuilder builder = new StringBuilder(chars.length + 5);
+	
+			builder.append('^');
+			
+			for (char c : chars) {
+				switch ( c ) {
+				case '*':
+					builder.append(".*");
+					break;
+				case '.':
+					builder.append("\\.");
+					break;
+				case '$':
+					builder.append( "\\$" );
+					break;
+				default:
+					builder.append( c );
+				}
+			}
+	
+			return Pattern.compile(builder.toString());
+		}
+		else {
+			return Pattern.compile(glob);
+		}
+	}
+}

Added: felix/trunk/sigil/org.cauldron.sigil.utils/src/org/cauldron/sigil/utils/PathHelper.java
URL: http://svn.apache.org/viewvc/felix/trunk/sigil/org.cauldron.sigil.utils/src/org/cauldron/sigil/utils/PathHelper.java?rev=793581&view=auto
==============================================================================
--- felix/trunk/sigil/org.cauldron.sigil.utils/src/org/cauldron/sigil/utils/PathHelper.java (added)
+++ felix/trunk/sigil/org.cauldron.sigil.utils/src/org/cauldron/sigil/utils/PathHelper.java Mon Jul 13 13:25:46 2009
@@ -0,0 +1,43 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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 License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.cauldron.sigil.utils;
+
+import java.io.File;
+import java.util.List;
+import java.util.regex.Pattern;
+
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.Path;
+
+public class PathHelper {
+
+	public static void scanFiles(List<IPath> paths, IPath path, String pattern, boolean recurse) {
+		Pattern p = GlobCompiler.compile(pattern);
+		
+		for ( File f : path.toFile().listFiles() ) {
+			if ( f.isDirectory() && recurse ) {
+				scanFiles( paths, new Path(f.getAbsolutePath()), pattern, recurse);
+			}
+			else if ( f.isFile() && p.matcher(f.getName()).matches() ) {
+				paths.add( new Path(f.getAbsolutePath()) );
+			}
+		}
+	}
+}

Added: felix/trunk/sigil/org.cauldron.sigil.utils/src/org/cauldron/sigil/utils/SigilUtils.java
URL: http://svn.apache.org/viewvc/felix/trunk/sigil/org.cauldron.sigil.utils/src/org/cauldron/sigil/utils/SigilUtils.java?rev=793581&view=auto
==============================================================================
--- felix/trunk/sigil/org.cauldron.sigil.utils/src/org/cauldron/sigil/utils/SigilUtils.java (added)
+++ felix/trunk/sigil/org.cauldron.sigil.utils/src/org/cauldron/sigil/utils/SigilUtils.java Mon Jul 13 13:25:46 2009
@@ -0,0 +1,39 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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 License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.cauldron.sigil.utils;
+
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.core.runtime.content.IContentType;
+
+public final class SigilUtils {
+	private SigilUtils () {
+	}
+	
+	public static boolean isResourceType(IResource resource, String type) {
+		IContentType[] types = Platform.getContentTypeManager().findContentTypesFor(resource.getName());
+		for (IContentType contentType : types) {
+			if(contentType.getId().equals(type)) {
+				return true;
+			}
+		}
+		return false;
+	}
+}

Added: felix/trunk/sigil/org.cauldron.sigil.utils/src/org/cauldron/sigil/utils/properties/EditorPropertyTester.java
URL: http://svn.apache.org/viewvc/felix/trunk/sigil/org.cauldron.sigil.utils/src/org/cauldron/sigil/utils/properties/EditorPropertyTester.java?rev=793581&view=auto
==============================================================================
--- felix/trunk/sigil/org.cauldron.sigil.utils/src/org/cauldron/sigil/utils/properties/EditorPropertyTester.java (added)
+++ felix/trunk/sigil/org.cauldron.sigil.utils/src/org/cauldron/sigil/utils/properties/EditorPropertyTester.java Mon Jul 13 13:25:46 2009
@@ -0,0 +1,51 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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 License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.cauldron.sigil.utils.properties;
+
+import org.cauldron.sigil.utils.SigilUtils;
+import org.eclipse.core.expressions.PropertyTester;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.IFileEditorInput;
+import org.eclipse.ui.IWorkbenchPart;
+
+public class EditorPropertyTester extends PropertyTester {
+
+	public boolean test(Object receiver, String property, Object[] args, Object expectedValue) {
+		IWorkbenchPart part = (IWorkbenchPart) receiver;
+
+		boolean result = false;
+		
+		if(part instanceof IEditorPart) {
+			IEditorInput input = ((IEditorPart) part).getEditorInput();
+			if(input instanceof IFileEditorInput) {
+				IFile file = ((IFileEditorInput) input).getFile();
+				
+				if("isEditorOfType".equals(property)) {
+					result = SigilUtils.isResourceType(file, (String) expectedValue);
+				}
+			}
+		}
+		
+		return result;
+	}
+
+}

Added: felix/trunk/sigil/org.cauldron.sigil.utils/src/org/cauldron/sigil/utils/properties/PartKindPropertyTester.java
URL: http://svn.apache.org/viewvc/felix/trunk/sigil/org.cauldron.sigil.utils/src/org/cauldron/sigil/utils/properties/PartKindPropertyTester.java?rev=793581&view=auto
==============================================================================
--- felix/trunk/sigil/org.cauldron.sigil.utils/src/org/cauldron/sigil/utils/properties/PartKindPropertyTester.java (added)
+++ felix/trunk/sigil/org.cauldron.sigil.utils/src/org/cauldron/sigil/utils/properties/PartKindPropertyTester.java Mon Jul 13 13:25:46 2009
@@ -0,0 +1,50 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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 License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.cauldron.sigil.utils.properties;
+
+import org.eclipse.core.expressions.PropertyTester;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.IViewPart;
+import org.eclipse.ui.IWorkbenchPart;
+
+public class PartKindPropertyTester extends PropertyTester{
+
+	public boolean test(Object receiver, String property, Object[] args, Object expectedValue) {
+		IWorkbenchPart part = (IWorkbenchPart) receiver;
+		
+		Object value;
+		if("partKind".equals(property)) {
+			if(part instanceof IEditorPart) {
+				value = "editor";
+			} else if(part instanceof IViewPart) {
+				value = "view";
+			} else {
+				value = null;
+			}
+		} else if("partId".equals(property)) {
+			value = part.getSite().getId();
+		} else {
+			value = null;
+		}
+		
+		return expectedValue.equals(value);
+	}
+	
+}

Added: felix/trunk/sigil/org.cauldron.sigil.utils/src/org/cauldron/sigil/utils/properties/ResourceTypePropertyTester.java
URL: http://svn.apache.org/viewvc/felix/trunk/sigil/org.cauldron.sigil.utils/src/org/cauldron/sigil/utils/properties/ResourceTypePropertyTester.java?rev=793581&view=auto
==============================================================================
--- felix/trunk/sigil/org.cauldron.sigil.utils/src/org/cauldron/sigil/utils/properties/ResourceTypePropertyTester.java (added)
+++ felix/trunk/sigil/org.cauldron.sigil.utils/src/org/cauldron/sigil/utils/properties/ResourceTypePropertyTester.java Mon Jul 13 13:25:46 2009
@@ -0,0 +1,52 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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 License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.cauldron.sigil.utils.properties;
+
+import org.eclipse.core.expressions.PropertyTester;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.core.runtime.content.IContentType;
+
+public class ResourceTypePropertyTester extends PropertyTester {
+
+	public boolean test(Object receiver, String property, Object[] args, Object expectedValue) {
+		if (!(receiver instanceof IResource)) {
+			return false;
+		}
+
+		boolean result = false;
+
+		IResource resource = (IResource) receiver;
+		if ("isResourceOfType".equals(property)) {
+			IContentType[] types = Platform.getContentTypeManager().findContentTypesFor(
+					resource.getName());
+
+			for (IContentType type : types) {
+				if (type.getId().equals(expectedValue)) {
+					result = true;
+					break;
+				}
+			}
+		}
+
+		return result;
+	}
+
+}

Added: felix/trunk/sigil/sigil-builder/.classpath
URL: http://svn.apache.org/viewvc/felix/trunk/sigil/sigil-builder/.classpath?rev=793581&view=auto
==============================================================================
--- felix/trunk/sigil/sigil-builder/.classpath (added)
+++ felix/trunk/sigil/sigil-builder/.classpath Mon Jul 13 13:25:46 2009
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+	<classpathentry kind="src" output="build-libs/classes" path="src"/>
+	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+	<classpathentry kind="lib" path="build-libs/ant.jar"/>
+	<classpathentry kind="lib" path="build-libs/osgi.core.jar"/>
+	<classpathentry kind="output" path="bin"/>
+</classpath>

Added: felix/trunk/sigil/sigil-builder/.project
URL: http://svn.apache.org/viewvc/felix/trunk/sigil/sigil-builder/.project?rev=793581&view=auto
==============================================================================
--- felix/trunk/sigil/sigil-builder/.project (added)
+++ felix/trunk/sigil/sigil-builder/.project Mon Jul 13 13:25:46 2009
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>sigil-builder</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>org.eclipse.jdt.core.javabuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>org.eclipse.jdt.core.javanature</nature>
+	</natures>
+</projectDescription>

Added: felix/trunk/sigil/sigil-builder/build.xml
URL: http://svn.apache.org/viewvc/felix/trunk/sigil/sigil-builder/build.xml?rev=793581&view=auto
==============================================================================
--- felix/trunk/sigil/sigil-builder/build.xml (added)
+++ felix/trunk/sigil/sigil-builder/build.xml Mon Jul 13 13:25:46 2009
@@ -0,0 +1,227 @@
+<?xml version="1.0"?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements.  See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership.  The ASF licenses this file
+  to you 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 License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+<project name="sigil-builder" default="build">
+  <property name="user.props" value="user.properties" />
+  <property file="${user.props}"/>
+  <property file="project.properties"/>
+  <property file="download.properties"/>
+
+  <property name="error.internal.target" value="Do not call this target directly"/>
+
+  <property name="eclipse.sdk" value="${eclipse.install.dir}"/>
+  <property name="extras.sdk" value="build-libs/target-platform-extras"/>
+
+  <condition property="isUnix">
+      <os family="unix"/>
+  </condition>
+
+  <!-- PUBLIC TARGETS -->
+
+  <target name="build"
+    depends="clean-tmp, target-platform, pdebuild"/>
+
+  <target name="clean-tmp">
+    <delete dir="target/tmp" />
+  </target>
+  
+  <target name="clean">
+    <delete dir="target"/>
+    <delete dir="build-libs/classes"/>
+  </target>
+
+  <!-- create target platform -->
+  <target name="target-platform" depends="rsync-platform, copy-platform"/>
+
+  <target name="rsync-platform" if="isUnix">
+      <mkdir dir="${target.platform}/eclipse" />
+      <exec executable="rsync" append="true"
+        output="${target.platform}/rsync.log" >
+	<arg line="-av --delete ${eclipse.sdk}/ ${extras.sdk}/ ${target.platform}/eclipse" />
+      </exec>
+  </target>
+
+  <target name="copy-platform" unless="isUnix">
+      <mkdir dir="${target.platform}/eclipse" />
+      <copy todir="${target.platform}/eclipse">
+	<fileset dir="${eclipse.sdk}"/>
+	<fileset dir="${extras.sdk}" />
+      </copy>
+  </target>
+
+  <target name="init">
+    <mkdir dir="target"/>
+    <mkdir dir="target/features"/>
+    <mkdir dir="target/plugins"/>
+  </target>
+
+  <target name="custom.tasks">
+    <mkdir dir="build-libs/classes"/>
+    <javac srcdir="src" destdir="build-libs/classes" debug="on">
+      <classpath>
+        <fileset dir="build-libs">
+          <include name="osgi.core.jar"/>
+        </fileset>
+      </classpath>
+    </javac>
+    <taskdef name="findbundle" classname="org.cauldron.sigil.build.FindBundlesTask">
+      <classpath>
+        <pathelement location="build-libs/osgi.core.jar"/>
+        <pathelement location="build-libs/classes"/>
+      </classpath>
+    </taskdef>
+    <taskdef name="siteInsertFeatures" classname="org.cauldron.sigil.build.SiteInsertFeatures">
+      <classpath>
+        <pathelement location="build-libs/classes"/>
+      </classpath>
+    </taskdef>
+  </target>
+
+  <target name="findbundles" depends="custom.tasks">
+    <!-- Find the Equinox launcher JAR -->
+    <echo>${eclipse.install.dir}</echo>
+    <findbundle dir="${eclipse.install.dir}/plugins" symbolicname="org.eclipse.equinox.launcher" property="eclipse.launcher.version"/>
+    <property name="eclipse.launcher.jar" location="${eclipse.install.dir}/plugins/org.eclipse.equinox.launcher_${eclipse.launcher.version}.jar"/>
+
+    <!-- Find the PDE Build scripts -->
+    <findbundle dir="${eclipse.install.dir}/plugins" symbolicname="org.eclipse.pde.build" property="eclipse.pdebuild.version"/>
+    <property name="eclipse.productBuild.xml" location="${eclipse.install.dir}/plugins/org.eclipse.pde.build_${eclipse.pdebuild.version}/scripts/productBuild/productBuild.xml"/>
+    <property name="eclipse.featureBuild.xml" location="${eclipse.install.dir}/plugins/org.eclipse.pde.build_${eclipse.pdebuild.version}/scripts/build.xml"/>
+  </target>
+
+  <!-- Unused
+  <target name="download" depends="init">
+    <mkdir dir="${target.platform}"/>
+
+    <echo message="Downloading platform runtime"/>
+    <get dest="${target.platform}/platform-runtime.zip"
+       src="${download.base}/${download.dir}/${download.platform.runtime}" verbose="true"/>
+
+    <echo message="Downloading RCP delta pack"/>
+    <get dest="${target.platform}/deltapack.zip"
+       src="${download.base}/${download.dir}/${download.deltapack}" verbose="true"/>
+
+    <echo message="Downloading CVS client"/>
+    <get dest="${target.platform}/cvsclient.zip"
+       src="${download.base}/${download.dir}/${download.cvsclient}" verbose="true"/>
+
+    <unzip src="${target.platform}/platform-runtime.zip" dest="${target.platform}" overwrite="true"/>
+    <unzip src="${target.platform}/deltapack.zip" dest="${target.platform}" overwrite="true"/>
+    <unzip src="${target.platform}/cvsclient.zip" dest="${target.platform}" overwrite="true"/>
+  </target>
+  -->
+
+  <target name="copy.projects" depends="init">
+    <foreach list="${plugins}" param="plugin.id"  target="__copy.plugin"/>
+    <foreach list="${features}" param="feature.id" target="__copy.feature"/>
+  </target>
+
+  <target name="copy.properties" depends="init">
+    <copy file="builder/template.build.properties" tofile="builder/build.properties" overwrite="true"/>
+    <pathconvert property="basedir.unix" targetos="unix">
+      <path location="${basedir}"/>
+    </pathconvert>
+    <replace file="builder/build.properties">
+      <replacefilter token="@@WARNING_TEXT" value="Warning! This file is auto-generated. Changes will be overwritten!"/>
+      <replacefilter token="@@BUILD_PROJECT_DIR" value="${basedir.unix}"/>
+      <replacefilter token="@@TARGET_PLATFORM" value="${target.platform}"/>
+    </replace>
+  </target>
+
+  <!-- Unused
+  <target name="copy.deps">
+    <copy todir="${target.platform}/eclipse/plugins">
+      <fileset dir="target-libs" includes="*.jar"/>
+    </copy>
+  </target>
+  -->
+
+  <target name="pdebuild" depends="findbundles,copy.projects,copy.properties">
+    <java jar="${eclipse.launcher.jar}" fork="true" failonerror="true">
+      <sysproperty key="builder" path="${basedir}/builder"/>
+      <arg line="-application org.eclipse.ant.core.antRunner"/>
+      <arg line="-buildfile ${eclipse.featureBuild.xml}"/>
+    </java>
+  </target>
+  
+  <target name="new.updateSite">
+    <copy file="site.xml" todir="${updateSiteDir}"/>
+    <antcall target="copy.updateSite" />
+  </target>
+
+  <target name="copy.updateSite" depends="custom.tasks">
+    <copy todir="${updateSiteDir}">
+      <fileset dir="target/tmp/eclipse" includes="**/*.jar"/>
+    </copy>
+    <property file="target/finalFeaturesVersions.properties" prefix="featureVersions"/>
+    <siteInsertFeatures sitexmlfile="${updateSiteDir}/site.xml"
+      features="${features}"
+      versionPropPrefix="featureVersions"
+      categoryPropPrefix="category"/>
+  </target>
+
+  <!-- INTERNAL TARGETS -->
+  <target name="__copy.plugin">
+    <fail unless="plugin.id" message="${error.internal.target}"/>
+    <echo message="Copying plugin ${plugin.id}"/>
+    <antcall target="__copy.artifact">
+      <param name="artifact.id" value="${plugin.id}"/>
+      <param name="artifact.type" value="plugin"/>
+    </antcall>
+  </target>
+
+  <target name="__copy.feature">
+    <fail unless="feature.id" message="${error.internal.target}"/>
+    <antcall target="__copy.artifact">
+      <param name="artifact.id" value="${feature.id}"/>
+      <param name="artifact.type" value="feature"/>
+    </antcall>
+    
+    <replace file="target/features/${feature.id}/feature.xml">
+      <replacefilter token="http://replace.with.real.url" value="${updateUrl}"/>
+    </replace>
+  </target>
+
+  <target name="__copy.artifact">
+    <fail unless="artifact.id" message="${error.internal.target}"/>
+    <fail unless="artifact.type" message="${error.internal.target}"/>
+
+    <echo message="Copying from ${source.dir}/${artifact.id} to target/${artifact.type}s"/>
+    <copy todir="target/${artifact.type}s">
+      <fileset dir="${source.dir}">
+        <exclude name="${artifact.id}/bin/**"/>
+        <exclude name="${artifact.id}/build/**"/>
+        <exclude name="${artifact.id}/**/*.class"/>
+        <include name="${artifact.id}/**"/>
+      </fileset>
+    </copy>
+  </target>
+
+  <target name="__nodefault">
+    <fail message="There is no default target"/>
+  </target>
+
+  <!-- TASK DEFINITIONS -->
+  <taskdef resource="net/sf/antcontrib/antlib.xml">
+    <classpath>
+      <pathelement location="build-libs/ant-contrib/ant-contrib-1.0b3.jar"/>
+    </classpath>
+  </taskdef>
+
+</project>

Added: felix/trunk/sigil/sigil-builder/builder/template.build.properties
URL: http://svn.apache.org/viewvc/felix/trunk/sigil/sigil-builder/builder/template.build.properties?rev=793581&view=auto
==============================================================================
--- felix/trunk/sigil/sigil-builder/builder/template.build.properties (added)
+++ felix/trunk/sigil/sigil-builder/builder/template.build.properties Mon Jul 13 13:25:46 2009
@@ -0,0 +1,215 @@
+###############################################################################
+#
+# @@WARNING_TEXT
+#
+############# WHAT SHOULD WE BUILD? #############
+
+#To build a Product
+#product=/org.blah.blah/blah.product
+#runPackager=true
+
+#To build a Feature
+topLevelElementId=org.cauldron.sigil.all.feature
+topLevelElementType=feature
+
+#The prefix that will be used in the generated archive.
+archivePrefix=eclipse
+
+# The location underwhich all of the build output will be collected.
+collectingFolder=${archivePrefix}
+
+# The list of {os, ws, arch} configurations to build.  This 
+# value is a '&' separated list of ',' separate triples.  For example, 
+#     configs=win32,win32,x86 & linux,motif,x86
+# By default the value is *,*,*
+configs=\
+	*, *, *
+#	win32, win32, x86
+#	macosx, carbon, ppc &\
+#	linux, gtk, ppc &\
+#	linux, gtk, x86 & \
+#	linux, gtk, x86_64 & \
+#	linux, motif, x86 & \
+#	solaris, motif, sparc & \
+#	solaris, gtk, sparc & \
+#	aix, motif, ppc & \
+#	hpux, motif, PA_RISC & \
+#	macosx, carbon, ppc
+
+# By default PDE creates one archive (result) per entry listed in the configs property.
+# Setting this value to try will cause PDE to only create one output containing all 
+# artifacts for all the platforms listed in the configs property.
+#groupConfigurations=true
+
+#The format of the archive. By default a zip is created using antZip.
+#The list can only contain the configuration for which the desired format is different than zip.
+archivesFormat=*,*,* - folder
+#archivesFormat=win32, win32, x86 - antZip& \
+#	linux, gtk, ppc - antZip &\
+#    linux, gtk, x86 - antZip& \
+#	linux, gtk, x86_64 - antZip& \
+# linux, motif, x86 - antZip& \
+#	solaris, motif, sparc - antZip& \
+#	solaris, gtk, sparc - antZip& \
+#	aix, motif, ppc - antZip& \
+#	hpux, motif, PA_RISC - antZip& \
+#	macosx, carbon, ppc - antZip
+	
+#Set to true if you want the output to be ready for an update jar (no site.xml generated)
+outputUpdateJars=true
+
+#Set to true for Jnlp generation
+#codebase should be a URL that will be used as the root of all relative URLs in the output.
+#generateJnlp=false
+#jnlp.codebase=<codebase url>
+#jnlp.j2se=<j2se version>
+#jnlp.locale=<a locale>
+#jnlp.generateOfflineAllowed=true or false generate <offlineAllowed/> attribute in the generated features
+#jnlp.configs=${configs}			#uncomment to filter the content of the generated jnlp files based on the configuration being built
+
+#Set to true if you want to sign jars
+#signJars=false
+#sign.alias=<alias>
+#sign.keystore=<keystore location>
+#sign.storepass=<keystore password>
+
+#Arguments to send to the zip executable
+zipargs=
+
+#Arguments to send to the tar executable
+tarargs=
+
+#Control the creation of a file containing the version included in each configuration - on by default 
+#generateVersionsLists=false
+
+############## BUILD NAMING CONTROL ################
+# The directory into which the build elements are fetched and where
+# the build takes place.
+buildProjectDirectory=@@BUILD_PROJECT_DIR
+buildDirectory=${buildProjectDirectory}/target
+
+# Type of build.  Used in naming the build output.  Typically this value is
+# one of I, N, M, S, ...
+buildType=N
+
+# ID of the build.  Used in naming the build output.
+buildId=Sigil
+
+# Label for the build.  Used in naming the build output
+buildLabel=${buildType}.${buildId}
+
+# Timestamp for the build.  Used in naming the build output
+timestamp=007
+
+#The value to be used for the qualifier of a plugin or feature when you want to override the value computed by pde.
+#The value will only be applied to plugin or features indicating build.properties, qualifier = context 
+#forceContextQualifier=<the value for the qualifier>
+
+#Enable / disable the generation of a suffix for the features that use .qualifier. 
+#The generated suffix is computed according to the content of the feature   
+#generateFeatureVersionSuffix=true
+
+############# BASE CONTROL #############
+# Settings for the base Eclipse components and Java class libraries 
+# against which you are building.
+# Base location for anything the build needs to compile against.  For example,
+# in most RCP app or a plug-in,  the baseLocation should be the location of a previously
+# installed Eclipse against which the application or plug-in code will be compiled and the RCP delta pack.
+
+base=@@TARGET_PLATFORM
+baseLocation=${base}/eclipse
+#Os/Ws/Arch/nl of the eclipse specified by baseLocation
+baseos=win32
+basews=win32
+basearch=x86
+
+#this property indicates whether you want the set of plug-ins and features to be considered during the build to be limited to the ones reachable from the features / plugins being built
+filteredDependencyCheck=false
+
+#this property indicates whether the resolution should be done in development mode (i.e. ignore multiple bundles with singletons)
+resolution.devMode=false
+
+#pluginPath is a list of locations in which to find plugins and features.  This list is separated by the platform file separator (; or :)
+#a location is one of:  
+#- the location of the jar or folder that is the plugin or feature : /path/to/foo.jar or /path/to/foo
+#- a directory that contains a /plugins or /features subdirectory
+#- the location of a feature.xml, or for 2.1 style plugins, the plugin.xml or fragment.xml
+#pluginPath=
+
+skipBase=true
+eclipseURL=http://www.eclipse.org/downloads/
+eclipseBuildId=3.3RC2
+eclipseBaseURL=${eclipseURL}/eclipse-platform-${eclipseBuildId}-win32.zip
+
+
+############# MAP FILE CONTROL ################
+# This section defines CVS tags to use when fetching the map files from the repository.
+# If you want to fetch the map file from repository / location, change the getMapFiles target in the customTargets.xml
+
+skipMaps=true
+mapsRepo=:pserver:anonymous@example.com/path/to/repo
+mapsRoot=path/to/maps
+mapsCheckoutTag=HEAD
+
+#tagMaps=true
+mapsTagTag=v${buildId}
+
+
+############ REPOSITORY CONTROL ###############
+# This section defines properties parameterizing the repositories where plugins, fragments
+# bundles and features are being obtained from. 
+
+# The tags to use when fetching elements to build.
+# By default thebuilder will use whatever is in the maps.  
+# This value takes the form of a comma separated list of repository identifier (like used in the map files) and the 
+# overriding value
+# For example fetchTag=CVS=HEAD, SVN=v20050101
+# fetchTag=HEAD
+skipFetch=true
+
+
+############# JAVA COMPILER OPTIONS ##############
+# The location of the Java jars to compile against.  Typically the rt.jar for your JDK/JRE
+#bootclasspath=${java.home}/lib/rt.jar
+
+# specific JRE locations to compile against. These values are used to compile bundles specifying a 
+# Bundle-RequiredExecutionEnvironment. Uncomment and set values for environments that you support
+#CDC-1.0/Foundation-1.0= /path/to/rt.jar
+#CDC-1.1/Foundation-1.1=
+#OSGi/Minimum-1.0=
+#OSGi/Minimum-1.1=
+#JRE-1.1=
+#J2SE-1.2=
+#J2SE-1.3=
+#J2SE-1.4=
+#J2SE-1.5=
+#JavaSE-1.6=
+#PersonalJava-1.1=
+#PersonalJava-1.2=
+#CDC-1.0/PersonalBasis-1.0=
+#CDC-1.0/PersonalJava-1.0=
+#CDC-1.1/PersonalBasis-1.1=
+#CDC-1.1/PersonalJava-1.1=
+
+# Specify the output format of the compiler log when eclipse jdt is used
+logExtension=.log
+
+# Whether or not to include debug info in the output jars
+javacDebugInfo=true
+
+# Whether or not to fail the build if there are compiler errors
+javacFailOnError=true
+
+# Enable or disable verbose mode of the compiler
+javacVerbose=true
+
+# Extra arguments for the compiler. These are specific to the java compiler being used.
+#compilerArg=
+
+# Default value for the version of the source code. This value is used when compiling plug-ins that do not set the Bundle-RequiredExecutionEnvironment or set javacSource in build.properties
+javacSource=1.5
+
+# Default value for the version of the byte code targeted. This value is used when compiling plug-ins that do not set the Bundle-RequiredExecutionEnvironment or set javacTarget in build.properties.
+javacTarget=1.5
+
+

Added: felix/trunk/sigil/sigil-builder/download.properties
URL: http://svn.apache.org/viewvc/felix/trunk/sigil/sigil-builder/download.properties?rev=793581&view=auto
==============================================================================
--- felix/trunk/sigil/sigil-builder/download.properties (added)
+++ felix/trunk/sigil/sigil-builder/download.properties Mon Jul 13 13:25:46 2009
@@ -0,0 +1,10 @@
+# For UK mirror service
+download.base=http://www.mirrorservice.org/sites/download.eclipse.org/eclipseMirror/eclipse/downloads/drops/
+
+# 3.3.1.1 Release
+download.dir=R-3.3.1.1-200710231652
+
+#
+download.platform.runtime=eclipse-platform-3.3.1.1-win32.zip
+download.deltapack=eclipse-RCP-3.3.1.1-delta-pack.zip
+download.cvsclient=eclipse-CVS-Client-3.3.1.1.zip
\ No newline at end of file

Added: felix/trunk/sigil/sigil-builder/project.properties
URL: http://svn.apache.org/viewvc/felix/trunk/sigil/sigil-builder/project.properties?rev=793581&view=auto
==============================================================================
--- felix/trunk/sigil/sigil-builder/project.properties (added)
+++ felix/trunk/sigil/sigil-builder/project.properties Mon Jul 13 13:25:46 2009
@@ -0,0 +1,18 @@
+# The list of plugins to be build
+plugins=org.cauldron.sigil.core,\
+	org.cauldron.sigil.obr,\
+	org.cauldron.sigil.search,\
+	org.cauldron.sigil.ui,\
+	org.cauldron.sigil.help,\
+	org.cauldron.sigil.utils,\
+	org.cauldron.bld.core,\
+	org.cauldron.bld.obr
+
+# The list of features to be built
+features=org.cauldron.sigil.all.feature,\
+	org.cauldron.sigil.feature,\
+	org.cauldron.sigil.obr.feature
+
+# Mapping of features to categories in the Update Site
+category.org.cauldron.sigil.feature=Sigil
+category.org.cauldron.sigil.obr.feature=Sigil

Added: felix/trunk/sigil/sigil-builder/readme.html
URL: http://svn.apache.org/viewvc/felix/trunk/sigil/sigil-builder/readme.html?rev=793581&view=auto
==============================================================================
--- felix/trunk/sigil/sigil-builder/readme.html (added)
+++ felix/trunk/sigil/sigil-builder/readme.html Mon Jul 13 13:25:46 2009
@@ -0,0 +1,131 @@
+<html>
+<head>
+<title>Sigil Build Instructions</title>
+</head>
+<body>
+
+<h1>Build Instructions</h1>
+
+<h2>1. Install Prerequisites</h2>
+
+<p>A full copy of Eclipse SDK is required to build. This must be
+installed in a directory called <code>eclipse</code>, and the full path
+should not contain any spaces. For example:</p>
+
+<ul>
+	<li><code>C:/eclipse-SDK-3.4/eclipse</code> is GOOD</li>
+	<li><code>C:/eclipse-SDK-3.4/</code> is BAD</li>
+	<li><code>C:/Program Files/Eclipse 3.4/</code> is VERY BAD</li>
+</ul>
+
+<p>This directory (<strong>including</strong> the final <code>eclipse</code>)
+will be referred to as the SDK directory.</p>
+
+<h2>2. Setup the Target Platform</h2>
+
+<p>The target platform is the collection of binary plugins and
+features against which the source projects are built. It is an Eclipse
+installation (with a <code>plugins</code> and <code>features</code>
+directory), and so can be setup by downloading the correct zip or
+tarball from the Eclipse website. Like the SDK directory, the target
+platform must be inside a directory called <code>eclipse</code>. In your
+IDE, you should point PDE at the target platform by opening Preferences
+and navigating to "Plug-in Development" --&gt; "Target Platform". Click
+Browse and select the <code>eclipse</code> directory.</p>
+
+<p>Note that since we are building SDK plugins, the Target Platform
+will be a full SDK (eg "Eclipse Classic SDK"). Therefore we can reuse
+the same SDK directory that we setup in the previous step. However it
+can also be useful to separate these because we might want to use
+different Eclipse versions for each function. For example, we may want
+to use Eclipse 3.4 to build a 3.3-based product.</p>
+
+<h2>3. Create and edit <code>user.properties</code></h2>
+
+<p>User-specific properties are supplied in the file <code>user.properties</code>.
+After checkout this file does not exist, so please copy <code>template.user.properties</code>
+to <code>user.properties</code> and change the following settings:</p>
+
+<ul>
+	<li><code>target.platform</code>: this should be set to the <strong>parent
+	</strong> directory of the <code>eclipse</code> directory which contains the
+	Target Platform.</li>
+	<li><code>eclipse.install.dir</code>: the SDK directory (including
+	final <code>eclipse</code> segment).</li>
+</ul>
+
+<p>Do not check <code>user.properties</code> into version control:
+the settings inside are specific to your machine.</p>
+
+<h2>4. Configure the Update Site URL</h2>
+
+<p>The Update Site URL can be specified by setting the <code>updateUrl</code>
+property in <code>project.properties</code> . This will be copied into
+the <code>feature.xml</code> descriptor for each feature that is part of
+the build. For this to work, the update site URL setting in the <code>feature.xml</code>
+of each source feature project must be set to the following placeholder
+string: <code>http://replace.with.real.url</code></p>
+
+<h2>5. Execute the Build</h2>
+
+<p>Execute a full build by running the <code>pdebuild</code> target
+in ANT, e.g.:</p>
+
+<pre>
+    ant pdebuild
+</pre>
+
+<p>This will generate a directory named <code>target/tmp/eclipse</code>
+which contains a <code>plugins</code> directory for the built plugin
+JARs and a <code>features</code> directory for the built features. If
+the build fails then compilation logs for each plugin can be found in <code>target/N.Sigil/compilelogs/plugins</code>.</p>
+
+<h2>6. Deploy to Update Site</h2>
+
+<p>After the features and plugins are built we can deploy them to an
+update site on the local filesystem. The update site directory must
+already exist with the following layout:</p>
+
+<pre>
+${updateSiteDir}/
+ |--plugins/
+ |--features/
+ \--site.xml
+</pre>
+
+<p>And <code>site.xml</code> must have at least the following
+content:</p>
+
+<pre>
+&lt;site&gt;
+    &lt;category-def name="Sigil" label="Sigil"&gt;
+        &lt;description&gt;Blah blah&lt;/description&gt;
+    &lt;/category-def&gt;
+&lt;/site&gt;
+</pre>
+
+<p>It can also have any number of pre-existing <code>&lt;feature&gt;</code>
+entries as direct children of the <code>&lt;site&gt;</code> element.</p>
+
+<p>Next set the <code>updateSiteDir</code> property in <code>project.properties</code>
+to point at the above directory. Now we can run the deploy target as
+follows:</p>
+
+<pre>
+    ant copy.updateSite
+</pre>
+
+<p>This will copy all of the plugin and feature JARs that were built
+in the previous step into the update site directory. It will also add a
+new entry into <code>site.xml</code> for each feature. Note that the
+update site directory will grow continually. Since the plugins and
+features are generated with a timestamp in their version qualifier (e.g.
+1.2.3.200808091200 for version 1.2.3 built on 9 Aug 2008 at 12 o'clock
+GMT), Eclipse Update Manager will always select the newest version
+available.</p>
+
+<p>NB: the deploy target will overwrite <code>site.xml</code>. A
+backup will be saved in <code>site.xml.bak</code> but this backup will
+be overwritten next time the build is run.</p>
+</body>
+</html>
\ No newline at end of file

Added: felix/trunk/sigil/sigil-builder/server-nightly.properties
URL: http://svn.apache.org/viewvc/felix/trunk/sigil/sigil-builder/server-nightly.properties?rev=793581&view=auto
==============================================================================
--- felix/trunk/sigil/sigil-builder/server-nightly.properties (added)
+++ felix/trunk/sigil/sigil-builder/server-nightly.properties Mon Jul 13 13:25:46 2009
@@ -0,0 +1,6 @@
+eclipse.install.dir=/opt/eclipse-SDK-3.4/eclipse
+source.dir=${basedir}/..
+target.platform=target/target-platform
+updateSiteDir=target/update-site
+# updateUrl is over-ridden from Hudson
+updateUrl=http://sigil.codecauldron.org/update-site-daily