mirror of
https://codeberg.org/icewind/flakelight-php.git
synced 2026-06-03 09:54:20 +02:00
per php-version phpunit
This commit is contained in:
parent
d143b04ec3
commit
3afda04092
2 changed files with 27 additions and 15 deletions
|
|
@ -1,12 +1,18 @@
|
||||||
{
|
{
|
||||||
phpunit,
|
callPackage,
|
||||||
|
php,
|
||||||
|
majorVersion,
|
||||||
testDependencies,
|
testDependencies,
|
||||||
writeShellApplication,
|
writeShellApplication,
|
||||||
}:
|
}: let
|
||||||
writeShellApplication {
|
unwrapped = callPackage ../pkgs/phpunit.nix {
|
||||||
|
inherit php majorVersion;
|
||||||
|
};
|
||||||
|
in
|
||||||
|
writeShellApplication {
|
||||||
name = "phpunit";
|
name = "phpunit";
|
||||||
runtimeInputs = [phpunit] ++ testDependencies;
|
runtimeInputs = [unwrapped] ++ testDependencies;
|
||||||
text = ''
|
text = ''
|
||||||
phpunit "$@"
|
phpunit "$@"
|
||||||
'';
|
'';
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -129,10 +129,8 @@ in
|
||||||
};
|
};
|
||||||
|
|
||||||
phpunit = final.callPackage ./apps/phpunit.nix {
|
phpunit = final.callPackage ./apps/phpunit.nix {
|
||||||
phpunit = final.callPackage ./pkgs/phpunit.nix {
|
|
||||||
php = final.minPhp;
|
php = final.minPhp;
|
||||||
majorVersion = composerMeta.phpUnitVersion;
|
majorVersion = composerMeta.phpUnitVersion;
|
||||||
};
|
|
||||||
testDependencies = config.testDependencies final;
|
testDependencies = config.testDependencies final;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -170,9 +168,17 @@ in
|
||||||
(optionalAttrs hasPsalm (forPhpVersions "psalm" ./checks/psalm.nix))
|
(optionalAttrs hasPsalm (forPhpVersions "psalm" ./checks/psalm.nix))
|
||||||
// (optionalAttrs hasPhpStan (forPhpVersions "phpstan" ./checks/phpstan.nix));
|
// (optionalAttrs hasPhpStan (forPhpVersions "phpstan" ./checks/phpstan.nix));
|
||||||
|
|
||||||
apps = {pkgs, ...}: {
|
apps = {pkgs, ...}: let
|
||||||
|
forPhpVersions = name: app:
|
||||||
|
genAttrs' composerMeta.phpVersions (version: {
|
||||||
|
name = "${name}${removeDots version}";
|
||||||
|
value = ''${getExe (app.override {
|
||||||
|
php = buildPhpVersion pkgs version;
|
||||||
|
})} "$@"'';
|
||||||
|
});
|
||||||
|
in {
|
||||||
phpunit = ''${getExe pkgs.phpunit} "$@"'';
|
phpunit = ''${getExe pkgs.phpunit} "$@"'';
|
||||||
};
|
} // (forPhpVersions "phpunit" pkgs.phpunit);
|
||||||
})
|
})
|
||||||
|
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue