use of com.github.sdedwards.m2e_nar.internal.model.NarLinker in project m2e-nar by maven-nar.
the class NarExecutionBuilder method buildLinkerSettings.
@SuppressWarnings("unchecked")
public NarLinker buildLinkerSettings(final ILinker linker, final boolean linkCpp, final ITest test) throws MojoFailureException, MojoExecutionException {
NarLinker settings = new NarLinker();
settings.setName(linker.getName());
List<NarLib> libs = settings.getLibs();
for (Iterator<?> it = linker.getLibs().iterator(); it.hasNext(); ) {
libs.add(buildLibSettings((ILib) it.next()));
}
List<NarSysLib> sysLibs = settings.getSysLibs();
for (Iterator<?> it = linker.getSysLibs().iterator(); it.hasNext(); ) {
sysLibs.add(buildSysLibSettings((ISysLib) it.next()));
}
settings.setIncremental(linker.isIncremental());
settings.setMap(linker.isMap());
List<String> options = settings.getOptions();
options.addAll(linker.getOptions());
if (test != null) {
List<String> testOptions = linker.getTestOptions();
if (testOptions != null) {
options.addAll(testOptions);
}
}
settings.setLinkCpp(linkCpp);
return settings;
}