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

Java ExternalSystemSourceType类代码示例

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

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



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

示例1: syncPaths

import com.intellij.openapi.externalSystem.model.project.ExternalSystemSourceType; //导入依赖的package包/类
private static void syncPaths(@NotNull final Module module, @NotNull IdeModifiableModelsProvider modelsProvider, @NotNull final ModuleData data) {
  final ModifiableRootModel modifiableRootModel = modelsProvider.getModifiableRootModel(module);
  CompilerModuleExtension extension = modifiableRootModel.getModuleExtension(CompilerModuleExtension.class);
  if (extension == null) {
    modifiableRootModel.dispose();
    final String errorMsg =
      String.format("Can't sync paths for module '%s'. Reason: no compiler extension is found for it", module.getName());
    throw new RuntimeException(errorMsg);
  }

  String compileOutputPath = data.getCompileOutputPath(ExternalSystemSourceType.SOURCE);
  if (compileOutputPath != null) {
    extension.setCompilerOutputPath(VfsUtilCore.pathToUrl(compileOutputPath));
  }

  String testCompileOutputPath = data.getCompileOutputPath(ExternalSystemSourceType.TEST);
  if (testCompileOutputPath != null) {
    extension.setCompilerOutputPathForTests(VfsUtilCore.pathToUrl(testCompileOutputPath));
  }

  extension.inheritCompilerOutputPath(data.isInheritProjectCompileOutputPath());
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:23,代码来源:ModuleDataService.java


示例2: addOutputModuleRoots

import com.intellij.openapi.externalSystem.model.project.ExternalSystemSourceType; //导入依赖的package包/类
private static void addOutputModuleRoots(@Nullable ExternalSourceSet externalSourceSet,
                                         @NotNull ExternalSystemSourceType sourceType,
                                         @NotNull Collection<String> result) {
  if (externalSourceSet == null) return;
  final ExternalSourceDirectorySet directorySet = externalSourceSet.getSources().get(sourceType);
  if (directorySet == null) return;

  if (directorySet.isCompilerOutputPathInherited()) return;
  final String path = directorySet.getOutputDir().getAbsolutePath();
  VirtualFile virtualFile = VirtualFileManager.getInstance().findFileByUrl(path);
  if (virtualFile == null) {
    if(!directorySet.getOutputDir().exists()){
      FileUtil.createDirectory(directorySet.getOutputDir());
    }
    ApplicationEx app = (ApplicationEx)ApplicationManager.getApplication();
    if (app.isDispatchThread() || !app.holdsReadLock()) {
      LocalFileSystem.getInstance().refreshAndFindFileByIoFile(directorySet.getOutputDir());
    }
  }
  result.add(VfsUtilCore.pathToUrl(path));
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:22,代码来源:GradleOrderEnumeratorHandler.java


示例3: syncPaths

import com.intellij.openapi.externalSystem.model.project.ExternalSystemSourceType; //导入依赖的package包/类
private static void syncPaths(@NotNull Module module, @NotNull ModuleData data) {
  ModifiableRootModel modifiableModel = ModuleRootManager.getInstance(module).getModifiableModel();
  CompilerModuleExtension extension = modifiableModel.getModuleExtension(CompilerModuleExtension.class);
  if (extension == null) {
    modifiableModel.dispose();
    LOG.warn(String.format("Can't sync paths for module '%s'. Reason: no compiler extension is found for it", module.getName()));
    return;
  }
  try {
    String compileOutputPath = data.getCompileOutputPath(ExternalSystemSourceType.SOURCE);
    if (compileOutputPath != null) {
      extension.setCompilerOutputPath(compileOutputPath);
    }

    String testCompileOutputPath = data.getCompileOutputPath(ExternalSystemSourceType.TEST);
    if (testCompileOutputPath != null) {
      extension.setCompilerOutputPathForTests(testCompileOutputPath);
    }

    extension.inheritCompilerOutputPath(data.isInheritProjectCompileOutputPath());
  }
  finally {
    modifiableModel.commit();
  }
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:26,代码来源:ModuleDataService.java


示例4: testCustomizeModule

import com.intellij.openapi.externalSystem.model.project.ExternalSystemSourceType; //导入依赖的package包/类
public void testCustomizeModule() throws Exception {

    final IdeModifiableModelsProviderImpl modelsProvider = new IdeModifiableModelsProviderImpl(myProject);
    try {
      myCustomizer.customizeModule(myProject, myModule, modelsProvider, myIdeaAndroidProject);
      modelsProvider.commit();
    }
    catch (Throwable t) {
      modelsProvider.dispose();
      ExceptionUtil.rethrowAllAsUnchecked(t);
    }

    ModuleRootManager moduleRootManager = ModuleRootManager.getInstance(myModule);
    ContentEntry contentEntry = moduleRootManager.getContentEntries()[0];

    SourceFolder[] sourceFolders = contentEntry.getSourceFolders();
    List<String> sourcePaths = Lists.newArrayListWithExpectedSize(sourceFolders.length);

    for (SourceFolder folder : sourceFolders) {
      if (!folder.isTestSource()) {
        VirtualFile file = folder.getFile();
        assertNotNull(file);
        sourcePaths.add(file.getPath());
      }
    }

    ContentRootSourcePaths expectedPaths = new ContentRootSourcePaths();
    expectedPaths.storeExpectedSourcePaths(myAndroidProject);


    List<String> allExpectedPaths = Lists.newArrayList();
    allExpectedPaths.addAll(expectedPaths.getPaths(ExternalSystemSourceType.SOURCE));
    allExpectedPaths.addAll(expectedPaths.getPaths(ExternalSystemSourceType.SOURCE_GENERATED));
    allExpectedPaths.addAll(expectedPaths.getPaths(ExternalSystemSourceType.RESOURCE));
    sort(allExpectedPaths);

    sort(sourcePaths);

    assertEquals(allExpectedPaths, sourcePaths);
  }
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:41,代码来源:ContentRootModuleCustomizerTest.java


示例5: addGeneratedDirPaths

import com.intellij.openapi.externalSystem.model.project.ExternalSystemSourceType; //导入依赖的package包/类
private void addGeneratedDirPaths(@NotNull AndroidArtifactStub androidArtifact, boolean isTest) {
  ExternalSystemSourceType sourceType = isTest ? ExternalSystemSourceType.TEST_GENERATED : ExternalSystemSourceType.SOURCE_GENERATED;
  addSourceDirPaths(sourceType, androidArtifact.getGeneratedSourceFolders());

  sourceType = isTest ? ExternalSystemSourceType.TEST_RESOURCE : ExternalSystemSourceType.RESOURCE;
  addSourceDirPaths(sourceType, androidArtifact.getGeneratedResourceFolders());
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:8,代码来源:ContentRootSourcePaths.java


示例6: addSourceDirPaths

import com.intellij.openapi.externalSystem.model.project.ExternalSystemSourceType; //导入依赖的package包/类
private void addSourceDirPaths(@NotNull SourceProvider sourceProvider, boolean isTest) {
  ExternalSystemSourceType sourceType = isTest ? ExternalSystemSourceType.TEST : ExternalSystemSourceType.SOURCE;

  addSourceDirPaths(sourceType, sourceProvider.getAidlDirectories());
  addSourceDirPaths(sourceType, sourceProvider.getAssetsDirectories());
  addSourceDirPaths(sourceType, sourceProvider.getJavaDirectories());
  addSourceDirPaths(sourceType, sourceProvider.getCppDirectories());
  addSourceDirPaths(sourceType, sourceProvider.getCDirectories());
  addSourceDirPaths(sourceType, sourceProvider.getRenderscriptDirectories());

  sourceType = isTest ? ExternalSystemSourceType.TEST_RESOURCE : ExternalSystemSourceType.RESOURCE;
  addSourceDirPaths(sourceType, sourceProvider.getResDirectories());
  addSourceDirPaths(sourceType, sourceProvider.getResourcesDirectories());
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:15,代码来源:ContentRootSourcePaths.java


示例7: assertCorrectStoredDirPaths

import com.intellij.openapi.externalSystem.model.project.ExternalSystemSourceType; //导入依赖的package包/类
public void assertCorrectStoredDirPaths(@NotNull Collection<String> paths, @NotNull ExternalSystemSourceType sourceType) {
  List<String> sortedPaths = Lists.newArrayList(paths);
  Collections.sort(sortedPaths);
  List<String> expectedPaths = getPaths(sourceType);
  String msg = String.format("Source paths (%s)", sourceType.toString().toLowerCase());
  Assert.assertEquals(msg, expectedPaths, sortedPaths);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:8,代码来源:ContentRootSourcePaths.java


示例8: DefaultExternalSourceSet

import com.intellij.openapi.externalSystem.model.project.ExternalSystemSourceType; //导入依赖的package包/类
public DefaultExternalSourceSet(ExternalSourceSet sourceSet) {
  this();
  myName = sourceSet.getName();
  for (Map.Entry<IExternalSystemSourceType, ExternalSourceDirectorySet> entry : sourceSet.getSources().entrySet()) {
    mySources.put(ExternalSystemSourceType.from(entry.getKey()), new DefaultExternalSourceDirectorySet(entry.getValue()));
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:8,代码来源:DefaultExternalSourceSet.java


示例9: addResources

import com.intellij.openapi.externalSystem.model.project.ExternalSystemSourceType; //导入依赖的package包/类
private static void addResources(@NotNull List<ResourceRootConfiguration> container,
                                 @Nullable ExternalSourceSet externalSourceSet,
                                 @NotNull ExternalSystemSourceType sourceType) {
  if (externalSourceSet == null) return;
  final ExternalSourceDirectorySet directorySet = externalSourceSet.getSources().get(sourceType);
  if (directorySet == null) return;

  for (File file : directorySet.getSrcDirs()) {
    final String dir = file.getPath();
    final ResourceRootConfiguration rootConfiguration = new ResourceRootConfiguration();
    rootConfiguration.directory = FileUtil.toSystemIndependentName(dir);
    final String target = directorySet.getOutputDir().getPath();
    rootConfiguration.targetPath = FileUtil.toSystemIndependentName(target);

    rootConfiguration.includes.clear();
    for (String include : directorySet.getIncludes()) {
      rootConfiguration.includes.add(include.trim());
    }
    rootConfiguration.excludes.clear();
    for (String exclude : directorySet.getExcludes()) {
      rootConfiguration.excludes.add(exclude.trim());
    }

    rootConfiguration.isFiltered = !directorySet.getFilters().isEmpty();
    rootConfiguration.filters.clear();
    for (ExternalFilter filter : directorySet.getFilters()) {
      final ResourceRootFilter resourceRootFilter = new ResourceRootFilter();
      resourceRootFilter.filterType = filter.getFilterType();
      resourceRootFilter.properties = filter.getPropertiesAsJsonMap();
      rootConfiguration.filters.add(resourceRootFilter);
    }

    container.add(rootConfiguration);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:36,代码来源:GradleResourceCompilerConfigurationGenerator.java


示例10: syncPaths

import com.intellij.openapi.externalSystem.model.project.ExternalSystemSourceType; //导入依赖的package包/类
private static void syncPaths(@Nonnull Module module, @Nonnull ModuleData data) {
  ModuleCompilerPathsManager compilerPathsManager = ModuleCompilerPathsManager.getInstance(module);
  compilerPathsManager.setInheritedCompilerOutput(data.isInheritProjectCompileOutputPath());
  if (!data.isInheritProjectCompileOutputPath()) {
    String compileOutputPath = data.getCompileOutputPath(ExternalSystemSourceType.SOURCE);
    if (compileOutputPath != null) {
      compilerPathsManager.setCompilerOutputUrl(ProductionContentFolderTypeProvider.getInstance(), VfsUtilCore.pathToUrl(compileOutputPath));
    }
    String testCompileOutputPath = data.getCompileOutputPath(ExternalSystemSourceType.TEST);
    if (testCompileOutputPath != null) {
      compilerPathsManager.setCompilerOutputUrl(TestContentFolderTypeProvider.getInstance(), VfsUtilCore.pathToUrl(testCompileOutputPath));
    }
  }
}
 
开发者ID:consulo,项目名称:consulo,代码行数:15,代码来源:ModuleDataService.java


示例11: ContentRootSourcePaths

import com.intellij.openapi.externalSystem.model.project.ExternalSystemSourceType; //导入依赖的package包/类
public ContentRootSourcePaths() {
  for (ExternalSystemSourceType sourceType : ALL_SOURCE_TYPES) {
    myDirectoryPathsBySourceType.put(sourceType, new ArrayList<String>());
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:6,代码来源:ContentRootSourcePaths.java


示例12: getPaths

import com.intellij.openapi.externalSystem.model.project.ExternalSystemSourceType; //导入依赖的package包/类
@NotNull
public List<String> getPaths(@NotNull ExternalSystemSourceType sourceType) {
  return myDirectoryPathsBySourceType.get(sourceType);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:5,代码来源:ContentRootSourcePaths.java


示例13: resolveProjectInfoImpl

import com.intellij.openapi.externalSystem.model.project.ExternalSystemSourceType; //导入依赖的package包/类
@NotNull
private DataNode<ProjectData> resolveProjectInfoImpl(
  @NotNull ExternalSystemTaskId id,
  @NotNull final PantsCompileOptionsExecutor executor,
  @NotNull ExternalSystemTaskNotificationListener listener,
  boolean isPreviewMode,
  boolean isEnableIncrementalImport
) throws ExternalSystemException, IllegalArgumentException, IllegalStateException {
  // todo(fkorotkov): add ability to choose a name for a project
  final ProjectData projectData = new ProjectData(
    PantsConstants.SYSTEM_ID,
    executor.getProjectName(),
    executor.getBuildRoot().getPath() + "/.idea/pants-projects/" + executor.getProjectRelativePath(),
    executor.getProjectPath()
  );
  final DataNode<ProjectData> projectDataNode = new DataNode<>(ProjectKeys.PROJECT, projectData, null);

  PantsUtil.findPantsExecutable(executor.getProjectPath())
    .flatMap(file -> PantsUtil.getDefaultJavaSdk(file.getPath(), null))
    .ifPresent(sdk -> projectDataNode.createChild(PantsConstants.SDK_KEY, sdk));

  if (!isPreviewMode) {
    PantsExternalMetricsListenerManager.getInstance().logIsIncrementalImport(isEnableIncrementalImport);
    resolveUsingPantsGoal(id, executor, listener, projectDataNode);

    if (!containsContentRoot(projectDataNode, executor.getProjectDir())) {
      // Add a module with content root as import project directory path.
      // This will allow all the files in the imported project directory will be indexed by the plugin.
      final String moduleName = executor.getRootModuleName();
      final ModuleData moduleData = new ModuleData(
        PantsConstants.PANTS_PROJECT_MODULE_ID_PREFIX + moduleName,
        PantsConstants.SYSTEM_ID,
        ModuleTypeId.JAVA_MODULE,
        moduleName + PantsConstants.PANTS_PROJECT_MODULE_SUFFIX,
        projectData.getIdeProjectFileDirectoryPath() + "/" + moduleName,
        executor.getProjectPath()
      );
      final DataNode<ModuleData> moduleDataNode = projectDataNode.createChild(ProjectKeys.MODULE, moduleData);
      final ContentRootData contentRoot = new ContentRootData(PantsConstants.SYSTEM_ID, executor.getProjectDir());
      if (FileUtil.filesEqual(executor.getBuildRoot(), new File(executor.getProjectPath()))) {
        contentRoot.storePath(ExternalSystemSourceType.EXCLUDED, executor.getBuildRoot().getPath() + "/.idea");
      }
      moduleDataNode.createChild(ProjectKeys.CONTENT_ROOT, contentRoot);
    }
  }

  return projectDataNode;
}
 
开发者ID:pantsbuild,项目名称:intellij-pants-plugin,代码行数:49,代码来源:PantsSystemProjectResolver.java



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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