Class DefaultBuildContext

java.lang.Object
org.jdrupes.builder.core.DefaultBuildContext
All Implemented Interfaces:
BuildContext

public class DefaultBuildContext extends Object implements BuildContext
A context for building.
  • Field Details

  • Method Details

    • executor

      Returns the executor service used by this build to create futures.
      Returns:
      the executor service
    • executor

      public void executor(ExecutorService executor)
      Sets the executor service used by this build to create futures.
      Parameters:
      executor - the executor
    • resources

      public <T extends Resource> Stream<T> resources(ResourceProvider provider, ResourceRequest<T> requested)
      Description copied from interface: BuildContext

      Obtains the stream of resources of the given type from the given provider. The result from invoking the provider is evaluated asynchronously and cached. Only when the returned stream is terminated will the invocation block until the result from the provider becomes available.

      To avoid duplicate invocations of a non-project provider, any intends are removed from the request before such a provider is invoked.

      Specified by:
      resources in interface BuildContext
      Type Parameters:
      T - the resource type
      Parameters:
      provider - the provider
      requested - the request
      Returns:
      the results
    • jdbldDirectory

      public Path jdbldDirectory()
      Description copied from interface: BuildContext
      Returns the relative path from a project directory to the JDrupes Builder directory.
      Specified by:
      jdbldDirectory in interface BuildContext
      Returns:
      the path
    • commandLine

      public org.apache.commons.cli.CommandLine commandLine()
      Description copied from interface: BuildContext
      The command line as processed by Apache Commons CLI.
      Specified by:
      commandLine in interface BuildContext
      Returns:
      the parsed command line
    • property

      public String property(String name, String defaultValue)
      Description copied from interface: BuildContext

      Returns the value of the given property. Properties are defined by (in order of precedence):

      1. command line options
      2. the file .jdbld.properties in the directory of the root project
      3. the file .jdbld/jdbld.properties in the user's home directory
      Specified by:
      property in interface BuildContext
      Parameters:
      name - the name
      defaultValue - the default value
      Returns:
      the string