Search in sources :

Example 1 with ICLibraryPathEntry

use of org.eclipse.cdt.core.settings.model.ICLibraryPathEntry in project m2e-nar by maven-nar.

the class AbstractSettingsSynchroniser method setLibraryPaths.

private void setLibraryPaths(final ICConfigurationDescription conf, final NarBuildArtifact settings) throws CoreException {
    final ICLanguageSetting[] languageSettings = conf.getRootFolderDescription().getLanguageSettings();
    final List<ICLibraryPathEntry> libraryPathEntries = new ArrayList<ICLibraryPathEntry>();
    for (final NarLib lib : settings.getDependencyLibs()) {
        ICLibraryPathEntry libraryPath = createLibraryPathEntry(lib.getDirectory().getPath(), 0);
        libraryPathEntries.add(libraryPath);
    }
    for (final NarLib lib : settings.getLinkerSettings().getLibs()) {
        ICLibraryPathEntry libraryPath = createLibraryPathEntry(lib.getDirectory().getPath(), 0);
        libraryPathEntries.add(libraryPath);
    }
    for (final ICLanguageSetting setting : languageSettings) {
        final List<ICLanguageSettingEntry> l = setting.getSettingEntriesList(ICSettingEntry.LIBRARY_PATH);
        l.clear();
        l.addAll(libraryPathEntries);
        setting.setSettingEntries(ICSettingEntry.LIBRARY_PATH, l);
    }
}
Also used : NarLib(com.github.sdedwards.m2e_nar.internal.model.NarLib) ICLibraryPathEntry(org.eclipse.cdt.core.settings.model.ICLibraryPathEntry) ICLanguageSettingEntry(org.eclipse.cdt.core.settings.model.ICLanguageSettingEntry) ArrayList(java.util.ArrayList) ICLanguageSetting(org.eclipse.cdt.core.settings.model.ICLanguageSetting)

Aggregations

NarLib (com.github.sdedwards.m2e_nar.internal.model.NarLib)1 ArrayList (java.util.ArrayList)1 ICLanguageSetting (org.eclipse.cdt.core.settings.model.ICLanguageSetting)1 ICLanguageSettingEntry (org.eclipse.cdt.core.settings.model.ICLanguageSettingEntry)1 ICLibraryPathEntry (org.eclipse.cdt.core.settings.model.ICLibraryPathEntry)1