use of org.jetbrains.plugins.gradle.service.project.BaseGradleProjectResolverExtension in project android by JetBrains.
the class AndroidGradleProjectResolverIdeaTest method setUp.
@Override
public void setUp() throws Exception {
super.setUp();
initMocks(this);
myProjectModel = new IdeaProjectStub("multiProject");
myAndroidProject = TestProjects.createBasicProject(myProjectModel.getRootDir());
myNativeAndroidProject = TestProjects.createNativeProject(myProjectModel.getRootDir());
myAndroidModuleModel = myProjectModel.addModule(myAndroidProject.getName(), "androidTask");
myNativeAndroidModuleModel = myProjectModel.addModule(myNativeAndroidProject.getName(), "nativeAndroidTask");
myJavaModuleModel = myProjectModel.addModule("util", "compileJava", "jar", "classes");
myProjectModel.addModule("notReallyAGradleProject");
ProjectImportAction.AllModels allModels = new ProjectImportAction.AllModels(myProjectModel);
allModels.addExtraProject(myAndroidProject, AndroidProject.class, myAndroidModuleModel);
allModels.addExtraProject(myNativeAndroidProject, NativeAndroidProject.class, myNativeAndroidModuleModel);
ExternalSystemTaskId id = ExternalSystemTaskId.create(SYSTEM_ID, RESOLVE_PROJECT, myProjectModel.getName());
String projectPath = toSystemDependentName(myProjectModel.getBuildFile().getParent());
ExternalSystemTaskNotificationListener notificationListener = new ExternalSystemTaskNotificationListenerAdapter() {
};
myResolverCtx = new DefaultProjectResolverContext(id, projectPath, null, mock(ProjectConnection.class), notificationListener, true);
myResolverCtx.setModels(allModels);
myProjectResolver = new AndroidGradleProjectResolver(myCommandLineArgs, myErrorHandler, myProjectFinder, myVariantSelector);
myProjectResolver.setProjectResolverContext(myResolverCtx);
GradleProjectResolverExtension next = new BaseGradleProjectResolverExtension();
next.setProjectResolverContext(myResolverCtx);
myProjectResolver.setNext(next);
}
Aggregations