saker.standard Documentation TaskDoc JavaDoc Packages
public class SakerStandardUtils
Utility class containing functions for the standard classes.
saker.standard 0.8.1
Methods
public static ExecutionProperty<extends EnvironmentSelectionResult>
Creates an execution property that tests and environment selector.
public static ExecutionProperty<extends ContentDescriptor>
Creates an execution property that queries the content descriptor of a given local file.
public static String
Gets the file name part of the argument file location.
Creates an execution property that tests and environment selector.

The execution property will use ExecutionContext.testEnvironmentSelection(TaskExecutionEnvironmentSelector, Set<UUID>) to check the environment selection of the argument. It can be useful when tasks want to examine or store the results of an environment selection, and act based on that.

The property can be used with build clusters to determine if a given operation can be executed in the current build configuration.

environmentselectorThe environment selector.
The execution property.
NullPointerExceptionIf the argument is null.
saker.standard 0.8.1
Creates an execution property that queries the content descriptor of a given local file.

The execution property will return the content descriptor of the denoted file by using ExecutionContext.getContentDescriptor(ProviderHolderPathKey). If the file doesn't exist or not accessible, the property returns null.

The argument tag serves as an unique identifier for the execution property. It can be used to uniquely associate a given execution property with a given task. This can be important as the result of execution properties are cached during build execution. If another task modifies the denoted file, the changes in the file contents may be unnoticed.

Specifying an arbitrary tag object for the execution property helps avoiding the issue by directly associating it with a caller task. In general, the task identifier of your task is a good tag to be passed to this function. Others, such an unique UUID is also a good candidate.
The tag should be serializable, and implement Object.equals(Object).

Note that if you're using this execution property to report local output file dependencies, you may need to set additional unique values as part of the tag. This is because the build system will check the value of the execution property when it detects the deltas for the task. If you report the property with the same tag, then the old (cached) value may be reported, therefore causing unexpected results. An example that works around this for output files:

 TaskContext taskcontext;
 
 taskcontext.getTaskUtilities().getReportExecutionDependency(
 		SakerStandardUtils.createLocalFileContentDescriptorExecutionProperty(outputlocalfilepath,
 				ImmutableUtils.asUnmodifiableArrayList(taskcontext.getTaskId(), UUID.randomUUID())));
 
localfilepathThe local file path.
tagThe tag object for the execution property. May be null.
The execution property that returns the content descriptor for a given local file.
NullPointerExceptionIf the path is null.
InvalidPathFormatExceptionIf the path is not absolute.
saker.standard 0.8.2
Gets the file name part of the argument file location.

The method will return the last file name component for the path of the argument.

flThe file location.
The file name or null if the argument is null, or has no file name.
saker.standard 0.8.1