use of com.intellij.execution.configurations.RuntimeConfigurationError in project intellij-plugins by JetBrains.
the class FlashRunnerParameters method checkCustomDescriptor.
public static void checkCustomDescriptor(final AirPackagingOptions packagingOptions, final String bcName, final String moduleName) throws RuntimeConfigurationError {
final boolean android = packagingOptions instanceof AndroidPackagingOptions;
final boolean ios = packagingOptions instanceof IosPackagingOptions;
if (android && !((AndroidPackagingOptions) packagingOptions).isEnabled()) {
throw new RuntimeConfigurationError(FlexBundle.message("android.disabled.in.bc", bcName, moduleName));
}
if (ios && !((IosPackagingOptions) packagingOptions).isEnabled()) {
throw new RuntimeConfigurationError(FlexBundle.message("ios.disabled.in.bc", bcName, moduleName));
}
if (!packagingOptions.isUseGeneratedDescriptor()) {
if (packagingOptions.getCustomDescriptorPath().isEmpty()) {
final String key = android ? "bc.0.module.1.android.custom.descriptor.not.set" : ios ? "bc.0.module.1.ios.custom.descriptor.not.set" : "bc.0.module.1.custom.descriptor.not.set";
throw new RuntimeConfigurationError(FlexBundle.message(key, bcName, moduleName));
} else {
final VirtualFile descriptorFile = LocalFileSystem.getInstance().findFileByPath(packagingOptions.getCustomDescriptorPath());
if (descriptorFile == null || descriptorFile.isDirectory()) {
final String key = android ? "bc.0.module.1.android.custom.descriptor.not.found" : ios ? "bc.0.module.1.ios.custom.descriptor.not.found" : "bc.0.module.1.custom.descriptor.not.found";
throw new RuntimeConfigurationError(FlexBundle.message(key, bcName, moduleName, FileUtil.toSystemDependentName(packagingOptions.getCustomDescriptorPath())));
}
}
}
}
use of com.intellij.execution.configurations.RuntimeConfigurationError in project intellij-community by JetBrains.
the class TestCategory method checkConfiguration.
@Override
public void checkConfiguration() throws RuntimeConfigurationException {
JavaParametersUtil.checkAlternativeJRE(getConfiguration());
ProgramParametersUtil.checkWorkingDirectoryExist(getConfiguration(), getConfiguration().getProject(), getConfiguration().getConfigurationModule().getModule());
final String category = getConfiguration().getPersistentData().getCategory();
if (category == null || category.isEmpty()) {
throw new RuntimeConfigurationError("Category is not specified");
}
final JavaRunConfigurationModule configurationModule = getConfiguration().getConfigurationModule();
if (getSourceScope() == null) {
configurationModule.checkForWarning();
}
final Module module = configurationModule.getModule();
if (module != null) {
final PsiClass psiClass = JavaExecutionUtil.findMainClass(getConfiguration().getProject(), category, GlobalSearchScope.moduleWithDependenciesAndLibrariesScope(module));
if (psiClass == null) {
throw new RuntimeConfigurationWarning(ExecutionBundle.message("class.not.found.in.module.error.message", category, configurationModule.getModuleName()));
}
}
}
use of com.intellij.execution.configurations.RuntimeConfigurationError in project intellij-community by JetBrains.
the class TestDirectory method checkConfiguration.
@Override
public void checkConfiguration() throws RuntimeConfigurationException {
JavaParametersUtil.checkAlternativeJRE(getConfiguration());
ProgramParametersUtil.checkWorkingDirectoryExist(getConfiguration(), getConfiguration().getProject(), getConfiguration().getConfigurationModule().getModule());
final String dirName = getConfiguration().getPersistentData().getDirName();
if (dirName == null || dirName.isEmpty()) {
throw new RuntimeConfigurationError("Directory is not specified");
}
final VirtualFile file = LocalFileSystem.getInstance().findFileByPath(FileUtil.toSystemIndependentName(dirName));
if (file == null) {
throw new RuntimeConfigurationWarning("Directory \'" + dirName + "\' is not found");
}
final Module module = getConfiguration().getConfigurationModule().getModule();
if (module == null) {
throw new RuntimeConfigurationError("Module to choose classpath from is not specified");
}
}
Aggregations