<commit_before>player_src = bower_components/podlove-web-player/dist
player_dst = lib/modules/podlove_web_player/player_v3

prepareTest:
	bash bin/install-wp-tests.sh wordpress_test root '' localhost latest

test:
	./vendor/bin/phpunit -c phpunit.xml

release:
	bin/release.sh

format:
	php-cs-fixer fix . --rules="@PSR2, @PhpCsFixer, -yoda_style"

validateFormat:
	php-cs-fixer fix . --rules="@PSR2, @PhpCsFixer, -yoda_style" -v --dry-run --stop-on-violation --using-cache=no

update_subscribe_button:
	rm -rf .tmppsb
	git clone https://github.com/podlove/podlove-subscribe-button.git .tmppsb
	rm -rf lib/modules/subscribe_button/dist
	mv .tmppsb/dist lib/modules/subscribe_button/dist
	rm -rf .tmppsb

player:
	mkdir -p $(player_dst)/bin
	mkdir -p $(player_dst)/css
	mkdir -p $(player_dst)/img
	mkdir -p $(player_dst)/js/vendor
	cp $(player_src)/bin/flashmediaelement.swf $(player_dst)/bin
	cp $(player_src)/css/*.min.css $(player_dst)/css
	cp -r $(player_src)/css/vendor $(player_dst)/css/vendor
	cp -r $(player_src)/img/* $(player_dst)/img
	cp -r $(player_src)/js/*.min.js $(player_dst)/js
	cp -r $(player_src)/js/vendor/*.min.js $(player_dst)/js/vendor

composer_with_prefixing:
	mkdir -p vendor-prefixed
	composer install --no-progress --prefer-dist --optimize-autoloader 	--no-dev
	./vendor-bin/php-scoper/vendor/humbug/php-scoper/bin/php-scoper add-prefix --prefix=PodlovePublisher_Vendor --output-dir=./vendor-prefixed/twig --config=scoper.inc.php
	composer install --no-progress --prefer-dist --optimize-autoloader --no-dev

install_php_scoper:
	composer require --dev bamarni/composer-bin-plugin
	composer bin php-scoper config minimum-stability dev
	composer bin php-scoper config prefer-stable true
	composer bin php-scoper require --dev humbug/php-scoper

build:
	mkdir -p vendor-prefixed
	composer install --no-progress --prefer-dist --optimize-autoloader 	--no-dev
	./vendor-bin/php-scoper/vendor/humbug/php-scoper/bin/php-scoper add-prefix --prefix=PodlovePublisher_Vendor --output-dir=./vendor-prefixed/twig --config=scoper.inc.php
	composer install --no-progress --prefer-dist --optimize-autoloader --no-dev
	npm install
	npm run production
	rm -rf dist
	mkdir dist
	# move everything into dist<commit_msg>fix: vendor-prefixed needs to be there earlier<commit_after>player_src = bower_components/podlove-web-player/dist
player_dst = lib/modules/podlove_web_player/player_v3

prepareTest:
	bash bin/install-wp-tests.sh wordpress_test root '' localhost latest

test:
	./vendor/bin/phpunit -c phpunit.xml

release:
	bin/release.sh

format:
	php-cs-fixer fix . --rules="@PSR2, @PhpCsFixer, -yoda_style"

validateFormat:
	php-cs-fixer fix . --rules="@PSR2, @PhpCsFixer, -yoda_style" -v --dry-run --stop-on-violation --using-cache=no

update_subscribe_button:
	rm -rf .tmppsb
	git clone https://github.com/podlove/podlove-subscribe-button.git .tmppsb
	rm -rf lib/modules/subscribe_button/dist
	mv .tmppsb/dist lib/modules/subscribe_button/dist
	rm -rf .tmppsb

player:
	mkdir -p $(player_dst)/bin
	mkdir -p $(player_dst)/css
	mkdir -p $(player_dst)/img
	mkdir -p $(player_dst)/js/vendor
	cp $(player_src)/bin/flashmediaelement.swf $(player_dst)/bin
	cp $(player_src)/css/*.min.css $(player_dst)/css
	cp -r $(player_src)/css/vendor $(player_dst)/css/vendor
	cp -r $(player_src)/img/* $(player_dst)/img
	cp -r $(player_src)/js/*.min.js $(player_dst)/js
	cp -r $(player_src)/js/vendor/*.min.js $(player_dst)/js/vendor

composer_with_prefixing:
	mkdir -p vendor-prefixed
	composer install --no-progress --prefer-dist --optimize-autoloader 	--no-dev
	./vendor-bin/php-scoper/vendor/humbug/php-scoper/bin/php-scoper add-prefix --prefix=PodlovePublisher_Vendor --output-dir=./vendor-prefixed/twig --config=scoper.inc.php
	composer install --no-progress --prefer-dist --optimize-autoloader --no-dev

install_php_scoper:
    mkdir -p vendor-prefixed
	composer require --dev bamarni/composer-bin-plugin
	composer bin php-scoper config minimum-stability dev
	composer bin php-scoper config prefer-stable true
	composer bin php-scoper require --dev humbug/php-scoper

build:
	mkdir -p vendor-prefixed
	composer install --no-progress --prefer-dist --optimize-autoloader 	--no-dev
	./vendor-bin/php-scoper/vendor/humbug/php-scoper/bin/php-scoper add-prefix --prefix=PodlovePublisher_Vendor --output-dir=./vendor-prefixed/twig --config=scoper.inc.php
	composer install --no-progress --prefer-dist --optimize-autoloader --no-dev
	npm install
	npm run production
	rm -rf dist
	mkdir dist
	# move everything into dist
{'fraction_non_alphanumeric': 0.14095744680851063, 'fraction_numerical': 0.0013297872340425532, 'mean_word_length': 4.008879023307436, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3964617', 'n_tokens_mistral': 1703, 'n_tokens_neox': 1653, 'n_words': 336}