Search in sources :

Example 6 with NarLib

use of com.github.sdedwards.m2e_nar.internal.model.NarLib 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)6 NarSysLib (com.github.sdedwards.m2e_nar.internal.model.NarSysLib)3 ILib (com.github.maven_nar.ILib)2 ISysLib (com.github.maven_nar.ISysLib)2 ArrayList (java.util.ArrayList)2 ICLanguageSetting (org.eclipse.cdt.core.settings.model.ICLanguageSetting)2 ICLanguageSettingEntry (org.eclipse.cdt.core.settings.model.ICLanguageSettingEntry)2 EclipseNarLayout (com.github.maven_nar.EclipseNarLayout)1 NarBuildArtifact (com.github.sdedwards.m2e_nar.internal.model.NarBuildArtifact)1 NarLinker (com.github.sdedwards.m2e_nar.internal.model.NarLinker)1 File (java.io.File)1 ICLibraryFileEntry (org.eclipse.cdt.core.settings.model.ICLibraryFileEntry)1 ICLibraryPathEntry (org.eclipse.cdt.core.settings.model.ICLibraryPathEntry)1