public class HybridProjectBuildFileParser extends Object implements ProjectBuildFileParser
Syntax
depending on which one is requested for the individual build file.
The default syntax determines the syntax used in cases when
marker is not used, but clients can explicitly request desired syntax by adding parser directive to the beginning of the build file followed by one of the
supported Syntax
values.
Note that default syntax is not used in cases when invalid syntax value is provided - instead in such cases an exception is thrown.
Modifier and Type | Method and Description |
---|---|
void |
close() |
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 information from a particular, along with metadata about the information, for
example which other files were also parsed.
|
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 |
reportProfile()
Reports profile information captured while parsing build files.
|
static HybridProjectBuildFileParser |
using(com.google.common.collect.ImmutableMap<Syntax,ProjectBuildFileParser> parsers,
Syntax defaultSyntax) |
public BuildFileManifest getManifest(Path buildFile) throws BuildFileParseException, InterruptedException, IOException
FileParser
getManifest
in interface FileParser<BuildFileManifest>
buildFile
- should be an absolute path to a file. Must have rootPath as its prefix.BuildFileParseException
InterruptedException
IOException
public void reportProfile() throws IOException
ProjectBuildFileParser
reportProfile
in interface ProjectBuildFileParser
IOException
public com.google.common.collect.ImmutableSortedSet<String> getIncludedFiles(Path buildFile) throws BuildFileParseException, InterruptedException, IOException
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
IOException
public boolean globResultsMatchCurrentState(Path buildFile, com.google.common.collect.ImmutableList<GlobSpecWithResult> existingGlobsWithResults) throws IOException, InterruptedException
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.IOException
InterruptedException
public void close() throws BuildFileParseException, InterruptedException, IOException
close
in interface FileParser<BuildFileManifest>
close
in interface AutoCloseable
BuildFileParseException
InterruptedException
IOException
public static HybridProjectBuildFileParser using(com.google.common.collect.ImmutableMap<Syntax,ProjectBuildFileParser> parsers, Syntax defaultSyntax)