Examples of addBuildListener()


Examples of org.apache.tools.ant.Project.addBuildListener()

            // the properties echoed out in the log (e.g. if they contain sensitive passwords)
            // we should do this after we set the properties.
            project.addBuildListener(new LoggerAntBuildListener(target, logFileOutput, Project.MSG_DEBUG));
            if (logStdOut) {
                PrintWriter stdout = new PrintWriter(System.out);
                project.addBuildListener(new LoggerAntBuildListener(target, stdout, Project.MSG_INFO));
            }

            if (properties != null) {
                for (Map.Entry<Object, Object> property : properties.entrySet()) {
                    project.setProperty(property.getKey().toString(), property.getValue().toString());
View Full Code Here

Examples of org.apache.tools.ant.Project.addBuildListener()

                project.setProperty(property.getKey().toString(), property.getValue().toString());
            }

            // notice we add our listener after we set the properties - we do not want the password to be in the log file
            // our dbupgrade script will echo the property settings, so we can still get the other values
            project.addBuildListener(new LoggerAntBuildListener(logFileOutput));

            for (Map.Entry<Object, Object> taskDef : taskDefs.entrySet()) {
                project.addTaskDefinition(taskDef.getKey().toString(), Class.forName(taskDef.getValue().toString(),
                    true, classLoader));
            }
View Full Code Here

Examples of org.apache.tools.ant.Project.addBuildListener()

        MockControl prCtrl = MockClassControl.createControl(Project.class);
        prCtrl.setDefaultMatcher(MockControl.ALWAYS_MATCHER);
        Project project = (Project)prCtrl.getMock();
        project.setNewProperty("prop", "true");
        prCtrl.setVoidCallable(2);
        project.addBuildListener(null);
        prCtrl.setVoidCallable(3);

        MockControl xhCtrl = MockClassControl.createControl(XharnessTask.class);
        XharnessTask xhTask = (XharnessTask)xhCtrl.getMock();
        xhTask.getName();
View Full Code Here

Examples of org.apache.tools.ant.Project.addBuildListener()

     
      Project project=new Project();
     
      AntServletLogger log=new AntServletLogger();
      log.setWriter( out );
      project.addBuildListener( log );
     
      project.init();

      Enumeration argsE=args.propertyNames();
      while( argsE.hasMoreElements() ) {
View Full Code Here

Examples of org.apache.tools.ant.Project.addBuildListener()

        Project project = new Project();
        DefaultLogger logger = new DefaultLogger();
        logger.setOutputPrintStream(System.out);
        logger.setErrorPrintStream(System.err);
        logger.setMessageOutputLevel(Project.MSG_INFO);
        project.addBuildListener(logger);
        project.init();
        task.setProject(project);
        /* getResourceAsStream override unnecessary on JDK 7. Ought to work around JAXP #6723276 in JDK 6, but causes a TypeCheckError in FunctionCall for reasons TBD:
        Thread.currentThread().setContextClassLoader(new ClassLoader(ClassLoader.getSystemClassLoader().getParent()) {
            public InputStream getResourceAsStream(String name) {
View Full Code Here

Examples of org.apache.tools.ant.Project.addBuildListener()

    @Test
    public void testLogBlankEcho() {
        Project p = new Project();
        p.init();
        EchoTestLogger logger = new EchoTestLogger();
        p.addBuildListener(logger);
        Echo echo = new Echo();
        echo.setProject(p);
        echo.setTaskName("testLogBlankEcho");
        echo.execute();
        assertEquals("[testLogBlankEcho] ", logger.lastLoggedMessage );
View Full Code Here

Examples of org.apache.tools.ant.Project.addBuildListener()

    @Test
    public void testLogUTF8Echo() throws IOException {
        Project p = new Project();
        p.init();
        EchoTestLogger logger = new EchoTestLogger();
        p.addBuildListener(logger);
        Echo echo = new Echo();
        echo.setProject(p);
        echo.setTaskName("testLogUTF8Echo");
        echo.setMessage("\u00e4\u00a9");
        removeThis = new File("abc.txt");
View Full Code Here

Examples of org.apache.tools.ant.Project.addBuildListener()

        if (showOutput) {
            DefaultLogger consoleLogger = new DefaultLogger();
            consoleLogger.setErrorPrintStream(System.err);
            consoleLogger.setOutputPrintStream(System.out);
            consoleLogger.setMessageOutputLevel(Project.MSG_INFO);
            p.addBuildListener(consoleLogger);
        }

        try {
            p.fireBuildStarted();
            p.init();
View Full Code Here

Examples of org.apache.tools.ant.Project.addBuildListener()

    //  Deal with GANT-80 by getting all the the loggers from the Ant instance Project object and adding
    //  them to the new Project Object.  This was followed up by GANT-91 so the code was amended to copying
    //  over all listeners except the class loader if present.
    for ( final Object o : antProject.getBuildListeners ( ) ) {
      final BuildListener listener = (BuildListener) o ;
      if ( ! ( listener instanceof AntClassLoader ) ) { newProject.addBuildListener ( listener ) ; }
    }
    //  Deal with GANT-50 by getting the base directory from the Ant instance Project object and use it for
    //  the new Project object.  GANT-93 leads to change in the way the Gant file is extracted.
    newProject.setBaseDir ( antProject.getBaseDir ( ) ) ;
    //  Deal with GANT-110 by using the strategy proposed by Eric Van Dewoestine.
View Full Code Here

Examples of org.apache.tools.ant.Project.addBuildListener()

        Project project = new Project();
        DefaultLogger consoleLogger = new DefaultLogger();
        consoleLogger.setErrorPrintStream(System.err);
        consoleLogger.setOutputPrintStream(System.out);
        consoleLogger.setMessageOutputLevel(Project.MSG_INFO);
        project.addBuildListener(consoleLogger);
        Path path = new Path(project);
        File[] jars = FileUtils.newFile(activeMqHome + "\\lib").listFiles(new FilenameWildcardFilter("*.jar"));
        path.add(new Path(project, FileUtils.newFile(activeMqHome, "\\conf").getAbsolutePath()));
        for (int i = 0; i < jars.length; i++)
        {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.