-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmakefile
53 lines (41 loc) · 2.05 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
52
53
#
# Makefile
#
.PHONY: help
.DEFAULT_GOAL := help
PLUGIN_VERSION=`php -r 'echo json_decode(file_get_contents("MyPaShopware/composer.json"))->version;'`
SHOPWARE_COMPATIBILIY=^6.5
help:
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
# ------------------------------------------------------------------------------------------------------------
install-prod: ## Installs only production dependencies
@php update-composer-require.php --env=prod --shopware=$(SHOPWARE_COMPATIBILIY)
@composer install --no-dev --no-scripts --no-interaction --optimize-autoloader
@php update-composer-require.php --env=prod --shopware=$(SHOPWARE_COMPATIBILIY) --release
@yarn workspaces focus
@yarn install --immutable
install: ## Installs dev dependencies
@composer install
@yarn install
clean: ## Cleans vendor
@rm -rf vendor
# ------------------------------------------------------------------------------------------------------------
install-plugin: ## Builds the package and installs the plugin
@php "$$PROJECT_ROOT/bin/console" plugin:refresh
make build
@php "$$PROJECT_ROOT/bin/console" plugin:install MyPaShopware --activate --clearCache
build: ## Builds the package
@rm -rf "src/Resources/app/storefront/dist"
@mkdir -p "src/Resources/app/storefront/dist"
@rm -rf "src/Resources/public/administration"
@cd "$$PROJECT_ROOT" && SHOPWARE_ADMIN_BUILD_ONLY_EXTENSIONS=1 bin/build-administration.sh
@cd "$$PROJECT_ROOT" && SHOPWARE_ADMIN_BUILD_ONLY_EXTENSIONS=1 bin/build-storefront.sh
release: ## Create a new release
make clean
make install-prod
make build
make zip
zip: ## Create a zip file
@cd .. && rm -rf MyPaShopware-$(PLUGIN_VERSION).zip
@cd .. && echo "Creating Zip file MyPaShopware-$(PLUGIN_VERSION).zip\n"
@cd .. && zip -q -r -0 MyPaShopware-$(PLUGIN_VERSION).zip MyPaShopware/src MyPaShopware/vendor MyPaShopware/CHANGELOG* MyPaShopware/README.md MyPaShopware/composer.json MyPaShopware/package.json MyPaShopware/composer.lock && echo "MyPaShopware-$(PLUGIN_VERSION).zip created."