From 6c841bf69b96dfedcc1ab589a64700b85167f361 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabriel=20Beims=20Br=C3=A4scher?= Date: Fri, 29 Mar 2019 03:25:45 -0300 Subject: [PATCH] apidocs: Make the API documentation version not *hardcoded* to v4.9.0 (#3247) This commit makes the API documentation automatically updated to the current project version. If one wants to set another version, it is possible by just editing the ACS_RELEASE variable in 'build-apidoc.sh'. --- tools/apidoc/build-apidoc.sh | 4 ++++ tools/apidoc/generatecommands.xsl | 11 +++++------ tools/apidoc/generatetoc_header.xsl | 3 +-- tools/apidoc/pom.xml | 1 + 4 files changed, 11 insertions(+), 8 deletions(-) diff --git a/tools/apidoc/build-apidoc.sh b/tools/apidoc/build-apidoc.sh index 4e1f9a639d1..1b0f4f36ca3 100755 --- a/tools/apidoc/build-apidoc.sh +++ b/tools/apidoc/build-apidoc.sh @@ -20,6 +20,8 @@ # cloud-build-api-doc.sh -- builds api documentation. #set -x #set -u +ACS_RELEASE="$1" +shift TARGETJARDIR="$1" shift DEPSDIR="$1" @@ -59,6 +61,8 @@ set -e cp "$thisdir"/*.java . cp "$thisdir"/*.xsl . sed -e 's,%API_HEADER%,All APIs,g' "$thisdir/generatetoc_header.xsl" >generatetoc.xsl + sed -i "s/%ACS_RELEASE%/${ACS_RELEASE}/g" generatetoc.xsl + sed -i "s/%ACS_RELEASE%/${ACS_RELEASE}/g" generatecommands.xsl PLATFORM=`uname -s` if [[ "$PLATFORM" =~ .*WIN.* ]] diff --git a/tools/apidoc/generatecommands.xsl b/tools/apidoc/generatecommands.xsl index 7e8ef78df36..d727197c88b 100644 --- a/tools/apidoc/generatecommands.xsl +++ b/tools/apidoc/generatecommands.xsl @@ -55,13 +55,12 @@ version="1.0">
- - Apache CloudStack v4.9.0 Root Admin API Reference - -

-

-

+ Apache CloudStack %ACS_RELEASE% Root Admin API Reference + +

+

+

diff --git a/tools/apidoc/generatetoc_header.xsl b/tools/apidoc/generatetoc_header.xsl index 6362ab86106..b522da644db 100644 --- a/tools/apidoc/generatetoc_header.xsl +++ b/tools/apidoc/generatetoc_header.xsl @@ -51,8 +51,7 @@ version="1.0">
- -

Apache CloudStack API Documentation (v4.9.0)

+

Apache CloudStack API Documentation (%ACS_RELEASE%)

diff --git a/tools/apidoc/pom.xml b/tools/apidoc/pom.xml index 8ad383020b7..c2d5748587e 100644 --- a/tools/apidoc/pom.xml +++ b/tools/apidoc/pom.xml @@ -63,6 +63,7 @@ bash ./build-apidoc.sh + ${project.version} ${client.config.jars} ${client.config.jars} ./target