[fant] r101 committed - * Add a new task to replace property strings...

3 views
Skip to first unread message

codesite...@google.com

unread,
Apr 1, 2010, 11:30:52 PM4/1/10
to fant...@googlegroups.com
Revision: 101
Author: maomaode
Date: Thu Apr 1 20:29:38 2010
Log: * Add a new task to replace property strings
* Add a Java Main task
* Create the package directories

--____________--

A
src/main/java/com/google/ant/extensions/tasks/PropertyTransformerTask.java

http://code.google.com/p/fant/source/detail?r=101

Added:

/trunk/src/main/java/com/google/ant/extensions/tasks/PropertyTransformerTask.java

=======================================
--- /dev/null
+++
/trunk/src/main/java/com/google/ant/extensions/tasks/PropertyTransformerTask.java
Thu Apr 1 20:29:38 2010
@@ -0,0 +1,47 @@
+package com.google.ant.extensions.tasks;
+
+import org.apache.tools.ant.Task;
+
+public class PropertyTransformerTask extends Task {
+ protected String property;
+ protected String expression;
+ protected String source;
+ protected String replacement;
+
+ public void setReplacement(String r) {
+ this.replacement = r;
+ }
+
+ public String getReplacement() {
+ return this.replacement;
+ }
+
+ public void setProperty(String p) {
+ this.property = p;
+ }
+
+ public String getProperty() {
+ return this.property;
+ }
+
+ public void setSource(String s) {
+ this.source = s;
+ }
+
+ public String getSource() {
+ return this.source;
+ }
+
+ public void setExpression(String exp) {
+ this.expression = exp;
+ }
+
+ public String getExpression() {
+ return this.expression;
+ }
+
+ public void execute() {
+ String result = getSource().replaceAll(getExpression(),
getReplacement());
+ getProject().setNewProperty(getProperty(), result);
+ }
+}

Reply all
Reply to author
Forward
0 new messages