Package io.helidon.build.dev
Class BuildRoot
- java.lang.Object
-
- io.helidon.build.dev.ProjectDirectory
-
- io.helidon.build.dev.BuildRoot
-
public class BuildRoot extends ProjectDirectory implements Iterable<BuildFile>
A project directory that tracks file changes.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classBuildRoot.ChangesDirectory changes.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description BuildRootTypebuildType()Returns the build type.BuildRoot.Changeschanges()Tests for any changed files.BuildComponentcomponent()Returns the build component containing this root.static BuildRootcreateBuildRoot(BuildRootType type, Path path)Returns a new project directory.booleanequals(Object o)BuildFilefindFirst(Predicate<Path> filter)Returns the first file whose path matches the given filter.BuildFilefindFirstNamed(Predicate<String> filter)Returns the first file whose file name matches the given filter.inthashCode()Iterator<BuildFile>iterator()Collection<BuildFile>list()Returns the list of files.Stream<BuildFile>stream()Returns the stream of files.StringtoString()voidupdate()Updates the files list.-
Methods inherited from class io.helidon.build.dev.ProjectDirectory
clean, createProjectDirectory, delete, directoryType, isEmpty, path
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
-
-
-
Method Detail
-
createBuildRoot
public static BuildRoot createBuildRoot(BuildRootType type, Path path)
Returns a new project directory.- Parameters:
type- The type.path- The directory path.- Returns:
- The build root.
-
component
public BuildComponent component()
Returns the build component containing this root.- Returns:
- The component.
-
buildType
public BuildRootType buildType()
Returns the build type.- Returns:
- The type.
-
list
public Collection<BuildFile> list()
Returns the list of files.- Returns:
- The list.
-
findFirst
public BuildFile findFirst(Predicate<Path> filter)
Returns the first file whose path matches the given filter.- Parameters:
filter- The filter.- Returns:
- The build file.
- Throws:
NoSuchElementException- If not found.
-
findFirstNamed
public BuildFile findFirstNamed(Predicate<String> filter)
Returns the first file whose file name matches the given filter.- Parameters:
filter- The filter.- Returns:
- The build file.
- Throws:
NoSuchElementException- If not found.
-
changes
public BuildRoot.Changes changes()
Tests for any changed files.- Returns:
- The changes.
-
update
public void update()
Updates the files list.
-
toString
public String toString()
- Overrides:
toStringin classProjectDirectory
-
equals
public boolean equals(Object o)
- Overrides:
equalsin classProjectDirectory
-
hashCode
public int hashCode()
- Overrides:
hashCodein classProjectDirectory
-
-