Skip to content

Commit

Permalink
Delete Preprocessor.Factory
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 152916191
  • Loading branch information
laurentlb authored and buchgr committed Apr 12, 2017
1 parent 0b18c5d commit 65a15ed
Showing 1 changed file with 0 additions and 49 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,58 +22,9 @@
import com.google.devtools.build.lib.vfs.PathFragment;
import java.io.IOException;
import java.util.Set;
import javax.annotation.Nullable;

/** A Preprocessor is an interface to implement generic text-based preprocessing of BUILD files. */
public interface Preprocessor {
/** Factory for {@link Preprocessor} instances. */
interface Factory {
/**
* Returns whether this {@link Factory} is still suitable for providing {@link Preprocessor}s.
* If not, all previous preprocessing results should be assumed to be invalid and a new
* {@link Factory} should be created via {@link Supplier#getFactory}.
*/
boolean isStillValid();

/**
* Returns whether all globs encountered during {@link Preprocessor#preprocess} will be passed
* along to the {@link Globber} given there (which then executes them asynchronously). If this
* is not the case, then e.g. prefetching globs during normal BUILD file evaluation may be
* profitable.
*/
boolean considersGlobs();

/**
* Returns a Preprocessor instance capable of preprocessing a BUILD file independently (e.g. it
* ought to be fine to call {@link #getPreprocessor} for each BUILD file).
*/
@Nullable
Preprocessor getPreprocessor();

/** Factory that always returns {@code null} {@link Preprocessor}s. */
static class NullFactory implements Factory {
public static final NullFactory INSTANCE = new NullFactory();

private NullFactory() {
}

@Override
public boolean isStillValid() {
return true;
}

@Override
public boolean considersGlobs() {
return false;
}

@Override
public Preprocessor getPreprocessor() {
return null;
}
}
}

/**
* A (result, success) tuple indicating the outcome of preprocessing.
*/
Expand Down

0 comments on commit 65a15ed

Please sign in to comment.