1 package org.antmod.tasks; 2 3 import org.apache.tools.ant.BuildException; 4 import org.apache.tools.ant.Task; 5 6 22 public class ReplacePropertyTask extends Task { 23 private String name; 24 private String value; 25 private int depth = 0; 26 27 32 public void setDepth(int depth) { 33 this.depth = depth; 34 } 35 36 41 public void setName(String name) { 42 this.name = name; 43 } 44 45 50 public void setValue(String value) { 51 this.value = value; 52 } 53 54 61 public void execute() throws BuildException { 62 String newValue = this.value; 63 for (int i = depth; i-- > 0;) { 64 newValue = getProject().replaceProperties(newValue); 65 } 66 getProject().setProperty(this.name, newValue); 67 } 68 } 69 | Popular Tags |