public class WorkspaceRegistry extends Object
Maintains a registry of goomph workspaces.
So here’s the problem. Let say you have a multiproject build, such as this:
libA/
.project
libB/
.project
ide/
build/oomph-ide/
eclipse.exe
workspace/
Everything works great! But in a single project build:
lib/
.project
build/oomph-ide/
eclipse.exe
workspace/
It breaks. Why? Because the workspace
is a subdirectory of the .project
folder. And eclipse does not support that. GAH!
So, to fix that, we need to maintain the workspaces in a central registry. This class maintains that registry, and cleans out old workspaces when the IDE they were created for gets deleted.
The registry lives in GoomphCacheLocations.workspaces()
. It names the workspace folders as such:
<gradle root project's name>-<hashcode of ide directory absolute path>/
<gradle root project's name>-<hashcode of ide directory absolute path>-owner [file containing absolute path of ide folder]
Modifier and Type | Method and Description |
---|---|
void |
clean()
Removes all workspace directories for which their owning workspace is no longer present.
|
static WorkspaceRegistry |
instance() |
File |
workspaceDir(Project project,
File ideDir)
Returns the workspace directory appropriate for the given project and ide folder.
|
File |
workspaceDir(String name,
File ideDir)
Returns the workspace directory appropriate for the given name and file.
|
public static WorkspaceRegistry instance() throws IOException
IOException
public File workspaceDir(Project project, File ideDir)
Returns the workspace directory appropriate for the given project and ide folder.
public File workspaceDir(String name, File ideDir)
Returns the workspace directory appropriate for the given name and file.
public void clean()
Removes all workspace directories for which their owning workspace is no longer present.