11.DEFAULT_GOAL := help
22SHELL =/bin/bash
33APP_DIR =tests/Application
4- SYLIUS_VERSION =1.10
4+ SYLIUS_VERSION =1.10.0
55SYMFONY =cd ${APP_DIR} && symfony
66COMPOSER =symfony composer
77CONSOLE =${SYMFONY} console
@@ -21,34 +21,26 @@ up: docker.up server.start ## Up the project (start docker, start symfony server
2121stop : server.stop docker.stop # # Stop the project (stop docker, stop symfony server)
2222down : server.stop docker.down # # Down the project (removes docker containers, stop symfony server)
2323
24- reset : docker.down # # Stop docker and remove dependencies
24+ reset : # # Stop docker and remove dependencies
25+ ${MAKE} docker.down || true
2526 rm -rf ${APP_DIR} /node_modules ${APP_DIR} /yarn.lock
2627 rm -rf ${APP_DIR}
2728 rm -rf vendor composer.lock
2829.PHONY : reset
2930
30- dependencies : vendor node_modules # # Setup the dependencies
31+ dependencies : composer.lock node_modules # # Setup the dependencies
3132.PHONY : dependencies
3233
3334.php-version : .php-version.dist
34- cp .php-version.dist .php-version
35+ rm -f .php-version
36+ ln -s .php-version.dist .php-version
3537
3638php.ini : php.ini.dist
37- cp php.ini.dist php.ini
38-
39- vendor : composer.lock # # Install the PHP dependencies using composer
40- ifdef GITHUB_ACTIONS
41- ${COMPOSER} install --prefer-dist
42- else
43- ${COMPOSER} install --prefer-source
44- endif
39+ rm -f php.ini
40+ ln -s php.ini.dist php.ini
4541
4642composer.lock : composer.json
47- ifdef GITHUB_ACTIONS
48- ${COMPOSER} update --prefer-dist
49- else
50- ${COMPOSER} update --prefer-source
51- endif
43+ ${COMPOSER} install --no-scripts --no-plugins
5244
5345yarn.install : ${APP_DIR}/yarn.lock
5446
@@ -70,22 +62,26 @@ ${APP_DIR}/node_modules: yarn.install
7062application : .php-version php.ini ${APP_DIR} setup_application ${APP_DIR}/docker-compose.yaml
7163
7264${APP_DIR} :
73- (${COMPOSER} create-project --prefer-dist --no-scripts --no-progress --no-install sylius/sylius-standard=" ${SYLIUS_VERSION} " ${APP_DIR} )
65+ (${COMPOSER} create-project --no-interaction -- prefer-dist --no-scripts --no-progress --no-install sylius/sylius-standard=" ~ ${SYLIUS_VERSION} " ${APP_DIR} )
7466
7567setup_application :
7668 rm -f ${APP_DIR} /yarn.lock
7769 (cd ${APP_DIR} && ${COMPOSER} config repositories.plugin ' {"type": "path", "url": "../../"}' )
7870 (cd ${APP_DIR} && ${COMPOSER} config extra.symfony.allow-contrib true)
79- (cd ${APP_DIR} && ${COMPOSER} require --no-scripts --no-progress --no-install --no-update monsieurbiz/ ${PLUGIN_NAME} = " *@ dev" )
80- $( MAKE ) apply_dist
71+ (cd ${APP_DIR} && ${COMPOSER} config minimum-stability dev)
72+ (cd ${APP_DIR} && ${COMPOSER} require --no-install --no-scripts --no-progress sylius/sylius= " ~ ${SYLIUS_VERSION} " ) # Make sure to install the required version of sylius because the sylius-standard has a soft constraint
8173 $(MAKE ) ${APP_DIR} /.php-version
8274 $(MAKE ) ${APP_DIR} /php.ini
83- (cd ${APP_DIR} && ${COMPOSER} install)
75+ (cd ${APP_DIR} && ${COMPOSER} install --no-interaction)
76+ $(MAKE ) apply_dist
77+ (cd ${APP_DIR} && ${COMPOSER} require --no-progress monsieurbiz/${PLUGIN_NAME} =" *@dev" )
78+ rm -rf ${APP_DIR} /var/cache
79+
8480
8581${APP_DIR}/docker-compose.yaml :
8682 rm -f ${APP_DIR} /docker-compose.yml
8783 rm -f ${APP_DIR} /docker-compose.yaml
88- cp docker-compose.yaml.dist ${APP_DIR} /docker-compose.yaml
84+ ln -s ../../ docker-compose.yaml.dist ${APP_DIR} /docker-compose.yaml
8985.PHONY : ${APP_DIR}/docker-compose.yaml
9086
9187${APP_DIR}/.php-version : .php-version
@@ -95,7 +91,15 @@ ${APP_DIR}/php.ini: php.ini
9591 (cd ${APP_DIR} && ln -sf ../../php.ini)
9692
9793apply_dist :
98- cp -Rv dist/* ${APP_DIR} || true
94+ ROOT_DIR=$(shell dirname $(realpath $(firstword $(MAKEFILE_LIST ) ) ) ) ; \
95+ for i in ` cd dist && find . -type f` ; do \
96+ FILE_PATH=` echo $$ i | sed ' s|./||' ` ; \
97+ FOLDER_PATH=` dirname $$ FILE_PATH` ; \
98+ echo $$ FILE_PATH; \
99+ (cd ${APP_DIR} && rm -f $$ FILE_PATH); \
100+ (cd ${APP_DIR} && mkdir -p $$ FOLDER_PATH); \
101+ (cd ${APP_DIR} && ln -s $$ ROOT_DIR/dist/$$ FILE_PATH $$ FILE_PATH); \
102+ done
99103
100104# ##
101105# ## TESTS
@@ -182,6 +186,11 @@ docker.logs: ## Logs the docker containers
182186 cd ${APP_DIR} && ${COMPOSE} logs -f
183187.PHONY : docker.logs
184188
189+ docker.dc : ARGS=ps
190+ docker.dc : # # Run docker-compose command. Use ARGS="" to pass parameters to docker-compose.
191+ cd ${APP_DIR} && ${COMPOSE} ${ARGS}
192+ .PHONY : docker.dc
193+
185194server.start : # # Run the local webserver using Symfony
186195 ${SYMFONY} local:server:start -d
187196
0 commit comments