peterreilly 2003/12/23 07:49:37
Modified: src/main/org/apache/tools/ant/taskdefs/optional Tag:
ANT_16_BRANCH Script.java
Log:
sync with HEAD
Revision Changes Path
No revision
No revision
1.24.2.1 +18 -6
ant/src/main/org/apache/tools/ant/taskdefs/optional/Script.java
Index: Script.java
===================================================================
RCS file:
/home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/optional/Script.java,v
retrieving revision 1.24
retrieving revision 1.24.2.1
diff -u -r1.24 -r1.24.2.1
--- Script.java 17 Sep 2003 20:11:43 -0000 1.24
+++ Script.java 23 Dec 2003 15:49:37 -0000 1.24.2.1
@@ -65,15 +65,28 @@
* @author Sam Ruby <a href="mailto:[EMAIL PROTECTED]">[EMAIL PROTECTED]</a>
*/
public class Script extends Task {
- /** Used to run the script */
- private ScriptRunner runner = new ScriptRunner();
+ private String language;
+ private File src;
+ private String text;
+
/**
* Do the work.
*
* @exception BuildException if something goes wrong with the build
*/
public void execute() throws BuildException {
+ ScriptRunner runner = new ScriptRunner();
+ if (language != null) {
+ runner.setLanguage(language);
+ }
+ if (src != null) {
+ runner.setSrc(src);
+ }
+ if (text != null) {
+ runner.addText(text);
+ }
+
runner.addBeans(getProject().getProperties());
runner.addBeans(getProject().getUserProperties());
runner.addBeans(getProject().getTargets());
@@ -91,7 +104,7 @@
* @param language the scripting language name for the script.
*/
public void setLanguage(String language) {
- runner.setLanguage(language);
+ this.language = language;
}
/**
@@ -100,8 +113,7 @@
* @param fileName the name of the file containing the script source.
*/
public void setSrc(String fileName) {
- File file = new File(fileName);
- runner.setSrc(file);
+ this.src = new File(fileName);
}
/**
@@ -110,6 +122,6 @@
* @param text a component of the script text to be added.
*/
public void addText(String text) {
- runner.addText(text);
+ this.text = text;
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]