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
GlobSpec s 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
IOException
public 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.BuildFileParseException
InterruptedException
protected BuildFileManifest getAllRulesInternal(Path buildFile) throws IOException, BuildFileParseException
IOException
BuildFileParseException
public void reportProfile() throws IOException
ProjectBuildFileParser
reportProfile
in interface ProjectBuildFileParser
IOException
public com.google.common.collect.ImmutableSortedSet<String> getIncludedFiles(Path buildFile) throws BuildFileParseException, InterruptedException
FileParser
parseFile
build spec.getIncludedFiles
in interface FileParser<BuildFileManifest>
buildFile
- should be an absolute path to a file. Must have rootPath as its prefix.BuildFileParseException
InterruptedException
public boolean globResultsMatchCurrentState(Path buildFile, com.google.common.collect.ImmutableList<GlobSpecWithResult> existingGlobsWithResults)
ProjectBuildFileParser
GlobSpec
s with results are the same as current state in the file
system.globResultsMatchCurrentState
in interface ProjectBuildFileParser
buildFile
- 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 AutoCloseable
BuildFileParseException
InterruptedException
IOException