当前位置: 首页>>代码示例>>Java>>正文


Java CompileScope.getUserData方法代码示例

本文整理汇总了Java中com.intellij.openapi.compiler.CompileScope.getUserData方法的典型用法代码示例。如果您正苦于以下问题:Java CompileScope.getUserData方法的具体用法?Java CompileScope.getUserData怎么用?Java CompileScope.getUserData使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.intellij.openapi.compiler.CompileScope的用法示例。


在下文中一共展示了CompileScope.getUserData方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getArtifactsToBuild

import com.intellij.openapi.compiler.CompileScope; //导入方法依赖的package包/类
public static Set<Artifact> getArtifactsToBuild(final Project project,
                                                final CompileScope compileScope,
                                                final boolean addIncludedArtifactsWithOutputPathsOnly) {
  final Artifact[] artifactsFromScope = getArtifacts(compileScope);
  final ArtifactManager artifactManager = ArtifactManager.getInstance(project);
  PackagingElementResolvingContext context = artifactManager.getResolvingContext();
  if (artifactsFromScope != null) {
    return addIncludedArtifacts(Arrays.asList(artifactsFromScope), context, addIncludedArtifactsWithOutputPathsOnly);
  }

  final Set<Artifact> cached = compileScope.getUserData(CACHED_ARTIFACTS_KEY);
  if (cached != null) {
    return cached;
  }

  Set<Artifact> artifacts = new HashSet<Artifact>();
  final Set<Module> modules = new HashSet<Module>(Arrays.asList(compileScope.getAffectedModules()));
  final List<Module> allModules = Arrays.asList(ModuleManager.getInstance(project).getModules());
  for (Artifact artifact : artifactManager.getArtifacts()) {
    if (artifact.isBuildOnMake()) {
      if (modules.containsAll(allModules)
          || containsModuleOutput(artifact, modules, context)) {
        artifacts.add(artifact);
      }
    }
  }
  Set<Artifact> result = addIncludedArtifacts(artifacts, context, addIncludedArtifactsWithOutputPathsOnly);
  compileScope.putUserData(CACHED_ARTIFACTS_KEY, result);
  return result;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:31,代码来源:ArtifactCompileScope.java

示例2: getUserData

import com.intellij.openapi.compiler.CompileScope; //导入方法依赖的package包/类
public <T> T getUserData(@NotNull Key<T> key) {
  for (CompileScope compileScope : myScopes) {
    T userData = compileScope.getUserData(key);
    if (userData != null) {
      return userData;
    }
  }
  return super.getUserData(key);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:10,代码来源:CompositeScope.java

示例3: isProGuardUsed

import com.intellij.openapi.compiler.CompileScope; //导入方法依赖的package包/类
private static boolean isProGuardUsed(@NotNull Project project, @NotNull CompileScope scope) {
  for (Module module : scope.getAffectedModules()) {
    final AndroidFacet facet = AndroidFacet.getInstance(module);

    if (facet != null && facet.getProperties().RUN_PROGUARD) {
      return true;
    }
  }
  final String proguardCfgPathsStr = scope.getUserData(AndroidCompileUtil.PROGUARD_CFG_PATHS_KEY);
  if (proguardCfgPathsStr != null && proguardCfgPathsStr.length() > 0) {
    return true;
  }
  final Set<Artifact> artifacts = ArtifactCompileScope.getArtifactsToBuild(project, scope, false);

  for (Artifact artifact : artifacts) {
    if (artifact.getArtifactType() instanceof AndroidApplicationArtifactType) {
      final ArtifactProperties<?> properties = artifact.getProperties(AndroidArtifactPropertiesProvider.getInstance());

      if (properties instanceof AndroidApplicationArtifactProperties) {
        final AndroidApplicationArtifactProperties p = (AndroidApplicationArtifactProperties)properties;

        if (p.isRunProGuard()) {
          return true;
        }
      }
    }
  }
  return false;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:30,代码来源:AndroidBuildTargetScopeProvider.java

示例4: getUserData

import com.intellij.openapi.compiler.CompileScope; //导入方法依赖的package包/类
public <T> T getUserData(@Nonnull Key<T> key) {
  for (CompileScope compileScope : myScopes) {
    T userData = compileScope.getUserData(key);
    if (userData != null) {
      return userData;
    }
  }
  return super.getUserData(key);
}
 
开发者ID:consulo,项目名称:consulo,代码行数:10,代码来源:CompositeScope.java

示例5: getRunConfiguration

import com.intellij.openapi.compiler.CompileScope; //导入方法依赖的package包/类
@Nullable
public static RunConfiguration getRunConfiguration(final CompileScope compileScope) {
  return compileScope.getUserData(RUN_CONFIGURATION);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:5,代码来源:CompileStepBeforeRun.java

示例6: getRunConfiguration

import com.intellij.openapi.compiler.CompileScope; //导入方法依赖的package包/类
@Nullable
public static RunConfiguration getRunConfiguration(final CompileScope compileScope) {
  return compileScope.getUserData(CompileStepBeforeRun.RUN_CONFIGURATION);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:5,代码来源:MakeProjectStepBeforeRun.java

示例7: getArtifacts

import com.intellij.openapi.compiler.CompileScope; //导入方法依赖的package包/类
@Nullable
public static Artifact[] getArtifacts(CompileScope compileScope) {
  return compileScope.getUserData(ARTIFACTS_KEY);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:5,代码来源:ArtifactCompileScope.java

示例8: getBaseScopeForExternalBuild

import com.intellij.openapi.compiler.CompileScope; //导入方法依赖的package包/类
public static List<TargetTypeBuildScope> getBaseScopeForExternalBuild(@NotNull CompileScope scope) {
  return scope.getUserData(BASE_SCOPE_FOR_EXTERNAL_BUILD);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:4,代码来源:CompileScopeUtil.java


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