use of com.intellij.lang.javascript.flex.run.FlashRunConfiguration in project intellij-plugins by JetBrains.
the class FlexBuildTargetScopeProvider method getModulesAndBCsToCompile.
static Collection<Pair<Module, FlexBuildConfiguration>> getModulesAndBCsToCompile(final CompileScope scope) throws ConfigurationException {
final Collection<Pair<Module, FlexBuildConfiguration>> result = new HashSet<>();
final Collection<Pair<Module, FlexBuildConfiguration>> modulesAndBCsToCompile = FlexResourceBuildTargetScopeProvider.getBCsToCompileForPackaging(scope);
final RunConfiguration runConfiguration = CompileStepBeforeRun.getRunConfiguration(scope);
if (modulesAndBCsToCompile != null) {
for (Pair<Module, FlexBuildConfiguration> moduleAndBC : modulesAndBCsToCompile) {
if (!moduleAndBC.second.isSkipCompile()) {
final FlexBuildConfiguration bcWithForcedDebugStatus = forceDebugStatus(moduleAndBC.first.getProject(), moduleAndBC.second);
result.add(Pair.create(moduleAndBC.first, bcWithForcedDebugStatus));
appendBCDependencies(result, moduleAndBC.first, moduleAndBC.second);
}
}
} else if (runConfiguration instanceof FlashRunConfiguration || runConfiguration instanceof FlexUnitRunConfiguration) {
final BCBasedRunnerParameters params = runConfiguration instanceof FlashRunConfiguration ? ((FlashRunConfiguration) runConfiguration).getRunnerParameters() : ((FlexUnitRunConfiguration) runConfiguration).getRunnerParameters();
final Pair<Module, FlexBuildConfiguration> moduleAndBC;
final Ref<RuntimeConfigurationError> exceptionRef = new Ref<>();
moduleAndBC = ApplicationManager.getApplication().runReadAction((NullableComputable<Pair<Module, FlexBuildConfiguration>>) () -> {
try {
return params.checkAndGetModuleAndBC(runConfiguration.getProject());
} catch (RuntimeConfigurationError e) {
exceptionRef.set(e);
return null;
}
});
if (!exceptionRef.isNull()) {
throw new ConfigurationException(exceptionRef.get().getMessage(), FlexBundle.message("run.configuration.0", runConfiguration.getName()));
}
if (!moduleAndBC.second.isSkipCompile()) {
result.add(moduleAndBC);
appendBCDependencies(result, moduleAndBC.first, moduleAndBC.second);
}
} else {
for (final Module module : scope.getAffectedModules()) {
if (module.isDisposed() || ModuleType.get(module) != FlexModuleType.getInstance())
continue;
for (final FlexBuildConfiguration bc : FlexBuildConfigurationManager.getInstance(module).getBuildConfigurations()) {
if (!bc.isSkipCompile()) {
result.add(Pair.create(module, bc));
}
}
}
}
return result;
}
Aggregations