Search in sources :

Example 1 with MagicConstant

use of org.intellij.lang.annotations.MagicConstant in project intellij-community by JetBrains.

the class JavaParametersUtil method getClasspathType.

@MagicConstant(valuesFromClass = JavaParameters.class)
public static int getClasspathType(final RunConfigurationModule configurationModule, final String mainClassName, final boolean classMustHaveSource) throws CantRunException {
    final Module module = configurationModule.getModule();
    if (module == null)
        throw CantRunException.noModuleConfigured(configurationModule.getModuleName());
    Boolean inProduction = isClassInProductionSources(mainClassName, module);
    if (inProduction == null) {
        if (!classMustHaveSource) {
            return JavaParameters.JDK_AND_CLASSES_AND_TESTS;
        }
        throw CantRunException.classNotFound(mainClassName, module);
    }
    return inProduction ? JavaParameters.JDK_AND_CLASSES : JavaParameters.JDK_AND_CLASSES_AND_TESTS;
}
Also used : Module(com.intellij.openapi.module.Module) RunConfigurationModule(com.intellij.execution.configurations.RunConfigurationModule) MagicConstant(org.intellij.lang.annotations.MagicConstant)

Aggregations

RunConfigurationModule (com.intellij.execution.configurations.RunConfigurationModule)1 Module (com.intellij.openapi.module.Module)1 MagicConstant (org.intellij.lang.annotations.MagicConstant)1