Orange is my favorite color

If you use the Ant <sync> task for pushing your files to deployment, be sure to include the attribute: overwrite=”true”.

If you ever have a botched release and need to roll back to an older version of your software, Ant’s default behavior will not overwrite newer files. But it’s usually those newer files that you want to revert when something goes wrong. After learning this the hard way, my build.xml now includes the following:

<sync todir="${project.deploy.root}"
      includeEmptyDirs="true"
      overwrite="true">
  <fileset dir="${project.clean.root}" />
    <preserveintarget>
      <include name="**/generated/**"/>
    </preserveintarget>
</sync>		

I preserve files in directories named “generated” for Transfer and Model-Glue. This saves recreating all of the generated components and views each time I push a build. If you do this and upgrade Transfer versions, don’t forget you have to delete the files!

Comments are closed.