#!/usr/bin/env php
<?php

$classLoaderFilepath = __DIR__ . '/../../../autoload.php';
if (!file_exists($classLoaderFilepath)) {
    if (file_exists(__DIR__ . '/../.Build/vendor/autoload.php')) {
        $classLoaderFilepath = __DIR__ . '/../.Build/vendor/autoload.php';
    } else {
        fwrite(
            STDERR,
            'You need to set up the project dependencies using Composer:' . PHP_EOL . PHP_EOL .
            '    composer install' . PHP_EOL . PHP_EOL .
            'You can learn all about Composer on https://getcomposer.org/.' . PHP_EOL
        );

        die(1);
    }
}

require $classLoaderFilepath;

$app = new \Symfony\Component\Console\Application('nimut/phpunit-merger', '1.0');
$app->addCommands(
    [
        new \Nimut\PhpunitMerger\Command\CoverageCommand(),
        new \Nimut\PhpunitMerger\Command\LogCommand(),
    ]
);
$app->run();
