public static function start($args, array $additionalUserProperties = null)
    {
        try {
            $m = new Phing();
            $m->execute($args);
        } catch (Exception $exc) {
            self::handleLogfile();
            self::printMessage($exc);
            self::statusExit(1);
            return;
        }

        if ($additionalUserProperties !== null) {
            foreach ($additionalUserProperties as $key => $value) {
                $m::setDefinedProperty($key, $value);
            }
        }

        // expect the worst
        $exitCode = 1;
        try {
            try {
                $m->runBuild();
                $exitCode = 0;
            } catch (ExitStatusException $ese) {
                $exitCode = $ese->getCode();
                if ($exitCode !== 0) {
                    self::handleLogfile();
                    throw $ese;
                }
            }
        } catch (BuildException $exc) {
            // avoid printing output twice: self::printMessage($exc);
        } catch (Throwable $exc) {
            self::printMessage($exc);
        } finally {
            self::handleLogfile();
        }
        self::statusExit($exitCode);
    }