Skip to content

Merge webapp/vendor/Makefile into webapp/Makefile #2636

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Aug 25, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ docs: SUBDIRS= doc
install-docs: SUBDIRS= doc
maintainer-conf: SUBDIRS= webapp
maintainer-install: SUBDIRS= webapp
inplace-install: SUBDIRS= doc misc-tools webapp
inplace-install: SUBDIRS= doc misc-tools
inplace-uninstall: SUBDIRS= doc misc-tools
dist: SUBDIRS= lib sql misc-tools
clean: SUBDIRS=etc doc lib sql judge misc-tools webapp
Expand Down Expand Up @@ -227,6 +227,8 @@ inplace-install-l:
# because judgehost-create-dirs sets wrong permissions:
$(MKDIR_P) $(domserver_tmpdir)
chmod a+rwx $(domserver_tmpdir)
# Make sure we're running from a clean state:
(cd webapp && composer auto-scripts)
@echo ""
@echo "========== Maintainer Install Completed =========="
@echo ""
Expand Down
1 change: 0 additions & 1 deletion webapp/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
/var/log/*
!var/log/.gitkeep
/vendor/
!vendor/Makefile

###> phpunit/phpunit ###
/phpunit.xml
Expand Down
23 changes: 16 additions & 7 deletions webapp/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ REC_TARGETS = domserver
include $(TOPDIR)/Makefile.global

# Subdirectories to recurse into for REC_TARGETS
SUBDIRS = config vendor
SUBDIRS = config

domserver: composer-dump-autoload

maintainer-conf: .env.local

Expand All @@ -18,6 +20,16 @@ maintainer-conf: .env.local
@echo "# the DOMjudge Symfony application in developer mode. Adjust as needed." >> $@
@echo "APP_ENV=dev" >> $@

# Dump autoload dependencies (including plugins)
# This is needed since symfony/runtime is a Composer plugin that runs while dumping
# the autoload file.
# We skip it if autoload_runtime.php already exists, to avoid running composer
# as root during `sudo make install-domserver`.
composer-dump-autoload: vendor/autoload_runtime.php
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure if we need composer-dump-autoload again. The whole reason I started with the move was to get less phony targets so if possible I rather get rid of that one.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added it back for symmetry with composer-dump-autoload-dev, like composer-dependencies(-dev). But it's just a naming choice, happy to change it back.


vendor/autoload_runtime.php:
composer $(subst 1,-q,$(QUIET)) dump-autoload -o -a

composer-dump-autoload-dev:
composer $(subst 1,-q,$(QUIET)) dump-autoload

Expand All @@ -30,6 +42,7 @@ copy-bundle-assets:

clean-l:
-rm -rf public/bundles/nelmioapidoc
-rm -f vendor/autoload_runtime.php

install-domserver:
# This must be done first to install with the rest.
Expand All @@ -52,7 +65,6 @@ install-domserver:
done
$(INSTALL_DATA) -t $(DESTDIR)$(domserver_webappdir) phpunit.xml.dist .env

inplace-install: composer-autoclean
maintainer-install: composer-dump-autoload-dev

# Install PHP dependencies
Expand All @@ -67,15 +79,12 @@ endif
composer-dependencies-dev:
composer $(subst 1,-q,$(QUIET)) install --prefer-dist --no-scripts --no-plugins

composer-autoclean:
# Make sure we're running from a clean state:
composer auto-scripts

maintainer-clean-l:
-for d in cache log ; do \
for t in dev prod ; do \
rm -rf var/$$d/$$t ; \
done ; \
done

.PHONY: copy-bundle-assets
.PHONY: composer-dump-autoload composer-dump-autoload-dev \
copy-bundle-assets
12 changes: 0 additions & 12 deletions webapp/vendor/Makefile

This file was deleted.