I’d like to update my ANT's build.xml file to:
- Read a value from the file and
- Change link on the system to reflect what it read in file
Assume the file to have content in the following format:
Environment = dev
Further assume directory to have the following files/link:
current_env_image -> qa_image.jpg
prod_image.jpg
qa_image.jpg
dev_image.jpg
.. where current_env_image is a link to whatever the current image should be presented at.
I’d like for an ANT script to:
- Read the value assigned to Environment (from the file) and
- Execute a command creating a link to point to the right image:
unlink current_env_image
ln -s ${environment}_image.jpg current_env_image
Reading the file can be easily done with the Property task:
Afterwards your variable
Environmentwill be set to that value.The second question could be achieved by the exec task