org.schmant.project.eclipse
Class EclipseWorkspace

java.lang.Object
  extended by org.schmant.project.AbstractProjectRepository<EclipseWorkspace,EclipseWorkspaceConfiguration>
      extended by org.schmant.project.eclipse.EclipseWorkspace
All Implemented Interfaces:
ProjectRepository

public class EclipseWorkspace
extends AbstractProjectRepository<EclipseWorkspace,EclipseWorkspaceConfiguration>

The EclipseWorkspace is a ProjectRepository built on an Eclipse workspace. It is created with a workspace directory and an optional settings object. When created, it uses an EclipseWorkspaceInfoCollector to parse dependency information from all projects' .project and .classpath files. That info collector uses the set of EclipseProjectCreatorPlugin plugins that all enabled task packages provide to identify different kinds of projects such as Java projects.

The EclipseWorkspaceInfoCollector tries to parse classpath library and user library from the workspace metadata, if present. The build script may supply its own values for these dependencies. Supplied values take precedence over values from the workspace metadata.

This class is documented in the User's guide.

Note: Implementing good support for building an Eclipse workspace is difficult since there are so many possible valid configurations. If you stumble upon something that does not work properly, please register it as a bug.

Since:
0.5
Author:
Karl Gustafsson

Constructor Summary
EclipseWorkspace(Object wosDir)
          Create an Eclipse workspace based on the projects in the provided directory.
EclipseWorkspace(Object wosDir, EclipseWorkspaceSettings settings)
          Create an Eclipse workspace based on the projects in the provided directory.
EclipseWorkspace(ProjectRepositoryInfoCollector<EclipseWorkspace,EclipseWorkspaceConfiguration> infoCollector)
          Create an Eclipse workspace using a custom information collector.
 
Method Summary
 String toString()
           
 
Methods inherited from class org.schmant.project.AbstractProjectRepository
getProject, getProjectRepositoryConfiguration, getProjects, getProjects, hasProject
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

EclipseWorkspace

public EclipseWorkspace(Object wosDir)
Create an Eclipse workspace based on the projects in the provided directory.

Parameters:
wosDir - The workspace directory. Interpreted with InterpretAsReadOnlyDirectoryStrategy. (Any filters in the in the DirectoryRepresentation object are ignored, but directory views work as usual.) The workspace directory should contain a directory named .metadata.

EclipseWorkspace

public EclipseWorkspace(Object wosDir,
                        EclipseWorkspaceSettings settings)
Create an Eclipse workspace based on the projects in the provided directory.

Parameters:
wosDir - The workspace directory, interpreted with InterpretAsReadOnlyDirectoryStrategy. Supplied filters are ignored, but directory views work. In addition to the projects in the subdirectories of this directory, project directories can also be added to the settings objects. The workspace directory should contain a directory named .metadata.
settings - Settings used to create the workspace object, such as definitions of workspace variables and user libraries.

EclipseWorkspace

public EclipseWorkspace(ProjectRepositoryInfoCollector<EclipseWorkspace,EclipseWorkspaceConfiguration> infoCollector)
Create an Eclipse workspace using a custom information collector.

Parameters:
infoCollector - The information collector.
Method Detail

toString

public String toString()
Overrides:
toString in class Object