forked from researchgate/avro-php
-
Notifications
You must be signed in to change notification settings - Fork 16
/
Makefile
51 lines (38 loc) · 1.36 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# no builtin rules and variables
MAKEFLAGS =+ -rR --warn-undefined-variables
.PHONY: composer-install composer-update examples docker run
COMPOSER ?= bin/composer.phar
COMPOSER_VERSION ?= 2.8.4
PHP ?= bin/php
PHP_VERSION ?= 8.3
XDEBUG_VERSION ?= 3.4.0
export
docker:
docker build \
--build-arg PHP_VERSION=$(PHP_VERSION) \
--build-arg XDEBUG_VERSION=$(XDEBUG_VERSION) \
-t avro-php:$(PHP_VERSION) \
-f Dockerfile \
.
composer-install:
PHP_VERSION=$(PHP_VERSION) $(PHP) $(COMPOSER) install --no-interaction --no-progress --no-suggest --no-scripts
composer-update:
PHP_VERSION=$(PHP_VERSION) $(PHP) $(COMPOSER) update --no-interaction --no-progress --no-suggest --no-scripts
phpunit:
@mkdir -p build/tmp build/share/test/schemas build/build/interop/data
@chmod -R a+w build
PHP_VERSION=$(PHP_VERSION) $(PHP) vendor/bin/phpunit
coverage:
@mkdir -p build/tmp build/share/test/schemas build/build/interop/data
@chmod -R a+w build
PHP_VERSION=$(PHP_VERSION) $(PHP) -d xdebug.mode=coverage vendor/bin/phpunit --coverage-text
run:
PHP_VERSION=$(PHP_VERSION) $(PHP) $(ARGS)
examples:
PHP_VERSION=$(PHP_VERSION) $(PHP) examples/*
install-phars:
curl https://getcomposer.org/download/$(COMPOSER_VERSION)/composer.phar -o bin/composer.phar -LR -z bin/composer.phar
chmod a+x bin/composer.phar
install: install-phars docker composer-install
clean:
rm -r build/*