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


Java BuildLogger.setMessageOutputLevel方法代码示例

本文整理汇总了Java中org.apache.tools.ant.BuildLogger.setMessageOutputLevel方法的典型用法代码示例。如果您正苦于以下问题:Java BuildLogger.setMessageOutputLevel方法的具体用法?Java BuildLogger.setMessageOutputLevel怎么用?Java BuildLogger.setMessageOutputLevel使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.tools.ant.BuildLogger的用法示例。


在下文中一共展示了BuildLogger.setMessageOutputLevel方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: createProject

import org.apache.tools.ant.BuildLogger; //导入方法依赖的package包/类
/**
 * @return Factory method to create new Project instances
 */
protected static Project createProject() {
    final Project project = new Project();

    final ProjectHelper helper = ProjectHelper.getProjectHelper();
    project.addReference(ProjectHelper.PROJECTHELPER_REFERENCE, helper);
    helper.getImportStack().addElement("AntBuilder"); // import checks that stack is not empty 

    final BuildLogger logger = new NoBannerLogger();

    logger.setMessageOutputLevel(org.apache.tools.ant.Project.MSG_INFO);
    logger.setOutputPrintStream(System.out);
    logger.setErrorPrintStream(System.err);

    project.addBuildListener(logger);

    project.init();
    project.getBaseDir();
    return project;
}
 
开发者ID:apache,项目名称:groovy,代码行数:23,代码来源:AntBuilder.java

示例2: createProject

import org.apache.tools.ant.BuildLogger; //导入方法依赖的package包/类
/**
 * Creates and configures Ant project for Java task.
 * 
 * @return Ant project for Java task
 */
protected Project createProject()
{
    final Project result = new Project();

    final ProjectHelper helper = ProjectHelper.getProjectHelper();
    result.addReference( ProjectHelper.PROJECTHELPER_REFERENCE, helper );
    helper.getImportStack().addElement( "AntBuilder" ); // import checks that stack is not empty

    final BuildLogger logger = new NoBannerLogger();

    logger.setMessageOutputLevel( Project.MSG_INFO );
    logger.setOutputPrintStream( System.out );
    logger.setErrorPrintStream( System.err );

    result.addBuildListener( logger );

    result.init();
    result.setDefaultInputStream( System.in ); // for interactive commands, like "shell", needs more work!
    return result;
}
 
开发者ID:sbtrun-maven-plugin,项目名称:sbtrun-maven-plugin,代码行数:26,代码来源:AbstractAntJavaBasedMojo.java

示例3: createProject

import org.apache.tools.ant.BuildLogger; //导入方法依赖的package包/类
protected Project createProject()
{
    final Project project = new Project();

    final ProjectHelper helper = ProjectHelper.getProjectHelper();
    project.addReference( ProjectHelper.PROJECTHELPER_REFERENCE, helper );
    helper.getImportStack().addElement( "AntBuilder" ); // import checks that stack is not empty

    final BuildLogger logger = new NoBannerLogger();

    logger.setMessageOutputLevel( Project.MSG_INFO );
    logger.setOutputPrintStream( System.out );
    logger.setErrorPrintStream( System.err );

    project.addBuildListener( logger );

    project.init();
    project.getBaseDir();
    return project;
}
 
开发者ID:play1-maven-plugin,项目名称:play1-maven-plugin,代码行数:21,代码来源:AbstractAntJavaBasedPlayMojo.java

示例4: execute

import org.apache.tools.ant.BuildLogger; //导入方法依赖的package包/类
/**
 * Executes this task.
 */
@SuppressWarnings("rawtypes")
public void execute() {
    if (logLevel == -1) {
        throw new BuildException("You must specify a log level");
    }

    Vector listeners = this.getProject().getBuildListeners();
    for (Iterator i = listeners.iterator(); i.hasNext();) {
        BuildListener listener = (BuildListener) i.next();

        if (listener instanceof BuildLogger) {
            BuildLogger logger = (BuildLogger) listener;
            logger.setMessageOutputLevel(logLevel);
        }
    }
}
 
开发者ID:SSEHUB,项目名称:spassMeter,代码行数:20,代码来源:SetLogLevelTask.java

示例5: runProxyGenerateTask

import org.apache.tools.ant.BuildLogger; //导入方法依赖的package包/类
/**
 * Run the task.
 *
 * @param outputDir
 *            the output directory.
 * @param destinationPackage
 *            the destination package name.
 * @throws IOException
 */
private void runProxyGenerateTask(final File outputDir, final String destinationPackage)
        throws IOException {
    final BuildLogger logger = new DefaultLogger();
    logger.setMessageOutputLevel(Project.MSG_INFO);
    logger.setOutputPrintStream(System.out);
    logger.setErrorPrintStream(System.out);
    logger.setEmacsMode(true);

    final ProjectHelper ph = ProjectHelper.getProjectHelper();
    final Project p = new Project();
    p.addBuildListener(logger);
    p.init();
    p.addReference("ant.projectHelper", ph);

    final URL[] urls =
            ((URLClassLoader) (Thread.currentThread().getContextClassLoader())).getURLs();
    final StringBuffer classPath = new StringBuffer();
    for (final URL url : urls) {
        classPath.append(new File(url.getPath()));
        classPath.append(System.getProperty("path.separator"));
    }
    classPath.append("src/test/resources/test-webservices.jar");

    // set properties
    p.setUserProperty("client.src.dir", outputDir.getAbsolutePath());
    p.setUserProperty("task.classpath", classPath.toString());

    if (destinationPackage != null) {
        p.setUserProperty("destinationPackage", destinationPackage);
    }

    ph.parse(p, new File("src/test/resources/restProxyGenBuild.xml"));
    p.executeTarget("restProxyGen");

    // ensure all files are generated
    final Set<String> expectedFiles =
            new HashSet<>(FileUtils.readLines(new File(
                    "src/test/resources/test-weservices-files.txt")));
    final File packageDir =
            new File(outputDir, destinationPackage.replaceAll("\\.", File.separator));
    final Set<String> actualFiles = new HashSet<String>();
    for (final File file : packageDir.listFiles()) {
        if (file.isFile()) {
            actualFiles.add(file.getName());
        }
    }

    assertEquals(expectedFiles, actualFiles);
}
 
开发者ID:strandls,项目名称:alchemy-rest-client-generator,代码行数:59,代码来源:RestProxyGeneratorTest.java


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