Package org.apache.tools.ant

Examples of org.apache.tools.ant.Task


    Object ref = project.getReference(taskref);
    if (!(ref instanceof Task)) {
      throw new BuildException("Reference (" + taskref
          + ") does not refer to a task");
    }
    Task target = (Task) ref;

    // Assign the autowire value for the bean factory
    int autowireValue = AutowireCapableBeanFactory.AUTOWIRE_BY_NAME;
    if (AUTOWIRE_BY_TYPE.equals(autowire)) {
      autowireValue = AutowireCapableBeanFactory.AUTOWIRE_BY_TYPE;
View Full Code Here


     */
    public static void register(ProjectComponent task, final Ivy ivy) {
        MessageLogger current = ivy.getLoggerEngine().peekLogger();
        if (current instanceof AntMessageLogger && task instanceof Task
                && ((AntMessageLogger) current).task instanceof Task) {
            Task currentTask = (Task) ((AntMessageLogger) current).task;

            if ((currentTask.getTaskName() != null)
                    && currentTask.getTaskName().equals(((Task) task).getTaskName())) {
                // The current AntMessageLogger already logs with the same
                // prefix as the given task. So we shouldn't do anything...
                return;
            }
        }
View Full Code Here

    private class MockProject extends Project {
        private Task   task;
        private Target target;

        public MockProject() {
            task = new Task(){
                public void execute() {
                }
            };
            task.setTaskName("testTask");
            target = new Target();
View Full Code Here

        Vector tasks = findElementInTarget(project, t, "description");
        if (tasks == null) {
            return;
        }
        for (int i = 0; i < tasks.size(); i++) {
            Task task = (Task) tasks.elementAt(i);
            if (!(task instanceof UnknownElement)) {
                continue;
            }
            UnknownElement ue = ((UnknownElement) task);
            String descComp = ue.getWrapper().getText().toString();
View Full Code Here

        timedOut = false;

        int threadNumber = 0;
        for (Enumeration e = nestedTasks.elements(); e.hasMoreElements();
             threadNumber++) {
            Task nestedTask = (Task) e.nextElement();
            runnables[threadNumber]
                = new TaskRunnable(nestedTask);
        }

        final int maxRunning = numTasks < numThreads ? numTasks : numThreads;
View Full Code Here

     *
     * @throws BuildException if one of the nested tasks fails.
     */
    public void execute() throws BuildException {
        for (Iterator i = nestedTasks.iterator(); i.hasNext();) {
            Task nestedTask = (Task) i.next();
            nestedTask.perform();
        }
    }
View Full Code Here

            if (timeout == null) {
                run();
            } else {
                thread = new Thread(this, "ExecuteJava");
                Task currentThreadTask
                    = project.getThreadTask(Thread.currentThread());
                project.registerThreadTask(thread, currentThreadTask);
                // if we run into a timout, the run-away thread shall not
                // make the VM run forever - if no timeout occurs, Ant's
                // main thread will still be there to let the new thread
View Full Code Here

    /**
     * @see BuildListener#taskStarted
     */
    public void taskStarted(BuildEvent event) {
        if (initialized) {
            Task task = event.getTask();
            Log log = logFactory.getInstance(task.getClass().getName());
            log.info("Task \"" + task.getTaskName() + "\" started.");
        }
    }
View Full Code Here

    /**
     * @see BuildListener#taskFinished
     */
    public void taskFinished(BuildEvent event) {
        if (initialized) {
            Task task = event.getTask();
            Log log = logFactory.getInstance(task.getClass().getName());
            if (event.getException() == null) {
                log.info("Task \"" + task.getTaskName() + "\" finished.");
            } else {
                log.error("Task \"" + task.getTaskName()
                        + "\" finished with error.", event.getException());
            }
        }
    }
View Full Code Here

    /**
     * @see BuildListener#taskStarted
     */
    public void taskStarted(BuildEvent event) {
        if (initialized) {
            Task task = event.getTask();
            Category cat = Category.getInstance(task.getClass().getName());
            cat.info("Task \"" + task.getTaskName() + "\" started.");
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.tools.ant.Task

Copyright © 2018 www.massapicom. 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.