Package io.helidon.build.dev
Class Project
- java.lang.Object
-
- io.helidon.build.dev.Project
-
public class Project extends Object
A continuous build project. New instances must have been successfully built.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classProject.BuilderAProjectbuilder.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Optional<FileTime>binaryFilesChangedTime()Returns the most recent modification time if any build file has an updated modification time.static Project.Builderbuilder()Returns a new builder.BuildFilesbuildFiles()Returns the build files (e.g.Optional<FileTime>buildFilesChangedTime()Returns the most recent modification time if any build file has an updated modification time.BuildTypebuildType()Returns the build type.List<File>classpath()Returns the project classpath.List<String>compilerFlags()Returns the compiler flags.List<BuildComponent>components()Returns all components.List<BuildFile>dependencies()Returns a list of all external dependencies.protected voidincrementalBuild(List<BuildRoot.Changes> changes, Consumer<String> stdOut, Consumer<String> stdErr)Perform an incremental build for the given changes.booleanisBuildUpToDate()Returns whether or not all binaries are newer than all sources and no sources have changed.StringmainClassName()Returns the main class name.Stringname()Returns the project name.ProjectDirectoryroot()Returns the root directory.List<BuildRoot.Changes>sourceChanges()Returns a list of source changes since the last update, if any.Optional<FileTime>sourceChangesSince(FileTime time)Checks whether any source file has a modified time more recent than the given time.voidupdate(boolean updateDependencies)Update the project time stamps.
-
-
-
Method Detail
-
builder
public static Project.Builder builder()
Returns a new builder.- Returns:
- The builder.
-
name
public String name()
Returns the project name.- Returns:
- The name.
-
buildType
public BuildType buildType()
Returns the build type.- Returns:
- The type.
-
root
public ProjectDirectory root()
Returns the root directory.- Returns:
- The root.
-
buildFiles
public BuildFiles buildFiles()
Returns the build files (e.g.pom.xml).- Returns:
- The files.
-
dependencies
public List<BuildFile> dependencies()
Returns a list of all external dependencies.- Returns:
- The paths.
-
components
public List<BuildComponent> components()
Returns all components.- Returns:
- The components.
-
mainClassName
public String mainClassName()
Returns the main class name.- Returns:
- The name.
-
buildFilesChangedTime
public Optional<FileTime> buildFilesChangedTime()
Returns the most recent modification time if any build file has an updated modification time.- Returns:
- The time, if changed.
-
sourceChanges
public List<BuildRoot.Changes> sourceChanges()
Returns a list of source changes since the last update, if any.- Returns:
- The changes.
-
sourceChangesSince
public Optional<FileTime> sourceChangesSince(FileTime time)
Checks whether any source file has a modified time more recent than the given time.- Parameters:
time- The time to check against. Ifnull, usesFileUtils.fromMillis(0).- Returns:
- The time, if changed.
-
binaryFilesChangedTime
public Optional<FileTime> binaryFilesChangedTime()
Returns the most recent modification time if any build file has an updated modification time.- Returns:
- The time, if changed.
-
isBuildUpToDate
public boolean isBuildUpToDate()
Returns whether or not all binaries are newer than all sources and no sources have changed.- Returns:
trueif up to date,falseif not.
-
update
public void update(boolean updateDependencies)
Update the project time stamps.- Parameters:
updateDependencies-trueif dependencies should be updated.
-
incrementalBuild
protected void incrementalBuild(List<BuildRoot.Changes> changes, Consumer<String> stdOut, Consumer<String> stdErr) throws Exception
Perform an incremental build for the given changes.- Parameters:
changes- The changes.stdOut- A consumer for stdout.stdErr- A consumer for stderr.- Throws:
Exception- on error.
-
-