Examples of RuntimeConfigurable


Examples of org.apache.tools.ant.RuntimeConfigurable

            t.setProject(getProject());
            ret.setOwningTarget(t);
        } else {
            ret.setOwningTarget(getOwningTarget());
        }
        RuntimeConfigurable rc = new RuntimeConfigurable(
            ret, ue.getTaskName());
        rc.setPolyType(ue.getWrapper().getPolyType());
        Map<String, Object> m = ue.getWrapper().getAttributeMap();
        for (Map.Entry<String, Object> entry : m.entrySet()) {
            rc.setAttribute(
                entry.getKey(),
                macroSubs((String) entry.getValue(), localAttributes));
        }
        rc.addText(macroSubs(ue.getWrapper().getText().toString(),
                             localAttributes));

        Enumeration<RuntimeConfigurable> e = ue.getWrapper().getChildren();
        while (e.hasMoreElements()) {
            RuntimeConfigurable r = e.nextElement();
            UnknownElement unknownElement = (UnknownElement) r.getProxy();
            String tag = unknownElement.getTaskType();
            if (tag != null) {
                tag = tag.toLowerCase(Locale.ENGLISH);
            }
            MacroDef.TemplateElement templateElement =
View Full Code Here

Examples of org.apache.tools.ant.RuntimeConfigurable

        throw new UnsupportedOperationException();
    }

    private synchronized void hijackId() {
        if (id == null) {
            RuntimeConfigurable wrapper = getWrapper();
            id = wrapper.getId();
            if (id == null) {
                throw new IllegalStateException(getTaskName() + " attribute 'id' unset");
            }
            wrapper.setAttribute("id", null);
            wrapper.removeAttribute("id");
            wrapper.setElementTag("augmented reference \"" + id + "\"");
        }
    }
View Full Code Here

Examples of org.apache.tools.ant.RuntimeConfigurable

     * @see https://issues.apache.org/bugzilla/show_bug.cgi?id=50894
     */
    private synchronized void restoreWrapperId() {
        if (id != null) {
            log("restoring augment wrapper " + id, Project.MSG_DEBUG);
            RuntimeConfigurable wrapper = getWrapper();
            wrapper.setAttribute("id", id);
            wrapper.setElementTag(getTaskName());
            id = null;
        }
    }
View Full Code Here

Examples of org.apache.tools.ant.RuntimeConfigurable

     * @param el the element this attribute is in.
     * @return a map of attributes.
     */
    protected Map getParams(UnknownElement el) {
        Map ret = new HashMap();
        RuntimeConfigurable rc = el.getWrapper();
        Map attributes = rc.getAttributeMap(); // This does a copy!
        for (Iterator i = attributes.entrySet().iterator(); i.hasNext();) {
            Map.Entry entry = (Map.Entry) i.next();
            String key = (String) entry.getKey();
            String value = (String) entry.getValue();
            if (key.startsWith("ant-attribute:param")) {
View Full Code Here

Examples of org.apache.tools.ant.RuntimeConfigurable

    public UnknownElement getNestedTask() {
        UnknownElement ret = new UnknownElement("sequential");
        ret.setTaskName("sequential");
        ret.setNamespace("");
        ret.setQName("sequential");
        new RuntimeConfigurable(ret, "sequential");
        final int size = nestedSequential.getNested().size();
        for (int i = 0; i < size; ++i) {
            UnknownElement e =
                (UnknownElement) nestedSequential.getNested().get(i);
            ret.addChild(e);
View Full Code Here

Examples of org.apache.tools.ant.RuntimeConfigurable

                Path classpath = getClasspath() != null ? getClasspath() : new Path(getProject());
                // extract joint options, some get pushed up...
                List<String> jointOptions = new ArrayList<String>();
                if (jointCompilation) {
                    RuntimeConfigurable rc = javac.getRuntimeConfigurableWrapper();
                    for (Iterator i = rc.getAttributeMap().entrySet().iterator(); i.hasNext();) {
                        final Map.Entry e = (Map.Entry) i.next();
                        final String key = e.getKey().toString();
                        final String value = getProject().replaceProperties(e.getValue().toString());
                        if (key.contains("debug")) {
                            String level = "";
                            if (javac.getDebugLevel() != null) {
                                level = ":" + javac.getDebugLevel();
                            }
                            jointOptions.add("-Fg" + level);
                        } else if (key.contains("debugLevel")) {
                            // ignore, taken care of in debug
                        } else if ((key.contains("nowarn"))
                                || (key.contains("verbose"))
                                || (key.contains("deprecation"))) {
                            // false is default, so something to do only in true case
                            if ("on".equalsIgnoreCase(value) || "true".equalsIgnoreCase(value) || "yes".equalsIgnoreCase("value"))
                                jointOptions.add("-F" + key);
                        } else if (key.contains("classpath")) {
                            classpath.add(javac.getClasspath());
                        } else if ((key.contains("depend"))
                                || (key.contains("extdirs"))
                                || (key.contains("encoding"))
                                || (key.contains("source"))
                                || (key.contains("target"))
                                || (key.contains("verbose"))) { // TODO remove extra verbose?
                            jointOptions.add("-J" + key + "=" + value);
                        } else {
                            log("The option " + key + " cannot be set on the contained <javac> element. The option will be ignored", Project.MSG_WARN);
                        }
                        // includes? excludes?
                    }
                    // ant's <javac> supports nested <compilerarg value=""> elements (there can be multiple of them)
                    // for additional options to be passed to javac.
                    Enumeration children = rc.getChildren();
                    while (children.hasMoreElements()) {
                        RuntimeConfigurable childrc = (RuntimeConfigurable) children.nextElement();
                        if(childrc.getElementTag().equals("compilerarg")) {
                            for (Iterator i = childrc.getAttributeMap().entrySet().iterator(); i.hasNext();) {
                                final Map.Entry e = (Map.Entry) i.next();
                                final String key = e.getKey().toString();
                                if(key.equals("value")) {
                                    final String value = getProject().replaceProperties(e.getValue().toString());
                                    StringTokenizer st = new StringTokenizer(value, " ");
View Full Code Here

Examples of org.apache.tools.ant.RuntimeConfigurable

   *
   * @param iter the iterator over {@link RuntimeConfigurable} child task
   */
  protected void addLostChildren(final Iterator iter) {
    while (iter.hasNext()) {
      final RuntimeConfigurable child = (RuntimeConfigurable) iter.next();
      addChild(new StepResult(child));
    }
  }
View Full Code Here

Examples of org.apache.tools.ant.RuntimeConfigurable

   * Tries to find the child tasks that haven't been executed and adds them to the current result.
   *
   * @param task the failing task
   */
  protected void addNotExecutedChildren(final Task task) {
    final RuntimeConfigurable taskWrapper = task.getRuntimeConfigurableWrapper();
    // may happens that no wrapper is available when the task has not been created by ant
    // like for some special WebTest tasks (that should probably disappear)
    if (taskWrapper == null) {
      LOG.debug("No wrapper found for task " + task + ", skipping lost children search");
      return;
    }

    final int iNbKnownChildren = getChildren().size();

    final List children = EnumerationUtils.toList(taskWrapper.getChildren());
    if (iNbKnownChildren < children.size()) {
      addLostChildren(children.listIterator(iNbKnownChildren));
    }

  }
View Full Code Here

Examples of org.apache.tools.ant.RuntimeConfigurable

    group.setLocation(getLocation());
    group.setOwningTarget(getOwningTarget());
    group.setDescription(description);

        final RuntimeConfigurable wrapper = new RuntimeConfigurable(group, "group");
        wrapper.setAttribute("description", description);

        // copy the children: both the UnknownElement and the associated RuntimeConfigurable
        final Enumeration e = getRuntimeConfigurableWrapper().getChildren();
        while (e.hasMoreElements())
        {
            final RuntimeConfigurable r = (RuntimeConfigurable) e.nextElement();
            final UnknownElement unknownElement = (UnknownElement) r.getProxy();
            final UnknownElement copy = copy(unknownElement);
            group.addTask(copy);
            wrapper.addChild(copy.getWrapper());
        }
View Full Code Here

Examples of org.apache.tools.ant.RuntimeConfigurable

    ret.setTaskType(ue.getTaskType());
    ret.setTaskName(ue.getTaskName());
    ret.setLocation(ue.getLocation());
    ret.setOwningTarget(getOwningTarget());
   
    final RuntimeConfigurable rc = new RuntimeConfigurable(ret, ue.getTaskName());
    rc.setPolyType(ue.getWrapper().getPolyType());
   
    final Map m = ue.getWrapper().getAttributeMap();
    for (final Iterator i = m.entrySet().iterator(); i.hasNext();)
    {
      final Map.Entry entry = (Map.Entry) i.next();
      rc.setAttribute((String) entry.getKey(), (String) entry.getValue());
    }
    rc.addText(ue.getWrapper().getText().toString());
   
    final Enumeration e = ue.getWrapper().getChildren();
    while (e.hasMoreElements())
    {
      final RuntimeConfigurable r = (RuntimeConfigurable) e.nextElement();
      final UnknownElement unknownElement = (UnknownElement) r.getProxy();
      final UnknownElement child = copy(unknownElement);
      rc.addChild(child.getWrapper());
      ret.addChild(child);
    }
    return ret;
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.