public class SkylarkPackageFileParser extends Object implements PackageFileParser
Modifier and Type | Field and Description |
---|---|
protected BuckGlobals |
buckGlobals |
protected com.google.devtools.build.lib.events.EventHandler |
eventHandler |
protected com.google.devtools.build.lib.vfs.FileSystem |
fileSystem |
protected ProjectBuildFileParserOptions |
options |
Modifier and Type | Method and Description |
---|---|
protected com.facebook.buck.skylark.parser.ExtensionData |
buildExtensionData(com.facebook.buck.skylark.parser.AbstractSkylarkFileParser.ExtensionLoadState load)
Given fully loaded extension represented by
ExtensionLoadState , evaluates extension and
returns ExtensionData |
void |
close() |
protected com.google.devtools.build.lib.cmdline.Label |
createContainingLabel(String basePath) |
com.google.common.collect.ImmutableSortedSet<String> |
getIncludedFiles(Path parseFile)
Collects the loaded files and extensions when parsing the
parseFile build spec. |
PackageFileManifest |
getManifest(Path packageFile)
Collect all information from a particular, along with metadata about the information, for
example which other files were also parsed.
|
protected com.google.common.collect.ImmutableList<com.facebook.buck.skylark.parser.ExtensionData> |
loadExtensions(com.google.devtools.build.lib.cmdline.Label containingLabel,
com.google.common.collect.ImmutableList<com.google.devtools.build.lib.syntax.SkylarkImport> skylarkImports)
Loads all extensions identified by corresponding
SkylarkImport s. |
protected ParseResult |
parse(Path parseFile) |
protected com.google.devtools.build.lib.syntax.BuildFileAST |
readSkylarkAST(com.google.devtools.build.lib.vfs.Path path,
FileKind fileKind)
Reads file and returns abstract syntax tree for that file.
|
static SkylarkPackageFileParser |
using(ProjectBuildFileParserOptions options,
BuckEventBus buckEventBus,
com.google.devtools.build.lib.vfs.FileSystem fileSystem,
BuckGlobals buckGlobals,
com.google.devtools.build.lib.events.EventHandler eventHandler)
Create an instance of Skylark package file parser using provided options.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
close, getIncludedFiles
protected final com.google.devtools.build.lib.vfs.FileSystem fileSystem
protected final ProjectBuildFileParserOptions options
protected final com.google.devtools.build.lib.events.EventHandler eventHandler
protected final BuckGlobals buckGlobals
public static SkylarkPackageFileParser using(ProjectBuildFileParserOptions options, BuckEventBus buckEventBus, com.google.devtools.build.lib.vfs.FileSystem fileSystem, BuckGlobals buckGlobals, com.google.devtools.build.lib.events.EventHandler eventHandler)
public PackageFileManifest getManifest(Path packageFile) throws BuildFileParseException, InterruptedException, IOException
FileParser
getManifest
in interface FileParser<PackageFileManifest>
packageFile
- should be an absolute path to a file. Must have rootPath as its prefix.BuildFileParseException
InterruptedException
IOException
protected ParseResult parse(Path parseFile) throws IOException, BuildFileParseException, InterruptedException
parseFile
.IOException
BuildFileParseException
InterruptedException
protected com.google.devtools.build.lib.cmdline.Label createContainingLabel(String basePath)
protected com.google.devtools.build.lib.syntax.BuildFileAST readSkylarkAST(com.google.devtools.build.lib.vfs.Path path, FileKind fileKind) throws IOException
path
- file path to read the data from.IOException
protected com.google.common.collect.ImmutableList<com.facebook.buck.skylark.parser.ExtensionData> loadExtensions(com.google.devtools.build.lib.cmdline.Label containingLabel, com.google.common.collect.ImmutableList<com.google.devtools.build.lib.syntax.SkylarkImport> skylarkImports) throws BuildFileParseException, IOException, InterruptedException
SkylarkImport
s.protected com.facebook.buck.skylark.parser.ExtensionData buildExtensionData(com.facebook.buck.skylark.parser.AbstractSkylarkFileParser.ExtensionLoadState load) throws InterruptedException
ExtensionLoadState
, evaluates extension and
returns ExtensionData
load
- ExtensionLoadState
representing loaded extensionInterruptedException
public com.google.common.collect.ImmutableSortedSet<String> getIncludedFiles(Path parseFile) throws BuildFileParseException, InterruptedException, IOException
FileParser
parseFile
build spec.getIncludedFiles
in interface FileParser<T extends FileManifest>
parseFile
- should be an absolute path to a file. Must have rootPath as its prefix.BuildFileParseException
InterruptedException
IOException
public void close() throws BuildFileParseException
close
in interface FileParser<T extends FileManifest>
close
in interface AutoCloseable
BuildFileParseException