Skip to content

Instantly share code, notes, and snippets.

@andrewrjones
Last active December 20, 2015 15:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andrewrjones/6155225 to your computer and use it in GitHub Desktop.
Save andrewrjones/6155225 to your computer and use it in GitHub Desktop.
Ant task to run Perl code through perltidy. Windows and Unix.
<!-- perltidy executable -->
<condition property="perltidy.exe" value="perltidy.bat">
<os family="windows" />
</condition>
<condition property="perltidy.exe" value="perltidy">
<os family="unix" />
</condition>
<fail unless="perltidy.exe">No perltidy executable defined for this OS</fail>
<target name="perl:tidy" description="Tidies the Perl code" depends="">
<echo message="Running perltidy" />
<property name="perl.src.dir" value="${src.dir}/perl" />
<apply executable="${perltidy.exe}">
<arg value="-b"/>
<fileset dir="${perl.src.dir}">
<patternset>
<include name="**/*.pl"/>
<include name="**/*.pm"/>
<include name="**/*.t"/>
</patternset>
</fileset>
</apply>
</target>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment