From 7368cc0946de8bcd08891ef37b0943608ea94faf Mon Sep 17 00:00:00 2001 From: GabrielBrascher Date: Thu, 28 Mar 2019 11:03:32 -0300 Subject: [PATCH 1/2] Currently the API documentation is *hardcoded* to v4.9.0 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 | 2 +- tools/apidoc/generatetoc_header.xsl | 2 +- tools/apidoc/pom.xml | 1 + 4 files changed, 7 insertions(+), 2 deletions(-) diff --git a/tools/apidoc/build-apidoc.sh b/tools/apidoc/build-apidoc.sh index 4e1f9a639d14..1b0f4f36ca32 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 7e8ef78df36b..b455a55d105a 100644 --- a/tools/apidoc/generatecommands.xsl +++ b/tools/apidoc/generatecommands.xsl @@ -57,7 +57,7 @@ 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 6362ab861061..54faf07be93c 100644 --- a/tools/apidoc/generatetoc_header.xsl +++ b/tools/apidoc/generatetoc_header.xsl @@ -52,7 +52,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 5c8ec857a91f..2758954da69b 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 From 6c01687d55fbd2a2d38e4da9b279f7116c5a53ad Mon Sep 17 00:00:00 2001 From: GabrielBrascher Date: Thu, 28 Mar 2019 14:48:57 -0300 Subject: [PATCH 2/2] Remove line --- tools/apidoc/generatecommands.xsl | 11 +++++------ tools/apidoc/generatetoc_header.xsl | 1 - 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/tools/apidoc/generatecommands.xsl b/tools/apidoc/generatecommands.xsl index b455a55d105a..d727197c88bf 100644 --- a/tools/apidoc/generatecommands.xsl +++ b/tools/apidoc/generatecommands.xsl @@ -55,13 +55,12 @@ version="1.0">
- - Apache CloudStack %ACS_RELEASE% 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 54faf07be93c..b522da644dbd 100644 --- a/tools/apidoc/generatetoc_header.xsl +++ b/tools/apidoc/generatetoc_header.xsl @@ -51,7 +51,6 @@ version="1.0">
-

Apache CloudStack API Documentation (%ACS_RELEASE%)