Re: Scope of scripts - workaround

2006-04-28 Thread Marcel Ruff
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

Re: Scope of scripts - workaround

2006-04-28 Thread Alexey N. Solofnenko
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() {

Re: Scope of scripts - workaround

2006-04-28 Thread Marcel Ruff
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:

Re: Scope of scripts - workaround

2006-04-28 Thread Peter Reilly
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

Re: Scope of scripts - workaround

2006-04-28 Thread Alexey N. Solofnenko
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