Class Project


  • public class Project
    extends Object
    A continuous build project. New instances must have been successfully built.
    • 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.
      • classpath

        public List<File> classpath()
        Returns the project classpath.
        Returns:
        The classpath.
      • compilerFlags

        public List<String> compilerFlags()
        Returns the compiler flags.
        Returns:
        The flags.
      • 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. If null, uses FileUtils.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:
        true if up to date, false if not.
      • update

        public void update​(boolean updateDependencies)
        Update the project time stamps.
        Parameters:
        updateDependencies - true if 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.