Search in sources :

Example 21 with TargetExpression

use of com.google.idea.blaze.base.model.primitives.TargetExpression in project intellij by bazelbuild.

the class WildcardTargetPatternTest method testNonWildcardPattern.

@Test
public void testNonWildcardPattern() {
    TargetExpression target = TargetExpression.fromStringSafe("//java/com/google:single_target");
    WildcardTargetPattern wildcardPattern = WildcardTargetPattern.fromExpression(target);
    assertThat(wildcardPattern).isNull();
}
Also used : WildcardTargetPattern(com.google.idea.blaze.base.model.primitives.WildcardTargetPattern) TargetExpression(com.google.idea.blaze.base.model.primitives.TargetExpression) Test(org.junit.Test)

Example 22 with TargetExpression

use of com.google.idea.blaze.base.model.primitives.TargetExpression in project intellij by bazelbuild.

the class WildcardTargetPatternTest method testRecursiveWildcardPatternAllTargetsAlternativeFormat.

@Test
public void testRecursiveWildcardPatternAllTargetsAlternativeFormat() {
    TargetExpression target = TargetExpression.fromStringSafe("//java/com/google/...:*");
    WildcardTargetPattern wildcardPattern = WildcardTargetPattern.fromExpression(target);
    assertThat(wildcardPattern).isNotNull();
    assertThat(wildcardPattern.coversPackage(new WorkspacePath("java/com/google"))).isTrue();
    assertThat(wildcardPattern.coversPackage(new WorkspacePath("java/com/google/foo"))).isTrue();
    assertThat(wildcardPattern.isRecursive()).isTrue();
    assertThat(wildcardPattern.getBasePackage()).isEqualTo(new WorkspacePath("java/com/google"));
    assertThat(wildcardPattern.rulesOnly()).isFalse();
}
Also used : WorkspacePath(com.google.idea.blaze.base.model.primitives.WorkspacePath) WildcardTargetPattern(com.google.idea.blaze.base.model.primitives.WildcardTargetPattern) TargetExpression(com.google.idea.blaze.base.model.primitives.TargetExpression) Test(org.junit.Test)

Example 23 with TargetExpression

use of com.google.idea.blaze.base.model.primitives.TargetExpression in project intellij by bazelbuild.

the class WildcardTargetPatternTest method testRecursiveWildcardPattern.

@Test
public void testRecursiveWildcardPattern() {
    TargetExpression target = TargetExpression.fromStringSafe("//java/com/google/...");
    WildcardTargetPattern wildcardPattern = WildcardTargetPattern.fromExpression(target);
    assertThat(wildcardPattern).isNotNull();
    assertThat(wildcardPattern.coversPackage(new WorkspacePath("java/com/google"))).isTrue();
    assertThat(wildcardPattern.coversPackage(new WorkspacePath("java/com/google/foo"))).isTrue();
    assertThat(wildcardPattern.isRecursive()).isTrue();
    assertThat(wildcardPattern.getBasePackage()).isEqualTo(new WorkspacePath("java/com/google"));
    assertThat(wildcardPattern.rulesOnly()).isTrue();
}
Also used : WorkspacePath(com.google.idea.blaze.base.model.primitives.WorkspacePath) WildcardTargetPattern(com.google.idea.blaze.base.model.primitives.WildcardTargetPattern) TargetExpression(com.google.idea.blaze.base.model.primitives.TargetExpression) Test(org.junit.Test)

Example 24 with TargetExpression

use of com.google.idea.blaze.base.model.primitives.TargetExpression in project intellij by bazelbuild.

the class WildcardTargetPatternTest method testNonWildcardImplicitTargetName.

@Test
public void testNonWildcardImplicitTargetName() {
    TargetExpression target = TargetExpression.fromStringSafe("//java/com/google/foo");
    WildcardTargetPattern wildcardPattern = WildcardTargetPattern.fromExpression(target);
    assertThat(wildcardPattern).isNull();
}
Also used : WildcardTargetPattern(com.google.idea.blaze.base.model.primitives.WildcardTargetPattern) TargetExpression(com.google.idea.blaze.base.model.primitives.TargetExpression) Test(org.junit.Test)

Example 25 with TargetExpression

use of com.google.idea.blaze.base.model.primitives.TargetExpression in project intellij by bazelbuild.

the class WildcardTargetPatternTest method testNonRecursiveWildcardPattern.

@Test
public void testNonRecursiveWildcardPattern() {
    TargetExpression target = TargetExpression.fromStringSafe("//java/com/google:all");
    WildcardTargetPattern wildcardPattern = WildcardTargetPattern.fromExpression(target);
    assertThat(wildcardPattern).isNotNull();
    assertThat(wildcardPattern.coversPackage(new WorkspacePath("java/com/google"))).isTrue();
    assertThat(wildcardPattern.coversPackage(new WorkspacePath("java/com/google/foo"))).isFalse();
    assertThat(wildcardPattern.isRecursive()).isFalse();
    assertThat(wildcardPattern.getBasePackage()).isEqualTo(new WorkspacePath("java/com/google"));
    assertThat(wildcardPattern.rulesOnly()).isTrue();
}
Also used : WorkspacePath(com.google.idea.blaze.base.model.primitives.WorkspacePath) WildcardTargetPattern(com.google.idea.blaze.base.model.primitives.WildcardTargetPattern) TargetExpression(com.google.idea.blaze.base.model.primitives.TargetExpression) Test(org.junit.Test)

Aggregations

TargetExpression (com.google.idea.blaze.base.model.primitives.TargetExpression)31 Test (org.junit.Test)11 WildcardTargetPattern (com.google.idea.blaze.base.model.primitives.WildcardTargetPattern)10 WorkspacePath (com.google.idea.blaze.base.model.primitives.WorkspacePath)8 File (java.io.File)6 Label (com.google.idea.blaze.base.model.primitives.Label)5 ImmutableList (com.google.common.collect.ImmutableList)3 TargetKey (com.google.idea.blaze.base.ideinfo.TargetKey)3 BlazeCommandRunConfigurationCommonState (com.google.idea.blaze.base.run.state.BlazeCommandRunConfigurationCommonState)3 ImmutableMap (com.google.common.collect.ImmutableMap)2 Lists (com.google.common.collect.Lists)2 Maps (com.google.common.collect.Maps)2 Futures (com.google.common.util.concurrent.Futures)2 ListenableFuture (com.google.common.util.concurrent.ListenableFuture)2 ListeningExecutorService (com.google.common.util.concurrent.ListeningExecutorService)2 FutureUtil (com.google.idea.blaze.base.async.FutureUtil)2 BuildSystemProvider (com.google.idea.blaze.base.bazel.BuildSystemProvider)2 BlazeCommand (com.google.idea.blaze.base.command.BlazeCommand)2 TargetIdeInfo (com.google.idea.blaze.base.ideinfo.TargetIdeInfo)2 Kind (com.google.idea.blaze.base.model.primitives.Kind)2