Package com.diffplug.gradle.oomph
Class WorkspaceRegistry
- java.lang.Object
-
- com.diffplug.gradle.oomph.WorkspaceRegistry
-
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 inGoomphCacheLocations.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] ```
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclean()Removes all workspace directories for which their owning workspace is no longer present.static WorkspaceRegistryinstance()FileworkspaceDir(String name, File ideDir)Returns the workspace directory appropriate for the given name and file.FileworkspaceDir(Project project, File ideDir)Returns the workspace directory appropriate for the given project and ide folder.
-
-
-
Method Detail
-
instance
public static WorkspaceRegistry instance() throws IOException
- Throws:
IOException
-
workspaceDir
public File workspaceDir(Project project, File ideDir)
Returns the workspace directory appropriate for the given project and ide folder.
-
workspaceDir
public File workspaceDir(String name, File ideDir)
Returns the workspace directory appropriate for the given name and file.
-
clean
public void clean()
Removes all workspace directories for which their owning workspace is no longer present.
-
-