ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 39554] Make sysproperty a top level element to set system properties of ant
Date Mon, 12 Apr 2010 17:25:16 GMT
https://issues.apache.org/bugzilla/show_bug.cgi?id=39554

--- Comment #3 from Stephen White <swhite-asfbugs@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.

Mime
View raw message