saker.build Documentation TaskDoc JavaDoc Packages
public interface TraceContributorEnvironmentProperty<Textends EnvironmentProperty<T>
Extension interface for EnvironmentProperty to signal that the property contributes build trace information.

This interface can be optionally implemented by environment properties to signal that they contribute meaningful information to the build trace.

As environment property values can be cached for subsequent builds in the same build environment, this interface can be used to report build trace information even if the environment property is not calculated again.

You should not report build trace information in the EnvironmentProperty.getCurrentValue(SakerEnvironment) function, but rather implement contributeBuildTraceInformation(T, PropertyComputationFailedException) to record build trace information.

TThe type of the environment property.
saker.build 0.8.9
Methods
public default void
Instructs the environment property to contribute build trace information.
public default void contributeBuildTraceInformation(T propertyvalue, PropertyComputationFailedException thrownexception)
Instructs the environment property to contribute build trace information.

The implementers of this method can use the BuildTrace interface to report information that should be recorded in the build trace.

The default implementation does nothing.

propertyvalueThe computed value of the environment property. null if it threw an exception.
thrownexceptionThe exception that was thrown by the environment property wrapped in a PropertyComputationFailedException. Use the getCause() method to retrieve the actually thrown exception.
If the property computation completed successfully, this argument is null.