use of org.gradle.plugins.ide.internal.tooling.idea.DefaultIdeaLanguageLevel in project gradle by gradle.
the class IdeaModelBuilder method build.
private DefaultIdeaProject build(Project project, DefaultGradleProject rootGradleProject) {
IdeaModel ideaModel = ideaPluginFor(project).getModel();
IdeaProject projectModel = ideaModel.getProject();
JavaVersion projectSourceLanguageLevel = convertIdeaLanguageLevelToJavaVersion(projectModel.getLanguageLevel());
JavaVersion projectTargetBytecodeLevel = projectModel.getTargetBytecodeVersion();
DefaultIdeaProject out = new DefaultIdeaProject().setName(projectModel.getName()).setJdkName(projectModel.getJdkName()).setLanguageLevel(new DefaultIdeaLanguageLevel(projectModel.getLanguageLevel().getLevel())).setJavaLanguageSettings(new DefaultIdeaJavaLanguageSettings().setSourceLanguageLevel(projectSourceLanguageLevel).setTargetBytecodeVersion(projectTargetBytecodeLevel).setJdk(DefaultInstalledJdk.current()));
Map<String, DefaultIdeaModule> modules = new LinkedHashMap<String, DefaultIdeaModule>();
for (IdeaModule module : projectModel.getModules()) {
appendModule(modules, module, out, rootGradleProject);
}
for (IdeaModule module : projectModel.getModules()) {
buildDependencies(modules, module);
}
final Collection<DefaultIdeaModule> ideaModules = modules.values();
out.setChildren(new LinkedList<DefaultIdeaModule>(ideaModules));
return out;
}
Aggregations