public class PythonDslProjectBuildFileParser extends Object implements ProjectBuildFileParser
| Constructor and Description |
|---|
PythonDslProjectBuildFileParser(ProjectBuildFileParserOptions options,
TypeCoercerFactory typeCoercerFactory,
com.google.common.collect.ImmutableMap<String,String> environment,
BuckEventBus buckEventBus,
ProcessExecutor processExecutor,
Optional<AtomicLong> processedBytes,
Optional<UserDefinedRuleLoader> userDefinedRulesParser) |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
protected BuildFileManifest |
getAllRulesInternal(Path buildFile) |
com.google.common.collect.ImmutableSortedSet<String> |
getIncludedFiles(Path buildFile)
Collects the loaded files and extensions when parsing the
parseFile build spec. |
BuildFileManifest |
getManifest(Path buildFile)
Collect all rules from a particular build file, along with meta rules about the rules, for
example which build files the rules depend on.
|
boolean |
globResultsMatchCurrentState(Path buildFile,
com.google.common.collect.ImmutableList<GlobSpecWithResult> existingGlobsWithResults)
Checks if existing
GlobSpecs with results are the same as current state in the file
system. |
void |
initIfNeeded()
Initialization on demand moves around the performance impact of creating the Python interpreter
to when parsing actually begins.
|
boolean |
isClosed() |
void |
reportProfile()
Reports profile information captured while parsing build files.
|
public PythonDslProjectBuildFileParser(ProjectBuildFileParserOptions options, TypeCoercerFactory typeCoercerFactory, com.google.common.collect.ImmutableMap<String,String> environment, BuckEventBus buckEventBus, ProcessExecutor processExecutor, Optional<AtomicLong> processedBytes, Optional<UserDefinedRuleLoader> userDefinedRulesParser)
public boolean isClosed()
public void initIfNeeded()
throws IOException
IOExceptionpublic BuildFileManifest getManifest(Path buildFile) throws BuildFileParseException, InterruptedException
getManifest in interface FileParser<BuildFileManifest>buildFile - should be an absolute path to a build file. Must have rootPath as its prefix.BuildFileParseExceptionInterruptedExceptionprotected BuildFileManifest getAllRulesInternal(Path buildFile) throws IOException, BuildFileParseException
IOExceptionBuildFileParseExceptionpublic void reportProfile()
throws IOException
ProjectBuildFileParserreportProfile in interface ProjectBuildFileParserIOExceptionpublic com.google.common.collect.ImmutableSortedSet<String> getIncludedFiles(Path buildFile) throws BuildFileParseException, InterruptedException
FileParserparseFile build spec.getIncludedFiles in interface FileParser<BuildFileManifest>buildFile - should be an absolute path to a file. Must have rootPath as its prefix.BuildFileParseExceptionInterruptedExceptionpublic boolean globResultsMatchCurrentState(Path buildFile, com.google.common.collect.ImmutableList<GlobSpecWithResult> existingGlobsWithResults)
ProjectBuildFileParserGlobSpecs with results are the same as current state in the file
system.globResultsMatchCurrentState in interface ProjectBuildFileParserbuildFile - the buildFile location to be used by the Globber.existingGlobsWithResults - the existing (deserialized) GlobSpecWithResult to check
the file system state against.true if glob expansion produces results matching previously recorded ones,
false otherwise.public void close()
throws BuildFileParseException,
InterruptedException,
IOException
close in interface FileParser<BuildFileManifest>close in interface AutoCloseableBuildFileParseExceptionInterruptedExceptionIOException