Interface BuildContext

All Known Implementing Classes:
DefaultBuildContext

public interface BuildContext
The context of a build.
  • Method Summary

    Modifier and Type
    Method
    Description
    org.apache.commons.cli.CommandLine
    The command line as processed by Apache Commons CLI.
    Returns the relative path from a project directory to the JDrupes Builder directory.
    property(String name, String defaultValue)
    Returns the value of the given property.
    <T extends Resource>
    Stream<T>
    Obtains the stream of resources of the given type from the given provider.
  • Method Details

    • jdbldDirectory

      Returns the relative path from a project directory to the JDrupes Builder directory.
      Returns:
      the path
    • commandLine

      org.apache.commons.cli.CommandLine commandLine()
      The command line as processed by Apache Commons CLI.
      Returns:
      the parsed command line
    • resources

      <T extends Resource> Stream<T> resources(ResourceProvider provider, ResourceRequest<T> request)

      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.

      Type Parameters:
      T - the resource type
      Parameters:
      provider - the provider
      request - the request
      Returns:
      the results
    • property

      String property(String name, String defaultValue)

      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
      Parameters:
      name - the name
      defaultValue - the default value
      Returns:
      the string