After fiddling further i have found this workaround:
-
target name=pre
script language=javascript
var expr = 'function doPrecond() { project.log(HELLO PRECOND); }'
project.setProperty(expr, expr);
/script
/target
target name=t depends=pre
Can you use scriptdef instead? See:
http://ant.apache.org/manual/OptionalTasks/scriptdef.html .
- Alexey.
Marcel Ruff wrote:
After fiddling further i have found this workaround:
-
target name=pre
script language=javascript
var expr = 'function doPrecond() {
Alexey N. Solofnenko wrote:
Can you use scriptdef instead? See:
http://ant.apache.org/manual/OptionalTasks/scriptdef.html .
i have tried already with no success (probably not hard enough :-),
thanks,
Marcel
- Alexey.
Marcel Ruff wrote:
After fiddling further i have found this workaround:
Each script command creates a new BSFManager, so
there is little sharing between the scripts.
(This is a different model from HTML + script)
The only sharing is via ant core objects (references
or properties or (as Alexey indiciates) tasks/types.
Peter
On 4/28/06, Marcel Ruff [EMAIL
With scriptdef you can define the same task differently in different
targets or you can provide the expression as a parameter into that
scriptdef. macrodef with script even allows text substitution
inside the script text - parameters will be inlined by using @{} notation.
- Alexey.
Marcel