本文整理汇总了Java中com.intellij.compiler.options.CompileStepBeforeRun类的典型用法代码示例。如果您正苦于以下问题:Java CompileStepBeforeRun类的具体用法?Java CompileStepBeforeRun怎么用?Java CompileStepBeforeRun使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
CompileStepBeforeRun类属于com.intellij.compiler.options包,在下文中一共展示了CompileStepBeforeRun类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: ensureRunConfigurationExists
import com.intellij.compiler.options.CompileStepBeforeRun; //导入依赖的package包/类
protected static void ensureRunConfigurationExists(Module module, ConfigurationType configurationType, String name) {
final RunManager runManager = RunManager.getInstance(module.getProject());
for (final RunConfiguration runConfiguration : runManager.getConfigurationsList(configurationType)) {
if (runConfiguration instanceof MvcRunConfiguration && ((MvcRunConfiguration)runConfiguration).getModule() == module) {
return;
}
}
final ConfigurationFactory factory = configurationType.getConfigurationFactories()[0];
final RunnerAndConfigurationSettings runSettings = runManager.createRunConfiguration(name,
factory);
final MvcRunConfiguration configuration = (MvcRunConfiguration)runSettings.getConfiguration();
configuration.setModule(module);
runManager.addConfiguration(runSettings, false);
runManager.setSelectedConfiguration(runSettings);
RunManagerEx.disableTasks(module.getProject(), configuration, CompileStepBeforeRun.ID, CompileStepBeforeRunNoErrorCheck.ID);
}
示例2: execute
import com.intellij.compiler.options.CompileStepBeforeRun; //导入依赖的package包/类
@Override
public boolean execute(CompileContext context) {
if(context.getMessageCount(CompilerMessageCategory.ERROR) > 0) {
RoboVmPlugin.logError(context.getProject(), "Can't compile application due to previous compilation errors");
return false;
}
RunConfiguration c = context.getCompileScope().getUserData(CompileStepBeforeRun.RUN_CONFIGURATION);
if(c == null || !(c instanceof RoboVmRunConfiguration)) {
CreateIpaAction.IpaConfig ipaConfig = context.getCompileScope().getUserData(CreateIpaAction.IPA_CONFIG_KEY);
if(ipaConfig != null) {
return compileForIpa(context, ipaConfig);
} else {
return true;
}
} else {
return compileForRunConfiguration(context, (RoboVmRunConfiguration)c);
}
}
示例3: ensureRunConfigurationExists
import com.intellij.compiler.options.CompileStepBeforeRun; //导入依赖的package包/类
protected static void ensureRunConfigurationExists(Module module, ConfigurationType configurationType, String name) {
final RunManagerEx runManager = RunManagerEx.getInstanceEx(module.getProject());
for (final RunConfiguration runConfiguration : runManager.getConfigurations(configurationType)) {
if (runConfiguration instanceof MvcRunConfiguration && ((MvcRunConfiguration)runConfiguration).getModule() == module) {
return;
}
}
final ConfigurationFactory factory = configurationType.getConfigurationFactories()[0];
final RunnerAndConfigurationSettings runSettings = runManager.createRunConfiguration(name,
factory);
final MvcRunConfiguration configuration = (MvcRunConfiguration)runSettings.getConfiguration();
configuration.setModule(module);
runManager.addConfiguration(runSettings, false);
runManager.setActiveConfiguration(runSettings);
RunManagerEx.disableTasks(module.getProject(), configuration, CompileStepBeforeRun.ID, CompileStepBeforeRunNoErrorCheck.ID);
}
示例4: configureBeforeRunTaskDefaults
import com.intellij.compiler.options.CompileStepBeforeRun; //导入依赖的package包/类
@Override
public void configureBeforeRunTaskDefaults(Key<? extends BeforeRunTask> providerID, BeforeRunTask task) {
// Under Android Studio, disable the default Make compile step for this run configuration type
if (AndroidStudioSpecificInitializer.isAndroidStudio() && CompileStepBeforeRun.ID.equals(providerID)) {
task.setEnabled(false);
}
}
示例5: tuneConfiguration
import com.intellij.compiler.options.CompileStepBeforeRun; //导入依赖的package包/类
@Override
public void tuneConfiguration(@NotNull GroovyFile file, @NotNull GroovyScriptRunConfiguration configuration, Location location) {
List<String> tasks = getTasksTarget(location);
if (tasks != null) {
String s = StringUtil.join(tasks, " ");
configuration.setScriptParameters(s);
configuration.setName("gradle:" + s);
}
RunManagerEx.disableTasks(file.getProject(), configuration, CompileStepBeforeRun.ID, CompileStepBeforeRunNoErrorCheck.ID);
}
示例6: GriffonRunConfigurationType
import com.intellij.compiler.options.CompileStepBeforeRun; //导入依赖的package包/类
public GriffonRunConfigurationType() {
myConfigurationFactory = new ConfigurationFactory(this) {
@Override
public RunConfiguration createTemplateConfiguration(Project project) {
return new GriffonRunConfiguration(this, project, GRIFFON_APPLICATION, "run-app");
}
@Override
public void configureBeforeRunTaskDefaults(Key<? extends BeforeRunTask> providerID, BeforeRunTask task) {
if (providerID == CompileStepBeforeRun.ID || providerID == CompileStepBeforeRunNoErrorCheck.ID) {
task.setEnabled(false);
}
}
};
}
示例7: tuneConfiguration
import com.intellij.compiler.options.CompileStepBeforeRun; //导入依赖的package包/类
@Override
public void tuneConfiguration(@NotNull GroovyFile file, @NotNull GroovyScriptRunConfiguration configuration, Location location) {
String target = getTargetName(location);
if (target != null) {
configuration.setScriptParameters(target);
configuration.setName(configuration.getName() + "." + target);
}
RunManagerEx.disableTasks(file.getProject(), configuration, CompileStepBeforeRun.ID, CompileStepBeforeRunNoErrorCheck.ID);
}
示例8: configureBeforeRunTaskDefaults
import com.intellij.compiler.options.CompileStepBeforeRun; //导入依赖的package包/类
@Override
public void configureBeforeRunTaskDefaults(Key<? extends BeforeRunTask> providerID, BeforeRunTask task) {
super.configureBeforeRunTaskDefaults(providerID, task);
if (providerID == CompileStepBeforeRun.ID) {
task.setEnabled(false);
}
}
示例9: createOn
import com.intellij.compiler.options.CompileStepBeforeRun; //导入依赖的package包/类
@NotNull
public static OCamlCompileContext createOn(@NotNull final CompileContext context) {
final RunConfiguration configuration = CompileStepBeforeRun.getRunConfiguration(context);
if (configuration == null || !(configuration instanceof OCamlRunConfiguration)) {
return new OCamlCompileContext(true, null, false);
}
final String debugExecutorId = DefaultDebugExecutor.getDebugExecutorInstance().getId();
final Executor currentExecutor = OCamlRunner.getCurrentExecutor();
final boolean isDebugMode = currentExecutor != null && debugExecutorId.equals(currentExecutor.getId());
return new OCamlCompileContext(false, (OCamlRunConfiguration) configuration, isDebugMode);
}
示例10: configureBeforeRunTaskDefaults
import com.intellij.compiler.options.CompileStepBeforeRun; //导入依赖的package包/类
@Override
public void configureBeforeRunTaskDefaults(Key<? extends BeforeRunTask> providerID, BeforeRunTask task) {
// Disable the default Make compile step for this run configuration type
if (CompileStepBeforeRun.ID.equals(providerID)) {
task.setEnabled(false);
}
}
示例11: process
import com.intellij.compiler.options.CompileStepBeforeRun; //导入依赖的package包/类
@Override
public ProcessingItem[] process(CompileContext context, ProcessingItem[] items) {
final RunConfiguration runConfiguration = CompileStepBeforeRun.getRunConfiguration(context.getCompileScope());
if (runConfiguration instanceof ModuleBasedConfiguration) {
return run(context, items, (ModuleBasedConfiguration)runConfiguration);
}
return make(context, items);
}
示例12: process
import com.intellij.compiler.options.CompileStepBeforeRun; //导入依赖的package包/类
@Override
public ProcessingItem[] process(CompileContext context, ProcessingItem[] items)
{
final RunConfiguration runConfiguration = CompileStepBeforeRun.getRunConfiguration(context.getCompileScope());
if(runConfiguration instanceof HaxeApplicationConfiguration)
{
return run(context, items, (HaxeApplicationConfiguration) runConfiguration);
}
return make(context, items);
}
示例13: isFullBuild
import com.intellij.compiler.options.CompileStepBeforeRun; //导入依赖的package包/类
public static boolean isFullBuild(@NotNull CompileScope scope) {
final RunConfiguration c = CompileStepBeforeRun.getRunConfiguration(scope);
return c == null || !AndroidCommonUtils.isTestConfiguration(c.getType().getId());
}
示例14: configureBeforeRunTaskDefaults
import com.intellij.compiler.options.CompileStepBeforeRun; //导入依赖的package包/类
@Override
public void configureBeforeRunTaskDefaults(Key<? extends BeforeRunTask> providerID, BeforeRunTask task) {
if (providerID == CompileStepBeforeRun.ID || providerID == CompileStepBeforeRunNoErrorCheck.ID) {
task.setEnabled(false);
}
}
示例15: execute
import com.intellij.compiler.options.CompileStepBeforeRun; //导入依赖的package包/类
@Override
public boolean execute(@NotNull final CompileContext context) {
if(isErroneous(context)) {
return false;
}
final Project project = context.getProject();
final RunConfiguration runConfiguration =
context.getCompileScope().getUserData(CompileStepBeforeRun.RUN_CONFIGURATION);
if(!isDefracRunConfiguration(runConfiguration)) {
return true;
}
final DefracRunConfiguration defracRunConfiguration =
(DefracRunConfiguration)runConfiguration;
final Module[] modules = defracRunConfiguration.getModules();
if(modules.length != 1) {
reportError(context, "No module found");
return false;
}
final DefracFacet facet = DefracFacet.getInstance(modules[0]);
if(facet == null) {
reportError(context,"Couldn't find defrac facet");
return false;
}
if(!shouldRunForFacet(facet)) {
return true;
}
try {
context.getProgressIndicator().pushState();
setProgressIndicatorText(context, facet);
UIUtil.invokeAndWaitIfNeeded(new Runnable() {
@Override
public void run() {
final ConsoleView console =
DefracConsoleView.getInstance(project);
if(console != null) {
console.clear();
}
}
});
return doCompile(context, defracRunConfiguration, facet);
} finally {
context.getProgressIndicator().popState();
}
}