Return Codes

Gant itself issues the following return codes:

0 Successful completion.
-1 Command line options processing problem.
-2 Gant file parsing problem.
-3 Speficied Gant file not found (1.0.2-SNAPSHOT and later, previosuly 1 is returned for this error).
-11 Unknown target.
-12 Attempt to call undefined default target.
-13 Gant file execution error.

Always uising negative numbers for return codes generated by Gant means that any and all positive integers can be used by the sctip to communicate not successful return codes.

The final value of the first initiated target is the return value from Gant. So as a trivial example:

target(alwaysFails: 'This target never succeeds.') { 27 }

would always return the value 27 and so, by convention, never succeeds – returning 0 is the only way of indicating success.