You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by ro...@apache.org on 2019/03/29 06:25:53 UTC

[cloudstack] branch master updated: apidocs: Make the API documentation version not *hardcoded* to v4.9.0 (#3247)

This is an automated email from the ASF dual-hosted git repository.

rohit pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/cloudstack.git


The following commit(s) were added to refs/heads/master by this push:
     new 6c841bf  apidocs: Make the API documentation version not *hardcoded* to v4.9.0 (#3247)
6c841bf is described below

commit 6c841bf69b96dfedcc1ab589a64700b85167f361
Author: Gabriel Beims Bräscher <ga...@gmail.com>
AuthorDate: Fri Mar 29 03:25:45 2019 -0300

    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 4e1f9a6..1b0f4f3 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 7e8ef78..d727197 100644
--- a/tools/apidoc/generatecommands.xsl
+++ b/tools/apidoc/generatecommands.xsl
@@ -55,13 +55,12 @@ version="1.0">
 			<div class="api_titlebox">
 				<div class="api_titlebox_left">
 				<xsl:for-each select="command/command">
-					<!-- Modify this line for the release version -->
 					<span>
-									Apache CloudStack v4.9.0 Root Admin API Reference
-								</span>
-								<p></p>
-                                <h1><xsl:value-of select="name"/></h1>
-                                <p><xsl:value-of select="description"/></p>
+						Apache CloudStack %ACS_RELEASE% Root Admin API Reference
+					</span>
+					<p></p>
+					<h1><xsl:value-of select="name"/></h1>
+					<p><xsl:value-of select="description"/></p>
 				</xsl:for-each>
                             </div>
 
diff --git a/tools/apidoc/generatetoc_header.xsl b/tools/apidoc/generatetoc_header.xsl
index 6362ab8..b522da6 100644
--- a/tools/apidoc/generatetoc_header.xsl
+++ b/tools/apidoc/generatetoc_header.xsl
@@ -51,8 +51,7 @@ version="1.0">
              	
                 <div class="inside_apileftpanel">
                 	<div class="inside_contentpanel" style="width:930px;">
-              		  	<!-- Modify this line for the release version -->
-                      <h1>Apache CloudStack API Documentation (v4.9.0)</h1>
+                      <h1>Apache CloudStack API Documentation (%ACS_RELEASE%)</h1>
                       <a class="api_backbutton" href="http://cloudstack.apache.org/docs/api/"></a>
                         <div class="apiannouncement_box">
                         	<div class="apiannouncement_contentarea">
diff --git a/tools/apidoc/pom.xml b/tools/apidoc/pom.xml
index 8ad3830..c2d5748 100644
--- a/tools/apidoc/pom.xml
+++ b/tools/apidoc/pom.xml
@@ -63,6 +63,7 @@
                             <executable>bash</executable>
                             <arguments>
                                 <argument>./build-apidoc.sh</argument>
+                                <armument>${project.version}</armument>
                                 <argument>${client.config.jars}</argument>
                                 <argument>${client.config.jars}</argument>
                                 <argument>./target</argument>