How to upload a file using source command in ANT script?

Using a Linux environment with java, I have a configuration file that needs to be configured before running the eclipse application from the console,

This is the OpenspliceDDS configuration file for the source, which is located in the following directory

source /../ HDE / x86.linx2.6. / release.com ---> Runs on the command line

But I need to execute the source command in the ANT script, can anyone help me with this.

Example:

I created a property tag for the command

<property name="release.path" location="/opt/HDE/x86.linux2.6/release.com"/> <exec executable="source ${release.path}" spawn="true"> </exec> 
+4
source share
1 answer

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> 
+4
source

All Articles