diff options
author | 2008-04-20 13:17:28 +0000 | |
---|---|---|
committer | 2008-04-20 13:17:28 +0000 | |
commit | 8871a68de193d740ad9c4b7dde77e5d5d5bd8f98 (patch) | |
tree | e30d88dfbb317072678f783f632a02d7f8356a7d | |
parent | Add a cElementTree based build.xml rewriter. (diff) | |
download | javatoolkit-8871a68de193d740ad9c4b7dde77e5d5d5bd8f98.tar.gz javatoolkit-8871a68de193d740ad9c4b7dde77e5d5d5bd8f98.tar.bz2 javatoolkit-8871a68de193d740ad9c4b7dde77e5d5d5bd8f98.zip |
Add encoding for javadoc and reorganize logic.
svn path=/projects/javatoolkit/trunk/; revision=6182
-rwxr-xr-x | src/bsfix/build-xml-rewrite | 28 |
1 files changed, 17 insertions, 11 deletions
diff --git a/src/bsfix/build-xml-rewrite b/src/bsfix/build-xml-rewrite index 4d78b48..61d69ae 100755 --- a/src/bsfix/build-xml-rewrite +++ b/src/bsfix/build-xml-rewrite @@ -21,20 +21,26 @@ gcp_sub = et.Element('classpath', path=gcp_str) for file in args: tree = et.ElementTree(file=file) - for elem in tree.getiterator(): - for c in changes: - elems, attr, value = c - if elem.tag in elems: - elem.attrib[attr] = value - if elem.tag == 'javac': + if gcp or options.encoding: + for javac in tree.getiterator('javac'): if gcp: - elem.attrib['classpath'] = gcp_str + javac.attrib['classpath'] = gcp_str if options.encoding: - elem.attrib['encoding'] = options.encoding - if elem.tag == 'junit': + javac.attrib['encoding'] = options.encoding + for javadoc in tree.getiterator('javadoc'): if gcp: - elem.append(gcp_sub) - elem.attrib['haltonfailure'] = 'true' + javadoc.attrib['classpath'] = gcp_str + if options.encoding: + javadoc.attrib['encoding'] = options.encoding + for c in changes: + elems, attr, value = c + for elem in elems: + for e in tree.getiterator(elem): + e.attrib[attr] = value + for junit in tree.getiterator('junit'): + if gcp: + junit.append(gcp_sub) + junit.attrib['haltonfailure'] = 'true' f = open(file, 'w') tree.write(f) |