-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmoodle-plugin-ci
More file actions
executable file
·75 lines (69 loc) · 2.98 KB
/
moodle-plugin-ci
File metadata and controls
executable file
·75 lines (69 loc) · 2.98 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
#!/usr/bin/env php
<?php
/*
* This file is part of the Moodle Plugin CI package.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
* @copyright Copyright (c) 2015 Moodlerooms Inc. (http://www.moodlerooms.com)
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
use Dotenv\Dotenv;
use Moodlerooms\MoodlePluginCI\Command\AddConfigCommand;
use Moodlerooms\MoodlePluginCI\Command\AddPluginCommand;
use Moodlerooms\MoodlePluginCI\Command\BehatCommand;
use Moodlerooms\MoodlePluginCI\Command\CodeCheckerCommand;
use Moodlerooms\MoodlePluginCI\Command\CodeFixerCommand;
use Moodlerooms\MoodlePluginCI\Command\CompletionCommand;
use Moodlerooms\MoodlePluginCI\Command\CopyPasteDetectorCommand;
use Moodlerooms\MoodlePluginCI\Command\CoverallsUploadCommand;
use Moodlerooms\MoodlePluginCI\Command\CSSLintCommand;
use Moodlerooms\MoodlePluginCI\Command\InstallCommand;
use Moodlerooms\MoodlePluginCI\Command\JSHintCommand;
use Moodlerooms\MoodlePluginCI\Command\MessDetectorCommand;
use Moodlerooms\MoodlePluginCI\Command\ParallelCommand;
use Moodlerooms\MoodlePluginCI\Command\PHPLintCommand;
use Moodlerooms\MoodlePluginCI\Command\PHPUnitCommand;
use Moodlerooms\MoodlePluginCI\Command\ShifterCommand;
use Moodlerooms\MoodlePluginCI\Command\ValidateCommand;
use Symfony\Component\Console\Application;
// Global install.
if (file_exists(__DIR__.'/../../../autoload.php')) {
/** @noinspection PhpIncludeInspection */
require_once __DIR__.'/../../../autoload.php';
// Project install.
} elseif (file_exists(__DIR__.'/../vendor/autoload.php')) {
require_once __DIR__.'/../vendor/autoload.php';
} else {
fwrite(STDERR, 'Failed to find Composer\'s autoload file. You might need to run Composer\'s install on this project'.PHP_EOL);
die(1);
}
define('ENV_DIR', dirname(__DIR__));
define('ENV_FILE', ENV_DIR.'/.env');
if (file_exists(ENV_FILE)) {
// Use this file because PHP cannot write to the environment.
// These are used to allow the install command to relay important
// information to the other commands so they can run with no args.
$env = new Dotenv(ENV_DIR);
$env->load();
}
$application = new Application('Moodle Plugin CI', '1.5.5');
$application->add(new AddConfigCommand());
$application->add(new AddPluginCommand(ENV_FILE));
$application->add(new BehatCommand());
$application->add(new CodeCheckerCommand());
$application->add(new CodeFixerCommand());
$application->add(new CompletionCommand());
$application->add(new CopyPasteDetectorCommand());
$application->add(new CoverallsUploadCommand());
$application->add(new CSSLintCommand());
$application->add(new InstallCommand(ENV_FILE));
$application->add(new JSHintCommand());
$application->add(new MessDetectorCommand());
$application->add(new ParallelCommand());
$application->add(new PHPLintCommand());
$application->add(new PHPUnitCommand());
$application->add(new ShifterCommand());
$application->add(new ValidateCommand());
$application->run();