use of com.facebook.buck.rules.DefaultBuildTargetSourcePath in project buck by facebook.
the class SourceListTest method untranslatedUnnamedSourcesTargets.
@Test
public void untranslatedUnnamedSourcesTargets() {
BuildTarget target = BuildTargetFactory.newInstance("//:rule");
TargetNodeTranslator translator = new FixedTargetNodeTranslator(ImmutableMap.of());
SourceList list = SourceList.ofUnnamedSources(ImmutableSortedSet.of(new DefaultBuildTargetSourcePath(target)));
assertThat(translator.translate(CELL_PATH_RESOLVER, PATTERN, list), Matchers.equalTo(Optional.empty()));
}
use of com.facebook.buck.rules.DefaultBuildTargetSourcePath in project buck by facebook.
the class SourceListTest method translatedUnnamedSourcesTargets.
@Test
public void translatedUnnamedSourcesTargets() {
BuildTarget target = BuildTargetFactory.newInstance("//:rule");
BuildTarget newTarget = BuildTargetFactory.newInstance("//something:else");
TargetNodeTranslator translator = new FixedTargetNodeTranslator(ImmutableMap.of(target, newTarget));
assertThat(translator.translate(CELL_PATH_RESOLVER, PATTERN, SourceList.ofUnnamedSources(ImmutableSortedSet.of(new DefaultBuildTargetSourcePath(target)))), Matchers.equalTo(Optional.of(SourceList.ofUnnamedSources(ImmutableSortedSet.of(new DefaultBuildTargetSourcePath(newTarget))))));
}
use of com.facebook.buck.rules.DefaultBuildTargetSourcePath in project buck by facebook.
the class SourceListTest method untranslatedNamedSourcesTargets.
@Test
public void untranslatedNamedSourcesTargets() {
BuildTarget target = BuildTargetFactory.newInstance("//:rule");
TargetNodeTranslator translator = new FixedTargetNodeTranslator(ImmutableMap.of());
SourceList list = SourceList.ofNamedSources(ImmutableSortedMap.of("name", new DefaultBuildTargetSourcePath(target)));
assertThat(translator.translate(CELL_PATH_RESOLVER, PATTERN, list), Matchers.equalTo(Optional.empty()));
}
use of com.facebook.buck.rules.DefaultBuildTargetSourcePath in project buck by facebook.
the class SourcePathTypeCoercerTest method coerceAbsoluteBuildTarget.
@Test
public void coerceAbsoluteBuildTarget() throws CoerceFailedException, IOException {
SourcePath sourcePath = sourcePathTypeCoercer.coerce(cellRoots, projectFilesystem, pathRelativeToProjectRoot, "//:hello");
assertEquals(new DefaultBuildTargetSourcePath(BuildTarget.of(UnflavoredBuildTarget.of(projectFilesystem.getRootPath(), Optional.empty(), "//", "hello"), ImmutableSortedSet.of())), sourcePath);
}
use of com.facebook.buck.rules.DefaultBuildTargetSourcePath in project buck by facebook.
the class SourcePathTypeCoercerTest method coerceRelativeBuildTarget.
@Test
public void coerceRelativeBuildTarget() throws CoerceFailedException, IOException {
SourcePath sourcePath = sourcePathTypeCoercer.coerce(cellRoots, projectFilesystem, pathRelativeToProjectRoot, ":hello");
assertEquals(new DefaultBuildTargetSourcePath(BuildTarget.of(UnflavoredBuildTarget.of(projectFilesystem.getRootPath(), Optional.empty(), "//", "hello"), ImmutableSortedSet.of())), sourcePath);
}
Aggregations