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 all commits
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
55 changes: 32 additions & 23 deletions webapp/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,34 @@ REC_TARGETS = domserver
include $(TOPDIR)/Makefile.global

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

maintainer-conf: .env.local
domserver: composer-dump-autoload

# Install PHP dependencies
composer-dependencies:
ifeq (, $(shell command -v composer 2> /dev/null))
$(error "'composer' command not found in $(PATH), install it via your package manager or https://getcomposer.org/download/")
endif
# We use --no-scripts here because at this point the autoload.php file is
# not generated yet, which is needed to run the post-install scripts.
composer $(subst 1,-q,$(QUIET)) install --prefer-dist -o -a --no-scripts --no-plugins

composer-dependencies-dev:
composer $(subst 1,-q,$(QUIET)) install --prefer-dist --no-scripts --no-plugins

# 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

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

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

copy-bundle-assets:
# We can not use bin/console here, as when using a fakeroot,
# the include paths are broken. We just copy in the data we need
Expand All @@ -30,6 +52,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,24 +75,9 @@ 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
composer-dependencies:
ifeq (, $(shell command -v composer 2> /dev/null))
$(error "'composer' command not found in $(PATH), install it via your package manager or https://getcomposer.org/download/")
endif
# We use --no-scripts here because at this point the autoload.php file is
# not generated yet, which is needed to run the post-install scripts.
composer $(subst 1,-q,$(QUIET)) install --prefer-dist -o -a --no-scripts --no-plugins

composer-dependencies-dev:
composer $(subst 1,-q,$(QUIET)) install --prefer-dist --no-scripts --no-plugins
maintainer-conf: .env.local

composer-autoclean:
# Make sure we're running from a clean state:
composer auto-scripts
maintainer-install: composer-dump-autoload-dev

maintainer-clean-l:
-for d in cache log ; do \
Expand All @@ -78,4 +86,5 @@ maintainer-clean-l:
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.

Loading