Skip to content
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

build_docs: enhanced antora detection logic #88

Merged
merged 1 commit into from
Jan 13, 2025
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
15 changes: 12 additions & 3 deletions build_docs/linuxdocs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -150,8 +150,17 @@ all_types="main antora cppalv1"
cppalv1_types="not_currently_used skipping_this"

if [ -z "$typeoption" ]; then
if [ -f "$BOOST_SRC_FOLDER/doc/build_antora.sh" ]; then
typeoption="antora"
# if [ -f "$BOOST_SRC_FOLDER/doc/build_antora.sh" ]; then
# if ls -1 "$BOOST_SRC_FOLDER/doc/" | grep -i antora > /dev/null; then
if find "$BOOST_SRC_FOLDER/doc/" -maxdepth 1 -name '*antora*' | grep . ; then
if [ -f "$BOOST_SRC_FOLDER/doc/Jamfile" ] || [ -f "$BOOST_SRC_FOLDER/doc/jamfile" ] || [ -f "$BOOST_SRC_FOLDER/doc/Jamfile.v2" ] || [ -f "$BOOST_SRC_FOLDER/doc/jamfile.v2" ] || [ -f "$BOOST_SRC_FOLDER/doc/Jamfile.v3" ] || [ -f "$BOOST_SRC_FOLDER/doc/jamfile.v3" ] || [ -f "$BOOST_SRC_FOLDER/doc/Jamfile.jam" ] || [ -f "$BOOST_SRC_FOLDER/doc/jamfile.jam" ] || [ -f "$BOOST_SRC_FOLDER/doc/build.jam" ] ; then
echo "doc/build_antora.sh or another doc/antora file exists however there is also a Jamfile. Ambiguous result. For the moment, prefer the Jamfile. Proceeding."
install_antora_deps="yes"
typeoption="main"
else
echo "build_antora.sh exists. Setting build type to antora."
typeoption="antora"
fi
elif [[ " $cppalv1_types " =~ .*\ $REPONAME\ .* ]]; then
# not used currently, but an example
typeoption="cppalv1"
Expand Down Expand Up @@ -181,7 +190,7 @@ if [ "$skippackagesoption" != "yes" ]; then

sudo apt-get install -y build-essential cmake curl default-jre-headless python3 python3-venv rsync unzip wget

if [ "$typeoption" = "antora" ]; then
if [ "$typeoption" = "antora" ] || [ "$install_antora_deps" = "yes" ]; then

mkdir -p ~/.nvm_${REPONAME}_antora
export NODE_VERSION=18.18.1
Expand Down
15 changes: 12 additions & 3 deletions build_docs/macosdocs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -172,8 +172,17 @@ all_types="main antora cppalv1"
cppalv1_types="not_currently_used skipping_this"

if [ -z "$typeoption" ]; then
if [ -f "$BOOST_SRC_FOLDER/doc/build_antora.sh" ]; then
typeoption="antora"
# if [ -f "$BOOST_SRC_FOLDER/doc/build_antora.sh" ]; then
# if ls -1 "$BOOST_SRC_FOLDER/doc/" | grep -i antora > /dev/null; then
if find "$BOOST_SRC_FOLDER/doc/" -maxdepth 1 -name '*antora*' | grep . ; then
if [ -f "$BOOST_SRC_FOLDER/doc/Jamfile" ] || [ -f "$BOOST_SRC_FOLDER/doc/jamfile" ] || [ -f "$BOOST_SRC_FOLDER/doc/Jamfile.v2" ] || [ -f "$BOOST_SRC_FOLDER/doc/jamfile.v2" ] || [ -f "$BOOST_SRC_FOLDER/doc/Jamfile.v3" ] || [ -f "$BOOST_SRC_FOLDER/doc/jamfile.v3" ] || [ -f "$BOOST_SRC_FOLDER/doc/Jamfile.jam" ] || [ -f "$BOOST_SRC_FOLDER/doc/jamfile.jam" ] || [ -f "$BOOST_SRC_FOLDER/doc/build.jam" ] ; then
echo "doc/build_antora.sh or another doc/antora file exists however there is also a Jamfile. Ambiguous result. For the moment, prefer the Jamfile. Proceeding."
install_antora_deps="yes"
typeoption="main"
else
echo "build_antora.sh exists. Setting build type to antora."
typeoption="antora"
fi
elif [[ " $cppalv1_types " =~ .*\ $REPONAME\ .* ]]; then
# not used currently, but an example
typeoption="cppalv1"
Expand All @@ -197,7 +206,7 @@ echo '==================================> INSTALL'

if [ "$skippackagesoption" != "yes" ]; then

if [ "$typeoption" = "antora" ]; then
if [ "$typeoption" = "antora" ] || [ "$install_antora_deps" = "yes" ]; then
mkdir -p ~/.nvm_${REPONAME}_antora
export NODE_VERSION=18.18.1
# The container has a pre-installed nodejs. Overwrite those again.
Expand Down
17 changes: 13 additions & 4 deletions build_docs/windowsdocs.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -220,8 +220,17 @@ $cppalv1_types="not_currently_used skipping_this"

if (! $typeoption ) {

if (Test-Path "$BOOST_SRC_FOLDER\doc\build_antora.sh") {
$typeoption="antora"
# if (Test-Path "$BOOST_SRC_FOLDER\doc\build_antora.sh") {
if ( Get-ChildItem -Path "$BOOST_SRC_FOLDER\doc\" "*antora*" ) {
if ( (Test-Path -Path $BOOST_SRC_FOLDER/doc/Jamfile) -or (Test-Path -Path $BOOST_SRC_FOLDER/doc/Jamfile.v2) -or (Test-Path -Path $BOOST_SRC_FOLDER/doc/Jamfile.v3) -or (Test-Path -Path $BOOST_SRC_FOLDER/doc/Jamfile.jam) -or (Test-Path -Path $BOOST_SRC_FOLDER/doc/build.jam)) {
Write-Output "doc/build_antora.sh or another doc/antora file exists however there is also a Jamfile. Ambiguous result. For the moment, prefer the Jamfile. Proceeding."
$install_antora_deps="yes"
$typeoption="main"
}
else {
Write-Output "build_antora.sh exists. Setting build type to antora."
$typeoption="antora"
}
}
elseif ($cppalv1_types.contains($REPONAME)) {
$typeoption="cppalv1"
Expand Down Expand Up @@ -296,7 +305,7 @@ if ( -Not ${skip-packages} ) {

refenv

if ($typeoption -eq "antora") {
if (($typeoption -eq "antora") -or ($install_antora_deps -eq "yes")) {

if ( -Not (Get-Command clang++ -errorAction SilentlyContinue) )
{
Expand Down Expand Up @@ -787,5 +796,5 @@ else {
}

Pop-Location
echo "At the end of $scriptname"
Write-Output "At the end of $scriptname"
exit 0
Loading