[ 
http://jira.codehaus.org/browse/MOJO-1647?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=257405#action_257405
 ] 

Clément Igonet edited comment on MOJO-1647 at 2/23/11 4:09 AM:
---------------------------------------------------------------

I suggest to create BCCResourceCompiler class in maven-native-bcc module (based 
on - MSVCResourceCompiler in maven-native-msvc module)

{code:java}
package org.codehaus.mojo.natives.bcc;

import java.io.File;

import org.codehaus.mojo.natives.NativeBuildException;
import org.codehaus.mojo.natives.compiler.AbstractResourceCompiler;
import org.codehaus.mojo.natives.compiler.ResourceCompilerConfiguration;
import org.codehaus.mojo.natives.util.EnvUtil;
import org.codehaus.plexus.util.cli.Commandline;

public class BCCResourceCompiler
    extends AbstractResourceCompiler
{
    protected Commandline getCommandLine( ResourceCompilerConfiguration config, 
File source )
        throws NativeBuildException
    {
        Commandline cl = new Commandline();
        EnvUtil.setupCommandlineEnv( cl, config.getEnvFactory() );

        if ( config.getWorkingDirectory() != null )
        {
            cl.setWorkingDirectory( config.getWorkingDirectory().getPath() );
        }

        if ( config.getExecutable() == null || 
config.getExecutable().trim().length() == 0 )
        {
           config.setExecutable ( "brcc32.exe" );
        }
        cl.setExecutable(config.getExecutable().trim());
        cl.addArguments( config.getOptions() );

        for ( int i = 0; i < config.getIncludePaths().length; ++i )
        {
            String includePath = config.getIncludePaths()[i].getPath();
            cl.createArg().setValue( "-i" );
            cl.createArg().setValue( includePath );
        }

        for ( int i = 0; i < config.getSystemIncludePaths().length; ++i )
        {
            String includePath = config.getSystemIncludePaths()[i].getPath();
            cl.createArg().setValue( "-i" );
            cl.createArg().setValue( includePath );
        }

        cl.createArg().setValue( "-fo" );
        cl.createArg().setValue( config.getOutputFile( source ).getPath() );
        cl.createArg().setValue( source.getPath() );
        return cl;
    }
}
{code}

... and add this lines in components.xml:
{code}

<component>
    <role>org.codehaus.mojo.natives.compiler.ResourceCompiler</role>
    <role-hint>bcc</role-hint>
    
<implementation>org.codehaus.mojo.natives.bcc.BCCResourceCompiler</implementation>
</component>
{code}

      was (Author: clement.igonet):
    .
  
> native-maven-plugin - bcc compilerProvider not fully implemented
> ----------------------------------------------------------------
>
>                 Key: MOJO-1647
>                 URL: http://jira.codehaus.org/browse/MOJO-1647
>             Project: Mojo
>          Issue Type: Bug
>          Components: native
>         Environment: Windows XP - Java 1.6 - Maven 2.0 - Borland C++ Builder
>            Reporter: Clément Igonet
>
> When compileProvder is defined as "bcc", the resource compiler used is rc.exe
> Whereas, it exists brcc32(.exe) compiler for Borland with specific way to 
> define options.
> brcc32 -help is pretty clear:
> {code}
> Borland Resource Compiler  Version 5.40
> Copyright (c) 1990, 1999 Inprise Corporation.  All rights reserved.
> Syntax: brcc32 [options ...] filename
>   options marked with a '*' are on by default
>   @<filename>        Take instructions from command file
>   -r                    (ignored for compatibility)
>   -16                   Build 16-bit Windows compatible .res file
>   -32                 * Build 32-bit Windows compatible .res file
>   -fofilename           Set output filename
>   -v                    Verbose
>   -ipath                Set include path
>   -dname[=string]       Define #define
>   -x                    Ignore INCLUDE environment variable
>   -m                    Enable multi-byte character support
>   -cdddd                set default code page to nnnn
>   -lxxxx                set default language to xxxx
>   -31   Provided for downward compatibility (build 16-bit .res file)
>   -w32  Provided for downward compatibility (build 16-bit .res file)
>   -? or -h              Display this message
> {code}

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira



---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply via email to