Skip to content

Commit

Permalink
chore(requirement-checker): Move the requirement checker dump from th…
Browse files Browse the repository at this point in the history
…e root Makefile to the requirement checker's Makefile (#754)
  • Loading branch information
theofidry committed Jan 7, 2023
1 parent 474e709 commit fd828a4
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 27 deletions.
30 changes: 3 additions & 27 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,7 @@ compile: box
.PHONY: dump-requirement-checker
dump-requirement-checker:## Dumps the requirement checker
dump-requirement-checker:
rm -rf .requirement-checker || true
$(MAKE) .requirement-checker
cd requirement-checker; $(MAKE) --file=Makefile dump


#
Expand Down Expand Up @@ -362,10 +361,6 @@ composer.lock: composer.json
@echo "$(@) is not up to date. You may want to run the following command:"
@echo "$$ composer update --lock && touch -c $(@)"

requirement-checker/composer.lock: requirement-checker/composer.json
composer install --working-dir=requirement-checker
touch -c $@

vendor: composer.lock
$(MAKE) vendor_install

Expand All @@ -376,14 +371,6 @@ bin/phpunit: composer.lock
$(MAKE) --always-make vendor_install
touch -c $@

requirement-checker/bin/phpunit: requirement-checker/composer.lock
composer install --working-dir=requirement-checker
touch -c $@

requirement-checker/vendor: requirement-checker/composer.json
composer install --working-dir=requirement-checker
touch -c $@

.PHONY: php_cs_fixer_install
php_cs_fixer_install: $(PHP_CS_FIXER_BIN)

Expand Down Expand Up @@ -437,15 +424,8 @@ fixtures/build/dir013/vendor:
fixtures/default_stub.php:
php -d phar.readonly=0 bin/generate_default_stub

.requirement-checker: requirement-checker/bin/check-requirements.phar
php bin/box extract requirement-checker/bin/check-requirements.phar .requirement-checker
touch -c $@

requirement-checker/actual_terminal_diff: requirement-checker/src/Terminal.php vendor/symfony/console/Terminal.php
(diff --ignore-all-space --side-by-side --suppress-common-lines vendor/symfony/console/Terminal.php requirement-checker/src/Terminal.php || true) > requirement-checker/actual_terminal_diff

tests/Console/DisplayNormalizer.php: vendor
vendor/symfony/console/Terminal.php: vendor
.requirement-checker:
cd requirement-checker; $(MAKE) --file=Makefile _dump

box: bin src res vendor box.json.dist scoper.inc.php .requirement-checker
# Compile Box
Expand All @@ -466,10 +446,6 @@ box: bin src res vendor box.json.dist scoper.inc.php .requirement-checker

touch -c $@

requirement-checker/bin/check-requirements.phar: requirement-checker/src requirement-checker/bin/check-requirements.php requirement-checker/box.json.dist requirement-checker/scoper.inc.php requirement-checker/vendor
bin/box compile --working-dir=requirement-checker --no-parallel
touch -c $@

.PHONY: docker-images
docker-images:
./.docker/build
Expand Down
34 changes: 34 additions & 0 deletions requirement-checker/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,13 @@ ORIGINAL_TERMINAL = ../vendor-bin/requirement-checker/vendor/symfony/console/Ter
PHP_CS_FIXER_BIN = ../vendor-bin/php-cs-fixer/vendor/bin/php-cs-fixer
PHP_CS_FIXER = $(PHP_CS_FIXER_BIN)

PHAR_SRC_FILES := $(shell find src bin/check-requirements.php box.json.dist scoper.inc.php)
PHAR = bin/check-requirements.phar
PHAR_EXTRACT = ../.requirement-checker

BOX_BIN = ../bin/box
BOX = $(BOX_BIN)


.DEFAULT_GOAL := help

Expand Down Expand Up @@ -45,6 +52,22 @@ clean:
|| true
$(MAKE) dist


.PHONY: dump
dump: ## Dumps the requirement-checker
dump:
rm -rf $(PHAR) $(PHAR_EXTRACT) || true
$(MAKE) _dump

.PHONY: _dump
_dump: $(PHAR_EXTRACT)


#
# CS
#---------------------------------------------------------------------------


.PHONY: cs
cs: ## Fixes CS
cs: gitignore_sort composer_normalize php_cs_fixer
Expand Down Expand Up @@ -133,3 +156,14 @@ dist:
mkdir -p dist
touch dist/.gitkeep
touch -c $@

$(PHAR): $(PHAR_SRC_FILES) $(BOX_BIN)
$(BOX) compile --no-parallel
touch -c $@

$(PHAR_EXTRACT): $(PHAR) $(BOX_BIN)
$(BOX) extract $(PHAR) $(PHAR_EXTRACT)
touch -c $@

$(BOX_BIN):
cd ..; $(MAKE) --file=Makefile bin/box

0 comments on commit fd828a4

Please sign in to comment.