You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ant.apache.org by bu...@apache.org on 2010/04/12 19:25:16 UTC

DO NOT REPLY [Bug 39554] Make sysproperty a top level element to set system properties of ant

https://issues.apache.org/bugzilla/show_bug.cgi?id=39554

--- Comment #3 from Stephen White <sw...@corefiling.co.uk> 2010-04-12 13:25:13 EDT ---
We have found a need for something similar, to configure the XML parser that
underlies an operation for which we use the <xslt> task.

We have a pretty trivial ant task implementation that allows us to invoke:

<setSystemProperty key="org.apache.xerces.xni.parser.XMLParserConfiguration"
value="org.apache.xerces.parsers.XIncludeParserConfiguration" />

prior to XSLT, and this then allows us to convert docbook (with xincludes) to
HTML using ant's xslt task.

No doubt there are other inventive uses for being able to set system
properties, so we'd like to add a +1 to having this as a standard feature in
ant.

For the record, or for anyone else that wants something similar, our task is
implemented as:

/** A simple Ant task to set a System property. */
public class SetProp extends Task {
  private String _key = null;
  private String _value = null;

  public void execute() throws BuildException {
    System.setProperty(_key, _value);
  }

  public void setKey(final String key) {
    _key = key;
  }

  public void setValue(final String value) {
    _value = value;
  }
}

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.