public class BuckConfig extends Object
.buckconfig
file.Constructor and Description |
---|
BuckConfig(Config config,
ProjectFilesystem projectFilesystem,
Architecture architecture,
Platform platform,
com.google.common.collect.ImmutableMap<String,String> environment,
java.util.function.Function<String,UnconfiguredBuildTarget> buildTargetParser) |
public BuckConfig(Config config, ProjectFilesystem projectFilesystem, Architecture architecture, Platform platform, com.google.common.collect.ImmutableMap<String,String> environment, java.util.function.Function<String,UnconfiguredBuildTarget> buildTargetParser)
public BuckConfig withBuildTargetParser(java.util.function.Function<String,UnconfiguredBuildTarget> buildTargetParser)
public <T extends ConfigView<BuckConfig>> T getView(Class<T> cls)
ConfigView
of this config.T
- Type of the config view.cls
- Class of the config view.public Architecture getArchitecture()
public com.google.common.collect.ImmutableMap<String,String> getEntriesForSection(String section)
public com.google.common.collect.ImmutableList<String> getListWithoutComments(String section, String field)
public com.google.common.collect.ImmutableList<String> getListWithoutComments(String section, String field, char splitChar)
public Optional<com.google.common.collect.ImmutableList<String>> getOptionalListWithoutComments(String section, String field)
public Optional<com.google.common.collect.ImmutableList<String>> getOptionalListWithoutComments(String section, String field, char splitChar)
public Optional<com.google.common.collect.ImmutableList<Path>> getOptionalPathList(String section, String field, boolean resolve)
public UnconfiguredBuildTarget getUnconfiguredBuildTargetForFullyQualifiedTarget(String target)
public BuildTarget getBuildTargetForFullyQualifiedTarget(String target, TargetConfiguration targetConfiguration)
public com.google.common.collect.ImmutableList<BuildTarget> getFullyQualifiedBuildTargets(String section, String key, TargetConfiguration targetConfiguration)
public Optional<BuildTarget> getBuildTarget(String section, String field, TargetConfiguration targetConfiguration)
public Optional<BuildTarget> getMaybeBuildTarget(String section, String field, TargetConfiguration targetConfiguration)
This is useful if you use getTool to get the target, if any, but allow filesystem references.
public Optional<UnconfiguredBuildTarget> getMaybeUnconfiguredBuildTarget(String section, String field)
This is useful if you use getTool to get the target, if any, but allow filesystem references.
public BuildTarget getRequiredBuildTarget(String section, String field, TargetConfiguration targetConfiguration)
public <T extends Enum<T>> Optional<T> getEnum(String section, String field, Class<T> clazz)
public Optional<SourcePath> getSourcePath(String section, String field, TargetConfiguration targetConfiguration)
SourcePath
identified by a @{link BuildTarget} or Path
reference by
the given section:field, if set.public PathSourcePath getPathSourcePath(Path path)
SourcePath
identified by a Path
.public PathSourcePath getPathSourcePath(Path path, String errorMessage)
errorMessage
- the error message to throw if path is not foundSourcePath
identified by a Path
.public Path resolvePathThatMayBeOutsideTheProjectFilesystem(Path path)
public Path resolveNonNullPathOutsideTheProjectFilesystem(Path path)
public String getLocalhost()
public Platform getPlatform()
public Optional<com.google.common.collect.ImmutableMap<String,String>> getSection(String sectionName)
public Optional<String> getValue(String sectionName, String propertyName)
Optional.empty()
.public Optional<String> getRawValue(String sectionName, String propertyName)
Optional[]
.public OptionalInt getInteger(String sectionName, String propertyName)
public boolean getBooleanValue(String sectionName, String propertyName, boolean defaultValue)
public com.google.common.collect.ImmutableMap<String,String> getMap(String section, String field)
public <T extends Enum<T>> Map<T,Double> getExperimentGroups(String section, String field, Class<T> enumClass)
public Optional<Path> getPath(String sectionName, String name)
public com.google.common.collect.ImmutableSet<String> getSections()
public Config getConfig()
public ProjectFilesystem getFilesystem()