• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java ExternalSystemTaskId类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中com.intellij.openapi.externalSystem.model.task.ExternalSystemTaskId的典型用法代码示例。如果您正苦于以下问题:Java ExternalSystemTaskId类的具体用法?Java ExternalSystemTaskId怎么用?Java ExternalSystemTaskId使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



ExternalSystemTaskId类属于com.intellij.openapi.externalSystem.model.task包,在下文中一共展示了ExternalSystemTaskId类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: isTaskActive

import com.intellij.openapi.externalSystem.model.task.ExternalSystemTaskId; //导入依赖的package包/类
public boolean isTaskActive(@NotNull ExternalSystemTaskId id) {
  Map<IntegrationKey, Pair<RemoteExternalSystemFacade, ExternalSystemExecutionSettings>> copy
    = ContainerUtilRt.newHashMap(myRemoteFacades);
  for (Map.Entry<IntegrationKey, Pair<RemoteExternalSystemFacade, ExternalSystemExecutionSettings>> entry : copy.entrySet()) {
    try {
      if (entry.getValue().first.isTaskInProgress(id)) {
        return true;
      }
    }
    catch (RemoteException e) {
      myLock.lock();
      try {
        myRemoteFacades.remove(entry.getKey());
        myFacadeWrappers.remove(entry.getKey());
      }
      finally {
        myLock.unlock();
      }
    }
  }
  return false;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:23,代码来源:ExternalSystemFacadeManager.java


示例2: resolveProjectInfo

import com.intellij.openapi.externalSystem.model.task.ExternalSystemTaskId; //导入依赖的package包/类
@Nullable
@Override
public DataNode<ProjectData> resolveProjectInfo(@NotNull final ExternalSystemTaskId id,
                                                @NotNull final String projectPath,
                                                final boolean isPreviewMode,
                                                final S settings)
  throws ExternalSystemException, IllegalArgumentException, IllegalStateException
{
  return execute(id, new Producer<DataNode<ProjectData>>() {
    @Nullable
    @Override
    public DataNode<ProjectData> produce() {
      return myDelegate.resolveProjectInfo(id, projectPath, isPreviewMode, settings, getNotificationListener());
    }
  });
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:17,代码来源:RemoteExternalSystemProjectResolverImpl.java


示例3: executeTasks

import com.intellij.openapi.externalSystem.model.task.ExternalSystemTaskId; //导入依赖的package包/类
@Override
public void executeTasks(@NotNull final ExternalSystemTaskId id,
                         @NotNull final List<String> taskNames,
                         @NotNull final String projectPath,
                         @Nullable final S settings,
                         @NotNull final List<String> vmOptions,
                         @NotNull final List<String> scriptParameters,
                         @Nullable final String debuggerSetup) throws RemoteException, ExternalSystemException
{
  execute(id, new Producer<Object>() {
    @Nullable
    @Override
    public Object produce() {
      myDelegate.executeTasks(
        id, taskNames, projectPath, settings, vmOptions, scriptParameters, debuggerSetup, getNotificationListener());
      return null;
    }
  });
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:20,代码来源:RemoteExternalSystemTaskManagerImpl.java


示例4: executeTasks

import com.intellij.openapi.externalSystem.model.task.ExternalSystemTaskId; //导入依赖的package包/类
@Override
public boolean executeTasks(@NotNull ExternalSystemTaskId id,
                            @NotNull List<String> taskNames,
                            @NotNull String projectPath,
                            @Nullable GradleExecutionSettings settings,
                            @NotNull final List<String> vmOptions,
                            @NotNull final List<String> scriptParameters,
                            @Nullable String debuggerSetup,
                            @NotNull ExternalSystemTaskNotificationListener listener) throws ExternalSystemException
{
  GradleInvoker invoker = getInvoker();
  if (invoker == null) {
    // Returning false gives control back to the framework, and the task(s) will be invoked by IDEA.
    return false;
  }
  invoker.executeTasks(taskNames, Collections.<String>emptyList(), id, listener, true);
  return true;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:19,代码来源:AndroidGradleTaskManager.java


示例5: setUp

import com.intellij.openapi.externalSystem.model.task.ExternalSystemTaskId; //导入依赖的package包/类
@Override
public void setUp() throws Exception {
  super.setUp();
  myIdeaProject = new IdeaProjectStub("multiProject");
  myAndroidProject = TestProjects.createBasicProject(myIdeaProject.getRootDir());

  myAndroidModule = myIdeaProject.addModule(myAndroidProject.getName(), "androidTask");
  myUtilModule = myIdeaProject.addModule("util", "compileJava", "jar", "classes");
  myIdeaProject.addModule("notReallyAGradleProject");

  ProjectImportAction.AllModels allModels = new ProjectImportAction.AllModels(myIdeaProject);
  allModels.addExtraProject(myAndroidProject, AndroidProject.class, myAndroidModule);

  ExternalSystemTaskId id = ExternalSystemTaskId.create(SYSTEM_ID, RESOLVE_PROJECT, myIdeaProject.getName());
  String projectPath = FileUtil.toSystemDependentName(myIdeaProject.getBuildFile().getParent());
  ExternalSystemTaskNotificationListener notificationListener = new ExternalSystemTaskNotificationListenerAdapter() {};
  myResolverCtx = new ProjectResolverContext(id, projectPath, null, createMock(ProjectConnection.class), notificationListener, true);
  myResolverCtx.setModels(allModels);

  myProjectResolver = new AndroidGradleProjectResolver(createMock(ProjectImportErrorHandler.class));
  myProjectResolver.setProjectResolverContext(myResolverCtx);

  GradleProjectResolverExtension next = new BaseGradleProjectResolverExtension();
  next.setProjectResolverContext(myResolverCtx);
  myProjectResolver.setNext(next);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:27,代码来源:AndroidGradleProjectResolverIdeaTest.java


示例6: cancelTask

import com.intellij.openapi.externalSystem.model.task.ExternalSystemTaskId; //导入依赖的package包/类
@Override
public boolean cancelTask(@NotNull ExternalSystemTaskId id, @NotNull ExternalSystemTaskNotificationListener listener)
  throws ExternalSystemException {

  // extension points are available only in IDE process
  if (ExternalSystemApiUtil.isInProcessMode(GradleConstants.SYSTEM_ID)) {
    for (GradleTaskManagerExtension gradleTaskManagerExtension : GradleTaskManagerExtension.EP_NAME.getExtensions()) {
      if (gradleTaskManagerExtension.cancelTask(id, listener)) return true;
    }
  }

  final CancellationTokenSource cancellationTokenSource = myCancellationMap.get(id);
  if (cancellationTokenSource != null) {
    cancellationTokenSource.cancel();
  }
  return true;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:18,代码来源:GradleTaskManager.java


示例7: resolveProjectInfo

import com.intellij.openapi.externalSystem.model.task.ExternalSystemTaskId; //导入依赖的package包/类
@Nullable
@Override
public DataNode<ProjectData> resolveProjectInfo(
  @NotNull ExternalSystemTaskId id,
  @NotNull String projectPath,
  boolean isPreviewMode,
  @Nullable PantsExecutionSettings settings,
  @NotNull ExternalSystemTaskNotificationListener listener
) throws ExternalSystemException, IllegalArgumentException, IllegalStateException {
  if (projectPath.startsWith(".pants.d")) {
    return null;
  }
  checkForDifferentPantsExecutables(id, projectPath);

  final PantsCompileOptionsExecutor executor = PantsCompileOptionsExecutor.create(projectPath, settings);
  task2executor.put(id, executor);
  final DataNode<ProjectData> projectDataNode =
    resolveProjectInfoImpl(id, executor, listener, isPreviewMode, settings.isEnableIncrementalImport());
  doViewSwitch(id, projectPath);
  task2executor.remove(id);
  return projectDataNode;
}
 
开发者ID:pantsbuild,项目名称:intellij-pants-plugin,代码行数:23,代码来源:PantsSystemProjectResolver.java


示例8: doViewSwitch

import com.intellij.openapi.externalSystem.model.task.ExternalSystemTaskId; //导入依赖的package包/类
private void doViewSwitch(@NotNull ExternalSystemTaskId id, @NotNull String projectPath) {
  Project ideProject = id.findProject();
  if (ideProject == null) {
    return;
  }
  // Disable zooming on subsequent project resolves/refreshes,
  // i.e. a project that already has existing modules, because it may zoom at a module
  // that is going to be replaced by the current resolve.
  if (ModuleManager.getInstance(ideProject).getModules().length > 0) {
    return;
  }

  MessageBusConnection messageBusConnection = ideProject.getMessageBus().connect();
  messageBusConnection.subscribe(
    ProjectTopics.PROJECT_ROOTS,
    new ModuleRootListener() {
      @Override
      public void rootsChanged(ModuleRootEvent event) {
        // Initiate view switch only when project modules have been created.
        new ViewSwitchProcessor(ideProject, projectPath).asyncViewSwitch();
      }
    }
  );
}
 
开发者ID:pantsbuild,项目名称:intellij-pants-plugin,代码行数:25,代码来源:PantsSystemProjectResolver.java


示例9: checkForDifferentPantsExecutables

import com.intellij.openapi.externalSystem.model.task.ExternalSystemTaskId; //导入依赖的package包/类
/**
 * Check whether the pants executable of the new project to import is the same as the existing project's pants executable.
 */
private void checkForDifferentPantsExecutables(@NotNull ExternalSystemTaskId id, @NotNull String projectPath) {
  final Project existingIdeProject = id.findProject();
  if (existingIdeProject == null) {
    return;
  }
  String projectFilePath = existingIdeProject.getProjectFilePath();
  if (projectFilePath == null) {
    return;
  }
  final Optional<VirtualFile> existingPantsExe = PantsUtil.findPantsExecutable(projectFilePath);
  final Optional<VirtualFile> newPantsExe = PantsUtil.findPantsExecutable(projectPath);
  if (!existingPantsExe.isPresent() || !newPantsExe.isPresent()) {
    return;
  }
  if (!existingPantsExe.get().getCanonicalFile().getPath().equals(newPantsExe.get().getCanonicalFile().getPath())) {
    throw new ExternalSystemException(String.format(
      "Failed to import. Target/Directory to be added uses a different pants executable %s compared to the existing project's %s",
      existingPantsExe, newPantsExe
    ));
  }
}
 
开发者ID:pantsbuild,项目名称:intellij-pants-plugin,代码行数:25,代码来源:PantsSystemProjectResolver.java


示例10: resolveUsingPantsGoal

import com.intellij.openapi.externalSystem.model.task.ExternalSystemTaskId; //导入依赖的package包/类
private void resolveUsingPantsGoal(
  @NotNull final ExternalSystemTaskId id,
  @NotNull PantsCompileOptionsExecutor executor,
  final ExternalSystemTaskNotificationListener listener,
  @NotNull DataNode<ProjectData> projectDataNode
) {
  final PantsResolver dependenciesResolver = new PantsResolver(executor);
  dependenciesResolver.resolve(
    new Consumer<String>() {
      @Override
      public void consume(String status) {
        listener.onStatusChange(new ExternalSystemTaskNotificationEvent(id, status));
      }
    },
    new ProcessAdapter() {
      @Override
      public void onTextAvailable(ProcessEvent event, Key outputType) {
        listener.onTaskOutput(id, event.getText(), outputType == ProcessOutputTypes.STDOUT);
      }
    }
  );
  dependenciesResolver.addInfoTo(projectDataNode);
}
 
开发者ID:pantsbuild,项目名称:intellij-pants-plugin,代码行数:24,代码来源:PantsSystemProjectResolver.java


示例11: resolveProjectInfo

import com.intellij.openapi.externalSystem.model.task.ExternalSystemTaskId; //导入依赖的package包/类
@Nullable
@Override
public DataNode<ProjectData> resolveProjectInfo(@NotNull final ExternalSystemTaskId id,
                                                @NotNull final String projectPath,
                                                final boolean downloadLibraries,
                                                ExternalSystemExecutionSettings settings)
  throws ExternalSystemException, IllegalArgumentException, IllegalStateException
{
  return execute(id, new Producer<DataNode<ProjectData>>() {
    @Nullable
    @Override
    public DataNode<ProjectData> produce() {
      return myDelegate.resolveProjectInfo(id, projectPath, downloadLibraries, getSettings(), getNotificationListener());
    }
  });
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:17,代码来源:RemoteExternalSystemProjectResolverImpl.java


示例12: executeTasks

import com.intellij.openapi.externalSystem.model.task.ExternalSystemTaskId; //导入依赖的package包/类
@Override
public void executeTasks(@NotNull final ExternalSystemTaskId id,
                         @NotNull final List<String> taskNames,
                         @NotNull final String projectPath,
                         @Nullable final S settings,
                         @Nullable final String vmOptions) throws RemoteException, ExternalSystemException
{
  execute(id, new Producer<Object>() {
    @Nullable
    @Override
    public Object produce() {
      myDelegate.executeTasks(id, taskNames, projectPath, settings, vmOptions, getNotificationListener());
      return null;
    }
  });
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:17,代码来源:RemoteExternalSystemTaskManagerImpl.java


示例13: resolveProjectInfo

import com.intellij.openapi.externalSystem.model.task.ExternalSystemTaskId; //导入依赖的package包/类
@Nullable
@Override
public DataNode<ProjectData> resolveProjectInfo(@NotNull ExternalSystemTaskId id,
                                                  @NotNull String projectPath,
                                                  boolean downloadLibraries,
                                                  @Nullable S settings)
  throws ExternalSystemException, IllegalArgumentException, IllegalStateException, RemoteException
{
  myProgressManager.onQueued(id);
  try {
    return getDelegate().resolveProjectInfo(id, projectPath, downloadLibraries, settings);
  }
  finally {
    myProgressManager.onEnd(id);
  }
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:17,代码来源:ExternalSystemProjectResolverWrapper.java


示例14: doResolveProjectInfo

import com.intellij.openapi.externalSystem.model.task.ExternalSystemTaskId; //导入依赖的package包/类
@NotNull
private DataNode<ProjectData> doResolveProjectInfo(@NotNull final ExternalSystemTaskId id,
                                                   @NotNull String projectPath,
                                                   @Nullable GradleExecutionSettings settings,
                                                   @NotNull ProjectConnection connection,
                                                   @NotNull ExternalSystemTaskNotificationListener listener,
                                                   boolean downloadLibraries)
  throws IllegalArgumentException, IllegalStateException
{
  ModelBuilder<? extends IdeaProject> modelBuilder = myHelper.getModelBuilder(id, settings, connection, listener, downloadLibraries);
  IdeaProject project = modelBuilder.get();
  DataNode<ProjectData> result = populateProject(project, projectPath);

  // We need two different steps ('create' and 'populate') in order to handle module dependencies, i.e. when one module is
  // configured to be dependency for another one, corresponding dependency module object should be available during
  // populating dependent module object.
  Map<String, Pair<DataNode<ModuleData>, IdeaModule>> modules = createModules(project, result);
  populateModules(modules.values(), result);
  Collection<DataNode<LibraryData>> libraries = ExternalSystemApiUtil.getChildren(result, ProjectKeys.LIBRARY);
  myLibraryNamesMixer.mixNames(libraries);
  parseTasks(result, project);
  return result;
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:24,代码来源:GradleProjectResolver.java


示例15: executeTasks

import com.intellij.openapi.externalSystem.model.task.ExternalSystemTaskId; //导入依赖的package包/类
@Override
public void executeTasks(@NotNull final ExternalSystemTaskId id,
                         @NotNull final List<String> taskNames,
                         @NotNull String projectPath,
                         @Nullable final GradleExecutionSettings settings,
                         @Nullable final String vmOptions,
                         @NotNull final ExternalSystemTaskNotificationListener listener) throws ExternalSystemException
{
  Function<ProjectConnection, Void> f = new Function<ProjectConnection, Void>() {
    @Override
    public Void fun(ProjectConnection connection) {
      BuildLauncher launcher = myHelper.getBuildLauncher(id, connection, settings, listener);
      if (!StringUtil.isEmpty(vmOptions)) {
        assert vmOptions != null;
        launcher.setJvmArguments(vmOptions.trim());
      }
      launcher.forTasks(ArrayUtil.toStringArray(taskNames));
      launcher.run();
      return null;
    }
  };
  myHelper.execute(projectPath, settings, f); 
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:24,代码来源:GradleTaskManager.java


示例16: detachProcessImpl

import com.intellij.openapi.externalSystem.model.task.ExternalSystemTaskId; //导入依赖的package包/类
@Override
protected void detachProcessImpl() {
  myTask.cancel(new ExternalSystemTaskNotificationListenerAdapter() {

    private boolean myResetGreeting = true;

    @Override
    public void onTaskOutput(@Nonnull ExternalSystemTaskId id, @Nonnull String text, boolean stdOut) {
      if (myResetGreeting) {
        notifyTextAvailable("\r", ProcessOutputTypes.SYSTEM);
        myResetGreeting = false;
      }
      notifyTextAvailable(text, stdOut ? ProcessOutputTypes.STDOUT : ProcessOutputTypes.STDERR);
    }
  });
  notifyProcessDetached();
}
 
开发者ID:consulo,项目名称:consulo,代码行数:18,代码来源:ExternalSystemRunConfiguration.java


示例17: isTaskActive

import com.intellij.openapi.externalSystem.model.task.ExternalSystemTaskId; //导入依赖的package包/类
public boolean isTaskActive(@Nonnull ExternalSystemTaskId id) {
  Map<IntegrationKey, Pair<RemoteExternalSystemFacade, ExternalSystemExecutionSettings>> copy
    = ContainerUtilRt.newHashMap(myRemoteFacades);
  for (Map.Entry<IntegrationKey, Pair<RemoteExternalSystemFacade, ExternalSystemExecutionSettings>> entry : copy.entrySet()) {
    try {
      if (entry.getValue().first.isTaskInProgress(id)) {
        return true;
      }
    }
    catch (RemoteException e) {
      myLock.lock();
      try {
        myRemoteFacades.remove(entry.getKey());
        myFacadeWrappers.remove(entry.getKey());
      }
      finally {
        myLock.unlock();
      }
    }
  }
  return false;
}
 
开发者ID:consulo,项目名称:consulo,代码行数:23,代码来源:ExternalSystemFacadeManager.java


示例18: resolveProjectInfo

import com.intellij.openapi.externalSystem.model.task.ExternalSystemTaskId; //导入依赖的package包/类
@javax.annotation.Nullable
@Override
public DataNode<ProjectData> resolveProjectInfo(@Nonnull final ExternalSystemTaskId id,
                                                @Nonnull final String projectPath,
                                                final boolean isPreviewMode,
                                                ExternalSystemExecutionSettings settings)
  throws ExternalSystemException, IllegalArgumentException, IllegalStateException
{
  return execute(id, new Producer<DataNode<ProjectData>>() {
    @javax.annotation.Nullable
    @Override
    public DataNode<ProjectData> produce() {
      return myDelegate.resolveProjectInfo(id, projectPath, isPreviewMode, getSettings(), getNotificationListener());
    }
  });
}
 
开发者ID:consulo,项目名称:consulo,代码行数:17,代码来源:RemoteExternalSystemProjectResolverImpl.java


示例19: executeTasks

import com.intellij.openapi.externalSystem.model.task.ExternalSystemTaskId; //导入依赖的package包/类
@Override
public void executeTasks(@Nonnull final ExternalSystemTaskId id,
                         @Nonnull final List<String> taskNames,
                         @Nonnull final String projectPath,
                         @javax.annotation.Nullable final S settings,
                         @Nonnull final List<String> vmOptions,
                         @Nonnull final List<String> scriptParameters,
                         @javax.annotation.Nullable final String debuggerSetup) throws RemoteException, ExternalSystemException
{
  execute(id, new Producer<Object>() {
    @javax.annotation.Nullable
    @Override
    public Object produce() {
      myDelegate.executeTasks(
              id, taskNames, projectPath, settings, vmOptions, scriptParameters, debuggerSetup, getNotificationListener());
      return null;
    }
  });
}
 
开发者ID:consulo,项目名称:consulo,代码行数:20,代码来源:RemoteExternalSystemTaskManagerImpl.java


示例20: buildAndroid

import com.intellij.openapi.externalSystem.model.task.ExternalSystemTaskId; //导入依赖的package包/类
/**
 * 执行./gradlew assembleRelease
 * @param project
 */
public static void buildAndroid(Project project) {
    GradleUtil.executeTask(project, "assembleRelease", "-Pmirror", new ExternalSystemTaskNotificationListenerAdapter() {
        @Override
        public void onTaskOutput(@NotNull ExternalSystemTaskId id, @NotNull String text, boolean stdOut) {
            super.onTaskOutput(id, text, stdOut);
        }
    });
}
 
开发者ID:beansoftapp,项目名称:react-native-console,代码行数:13,代码来源:RNUtil.java



注:本文中的com.intellij.openapi.externalSystem.model.task.ExternalSystemTaskId类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java Resource类代码示例发布时间:2022-05-22
下一篇:
Java Hashon类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap