use of com.facebook.buck.rules.DefaultCellPathResolver in project buck by facebook.
the class OCamlIntegrationTest method checkOcamlIsConfigured.
@Before
public void checkOcamlIsConfigured() throws IOException {
ProjectWorkspace workspace = TestDataHelper.createProjectWorkspaceForScenario(this, "ocaml", tmp);
workspace.setUp();
ProjectFilesystem filesystem = new ProjectFilesystem(tmp.getRoot());
Config rawConfig = Configs.createDefaultConfig(filesystem.getRootPath());
BuckConfig buckConfig = new BuckConfig(rawConfig, filesystem, Architecture.detect(), Platform.detect(), ImmutableMap.copyOf(System.getenv()), new DefaultCellPathResolver(filesystem.getRootPath(), rawConfig));
OcamlBuckConfig ocamlBuckConfig = new OcamlBuckConfig(buckConfig, DefaultCxxPlatforms.build(Platform.detect(), filesystem, new CxxBuckConfig(buckConfig)));
assumeTrue(ocamlBuckConfig.getOcamlCompiler().isPresent());
assumeTrue(ocamlBuckConfig.getOcamlBytecodeCompiler().isPresent());
assumeTrue(ocamlBuckConfig.getOcamlDepTool().isPresent());
assumeTrue(ocamlBuckConfig.getYaccCompiler().isPresent());
assumeTrue(ocamlBuckConfig.getLexCompiler().isPresent());
}
use of com.facebook.buck.rules.DefaultCellPathResolver in project buck by facebook.
the class ProjectWorkspace method asCell.
public Cell asCell() throws IOException, InterruptedException {
ProjectFilesystemAndConfig filesystemAndConfig = projectFilesystemAndConfig.get();
ProjectFilesystem filesystem = filesystemAndConfig.projectFilesystem;
Config config = filesystemAndConfig.config;
TestConsole console = new TestConsole();
ImmutableMap<String, String> env = ImmutableMap.copyOf(System.getenv());
DefaultAndroidDirectoryResolver directoryResolver = new DefaultAndroidDirectoryResolver(filesystem.getRootPath().getFileSystem(), env, Optional.empty(), Optional.empty());
return CellProvider.createForLocalBuild(filesystem, Watchman.NULL_WATCHMAN, new BuckConfig(config, filesystem, Architecture.detect(), Platform.detect(), env, new DefaultCellPathResolver(filesystem.getRootPath(), config)), CellConfig.of(), new KnownBuildRuleTypesFactory(new DefaultProcessExecutor(console), directoryResolver)).getCellByPath(filesystem.getRootPath());
}
use of com.facebook.buck.rules.DefaultCellPathResolver in project buck by facebook.
the class GroovyBuckConfigTest method createGroovyConfig.
private GroovyBuckConfig createGroovyConfig(ImmutableMap<String, String> environment, ImmutableMap<String, ImmutableMap<String, String>> rawConfig) {
ProjectFilesystem projectFilesystem = new ProjectFilesystem(temporaryFolder.getRoot());
Config config = new Config(RawConfig.of(rawConfig));
BuckConfig buckConfig = new BuckConfig(config, projectFilesystem, Architecture.detect(), Platform.detect(), environment, new DefaultCellPathResolver(projectFilesystem.getRootPath(), config));
return new GroovyBuckConfig(buckConfig);
}
use of com.facebook.buck.rules.DefaultCellPathResolver in project buck by facebook.
the class LuaBinaryIntegrationTest method getLuaBuckConfig.
private LuaBuckConfig getLuaBuckConfig() throws IOException {
Config rawConfig = Configs.createDefaultConfig(tmp.getRoot());
BuckConfig buckConfig = new BuckConfig(rawConfig, new ProjectFilesystem(tmp.getRoot()), Architecture.detect(), Platform.detect(), ImmutableMap.of(), new DefaultCellPathResolver(tmp.getRoot(), rawConfig));
return new LuaBuckConfig(buckConfig, new FakeExecutableFinder(ImmutableList.of()));
}
use of com.facebook.buck.rules.DefaultCellPathResolver in project buck by facebook.
the class DistBuildStateTest method canReconstructConfig.
@Test
public void canReconstructConfig() throws IOException, InterruptedException {
ProjectFilesystem filesystem = createJavaOnlyFilesystem("/saving");
Config config = new Config(ConfigBuilder.rawFromLines());
BuckConfig buckConfig = new BuckConfig(config, filesystem, Architecture.detect(), Platform.detect(), ImmutableMap.<String, String>builder().putAll(System.getenv()).put("envKey", "envValue").build(), new DefaultCellPathResolver(filesystem.getRootPath(), config));
Cell rootCellWhenSaving = new TestCellBuilder().setFilesystem(filesystem).setBuckConfig(buckConfig).build();
BuildJobState dump = DistBuildState.dump(new DistBuildCellIndexer(rootCellWhenSaving), emptyActionGraph(), createDefaultCodec(rootCellWhenSaving, Optional.empty()), createTargetGraph(filesystem), ImmutableSet.of(BuildTargetFactory.newInstance(filesystem.getRootPath(), "//:dummy")));
Cell rootCellWhenLoading = new TestCellBuilder().setFilesystem(createJavaOnlyFilesystem("/loading")).build();
DistBuildState distributedBuildState = DistBuildState.load(Optional.empty(), dump, rootCellWhenLoading, knownBuildRuleTypesFactory);
ImmutableMap<Integer, Cell> cells = distributedBuildState.getCells();
assertThat(cells, Matchers.aMapWithSize(1));
assertThat(cells.get(0).getBuckConfig(), Matchers.equalTo(buckConfig));
}
Aggregations