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
    • get

      public <T extends Resource> Stream<T> get(ResourceProvider provider, ResourceRequest<T> request)
      Description copied from interface: BuildContext
      Obtains the resource stream for the given resource 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.
      Specified by:
      get in interface BuildContext
      Type Parameters:
      T - the resource type
      Parameters:
      provider - the provider
      request - the request
      Returns:
      the results
    • jdbldDirectory

      public Path jdbldDirectory()
      Description copied from interface: BuildContext
      The relative path to the JDrupes Builder directory from a project 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 string[]
    • property

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

      Return 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
      Returns:
      the string