use of com.intellij.openapi.module.Module in project intellij-community by JetBrains.
the class XsltRunConfiguration method getEffectiveModule.
@Nullable
public Module getEffectiveModule() {
//assert myJdkChoice == JdkChoice.FROM_MODULE;
Module module = myJdkChoice == JdkChoice.FROM_MODULE ? getModule() : null;
if (module == null && myXsltFile != null) {
final VirtualFile file = myXsltFile.getFile();
if (file != null) {
final ProjectFileIndex index = ProjectRootManager.getInstance(getProject()).getFileIndex();
module = index.getModuleForFile(file);
}
}
return module;
}
use of com.intellij.openapi.module.Module in project intellij-community by JetBrains.
the class AbstractPythonRunConfiguration method getValidModules.
public static List<Module> getValidModules(Project project) {
final Module[] modules = ModuleManager.getInstance(project).getModules();
List<Module> result = Lists.newArrayList();
for (Module module : modules) {
if (PythonSdkType.findPythonSdk(module) != null) {
result.add(module);
}
}
return result;
}
use of com.intellij.openapi.module.Module in project intellij-community by JetBrains.
the class PythonCommandLineState method getInterpreterPath.
@Nullable
public static String getInterpreterPath(Project project, PythonRunParams config) {
String sdkHome = config.getSdkHome();
if (config.isUseModuleSdk() || StringUtil.isEmpty(sdkHome)) {
Module module = getModule(project, config);
Sdk sdk = PythonSdkType.findPythonSdk(module);
if (sdk != null) {
sdkHome = sdk.getHomePath();
}
}
return sdkHome;
}
use of com.intellij.openapi.module.Module in project intellij-community by JetBrains.
the class PythonCommandLineState method collectPythonPath.
protected static Collection<String> collectPythonPath(Project project, PythonRunParams config, boolean isDebug) {
final Module module = getModule(project, config);
final HashSet<String> pythonPath = Sets.newHashSet(collectPythonPath(module, config.shouldAddContentRoots(), config.shouldAddSourceRoots()));
if (isDebug && PythonSdkFlavor.getFlavor(config.getSdkHome()) instanceof JythonSdkFlavor) {
//that fixes Jython problem changing sys.argv on execfile, see PY-8164
pythonPath.add(PythonHelpersLocator.getHelperPath("pycharm"));
pythonPath.add(PythonHelpersLocator.getHelperPath("pydev"));
}
return pythonPath;
}
use of com.intellij.openapi.module.Module in project intellij-community by JetBrains.
the class MavenProjectsManager method setMavenizedModules.
public void setMavenizedModules(Collection<Module> modules, boolean mavenized) {
ApplicationManager.getApplication().assertWriteAccessAllowed();
for (Module m : modules) {
if (m.isDisposed())
continue;
if (mavenized) {
m.setOption(getMavenizedModuleOptionName(), "true");
// clear external system API options
// see com.intellij.openapi.externalSystem.service.project.manage.ModuleDataService#setModuleOptions
m.clearOption(ExternalSystemConstants.EXTERNAL_SYSTEM_ID_KEY);
m.clearOption(ExternalSystemConstants.LINKED_PROJECT_PATH_KEY);
m.clearOption(ExternalSystemConstants.ROOT_PROJECT_PATH_KEY);
m.clearOption(ExternalSystemConstants.EXTERNAL_SYSTEM_MODULE_GROUP_KEY);
m.clearOption(ExternalSystemConstants.EXTERNAL_SYSTEM_MODULE_VERSION_KEY);
} else {
m.clearOption(getMavenizedModuleOptionName());
}
}
}
Aggregations