From a38e2598f4d2f0f1d3625c4d743b3694026e9796 Mon Sep 17 00:00:00 2001 From: Jakub Zalas Date: Wed, 29 Aug 2018 17:28:55 +0100 Subject: [PATCH] Package the devkit --- .travis.yml | 6 ++++-- Makefile | 16 ++++++++++++++++ bin/devkit.php | 6 +++--- box-devkit.json.dist | 18 ++++++++++++++++++ 4 files changed, 41 insertions(+), 5 deletions(-) create mode 100644 box-devkit.json.dist diff --git a/.travis.yml b/.travis.yml index c424fd01..348efec5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,12 +12,14 @@ install: - if [[ $deps = low ]]; then make update-min; else make install; fi script: - if [[ $deps = low ]]; then make test-min; else make test; fi -- make package +- make package package-devkit deploy: provider: releases api_key: secure: U0BP6+CaAYKAPC5pNIzgIpITLIL5lc0fPRSRW2SBdCh5u55NuHoHL22LldK+309t0L8mxLybq6yh4pUksBdkKB/gKLEI4Vrc5hZeR1y49kIClDIAllrQeCAn+XgDZlZls/Q/Op8DPkAouJrj0Y2qBTWrhAG1Fhn9SLsIcVG0x4JhbKd4I0IN+G4YgxSpzcdYEc6uszqZrPSGKjK+ygrnZ2IJZ+roUTJIQXCK0KEOGHx7sKS4mtqvd5hEx9P+FUZcs3Pp7nNp/gJBWd80ZNbVj7iiOulc7Fl2BxqLqVKGqyv7ekqyeg2vaDz2GpbBiYGbDXiGQlJ0kGlENCuTyqS0ZQ/j9O0htaO57C1m0HVFu+gX34cnL6vP6dkwqjPRDQA8BQ1YNeKQcCP7LDYY/OXvYwaEhB2iw7/e6PjYhQTv41kStGGyTqrFbGNWpV/JM+7oCjr977C8lfDU9I1A/MHRHQHuMKPLA2jygCIVzibmxElsfDaHkIbrbgKZ4ukRYr9fyDVfjv9L2TNWp19++JdDbwBDutuho9E23AFgqEQJjTGTG4mf9pX3tFlfGv+3VDe7LhNm69Wkat1lMjFnL4qjI+uY2K9JdHqPZPw0SOaUpbh9BSuv7+n3Wp/j59Dva136BOK/KUEleD2PBf2oufO+ETLDEofpKQ8HA0R/8K1HN2w= - file: build/toolbox.phar + file: + - build/toolbox.phar + - build/devkit.phar skip_cleanup: true on: tags: true diff --git a/Makefile b/Makefile index 3a2001ee..cc2f9fd9 100644 --- a/Makefile +++ b/Makefile @@ -65,6 +65,22 @@ package: tools/box @rm -rf build/phar .PHONY: package +package-devkit: tools/box + $(eval VERSION=$(shell (git describe --abbrev=0 --tags 2>/dev/null || echo "0.1-dev") | sed -e 's/^v//')) + @rm -rf build/devkit-phar && mkdir -p build/devkit-phar build/devkit-phar/bin + + cp -r src resources LICENSE composer.json scoper.inc.php build/devkit-phar + sed -e 's/\(Application(.*\)'"'"'dev/\1'"'"'$(VERSION)/g' bin/devkit.php > build/devkit-phar/bin/devkit.php + + cd build/devkit-phar && \ + composer config platform.php 7.1.3 && \ + composer update --no-dev -o -a + + tools/box compile -c box-devkit.json.dist + + @rm -rf build/devkit-phar +.PHONY: package-devkit + tools: tools/php-cs-fixer tools/deptrac tools/infection tools/box .PHONY: tools diff --git a/bin/devkit.php b/bin/devkit.php index 6eeb7754..fade4136 100755 --- a/bin/devkit.php +++ b/bin/devkit.php @@ -28,8 +28,8 @@ protected function configure() protected function execute(InputInterface $input, OutputInterface $output) { - $jsonPath = realpath($input->getOption('tools')); - $readmePath = realpath($input->getOption('readme')); + $jsonPath = $input->getOption('tools'); + $readmePath = $input->getOption('readme'); $tools = (new Tools($jsonPath))->all(); $toolsList = $tools->reduce('', function ($acc, Tool $tool) { return $acc . sprintf('* %s - [%s](%s)', $tool->name(), $tool->summary(), $tool->website()) . PHP_EOL; @@ -56,7 +56,7 @@ protected function configure() protected function execute(InputInterface $input, OutputInterface $output) { - $jsonPath = realpath($input->getOption('tools')); + $jsonPath = $input->getOption('tools'); $phars = $this->findLatestPhars($jsonPath); diff --git a/box-devkit.json.dist b/box-devkit.json.dist new file mode 100644 index 00000000..1d63df81 --- /dev/null +++ b/box-devkit.json.dist @@ -0,0 +1,18 @@ +{ + "base-path": "build/devkit-phar", + "output": "../devkit.phar", + "compression": "GZ", + "directories": ["."], + "dump-autoload": true, + "exclude-composer-files": true, + "check-requirements": false, + "main": "bin/devkit.php", + "compactors": [ + "KevinGH\\Box\\Compactor\\PhpScoper" + ], + "banner": [ + "This file is part of the zalas/toolbox project.", + "", + "(c) Jakub Zalas " + ] +} \ No newline at end of file