Skip to content

Commit 1b06d6c

Browse files
tom93eldering
authored andcommitted
Merge webapp/vendor/Makefile into webapp/Makefile
I find it easier to follow when all the composer commands are in the same Makefile. Also move `composer auto-scripts` back into inplace-install-l, out of concern for ordering issues. It was moved into a prereq of inplace-install in commit ab267ec (Put lib/vendor close to the webapp, 2024-06-23).
1 parent c53ccda commit 1b06d6c

File tree

4 files changed

+19
-21
lines changed

4 files changed

+19
-21
lines changed

Makefile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ docs: SUBDIRS= doc
8989
install-docs: SUBDIRS= doc
9090
maintainer-conf: SUBDIRS= webapp
9191
maintainer-install: SUBDIRS= webapp
92-
inplace-install: SUBDIRS= doc misc-tools webapp
92+
inplace-install: SUBDIRS= doc misc-tools
9393
inplace-uninstall: SUBDIRS= doc misc-tools
9494
dist: SUBDIRS= lib sql misc-tools
9595
clean: SUBDIRS=etc doc lib sql judge misc-tools webapp
@@ -227,6 +227,8 @@ inplace-install-l:
227227
# because judgehost-create-dirs sets wrong permissions:
228228
$(MKDIR_P) $(domserver_tmpdir)
229229
chmod a+rwx $(domserver_tmpdir)
230+
# Make sure we're running from a clean state:
231+
(cd webapp && composer auto-scripts)
230232
@echo ""
231233
@echo "========== Maintainer Install Completed =========="
232234
@echo ""

webapp/.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
/var/log/*
99
!var/log/.gitkeep
1010
/vendor/
11-
!vendor/Makefile
1211

1312
###> phpunit/phpunit ###
1413
/phpunit.xml

webapp/Makefile

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@ REC_TARGETS = domserver
77
include $(TOPDIR)/Makefile.global
88

99
# Subdirectories to recurse into for REC_TARGETS
10-
SUBDIRS = config vendor
10+
SUBDIRS = config
11+
12+
domserver: composer-dump-autoload
1113

1214
maintainer-conf: .env.local
1315

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

23+
# Dump autoload dependencies (including plugins)
24+
# This is needed since symfony/runtime is a Composer plugin that runs while dumping
25+
# the autoload file.
26+
# We skip it if autoload_runtime.php already exists, to avoid running composer
27+
# as root during `sudo make install-domserver`.
28+
composer-dump-autoload: vendor/autoload_runtime.php
29+
30+
vendor/autoload_runtime.php:
31+
composer $(subst 1,-q,$(QUIET)) dump-autoload -o -a
32+
2133
composer-dump-autoload-dev:
2234
composer $(subst 1,-q,$(QUIET)) dump-autoload
2335

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

3143
clean-l:
3244
-rm -rf public/bundles/nelmioapidoc
45+
-rm -f vendor/autoload_runtime.php
3346

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

55-
inplace-install: composer-autoclean
5668
maintainer-install: composer-dump-autoload-dev
5769

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

70-
composer-autoclean:
71-
# Make sure we're running from a clean state:
72-
composer auto-scripts
73-
7482
maintainer-clean-l:
7583
-for d in cache log ; do \
7684
for t in dev prod ; do \
7785
rm -rf var/$$d/$$t ; \
7886
done ; \
7987
done
8088

81-
.PHONY: copy-bundle-assets
89+
.PHONY: composer-dump-autoload composer-dump-autoload-dev \
90+
copy-bundle-assets

webapp/vendor/Makefile

Lines changed: 0 additions & 12 deletions
This file was deleted.

0 commit comments

Comments
 (0)