I think you need to make a shell script for Ant to call. In the shell script, run the command "source" and then the command "sources". (You can pass the parameters for the file to the source code and execute).
Following actions
For a shell script, I mean something like this:
#!/bin/bash env_file=$1 script_to_exec=$2 . $env_file exec $script_to_exec
The point is that you need to send the source file and then execute the script in the same environment. So wrap them in a script that you can execute from another environment (Ant).
To call this from Ant, something like this:
<exec executable="wrapper_script"> <arg value="${release.path}"/> <arg value="script_to_execute"/> </exec>
source share