-
-
Notifications
You must be signed in to change notification settings - Fork 51
/
shell.nix
122 lines (102 loc) · 2.32 KB
/
shell.nix
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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
{
pkgs ? import <nixpkgs> { }
,phpVersion ? "php82"
}:
let
php = pkgs.${phpVersion}.buildEnv {
extensions = { enabled, all }: enabled ++ (with all; [
xdebug
]);
extraConfig = ''
xdebug.mode = debug
memory_limit = 4G
'';
};
inherit(pkgs."${phpVersion}Packages") composer;
projectInstall = pkgs.writeShellApplication {
name = "project-install";
runtimeInputs = [
php
composer
];
text = ''
composer update --prefer-dist --no-progress
'';
};
projectCgl = pkgs.writeShellApplication {
name = "project-cgl";
runtimeInputs = [
php
];
text = ''
./.build/bin/php-cs-fixer fix --config=Build/.php-cs-fixer.dist.php -v --dry-run --diff
'';
};
projectCglFix = pkgs.writeShellApplication {
name = "project-cgl-fix";
runtimeInputs = [
php
];
text = ''
./.build/bin/php-cs-fixer fix --config=Build/.php-cs-fixer.dist.php
'';
};
projectLint = pkgs.writeShellApplication {
name = "project-lint";
runtimeInputs = [
php
];
text = ''
find ./*.php Classes Configuration Tests -name '*.php' -print0 | xargs -0 -n 1 -P 4 php -l
'';
};
projectPhpstan = pkgs.writeShellApplication {
name = "project-phpstan";
runtimeInputs = [
php
];
text = ''
./.build/bin/phpstan analyse -c Build/phpstan.neon --memory-limit 256M
'';
};
projectTestUnit = pkgs.writeShellApplication {
name = "project-test-unit";
runtimeInputs = [
php
projectInstall
];
text = ''
project-install
.build/bin/phpunit -c Build/UnitTests.xml --display-deprecations --display-warnings
'';
};
projectTestFunctional = pkgs.writeShellApplication {
name = "project-test-functional";
runtimeInputs = [
php
projectInstall
];
text = ''
project-install
.build/bin/phpunit -c Build/FunctionalTests.xml --display-deprecations --display-warnings
'';
};
in pkgs.mkShell {
name = "TYPO3 Extension cart";
buildInputs = [
php
composer
projectInstall
projectPhpstan
projectCgl
projectCglFix
projectLint
projectPhpstan
projectTestUnit
projectTestFunctional
];
shellHook = ''
export PROJECT_ROOT="$(pwd)"
export typo3DatabaseDriver=pdo_sqlite
'';
}