saker.build Documentation TaskDoc JavaDoc Packages
public interface TaskDirectoryContext extends TaskDirectoryPathContext
Container for the base directories used by a task during execution.
Methods
public SakerDirectory
Gets the build directory for the currently executing task or null if not available.
public SakerDirectory
Gets the working directory for the currently executing task.
Gets the build directory for the currently executing task or null if not available.

The build directory is based on the execution-wide base build directory and the task execution parameters specified for the task.

It is strongly recommended that unless explicitly specified by the user, all tasks produce outputs under the directory returned by this method.

To avoid checking null result of this method consider using SakerPathFiles.requireBuildDirectory(TaskDirectoryContext) which throws an appropriate exception if it is not available.

The build directory or null if not available.
Gets the working directory for the currently executing task.

The working directory is based on the execution-wide base working directory and the task execution parameters specified for the task.

Any relative paths used by this task should be resolved against this directory.

Note: In some cases this method may return null. This might be for example when the build system is detecting the deltas for a given task, and the working directory path did not resolve to an actual path. Callers in FileCollectionStrategy.collectFiles(ExecutionDirectoryContext, TaskDirectoryContext) should handle the possibility of this method returning null. If this method is called during task execution (I.e. inside Task.run(TaskContext), then this method will never return null.)

The working directory.