use of org.eclipse.cdt.core.settings.model.ICIncludePathEntry in project m2e-nar by maven-nar.
the class AbstractSettingsSynchroniser method setIncludes.
private void setIncludes(final ICConfigurationDescription conf, final NarBuildArtifact settings) throws CoreException {
final ICLanguageSetting[] languageSettings = conf.getRootFolderDescription().getLanguageSettings();
final List<ICIncludePathEntry> cIncludePathEntries = new ArrayList<ICIncludePathEntry>();
for (final String path : settings.getCSettings().getIncludePaths()) {
ICIncludePathEntry includePath = createIncludePathEntry(path, ICSettingEntry.LOCAL);
cIncludePathEntries.add(includePath);
}
for (final String path : settings.getCSettings().getSystemIncludePaths()) {
ICIncludePathEntry includePath = createIncludePathEntry(path, 0);
cIncludePathEntries.add(includePath);
}
final List<ICIncludePathEntry> cppIncludePathEntries = new ArrayList<ICIncludePathEntry>();
for (final String path : settings.getCppSettings().getIncludePaths()) {
ICIncludePathEntry includePath = createIncludePathEntry(path, ICSettingEntry.LOCAL);
cppIncludePathEntries.add(includePath);
}
for (final String path : settings.getCppSettings().getSystemIncludePaths()) {
ICIncludePathEntry includePath = createIncludePathEntry(path, 0);
cppIncludePathEntries.add(includePath);
}
final List<ICIncludePathEntry> commonIncludePathEntries = new ArrayList<ICIncludePathEntry>();
for (final String path : settings.getJavahIncludePaths()) {
ICIncludePathEntry includePath = createIncludePathEntry(path, ICSettingEntry.LOCAL);
commonIncludePathEntries.add(includePath);
}
for (final String path : settings.getJavaIncludePaths()) {
ICIncludePathEntry includePath = createIncludePathEntry(path, 0);
commonIncludePathEntries.add(includePath);
}
for (final File f : settings.getDependencyIncludePaths()) {
ICIncludePathEntry includePath = createIncludePathEntry(f.getPath(), 0);
commonIncludePathEntries.add(includePath);
}
for (ICLanguageSetting setting : languageSettings) {
final List<ICLanguageSettingEntry> l = setting.getSettingEntriesList(ICSettingEntry.INCLUDE_PATH);
l.clear();
l.addAll(commonIncludePathEntries);
if (cppLanguageId.equals(setting.getLanguageId())) {
l.addAll(cppIncludePathEntries);
} else if (cLanguageId.equals(setting.getLanguageId())) {
l.addAll(cIncludePathEntries);
}
setting.setSettingEntries(ICSettingEntry.INCLUDE_PATH, l);
}
}
Aggregations