Class ScriptExecutor

java.lang.Object
org.jdrupes.builder.core.AbstractProvider
org.jdrupes.builder.core.ScriptExecutor
All Implemented Interfaces:
Renamable, RequiredResourceSupport, ResourceProvider

A provider of execution results from invoking a script executed by a configurable interpreter. The provider generates resources in response to requests for ExecResult whose name matches this provider's name.

  • The working directory is the project directory.

  • The provider retrieves all resources added by required(Stream). While the provider itself does not process these resources, it is assumed that they are processed by the script and therefore need to be available.

  • The provider invokes the function configured with output(Function) and collects all resources. If the generated resources exist and no resource from required is newer than the generated resources found, the provider returns a result that indicates successful invocation. The date of the result is set to the newest date from the generated resources and the (existing) resources are attached.

  • Else, the provider executes the script, calls the function set with output(Function) again and adds the result to the ExecResult that it returns.

The generated resources can also be provided directly (i.e. not as part of an ExecResult) in response to a configurable resource request, see provideResources(ResourceRequest, Function).

The provider also uses the function set with output(Function) to determine the resources to be removed when it is invoked with a request for Cleanliness.

  • Constructor Details

    • ScriptExecutor

      public ScriptExecutor(Project project)
      Initializes a new script executor.
      Parameters:
      project - the project
  • Method Details