本文整理汇总了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;
}
示例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);
}
示例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;
}
示例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);
}
示例5: getRunConfiguration
import com.intellij.openapi.compiler.CompileScope; //导入方法依赖的package包/类
@Nullable
public static RunConfiguration getRunConfiguration(final CompileScope compileScope) {
return compileScope.getUserData(RUN_CONFIGURATION);
}
示例6: getRunConfiguration
import com.intellij.openapi.compiler.CompileScope; //导入方法依赖的package包/类
@Nullable
public static RunConfiguration getRunConfiguration(final CompileScope compileScope) {
return compileScope.getUserData(CompileStepBeforeRun.RUN_CONFIGURATION);
}
示例7: getArtifacts
import com.intellij.openapi.compiler.CompileScope; //导入方法依赖的package包/类
@Nullable
public static Artifact[] getArtifacts(CompileScope compileScope) {
return compileScope.getUserData(ARTIFACTS_KEY);
}
示例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);
}