Search in sources :

Example 6 with ICLanguageSettingEntry

use of org.eclipse.cdt.core.settings.model.ICLanguageSettingEntry 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

ICLanguageSetting (org.eclipse.cdt.core.settings.model.ICLanguageSetting)6 ICLanguageSettingEntry (org.eclipse.cdt.core.settings.model.ICLanguageSettingEntry)6 ArrayList (java.util.ArrayList)4 NarLib (com.github.sdedwards.m2e_nar.internal.model.NarLib)2 CIncludePathEntry (org.eclipse.cdt.core.settings.model.CIncludePathEntry)2 ICFolderDescription (org.eclipse.cdt.core.settings.model.ICFolderDescription)2 NarSysLib (com.github.sdedwards.m2e_nar.internal.model.NarSysLib)1 File (java.io.File)1 ICIncludePathEntry (org.eclipse.cdt.core.settings.model.ICIncludePathEntry)1 ICLibraryFileEntry (org.eclipse.cdt.core.settings.model.ICLibraryFileEntry)1 ICLibraryPathEntry (org.eclipse.cdt.core.settings.model.ICLibraryPathEntry)1 ICMacroEntry (org.eclipse.cdt.core.settings.model.ICMacroEntry)1 IPath (org.eclipse.core.runtime.IPath)1 IStatus (org.eclipse.core.runtime.IStatus)1 Status (org.eclipse.core.runtime.Status)1