本文整理汇总了Java中com.intellij.openapi.compiler.CompileScope.putUserData方法的典型用法代码示例。如果您正苦于以下问题:Java CompileScope.putUserData方法的具体用法?Java CompileScope.putUserData怎么用?Java CompileScope.putUserData使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.openapi.compiler.CompileScope
的用法示例。
在下文中一共展示了CompileScope.putUserData方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: actionPerformed
import com.intellij.openapi.compiler.CompileScope; //导入方法依赖的package包/类
public void actionPerformed(final AnActionEvent e) {
final CreateIpaDialog dialog = new CreateIpaDialog(e.getProject());
dialog.show();
if(dialog.getExitCode() == DialogWrapper.OK_EXIT_CODE) {
// create IPA
IpaConfig ipaConfig = dialog.getIpaConfig();
CompileScope scope = CompilerManager.getInstance(e.getProject()).createModuleCompileScope(ipaConfig.module, true);
scope.putUserData(IPA_CONFIG_KEY, ipaConfig);
CompilerManager.getInstance(e.getProject()).compile(scope, new CompileStatusNotification() {
@Override
public void finished(boolean aborted, int errors, int warnings, CompileContext compileContext) {
RoboVmPlugin.logInfo(e.getProject(), "IPA creation complete, %d errors, %d warnings", errors, warnings);
}
});
}
}
示例2: createScopeWithArtifacts
import com.intellij.openapi.compiler.CompileScope; //导入方法依赖的package包/类
public static CompileScope createScopeWithArtifacts(final CompileScope baseScope, @NotNull Collection<Artifact> artifacts, final boolean forceArtifactBuild) {
baseScope.putUserData(ARTIFACTS_KEY, artifacts.toArray(new Artifact[artifacts.size()]));
if (forceArtifactBuild) {
baseScope.putUserData(FORCE_ARTIFACT_BUILD, Boolean.TRUE);
}
return baseScope;
}
示例3: 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;
}
示例4: createScopeWithArtifacts
import com.intellij.openapi.compiler.CompileScope; //导入方法依赖的package包/类
public static CompileScope createScopeWithArtifacts(final CompileScope baseScope,
@NotNull Collection<Artifact> artifacts,
boolean useCustomContentId,
final boolean forceArtifactBuild) {
baseScope.putUserData(ARTIFACTS_KEY, artifacts.toArray(new Artifact[artifacts.size()]));
if (useCustomContentId) {
baseScope.putUserData(CompilerManager.CONTENT_ID_KEY, ARTIFACTS_CONTENT_ID_KEY);
}
if (forceArtifactBuild) {
baseScope.putUserData(FORCE_ARTIFACT_BUILD, Boolean.TRUE);
}
return baseScope;
}
示例5: createScopeWithArtifacts
import com.intellij.openapi.compiler.CompileScope; //导入方法依赖的package包/类
public static CompileScope createScopeWithArtifacts(final CompileScope baseScope,
@Nonnull Collection<Artifact> artifacts,
boolean useCustomContentId,
final boolean forceArtifactBuild) {
baseScope.putUserData(ARTIFACTS_KEY, artifacts.toArray(new Artifact[artifacts.size()]));
if (useCustomContentId) {
baseScope.putUserData(CompilerManager.CONTENT_ID_KEY, ARTIFACTS_CONTENT_ID_KEY);
}
if (forceArtifactBuild) {
baseScope.putUserData(FORCE_ARTIFACT_BUILD, Boolean.TRUE);
}
return baseScope;
}
示例6: setBaseScopeForExternalBuild
import com.intellij.openapi.compiler.CompileScope; //导入方法依赖的package包/类
public static void setBaseScopeForExternalBuild(@NotNull CompileScope scope, @NotNull List<TargetTypeBuildScope> scopes) {
scope.putUserData(BASE_SCOPE_FOR_EXTERNAL_BUILD, scopes);
}
示例7: _commit
import com.intellij.openapi.compiler.CompileScope; //导入方法依赖的package包/类
@Override
public void _commit(boolean finishChosen) throws CommitStepException {
final String apkPath = myApkPathField.getText().trim();
if (apkPath.length() == 0) {
throw new CommitStepException(AndroidBundle.message("android.extract.package.specify.apk.path.error"));
}
AndroidFacet facet = myWizard.getFacet();
PropertiesComponent properties = PropertiesComponent.getInstance(myWizard.getProject());
properties.setValue(ChooseModuleStep.MODULE_PROPERTY, facet != null ? facet.getModule().getName() : "");
properties.setValue(getApkPathPropertyName(), apkPath);
File folder = new File(apkPath).getParentFile();
if (folder == null) {
throw new CommitStepException(AndroidBundle.message("android.cannot.create.file.error", apkPath));
}
try {
if (!folder.exists()) {
folder.mkdirs();
}
}
catch (Exception e) {
throw new CommitStepException(e.getMessage());
}
final CompileScope compileScope = CompilerManager.getInstance(myWizard.getProject()).
createModuleCompileScope(facet.getModule(), true);
AndroidCompileUtil.setReleaseBuild(compileScope);
properties.setValue(RUN_PROGUARD_PROPERTY, Boolean.toString(myProguardCheckBox.isSelected()));
if (myProguardCheckBox.isSelected()) {
final List<String> proguardOsCfgPaths = myProGuardConfigFilesPanel.getOsPaths();
if (proguardOsCfgPaths.isEmpty()) {
throw new CommitStepException(AndroidBundle.message("android.extract.package.specify.proguard.cfg.path.error"));
}
final String proguardPathsStr = mergeProguardCfgPathsToOneString(proguardOsCfgPaths);
properties.setValue(PROGUARD_CFG_PATHS_PROPERTY, proguardPathsStr);
for (String path : proguardOsCfgPaths) {
if (!new File(path).isFile()) {
throw new CommitStepException("Cannot find file " + path);
}
}
compileScope.putUserData(AndroidCompileUtil.PROGUARD_CFG_PATHS_KEY, proguardPathsStr);
}
myWizard.setCompileScope(compileScope);
myWizard.setApkPath(apkPath);
}
示例8: setReleaseBuild
import com.intellij.openapi.compiler.CompileScope; //导入方法依赖的package包/类
public static void setReleaseBuild(@NotNull CompileScope compileScope) {
compileScope.putUserData(RELEASE_BUILD_KEY, Boolean.TRUE);
}