@echo off

set ANT_COMMAND_ARGUMENTS=%*
set allArguments=%*

IF "%1"==""	echo "You must supply at least one target for Kundo to have any idea of what it is to do." && goto end

IF NOT EXIST "build.xml" set antArguments="-buildfile "%KUNDO_HOME%"\conf\kundo.build -Dbasedir=%CD% %allArguments%"

IF NOT EXIST "%CD%\recipe.groovy" echo "Kundo requires a recipe file that specifies your phases and plug-ins." && goto end

IF DEFINED antArguments CALL ant "%antArguments%" && goto end
ant %allArguments%

:end

