The type of variable expansion you are asking for can only be performed by the build step itself. If this is your own plug-in then you can apply the change I suggest here, otherwise you can always ask the plug-in author to do so. Short of either you'll have to rely on the work-around Slav provided.
If you do have access to the source for the plug-in here's how to expand variables during execution of the build step. I assume the build step class is SanityTestResultsToJUnitXMLBuilder. Inside this class's perform
method you need to expand the source and destination directory fields. I added place holders for other pieces of code you'd normally find in a build step for brevity.
public class SanityTestResultsToJUnitXMLBuilder extends Builder {
private final String sourceDirectory;
private final String destinationDirectory;
/* Constructor and getters typically appear here. */
@Override
public void perform(AbstractBuild<?, ?> build, Launcher launcher, BuildListener listener) throws InterruptedException, IOException {
EnvVars environment = build.getEnvironment(listener);
String expandedSourceDirectory = environment.expand(sourceDirectory);
String expandedDestinationDirectory = environment.expand(destinationDirectory);
/* The rest of the perform() logic goes here */
}
/* Other methods typically appear here. */
/* The Descriptor typically appears here. */
}