当前位置: 首页>>代码示例>>Java>>正文


Java StreamConsumer类代码示例

本文整理汇总了Java中org.codehaus.plexus.util.cli.StreamConsumer的典型用法代码示例。如果您正苦于以下问题:Java StreamConsumer类的具体用法?Java StreamConsumer怎么用?Java StreamConsumer使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


StreamConsumer类属于org.codehaus.plexus.util.cli包,在下文中一共展示了StreamConsumer类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: createCppCheckRunner

import org.codehaus.plexus.util.cli.StreamConsumer; //导入依赖的package包/类
private CppCheckRunner createCppCheckRunner( VCProject vcProject, StreamConsumer streamConsumer ) 
        throws MojoExecutionException
{
    CppCheckRunner cppCheckRunner = new CppCheckRunner( cppCheck.getCppCheckPath(), streamConsumer, getLog() );
    cppCheckRunner.setWorkingDirectory( vcProject.getBaseDirectory() );
    cppCheckRunner.setStandardInputString( getSourcesForStdin( vcProject ) );
    cppCheckRunner.setCppCheckType( cppCheck.getCppCheckType() );
    cppCheckRunner.setIncludeDirectories( getRelativeIncludeDirectories( vcProject ) );
    cppCheckRunner.setPreprocessorDefs( vcProject.getPreprocessorDefs() );
    
    return cppCheckRunner;
}
 
开发者ID:andi12,项目名称:msbuild-maven-plugin,代码行数:13,代码来源:CppCheckMojo.java

示例2: createEnvs

import org.codehaus.plexus.util.cli.StreamConsumer; //导入依赖的package包/类
protected Map createEnvs( String commonToolEnvKey, String platform )
    throws NativeBuildException
{

    File tmpEnvExecFile = null;
    try
    {
        File vsCommonToolDir = this.getCommonToolDirectory( commonToolEnvKey );

        File vsInstallDir = this.getVisualStudioInstallDirectory( vsCommonToolDir );

        if ( !vsInstallDir.isDirectory() )
        {
            throw new NativeBuildException( vsInstallDir.getPath() + " is not a directory." );
        }

        tmpEnvExecFile = this.createEnvWrapperFile( vsInstallDir, platform );

        Commandline cl = new Commandline();
        cl.setExecutable( tmpEnvExecFile.getAbsolutePath() );

        EnvStreamConsumer stdout = new EnvStreamConsumer();
        StreamConsumer stderr = new DefaultConsumer();

        CommandLineUtils.executeCommandLine( cl, stdout, stderr );

        return stdout.getParsedEnv();
    }
    catch ( Exception e )
    {
        throw new NativeBuildException( "Unable to retrieve env", e );
    }
    finally
    {
        if ( tmpEnvExecFile != null )
        {
            tmpEnvExecFile.delete();
        }
    }

}
 
开发者ID:mojohaus,项目名称:maven-native,代码行数:42,代码来源:AbstractMSVCEnvFactory.java

示例3: setOut

import org.codehaus.plexus.util.cli.StreamConsumer; //导入依赖的package包/类
public JavaCommand setOut(StreamConsumer out)
{
	this.out = out;
	return this;
}
 
开发者ID:CruxFramework,项目名称:crux-maven-plugin,代码行数:6,代码来源:JavaCommand.java

示例4: setErr

import org.codehaus.plexus.util.cli.StreamConsumer; //导入依赖的package包/类
public JavaCommand setErr(StreamConsumer err)
{
	this.err = err;
	return this;
}
 
开发者ID:CruxFramework,项目名称:crux-maven-plugin,代码行数:6,代码来源:JavaCommand.java

示例5: executeReport

import org.codehaus.plexus.util.cli.StreamConsumer; //导入依赖的package包/类
/**
 * @param unusedLocale the wanted locale (actually unused).
 * @throws MavenReportException if any
 */
protected void executeReport( Locale unusedLocale )
    throws MavenReportException
{

    File config = buildConfigurationFile();

    Commandline cli = new Commandline();
    cli.setWorkingDirectory( getBasedir().getAbsolutePath() );
    cli.setExecutable( getExecutablePath() );
    cli.createArgument().setValue( config.getAbsolutePath() );

    Writer stringWriter = new StringWriter();
    StreamConsumer out = new WriterStreamConsumer( stringWriter );
    StreamConsumer err = new WriterStreamConsumer( stringWriter );

    try
    {
        int returnCode = CommandLineUtils.executeCommandLine( cli, out, err );

        if ( !isQuiet() )
        {
            // Get all output from doxygen and put it to the log out of Maven.
            String[] lines = stringWriter.toString().split( "\n" );
            for ( int i = 0; i < lines.length; i++ )
            {
                lines[i] = lines[i].replaceAll( "\n|\r", "" );
                getLog().info( "doxygen: " + lines[i] );
            }
        }

        if ( returnCode != 0 )
        {
            throw new MavenReportException( "Failed to generate Doxygen documentation." );
        }

    }
    catch ( CommandLineException ex )
    {
        throw new MavenReportException( "Error while executing Doxygen.", ex );
    }

}
 
开发者ID:khmarbaise,项目名称:doxygen-maven-plugin,代码行数:47,代码来源:AbstractDoxygenMojo.java

示例6: CommandLineRunner

import org.codehaus.plexus.util.cli.StreamConsumer; //导入依赖的package包/类
/**
 * Create a new command-line process runner.
 * @param processName the name of the process being run (for log messages)
 * @param outputConsumer a consumer for the process' standard output 
 * @param errorConsumer a consumer for the process' standard error 
 * @see uk.org.raje.maven.plugin.msbuild.streamconsumers.StdoutStreamToLog
 * @see uk.org.raje.maven.plugin.msbuild.streamconsumers.StderrStreamToLog
 */
public CommandLineRunner( String processName, StreamConsumer outputConsumer, StreamConsumer errorConsumer )
{
    this.processName = processName;
    this.outputConsumer = outputConsumer;
    this.errorConsumer = errorConsumer;
}
 
开发者ID:andi12,项目名称:msbuild-maven-plugin,代码行数:15,代码来源:CommandLineRunner.java

示例7: setSystemOut

import org.codehaus.plexus.util.cli.StreamConsumer; //导入依赖的package包/类
/**
 * Sets the stream consumer used to handle messages from
 * <code>System.out</code>.
 *
 * @param consumer
 *        The stream consumer, may be <code>null</code> to discard the output.
 */
public void setSystemOut (final StreamConsumer consumer)
{
  this.systemOut = consumer;
}
 
开发者ID:phax,项目名称:ph-javacc-maven-plugin,代码行数:12,代码来源:ForkedJvm.java

示例8: setSystemErr

import org.codehaus.plexus.util.cli.StreamConsumer; //导入依赖的package包/类
/**
 * Sets the stream consumer used to handle messages from
 * <code>System.err</code>.
 *
 * @param consumer
 *        The stream consumer, may be <code>null</code> to discard the output.
 */
public void setSystemErr (final StreamConsumer consumer)
{
  this.systemErr = consumer;
}
 
开发者ID:phax,项目名称:ph-javacc-maven-plugin,代码行数:12,代码来源:ForkedJvm.java

示例9: CppCheckRunner

import org.codehaus.plexus.util.cli.StreamConsumer; //导入依赖的package包/类
/**
 * Construct the CppCheckRunner
 * @param cppCheckPath the path to CppCheck.exe
 * @param reportConsumer a StreamConsumer to write the report to
 * @param log the Maven Log to use
 */
public CppCheckRunner( File cppCheckPath, StreamConsumer reportConsumer, Log log )
{
    super( CppCheckConfiguration.TOOL_NAME, new StdoutStreamToLog( log ), reportConsumer );
    this.cppCheckPath = cppCheckPath;
}
 
开发者ID:andi12,项目名称:msbuild-maven-plugin,代码行数:12,代码来源:CppCheckMojo.java


注:本文中的org.codehaus.plexus.util.cli.StreamConsumer类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。