<?xml version="1.0" encoding="UTF-8"?>
<!--

    Copyright (c) 2001-2017 Mathew A. Nelson and Robocode contributors
    All rights reserved. This program and the accompanying materials
    are made available under the terms of the Eclipse Public License v1.0
    which accompanies this distribution, and is available at
    http://robocode.sourceforge.net/license/epl-v10.html

-->
<!-- ====================================================================== -->
<!--  Apache Ant build script for code beautifying Robocode sources         -->
<!-- ====================================================================== -->

<project name="beautifier" default="beatify">
  <description>Ant script for code beautifying Robocode sources</description>

  <!-- ====================================== -->
  <!-- Jacobe Code Beautifying                -->
  <!-- ====================================== -->
  <taskdef name="jacobe" classname="com.tiobe.jacobe.JacobeTask" classpath="jacobe.jar"/>
  <taskdef resource="net/sf/antcontrib/antcontrib.properties">
    <classpath>
      <pathelement location="../lib/ant-contrib-0.6.jar"/>
    </classpath>
  </taskdef>

  <target name="beatify">
    <for param="file">
      <path>
	    <fileset dir="${basedir}/../..">
		  <include name="**/*.java"/>
		  <exclude name=".metadata/**"/>
		  <exclude name="**/target/**"/>
          <exclude name="plugins/dotnet/robocode.dotnet.host/**"/>
		</fileset>
      </path>
      <sequential>
	    <echo>@{file}</echo>
        <jacobe input="@{file}" cfg="${basedir}/robocode.cfg" overwrite="true" nobackup="true" quiet="true"/>
      </sequential>
    </for>
  </target>

</project>