Search in sources :

Example 1 with ICLibraryFileEntry

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

the class AbstractSettingsSynchroniser method setLibraries.

private void setLibraries(final ICConfigurationDescription conf, final NarBuildArtifact settings) throws CoreException {
    final ICLanguageSetting[] languageSettings = conf.getRootFolderDescription().getLanguageSettings();
    final List<ICLibraryFileEntry> libraryEntries = new ArrayList<ICLibraryFileEntry>();
    for (final NarLib lib : settings.getDependencyLibs()) {
        final ICLibraryFileEntry library = CDataUtil.createCLibraryFileEntry(lib.getName(), 0);
        libraryEntries.add(library);
    }
    for (final NarSysLib syslib : settings.getDependencySysLibs()) {
        final ICLibraryFileEntry library = CDataUtil.createCLibraryFileEntry(syslib.getName(), 0);
        libraryEntries.add(library);
    }
    for (final NarLib lib : settings.getLinkerSettings().getLibs()) {
        final ICLibraryFileEntry library = CDataUtil.createCLibraryFileEntry(lib.getName(), 0);
        libraryEntries.add(library);
    }
    for (final NarSysLib syslib : settings.getLinkerSettings().getSysLibs()) {
        final ICLibraryFileEntry library = CDataUtil.createCLibraryFileEntry(syslib.getName(), 0);
        libraryEntries.add(library);
    }
    /*
		 * for (String path : settings.getLibraries()) { ICLibraryFileEntry
		 * library = CDataUtil.createCLibraryFileEntry(lib, 0);
		 * libraryPathEntries.add(library); }
		 */
    for (final ICLanguageSetting setting : languageSettings) {
        final List<ICLanguageSettingEntry> l = setting.getSettingEntriesList(ICSettingEntry.LIBRARY_FILE);
        l.clear();
        l.addAll(libraryEntries);
        setting.setSettingEntries(ICSettingEntry.LIBRARY_FILE, l);
    }
}
Also used : ICLibraryFileEntry(org.eclipse.cdt.core.settings.model.ICLibraryFileEntry) NarLib(com.github.sdedwards.m2e_nar.internal.model.NarLib) ICLanguageSettingEntry(org.eclipse.cdt.core.settings.model.ICLanguageSettingEntry) NarSysLib(com.github.sdedwards.m2e_nar.internal.model.NarSysLib) ArrayList(java.util.ArrayList) ICLanguageSetting(org.eclipse.cdt.core.settings.model.ICLanguageSetting)

Aggregations

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