This website works better with JavaScript.
Home
Issues
Pull Requests
Milestones
AI流水线
Repositories
Datasets
Forum
实训
竞赛
大数据
AI开发
Register
Sign In
youys
/
ant
Not watched
Unwatch
Watch all
Watch but not notify
1
Star
0
Fork
1
Code
Releases
0
Wiki
Activity
Issues
0
Pull Requests
0
Datasets
Model
Cloudbrain
Browse Source
make scriptcondition behave as documented wrt script return value
master
Matt Benson
3 years ago
parent
c59f8a28c3
commit
413f5c0dea
2 changed files
with
18 additions
and
2 deletions
Split View
Diff Options
Show Stats
Download Patch File
Download Diff File
+2
-2
src/main/org/apache/tools/ant/types/optional/ScriptCondition.java
+16
-0
src/tests/antunit/types/optional/scriptcondition-test.xml
+ 2
- 2
src/main/org/apache/tools/ant/types/optional/ScriptCondition.java
View File
@@ -44,8 +44,8 @@ public class ScriptCondition extends AbstractScriptComponent implements Conditio
@Override
public boolean eval() throws BuildException {
initScriptRunner();
execu
teScript("ant_condition");
return getValue();
final Object result = getRunner().evalua
teScript("ant_condition");
return
Boolean.TRUE.equals(result) ||
getValue();
}
/**
+ 16
- 0
src/tests/antunit/types/optional/scriptcondition-test.xml
View File
@@ -68,4 +68,20 @@
</au:assertFalse>
</target>
<target name="test-return-value-true">
<au:assertTrue>
<scriptcondition language="beanshell">
true
</scriptcondition>
</au:assertTrue>
</target>
<target name="test-return-value-false">
<au:assertTrue>
<scriptcondition language="beanshell" value="true">
false
</scriptcondition>
</au:assertTrue>
</target>
</project>
Write
Preview
Loading…
Cancel
Save