Skip to content

Commit b0bba5a

Browse files
authored
IBX-9737: Enhance PHP API Ref generation tool (#2677)
* edition-tag.html.twig: New line before package In the tooltip, the new line was often after the slash (between vendor and package). Now, it's just before the package ref, before the vendor. https://www.w3.org/TR/2011/WD-html5-20110525/elements.html#the-title-attribute https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/title#multiline_titles * phpdoc.sh: Ease the targeting of a dev branch
1 parent f7e9cae commit b0bba5a

File tree

2 files changed

+24
-9
lines changed

2 files changed

+24
-9
lines changed

tools/php_api_ref/.phpdoc/template/components/edition-tag.html.twig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,6 @@
3232
{% endfor %}
3333
{% endif %}
3434
{% elseif package_edition_map[package] == 'optional' %}
35-
<div class="pill optional-pill" title="Included in the optional package {{ package }}"></div>
35+
<div class="pill optional-pill" title="Included in the optional package&#x000A;{{ package }}"></div>
3636
{% endif %}
3737
{% endblock %}

tools/php_api_ref/phpdoc.sh

Lines changed: 23 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ PHPDOC_DIR="$(pwd)/tools/php_api_ref/.phpdoc"; # Absolute path to phpDocumentor
1818
PHP_BINARY="php -d error_reporting=`php -r 'echo E_ALL & ~E_DEPRECATED;'`"; # Avoid depreciation messages from phpDocumentor/Reflection/issues/529 when using PHP 8.2 or higher
1919
TMP_DXP_DIR=/tmp/ibexa-dxp-phpdoc; # Absolute path of the temporary directory in which Ibexa DXP will be installed and the PHP API Reference built
2020
FORCE_DXP_INSTALL=1; # If 1, empty the temporary directory, install DXP from scratch, build, remove temporary directory; if 0, potentially reuse the DXP already installed in temporary directory, keep temporary directory for future uses.
21+
BASE_DXP_BRANCH=''; # Branch from and for which the Reference is built when using a dev branch as version
22+
VIRTUAL_DXP_VERSION=''; # Version for which the reference is supposedly built when using dev branch as version
2123

2224
if [ ! -d $OUTPUT_DIR ]; then
2325
echo -n "Creating ${OUTPUT_DIR}";
@@ -49,9 +51,18 @@ cd $TMP_DXP_DIR; # /!\ Change working directory (reason why all paths must be ab
4951

5052
if [ 0 -eq $DXP_ALREADY_EXISTS ]; then
5153
echo "Creating ibexa/$DXP_EDITION-skeleton:$DXP_VERSION project in ${TMP_DXP_DIR}";
52-
composer create-project ibexa/$DXP_EDITION-skeleton:$DXP_VERSION . --no-interaction --no-install --ignore-platform-reqs --no-scripts;
53-
if [ -n "$AUTH_JSON" ]; then
54-
cp $AUTH_JSON ./;
54+
if [[ "$DXP_VERSION" == *".x-dev" ]]; then
55+
composer create-project ibexa/website-skeleton:$DXP_VERSION . --no-interaction --no-install --ignore-platform-reqs --no-scripts --stability=dev;
56+
if [ -n "$AUTH_JSON" ]; then
57+
cp $AUTH_JSON ./;
58+
fi;
59+
composer config repositories.ibexa composer https://updates.ibexa.co;
60+
composer require ibexa/$DXP_EDITION:$DXP_VERSION --no-interaction --update-with-all-dependencies --no-install --ignore-platform-reqs --no-scripts;
61+
else
62+
composer create-project ibexa/$DXP_EDITION-skeleton:$DXP_VERSION . --no-interaction --no-install --ignore-platform-reqs --no-scripts;
63+
if [ -n "$AUTH_JSON" ]; then
64+
cp $AUTH_JSON ./;
65+
fi;
5566
fi;
5667
composer install --no-interaction --ignore-platform-reqs --no-scripts;
5768
fi;
@@ -70,11 +81,11 @@ if [ 0 -eq $DXP_ALREADY_EXISTS ]; then
7081
done;
7182
fi;
7283

73-
#if [ 0 -eq $DXP_ALREADY_EXISTS ]; then
74-
# MY_PACKAGE='';
75-
# MY_BRANCH='';
76-
# composer require --no-interaction --ignore-platform-reqs --no-scripts ibexa/$MY_PACKAGE "$MY_BRANCH as $DXP_VERSION";
77-
#fi;
84+
if [[ "$DXP_VERSION" == *".x-dev" ]]; then
85+
GIT_REF=$BASE_DXP_BRANCH;
86+
else
87+
GIT_REF="v$DXP_VERSION";
88+
fi
7889

7990
if [ 0 -eq $DXP_ALREADY_EXISTS ]; then
8091
echo -n 'Building package→edition map… ';
@@ -117,6 +128,10 @@ if [ 0 -eq $DXP_ALREADY_EXISTS ]; then
117128
echo 'OK';
118129
fi;
119130

131+
if [[ "$DXP_VERSION" == *".x-dev" ]]; then
132+
DXP_VERSION=$VIRTUAL_DXP_VERSION;
133+
fi;
134+
120135
echo 'Set up phpDocumentor…';
121136
sed "s/version number=\".*\"/version number=\"$DXP_VERSION\"/" $PHPDOC_CONF > ./phpdoc.dist.xml;
122137
mkdir .phpdoc;

0 commit comments

Comments
 (0)