Refactored ANT script (modular targets, use standard SDK env. variables if present)