Package org.apache.tools.ant.taskdefs

Examples of org.apache.tools.ant.taskdefs.CallTarget


        public void deliverDependency(ModuleRevisionId depMrid, String version, String status,
                String depStatus) {
            // call deliver target if any
            if (deliverTarget != null && deliverTarget.trim().length() > 0) {

                CallTarget ct = (CallTarget) getProject().createTask("antcall");
                ct.setOwningTarget(getOwningTarget());
                ct.init();
                ct.setTarget(deliverTarget);
                ct.setInheritAll(true);
                ct.setInheritRefs(true);
                Property param = ct.createParam();
                param.setName("dependency.name");
                param.setValue(depMrid.getName());
                param = ct.createParam();
                param.setName("dependency.published.status");
                param.setValue(status);
                param = ct.createParam();
                param.setName("dependency.published.version");
                param.setValue(version);
                param = ct.createParam();
                param.setName("dependency.version");
                param.setValue(depMrid.getRevision());
                param = ct.createParam();
                param.setName("dependency.status");
                param.setValue(depStatus == null ? "null" : depStatus);

                ct.perform();

                String deliveredProperty = depMrid.getName() + "." + depMrid.getRevision()
                        + ".delivered";
                getProject().setProperty(deliveredProperty, "true");
                appendDeliveryList(deliveredProperty + " = true");
View Full Code Here


            return;
        }
        if (onlyonce && isTriggered(event)) {
            Message.verbose("call already triggered for this event, skipping: " + event);
        } else {
            CallTarget call = new CallTarget();

            call.setProject(project);
            call.setTaskName("antcall");

            Map attributes = event.getAttributes();
            String target = IvyPatternHelper.substituteTokens(getTarget(), attributes);
            call.setTarget(target);

            for (Iterator iter = attributes.keySet().iterator(); iter.hasNext();) {
                String key = (String) iter.next();
                String value = (String) attributes.get(key);
                Property p = call.createParam();
                p.setName(prefix == null ? key : prefix + key);
                p.setValue(value == null ? "" : value);
            }

            Message.verbose("triggering ant call: target=" + target + " for " + event);
            call.execute();
            markTriggered(event);

            Message.debug("triggered ant call finished: target=" + target + " for " + event);
        }
    }
View Full Code Here

    /**
     * Call the selected ant task.
     */
    private void antcall (String taskName) {
        CallTarget callee;
        callee = (CallTarget)project.createTask("antcall");
        callee.setOwningTarget(target);
        callee.setTaskName(getTaskName());
        callee.setLocation(location);
        callee.init();
        callee.setTarget(taskName);
        callee.execute();
    }
View Full Code Here

        properties.put(propName, propValue);
    }
    private void executeTarget() {
        /* The "callee" has to be created each time in order to make
        the properties mutable. */
        CallTarget callee;
        callee = (CallTarget)project.createTask("antcall");
        callee.init();
        callee.setTarget(subTarget);
        Enumeration keys = properties.keys();
        while (keys.hasMoreElements()) {
            String key = (String)keys.nextElement();
            String val = (String)properties.get(key);
            Property prop = callee.createParam();
            prop.setName(key);
            prop.setValue(val);
        }
        callee.execute();
    }
View Full Code Here

   
    /**
     * Call the selected ant task.
     */
    private void antcall (String taskName) {
        CallTarget callee;
        callee = (CallTarget)project.createTask("antcall");
        callee.setOwningTarget(target);
        callee.setTaskName(getTaskName());
        callee.setLocation(location);
        callee.init();
        callee.setTarget(taskName);
        callee.execute();
    }
View Full Code Here

        public void deliverDependency(ModuleRevisionId depMrid, String version, String status,
                String depStatus) {
            // call deliver target if any
            if (deliverTarget != null && deliverTarget.trim().length() > 0) {

                CallTarget ct = (CallTarget) getProject().createTask("antcall");
                ct.setOwningTarget(getOwningTarget());
                ct.init();
                ct.setTarget(deliverTarget);
                ct.setInheritAll(true);
                ct.setInheritRefs(true);
                Property param = ct.createParam();
                param.setName("dependency.name");
                param.setValue(depMrid.getName());
                param = ct.createParam();
                param.setName("dependency.published.status");
                param.setValue(status);
                param = ct.createParam();
                param.setName("dependency.published.version");
                param.setValue(version);
                param = ct.createParam();
                param.setName("dependency.version");
                param.setValue(depMrid.getRevision());
                param = ct.createParam();
                param.setName("dependency.status");
                param.setValue(depStatus == null ? "null" : depStatus);

                ct.perform();

                String deliveredProperty = depMrid.getName() + "." + depMrid.getRevision()
                        + ".delivered";
                getProject().setProperty(deliveredProperty, "true");
                appendDeliveryList(deliveredProperty + " = true");
View Full Code Here

         */
        public void execute() throws BuildException
        {
            if (this.target != null)
            {
                CallTarget antCall = (CallTarget) createAntTask("antcall");
                antCall.setInheritAll(true);
                antCall.setInheritRefs(true);
                antCall.init();
                antCall.setTarget(this.target);
                antCall.execute();
            }
            else
            {
                for (Iterator i = this.tasks.iterator(); i.hasNext();)
                {
View Full Code Here

            return;
        }
        if (onlyonce && isTriggered(event)) {
            Message.verbose("call already triggered for this event, skipping: " + event);
        } else {
            CallTarget call = new CallTarget();

            call.setProject(project);
            call.setTaskName("antcall");

            Map attributes = event.getAttributes();
            String target = IvyPatternHelper.substituteTokens(getTarget(), attributes);
            call.setTarget(target);

            for (Iterator iter = attributes.keySet().iterator(); iter.hasNext();) {
                String key = (String) iter.next();
                String value = (String) attributes.get(key);
                Property p = call.createParam();
                p.setName(prefix == null ? key : prefix + key);
                p.setValue(value == null ? "" : value);
            }

            Message.verbose("triggering ant call: target=" + target + " for " + event);
            MessageImpl impl = IvyContext.getContext().getMessageImpl();
            try {
                IvyContext.getContext().setMessageImpl(null);
                call.execute();
                markTriggered(event);
            } finally {
                IvyContext.getContext().setMessageImpl(impl);
            }
View Full Code Here

        public void deliverDependency(ModuleRevisionId depMrid, String version, String status,
                String depStatus) {
            // call deliver target if any
            if (deliverTarget != null && deliverTarget.trim().length() > 0) {

                CallTarget ct = (CallTarget) getProject().createTask("antcall");
                ct.setOwningTarget(getOwningTarget());
                ct.init();
                ct.setTarget(deliverTarget);
                ct.setInheritAll(true);
                ct.setInheritRefs(true);
                Property param = ct.createParam();
                param.setName("dependency.name");
                param.setValue(depMrid.getName());
                param = ct.createParam();
                param.setName("dependency.published.status");
                param.setValue(status);
                param = ct.createParam();
                param.setName("dependency.published.version");
                param.setValue(version);
                param = ct.createParam();
                param.setName("dependency.version");
                param.setValue(depMrid.getRevision());
                param = ct.createParam();
                param.setName("dependency.status");
                param.setValue(depStatus == null ? "null" : depStatus);

                MessageImpl impl = IvyContext.getContext().getMessageImpl();
                try {
                    IvyContext.getContext().setMessageImpl(null);
                    ct.perform();
                } finally {
                    IvyContext.getContext().setMessageImpl(impl);
                }

                String deliveredProperty = depMrid.getName() + "." + depMrid.getRevision()
View Full Code Here

         */
        public void execute() throws BuildException
        {
            if (this.target != null)
            {
                CallTarget antCall = (CallTarget) createAntTask("antcall");
                antCall.setInheritAll(true);
                antCall.setInheritRefs(true);
                antCall.init();
                antCall.setTarget(this.target);
                antCall.execute();
            }
            else
            {
                for (Iterator i = this.tasks.iterator(); i.hasNext();)
                {
View Full Code Here

TOP

Related Classes of org.apache.tools.ant.taskdefs.CallTarget

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.