From: Jocelyn <ei...@dj...> - 2008-02-11 15:29:46
|
> So far we didn't use branches in Gobo. Personally I think that > the best way to experiment with your changes and to find out > whether they break something or not it to commit them in the > trunk. Ok, in this case, a big commit is about to come. It includes - internal changes to create TASK faster (no more huge if elseif elseif ...on string comparison) - <local /> to declare a variable as local for instance: <local name="foo" /> or even by providing a value right away <local name="foo" value="bar" /> - <global /> to declare a variable as global (this is currently the default behavior) for instance: <global name="foo" /> or even by providing a value right away <global name="foo" value="bar" /> - <group /> to group set of tasks for instance: <target name="test" > <available resource="$file" variable="file_available" /> <group if="$file_available=true"> <echo message="..." /> <copy file="$file" to_file="${file}.bak" /> <exec executable="echo > $file" /> </group> </target> You can use the if="..", unless=".." and even dir=".." attribute on <group /> You can also have nested groups, and so on ... <target name="test" > <argument name="backup_dir" /> <argument name="file" /> <global variable="backup_enabled" /><!-- not necessary for now --> <local variable="file_available" /> <available resource="$file" variable="file_available" /> <group if="$file_available=true"> <group if="$backup_enabled=true" dir="$backup_dir"> <description>Backup file in $backup_dir folder.</description> <echo message="backup $file" /> <copy file="$file" to_file="${file}.bak" /> <echo message="Copied $file to ${file}.bak" /> </group> <exec executable="echo new content > $file" /> </group> <!-- no need to unset `file_available' since it is a local --> </target> And this will make geant' scripts cleaner (I hope) I started the work, to have "locals" as default instead of "globals", but not yet complete. Any feedback, comment, bug report will be welcome. -- Jocelyn |