@@ -9,65 +9,36 @@ BUILD_DIR ?= ./build/api
99DEPLOY_DIR ?= ./website
1010
1111PHP ?= php
12+ DOCS_CACHE_DIR ?=
13+ export DOCS_CACHE_REFRESH
1214COMPOSER := $(CURDIR ) /composer.phar
1315COMPOSER_UPDATE_FLAGS := --no-plugins --no-audit --no-security-blocking --ignore-platform-reqs
1416
1517.DEFAULT_GOAL := help
1618
17- CAKEPHP3_RELEASES := \
18- 3.0|3.0.19|no-vendor \
19- 3.1|3.1.14|no-vendor \
20- 3.2|3.2.14|update \
21- 3.3|3.3.16|update \
22- 3.4|3.4.14|update \
23- 3.5|3.5.18|update \
24- 3.6|3.6.15|update \
25- 3.7|3.7.9|update \
26- 3.8|3.8.13|update \
27- 3.9|3.9.10|update \
28- 3.10|origin/3.x|update
29-
30- CAKEPHP4_RELEASES := \
31- 4.0|4.0.9|update \
32- 4.1|4.1.7|update \
33- 4.2|4.2.10|update \
34- 4.3|4.3.10|update \
35- 4.4|4.4.18|update \
36- 4.5|4.5.10|update \
37- 4.6|origin/4.x|update
38-
39- CAKEPHP5_RELEASES := \
40- 5.0|5.0.11|update \
41- 5.1|5.1.9|update \
42- 5.2|5.2.15|update \
43- 5.3|5.3.7|update \
44- 5.4|origin/5.x|update
45-
46- CAKEPHP6_RELEASES := \
47- 6.0|origin/6.x|update
48-
49- CHRONOS_RELEASES := \
50- 1.x|origin/1.x|update \
51- 2.x|origin/2.x|update \
52- 3.x|origin/3.x|update
53-
54- ELASTIC_RELEASES := \
55- 2.x|origin/2.x|update \
56- 3.x|origin/3.x|update \
57- 4.x|origin/4.x|update
58-
59- QUEUE_RELEASES := \
60- 1.x|origin/1.x|update \
61- 2.x|origin/2.x|update
62-
63- AUTHENTICATION_RELEASES := \
64- 2.x|origin/2.x|update \
65- 3.x|origin/3.x|update \
66- 4.x|origin/4.x|update
67-
68- AUTHORIZATION_RELEASES := \
69- 2.x|origin/2.x|update \
70- 3.x|origin/3.x|update
19+ CAKEPHP3_RELEASES := $(shell $(PHP ) bin/releases.php cakephp3)
20+
21+ CAKEPHP4_RELEASES := $(shell $(PHP ) bin/releases.php cakephp4)
22+
23+ CAKEPHP5_RELEASES := $(shell $(PHP ) bin/releases.php cakephp5)
24+
25+ CAKEPHP6_RELEASES := $(shell $(PHP ) bin/releases.php cakephp6)
26+
27+ CHRONOS_RELEASES := $(shell $(PHP ) bin/releases.php chronos)
28+
29+ ELASTIC_RELEASES := $(shell $(PHP ) bin/releases.php elastic)
30+
31+ QUEUE_RELEASES := $(shell $(PHP ) bin/releases.php queue)
32+
33+ AUTHENTICATION_RELEASES := $(shell $(PHP ) bin/releases.php authentication)
34+
35+ AUTHORIZATION_RELEASES := $(shell $(PHP ) bin/releases.php authorization)
36+
37+ RELEASE_GROUPS := CAKEPHP3 CAKEPHP4 CAKEPHP5 CAKEPHP6 CHRONOS ELASTIC QUEUE AUTHENTICATION AUTHORIZATION
38+ $(foreach group,$(RELEASE_GROUPS),$(if $($(group)_RELEASES),,$(error Unable to load $(group) releases; check PHP and config/releases.php)))
39+
40+ # Releases share source checkouts; concurrent builds would race on git checkout.
41+ .NOTPARALLEL :
7142
7243release_version = $(word 1,$(subst |, ,$1) )
7344release_tag = $(word 2,$(subst |, ,$1) )
@@ -134,6 +105,8 @@ help:
134105 @echo " AUTHENTICATION_SOURCE_DIR Location of the authentication clone."
135106 @echo " AUTHORIZATION_SOURCE_DIR Location of the authorization clone."
136107 @echo " BUILD_DIR Output directory. Default: $( BUILD_DIR) "
108+ @echo " DOCS_CACHE_DIR Optional cache directory for completed release builds."
109+ @echo " DOCS_CACHE_REFRESH Change this value to refresh cached dependency resolution."
137110 @echo " DEPLOY_DIR Deployment directory. Default: $( DEPLOY_DIR) "
138111 @echo " "
139112 @echo " NOTE: Source directories will have their checkout branch changed."
@@ -158,18 +131,15 @@ deploy: $(DEPLOY_DIR)
158131composer.phar :
159132 curl -sS https://getcomposer.org/installer | php
160133
161- install : composer.phar
134+ install : vendor/autoload.php
135+
136+ vendor/autoload.php : composer.json composer.lock composer.phar
162137 $(PHP ) $(COMPOSER ) install
163138
164139define build_docs
165140build-$(1 ) -$(5 ) : install
166- cd $($(2 ) ) && git checkout -f $(6 )
167- $(if $(filter no-vendor,$(7 ) ) ,cd $($(2 ) ) && rm -rf ./vendor,cd $($(2 ) ) && $(PHP ) $(COMPOSER ) update $(COMPOSER_UPDATE_FLAGS ) )
168- mkdir -p $(BUILD_DIR ) /$(3 ) /$(5 )
169- cp -r static/assets/* $(BUILD_DIR ) /$(3 ) /$(5 )
170-
171- $(PHP ) bin/apitool.php generate --config $(4 ) --version $(5 ) --tag $(6 ) \
172- --output-dir $(BUILD_DIR ) /$(3 ) /$(5 ) $($(2 ) )
141+ sh bin/build-release.sh "$(PHP ) " "$(COMPOSER ) " "$($(2 ) ) " "$(BUILD_DIR ) /$(3 ) /$(5 ) " \
142+ "$(4 ) " "$(5 ) " "$(6 ) " "$(7 ) " "$(COMPOSER_UPDATE_FLAGS ) " "$(DOCS_CACHE_DIR ) "
173143endef
174144
175145build-cakephp3-all : $(foreach version,$(CAKEPHP3_VERSIONS ) ,build-cakephp-$(version ) )
0 commit comments