Search in sources :

Example 1 with EclipseNarLayout

use of com.github.maven_nar.EclipseNarLayout in project m2e-nar by maven-nar.

the class NarExecutionBuilder method buildArtifactSettings.

@SuppressWarnings("unchecked")
private NarBuildArtifact buildArtifactSettings(final String type, final String buildType, final boolean linkCPP, final ITest test) throws MojoExecutionException, MojoFailureException {
    NarBuildArtifact settings = new NarBuildArtifact();
    settings.setType(type);
    List<String> projectRefs = settings.getProjectReferences();
    List<com.github.maven_nar.NarArtifact> narArtifacts = narCompileMojo.getNarArtifacts();
    for (com.github.maven_nar.NarArtifact artifact : narArtifacts) {
        if (artifact.getNarLayout() instanceof EclipseNarLayout) {
            EclipseNarLayout layout = (EclipseNarLayout) artifact.getNarLayout();
            projectRefs.add(layout.getProject().getProject().getName());
        }
    }
    settings.setLinkerSettings(buildLinkerSettings(narCompileMojo.getLinker(), linkCPP, test));
    settings.setCppSettings(buildCompilerSettings(narCompileMojo.getCpp(), buildType, test));
    settings.setCSettings(buildCompilerSettings(narCompileMojo.getC(), buildType, test));
    List<String> javahIncludePaths = settings.getJavahIncludePaths();
    javahIncludePaths.addAll(narCompileMojo.getJavahIncludePaths());
    List<String> javaIncludePaths = settings.getJavaIncludePaths();
    javaIncludePaths.addAll(narCompileMojo.getJavaIncludePaths());
    List<File> dependencyIncludePaths = settings.getDependencyIncludePaths();
    logger.debug("include paths size " + narCompileMojo.getDependencyIncludePaths().size());
    dependencyIncludePaths.addAll(narCompileMojo.getDependencyIncludePaths());
    List<NarLib> dependencyLibs = settings.getDependencyLibs();
    logger.debug("library size " + narCompileMojo.getDependencyLibs(type, test).size());
    for (Iterator<?> it = narCompileMojo.getDependencyLibs(type, test).iterator(); it.hasNext(); ) {
        dependencyLibs.add(buildLibSettings((ILib) it.next()));
    }
    List<NarSysLib> dependencySysLibs = settings.getDependencySysLibs();
    for (Iterator<?> it = narCompileMojo.getDependencySysLibs(type).iterator(); it.hasNext(); ) {
        dependencySysLibs.add(buildSysLibSettings((ISysLib) it.next()));
    }
    List<String> dependencyOptions = settings.getDependencyOptions();
    dependencyOptions.addAll(narCompileMojo.getDependencyOptions(type));
    return settings;
}
Also used : NarLib(com.github.sdedwards.m2e_nar.internal.model.NarLib) NarSysLib(com.github.sdedwards.m2e_nar.internal.model.NarSysLib) ISysLib(com.github.maven_nar.ISysLib) NarBuildArtifact(com.github.sdedwards.m2e_nar.internal.model.NarBuildArtifact) EclipseNarLayout(com.github.maven_nar.EclipseNarLayout) File(java.io.File) ILib(com.github.maven_nar.ILib)

Aggregations

EclipseNarLayout (com.github.maven_nar.EclipseNarLayout)1 ILib (com.github.maven_nar.ILib)1 ISysLib (com.github.maven_nar.ISysLib)1 NarBuildArtifact (com.github.sdedwards.m2e_nar.internal.model.NarBuildArtifact)1 NarLib (com.github.sdedwards.m2e_nar.internal.model.NarLib)1 NarSysLib (com.github.sdedwards.m2e_nar.internal.model.NarSysLib)1 File (java.io.File)1