2022-09-28 11:35:07 +02:00
|
|
|
{ pkgs ? import <nixpkgs> { } }:
|
|
|
|
|
|
|
|
let
|
2023-07-24 14:37:26 +02:00
|
|
|
php = pkgs.php81;
|
|
|
|
composer = pkgs.php81Packages.composer;
|
|
|
|
|
2022-09-28 11:35:07 +02:00
|
|
|
projectInstall = pkgs.writeShellApplication {
|
|
|
|
name = "project-install";
|
|
|
|
runtimeInputs = [
|
2023-07-24 14:37:26 +02:00
|
|
|
composer
|
2022-09-28 11:35:07 +02:00
|
|
|
];
|
|
|
|
text = ''
|
|
|
|
composer install --prefer-dist --no-progress --working-dir="$PROJECT_ROOT"
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
projectValidateComposer = pkgs.writeShellApplication {
|
|
|
|
name = "project-validate-composer";
|
|
|
|
runtimeInputs = [
|
2023-07-24 14:37:26 +02:00
|
|
|
composer
|
2022-09-28 11:35:07 +02:00
|
|
|
];
|
|
|
|
text = ''
|
|
|
|
composer validate
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
projectValidateXml = pkgs.writeShellApplication {
|
|
|
|
name = "project-validate-xml";
|
|
|
|
runtimeInputs = [
|
|
|
|
pkgs.libxml2
|
|
|
|
pkgs.wget
|
|
|
|
projectInstall
|
|
|
|
];
|
|
|
|
text = ''
|
|
|
|
project-install
|
|
|
|
xmllint --schema vendor/phpunit/phpunit/phpunit.xsd --noout phpunit.xml.dist
|
|
|
|
wget --no-check-certificate https://docs.oasis-open.org/xliff/v1.2/os/xliff-core-1.2-strict.xsd --output-document=xliff-core-1.2-strict.xsd
|
2022-09-28 15:32:26 +02:00
|
|
|
# shellcheck disable=SC2046
|
|
|
|
xmllint --schema xliff-core-1.2-strict.xsd --noout $(find Resources -name '*.xlf')
|
2022-09-28 11:35:07 +02:00
|
|
|
'';
|
|
|
|
};
|
|
|
|
projectCodingGuideline = pkgs.writeShellApplication {
|
|
|
|
name = "project-coding-guideline";
|
|
|
|
runtimeInputs = [
|
2023-07-24 14:37:26 +02:00
|
|
|
php
|
2022-09-28 11:35:07 +02:00
|
|
|
projectInstall
|
|
|
|
];
|
|
|
|
text = ''
|
|
|
|
project-install
|
|
|
|
./vendor/bin/php-cs-fixer fix --dry-run --diff
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
projectTestAcceptance = pkgs.writeShellApplication {
|
|
|
|
name = "project-test-acceptance";
|
|
|
|
runtimeInputs = [
|
|
|
|
projectInstall
|
|
|
|
pkgs.sqlite
|
|
|
|
pkgs.firefox
|
|
|
|
pkgs.geckodriver
|
2023-07-24 14:37:26 +02:00
|
|
|
php
|
2022-09-28 11:35:07 +02:00
|
|
|
];
|
|
|
|
text = ''
|
|
|
|
project-install
|
|
|
|
|
2022-10-20 08:45:56 +02:00
|
|
|
export INSTANCE_PATH="$PROJECT_ROOT/.Build/web/typo3temp/var/tests/acceptance/"
|
2022-09-28 11:35:07 +02:00
|
|
|
|
2022-10-20 08:45:56 +02:00
|
|
|
mkdir -p "$INSTANCE_PATH"
|
2022-09-28 11:35:07 +02:00
|
|
|
./vendor/bin/codecept run
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
|
|
|
in pkgs.mkShell {
|
|
|
|
name = "TYPO3 Extension Watchlist";
|
|
|
|
buildInputs = [
|
2023-07-24 14:37:26 +02:00
|
|
|
php
|
|
|
|
composer
|
|
|
|
projectInstall
|
2022-09-28 11:35:07 +02:00
|
|
|
projectValidateComposer
|
|
|
|
projectValidateXml
|
|
|
|
projectCodingGuideline
|
|
|
|
projectTestAcceptance
|
|
|
|
];
|
|
|
|
|
|
|
|
shellHook = ''
|
|
|
|
export PROJECT_ROOT="$(pwd)"
|
|
|
|
|
|
|
|
export typo3DatabaseDriver=pdo_sqlite
|
|
|
|
'';
|
|
|
|
}
|