Search in sources :

Example 11 with BuildSystemName

use of com.google.idea.blaze.base.settings.BuildSystemName in project intellij by bazelbuild.

the class BlazeModuleSystemExternalDependencyIntegrationTest method setupSourcesAndProjectView.

@Before
public void setupSourcesAndProjectView() {
    registerExtension(MavenArtifactLocator.EP_NAME, new MavenArtifactLocator() {

        private final ImmutableMap<GradleCoordinate, Label> knownArtifacts = new ImmutableMap.Builder<GradleCoordinate, Label>().put(CONSTRAINT_LAYOUT_COORDINATE, Label.create(CONSTRAINT_LAYOUT_LABEL)).build();

        @Override
        public Label labelFor(GradleCoordinate coordinate) {
            return knownArtifacts.get(new GradleCoordinate(coordinate.getGroupId(), coordinate.getArtifactId(), "+"));
        }

        @Override
        public BuildSystemName buildSystem() {
            return BuildSystemName.Bazel;
        }
    });
    setProjectView("directories:", "  java/com/foo/gallery/activities", "targets:", "  //java/com/foo/gallery/activities:activities", "android_sdk_platform: android-27");
    MockSdkUtil.registerSdk(workspace, "27");
    workspace.createFile(new WorkspacePath("java/com/foo/gallery/activities/MainActivity.java"), "package com.foo.gallery.activities", "import android.app.Activity;", "public class MainActivity extends Activity {}");
    workspace.createFile(new WorkspacePath("java/com/foo/libs/res/values/styles.xml"), "<?xml version=\"1.0\" encoding=\"utf-8\"?>", "<resources></resources>");
}
Also used : MavenArtifactLocator(com.google.idea.blaze.android.projectsystem.MavenArtifactLocator) WorkspacePath(com.google.idea.blaze.base.model.primitives.WorkspacePath) GradleCoordinate(com.android.ide.common.repository.GradleCoordinate) Label(com.google.idea.blaze.base.model.primitives.Label) BuildSystemName(com.google.idea.blaze.base.settings.BuildSystemName) Before(org.junit.Before)

Aggregations

BuildSystemName (com.google.idea.blaze.base.settings.BuildSystemName)11 File (java.io.File)5 IOException (java.io.IOException)4 WorkspacePath (com.google.idea.blaze.base.model.primitives.WorkspacePath)3 WorkspaceRoot (com.google.idea.blaze.base.model.primitives.WorkspaceRoot)3 ProjectViewSet (com.google.idea.blaze.base.projectview.ProjectViewSet)3 Nullable (javax.annotation.Nullable)3 GradleCoordinate (com.android.ide.common.repository.GradleCoordinate)2 MavenArtifactLocator (com.google.idea.blaze.android.projectsystem.MavenArtifactLocator)2 BlazeInfo (com.google.idea.blaze.base.command.info.BlazeInfo)2 FileOperationProvider (com.google.idea.blaze.base.io.FileOperationProvider)2 Label (com.google.idea.blaze.base.model.primitives.Label)2 BlazeContext (com.google.idea.blaze.base.scope.BlazeContext)2 Scope (com.google.idea.blaze.base.scope.Scope)2 Logger (com.intellij.openapi.diagnostic.Logger)2 List (java.util.List)2 Before (org.junit.Before)2 PathString (com.android.ide.common.util.PathString)1 VisibleForTesting (com.google.common.annotations.VisibleForTesting)1 ImmutableMap (com.google.common.collect.ImmutableMap)1