本文整理汇总了Java中com.intellij.execution.runners.ExecutionEnvironment.getProject方法的典型用法代码示例。如果您正苦于以下问题:Java ExecutionEnvironment.getProject方法的具体用法?Java ExecutionEnvironment.getProject怎么用?Java ExecutionEnvironment.getProject使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.execution.runners.ExecutionEnvironment
的用法示例。
在下文中一共展示了ExecutionEnvironment.getProject方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createRunner
import com.intellij.execution.runners.ExecutionEnvironment; //导入方法依赖的package包/类
@Override
public BlazeCommandRunConfigurationRunner createRunner(
Executor executor, ExecutionEnvironment environment) throws ExecutionException {
Project project = environment.getProject();
Module module = getModule();
AndroidFacet facet = module != null ? AndroidFacet.getInstance(module) : null;
ProjectViewSet projectViewSet = ProjectViewManager.getInstance(project).getProjectViewSet();
BlazeAndroidRunConfigurationValidationUtil.validateExecution(module, facet, projectViewSet);
ImmutableList<String> blazeFlags =
configState
.getCommonState()
.getExpandedBuildFlags(project, projectViewSet, BlazeCommandName.RUN);
ImmutableList<String> exeFlags =
ImmutableList.copyOf(configState.getCommonState().getExeFlagsState().getExpandedFlags());
BlazeAndroidRunContext runContext =
createRunContext(project, facet, environment, blazeFlags, exeFlags);
return new BlazeAndroidRunConfigurationRunner(
module,
runContext,
getCommonState().getDeployTargetManager(),
getCommonState().getDebuggerManager(),
configuration.getUniqueID());
}
示例2: createRunner
import com.intellij.execution.runners.ExecutionEnvironment; //导入方法依赖的package包/类
@Override
public BlazeCommandRunConfigurationRunner createRunner(
Executor executor, ExecutionEnvironment environment) throws ExecutionException {
Project project = environment.getProject();
Module module = getModule();
AndroidFacet facet = module != null ? AndroidFacet.getInstance(module) : null;
ProjectViewSet projectViewSet = ProjectViewManager.getInstance(project).getProjectViewSet();
BlazeAndroidRunConfigurationValidationUtil.validateExecution(module, facet, projectViewSet);
ImmutableList<String> blazeFlags =
configState
.getCommonState()
.getExpandedBuildFlags(project, projectViewSet, BlazeCommandName.TEST);
ImmutableList<String> exeFlags =
ImmutableList.copyOf(configState.getCommonState().getExeFlagsState().getExpandedFlags());
BlazeAndroidRunContext runContext =
createRunContext(project, facet, environment, blazeFlags, exeFlags);
return new BlazeAndroidRunConfigurationRunner(
module,
runContext,
getCommonState().getDeployTargetManager(),
getCommonState().getDebuggerManager(),
configuration.getUniqueID());
}
示例3: startDebugSession
import com.intellij.execution.runners.ExecutionEnvironment; //导入方法依赖的package包/类
@Override
public void startDebugSession(@NotNull JavaDebugConnectionData info, @NotNull ExecutionEnvironment executionEnvironment, @NotNull RemoteServer<?> server)
throws ExecutionException {
final Project project = executionEnvironment.getProject();
final DebuggerPanelsManager manager = DebuggerPanelsManager.getInstance(project);
final JavaDebugServerModeHandler serverModeHandler = info.getServerModeHandler();
boolean serverMode = serverModeHandler != null;
final RemoteConnection remoteConnection = new RemoteConnection(true, info.getHost(), String.valueOf(info.getPort()), serverMode);
DebugEnvironment debugEnvironment = new RemoteServerDebugEnvironment(project, remoteConnection, executionEnvironment.getRunProfile());
DebugUIEnvironment debugUIEnvironment = new RemoteServerDebugUIEnvironment(debugEnvironment, executionEnvironment);
RunContentDescriptor debugContentDescriptor = manager.attachVirtualMachine(debugUIEnvironment);
LOG.assertTrue(debugContentDescriptor != null);
ProcessHandler processHandler = debugContentDescriptor.getProcessHandler();
LOG.assertTrue(processHandler != null);
if (serverMode) {
serverModeHandler.attachRemote();
DebuggerManager.getInstance(executionEnvironment.getProject())
.addDebugProcessListener(processHandler, new DebugProcessAdapter() {
public void processDetached(DebugProcess process, boolean closedByUser) {
try {
serverModeHandler.detachRemote();
}
catch (ExecutionException e) {
LOG.info(e);
}
}
});
}
}
示例4: MyDebugLauncher
import com.intellij.execution.runners.ExecutionEnvironment; //导入方法依赖的package包/类
public MyDebugLauncher(AndroidRunningState state,
ExecutionEnvironment environment) {
myProject = environment.getProject();
myRunningState = state;
myEnvironment = environment;
myExecutor = environment.getExecutor();
}
示例5: executeBeforeRunTask
import com.intellij.execution.runners.ExecutionEnvironment; //导入方法依赖的package包/类
@Override
public boolean executeBeforeRunTask(ExecutionEnvironment env) {
final Project project = env.getProject();
BlazeConsolePopupBehavior consolePopupBehavior =
BlazeUserSettings.getInstance().getSuppressConsoleForRunAction()
? BlazeConsolePopupBehavior.NEVER
: BlazeConsolePopupBehavior.ALWAYS;
return Scope.root(
context -> {
context
.push(new IssuesScope(project))
.push(new ExperimentScope())
.push(
new BlazeConsoleScope.Builder(project)
.setPopupBehavior(consolePopupBehavior)
.build())
.push(new IdeaLogScope());
BlazeAndroidRunContext runContext = env.getCopyableUserData(RUN_CONTEXT_KEY);
if (runContext == null) {
IssueOutput.error("Could not find run context. Please try again").submit(context);
return false;
}
BlazeAndroidDeviceSelector.DeviceSession deviceSession =
env.getCopyableUserData(DEVICE_SESSION_KEY);
BlazeApkBuildStep buildStep = runContext.getBuildStep();
try {
return buildStep.build(context, deviceSession);
} catch (Exception e) {
LOG.error(e);
return false;
}
});
}
示例6: executeTask
import com.intellij.execution.runners.ExecutionEnvironment; //导入方法依赖的package包/类
@Override
public boolean executeTask(DataContext dataContext, RunConfiguration runConfiguration, ExecutionEnvironment executionEnvironment, MuleBeforeRunTask muleBeforeRunTask)
{
final Semaphore targetDone = new Semaphore();
final List<Boolean> results = new ArrayList<>();
final Project project = executionEnvironment.getProject();
MuleConfiguration muleConfiguration = (MuleConfiguration) runConfiguration;
Module[] modules = muleConfiguration.getModules();
for (Module nextModule : modules) {
//final MavenProject mavenProject = getMavenProject(runConfiguration, project);
final MavenProject mavenProject = getMavenProject(nextModule);
try {
ApplicationManager.getApplication().invokeAndWait(new Runnable() {
public void run() {
if (!project.isDisposed() && mavenProject != null) {
FileDocumentManager.getInstance().saveAllDocuments();
final MavenExplicitProfiles explicitProfiles = MavenProjectsManager.getInstance(project).getExplicitProfiles();
final MavenRunner mavenRunner = MavenRunner.getInstance(project);
targetDone.down();
(new Task.Backgroundable(project, TasksBundle.message("maven.tasks.executing"), true) {
public void run(@NotNull ProgressIndicator indicator) {
try {
MavenRunnerParameters params =
new MavenRunnerParameters(true, mavenProject.getDirectory(), ParametersListUtil.parse("package"), explicitProfiles.getEnabledProfiles(),
explicitProfiles.getDisabledProfiles());
boolean result = mavenRunner.runBatch(Collections.singletonList(params), null, null, TasksBundle.message("maven.tasks.executing"), indicator);
results.add(result);
} finally {
targetDone.up();
}
}
public boolean shouldStartInBackground() {
return MavenRunner.getInstance(project).getSettings().isRunMavenInBackground();
}
public void processSentToBackground() {
MavenRunner.getInstance(project).getSettings().setRunMavenInBackground(true);
}
}).queue();
}
}
}, ModalityState.NON_MODAL);
} catch (Exception exeception) {
return false;
}
targetDone.waitFor();
}
boolean endResult = true;
for (Boolean nextResult : results) {
endResult = endResult && nextResult;
}
return endResult;
}