From 56659ab95d42430a4adbfbddf5b460282dc119ac Mon Sep 17 00:00:00 2001 From: Daniel Rudolf Date: Mon, 9 Sep 2019 15:10:20 +0200 Subject: [PATCH] Build system: Don't use Composer for dev dependencies PHP_CodeSniffer and phpDocumentor are external tools which should never affect Pico's environment, thus we rather use PHARs in the future. --- .build/install.sh | 22 +++++++++++++++++++++- composer.json | 4 ---- 2 files changed, 21 insertions(+), 5 deletions(-) diff --git a/.build/install.sh b/.build/install.sh index 5dde051..de25de5 100755 --- a/.build/install.sh +++ b/.build/install.sh @@ -9,11 +9,31 @@ case "$1" in echo "Synchronizing package index files..." sudo apt-get update - echo "Installing packages..." + echo "Installing cloc..." sudo apt-get install -y cloc + + echo "Installing phpDocumentor..." + curl --location --output "$PICO_TOOLS_DIR/phpdoc" \ + "https://github.com/phpDocumentor/phpDocumentor2/releases/latest/download/phpDocumentor.phar" + chmod +x "$PICO_TOOLS_DIR/phpdoc" ;; esac +echo "Installing PHP_CodeSniffer..." +if [ "$(php -r 'echo PHP_VERSION_ID;')" -ge 50400 ]; then + PHPCS_DOWNLOAD="https://github.com/squizlabs/PHP_CodeSniffer/releases/latest/download/" +else + PHPCS_DOWNLOAD="https://github.com/squizlabs/PHP_CodeSniffer/releases/download/2.9.2/" +fi + +curl --location --output "$PICO_TOOLS_DIR/phpcs" \ + "$PHPCS_DOWNLOAD/phpcs.phar" +chmod +x "$PICO_TOOLS_DIR/phpcs" + +curl --location --output "$PICO_TOOLS_DIR/phpcbf" \ + "$PHPCS_DOWNLOAD/phpcbf.phar" +chmod +x "$PICO_TOOLS_DIR/phpcbf" + echo # setup composer diff --git a/composer.json b/composer.json index db3682f..016b823 100644 --- a/composer.json +++ b/composer.json @@ -38,10 +38,6 @@ "picocms/pico-deprecated": "PicoDeprecated's purpose is to maintain backward compatibility to older versions of Pico.", "picocms/composer-installer": "This Composer plugin is responsible for installing Pico plugins and themes using the Composer package manager." }, - "require-dev" : { - "phpdocumentor/phpdocumentor": "^2.9", - "squizlabs/php_codesniffer": "^2.9" - }, "autoload": { "psr-0": { "Pico": "lib/",