Hello
In my ant build file:
Copy original installation folder to newer path ( I like to preserve the
permissions of the files during copy ):
<if>
<isset property="os.windows" />
<then>
<copy todir="${fnd0_XX.installationPath}/Test">
<fileset dir="${fnd0_XX.installationPath_old}/Test"/>
</copy>
</then>
<else>
<exec executable="cp">
<arg line="-p -R ${fnd0_XX.installationPath_old}/Test
${fnd0_XX.installationPath}"/>
</exec>
</else>
</if>
Find and replace string that have older path with the newer path in all the
files of the directory ( if needed recursively ) :
<replaceregexp match="${fnd0_XX.installationPath_old}/Test"
replace="${fnd0_XX.installationPath}/Test" flags="g" byline="true">
<fileset dir="${fnd0_XX.installationPath}/Test"/>
</replaceregexp>
After replacement, replaceregexp task overrode the permissions.
I found below article that mentions this behavior as well:
https://hmemcpy.com/2014/06/when-good-permissions-gone-bada-case-of-a-failed-build/
Is there an ANT task that I can use that will replace and retain the
permissions of the file ? I would like this behavior to be uniform on all
platforms.
Thanks..