First question
with script task it's as easy as =
<project>
<property name="module.list" value="mod1,mod2,mod3,mod4,mod5"/>
<target name="main">
<script language="ruby">
$project.setProperty 'module.1', $project.getProperty('module.list').split(',')[0]
</script>
<echo>${module.1}</echo>
</target>
</project>
main:
[echo] mod1
BUILD SUCCESSFUL
all you need for script task with jruby is =
bsf.jar,commons-logging-1.1.1.jar,jruby-complete-1.3.1.jar
Second question
normally properties are immutable once set in ant, but you can over it, with
script task and use of the ant api, f.e. =
<property name="foo" value="bar"/>
<script language="ruby">
$project.setProperty 'foo', 'baz'
</script>
would overwrite the existing property foo with new value baz, simply use method
project.setProperty from ant api with on existing property