bookkeeper-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From si...@apache.org
Subject [bookkeeper] branch master updated: ISSUE #435: Build javadoc for releases
Date Fri, 11 Aug 2017 22:27:33 GMT
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/master by this push:
     new caba6b1  ISSUE #435: Build javadoc for releases
caba6b1 is described below

commit caba6b1dbd7eab07c8c6dd518797c55739f3524e
Author: Sijie Guo <sijie@apache.org>
AuthorDate: Fri Aug 11 15:27:27 2017 -0700

    ISSUE #435: Build javadoc for releases
    
    Descriptions of the changes in this PR:
    
    - add javadoc links on sidebar and overview pages (try to promote this link for users
to find the link easier)
    - update javadoc-gen.sh to be able to generate latest javadoc and all javadocs for versions
under `docs`
    
    minor fixes:
    - pass "JEKYLL_ENV=production" to docker because ci uses docker to build the documentation
    -
    
    Author: Sijie Guo <sijie@apache.org>
    
    Reviewers: Matteo Merli <mmerli@apache.org>
    
    This closes #438 from sijie/publish_javadocs, closes #435
---
 site/Makefile                         |  5 +++-
 site/_data/sidebar.yaml               |  2 ++
 site/docker/ci.sh                     |  1 +
 site/docs/4.5.0/overview/overview.md  |  1 +
 site/docs/latest/overview/overview.md |  1 +
 site/scripts/javadoc-gen.sh           | 43 +++++++++++++++++++++++++++++++----
 6 files changed, 47 insertions(+), 6 deletions(-)

diff --git a/site/Makefile b/site/Makefile
index 7108380..0c08f51 100644
--- a/site/Makefile
+++ b/site/Makefile
@@ -27,7 +27,10 @@ apache: clean
 		--config _config.yml,_config.apache.yml
 
 javadoc:
-	scripts/javadoc-gen.sh
+	scripts/javadoc-gen.sh "all"
+
+latest_javadoc:
+	scripts/javadoc-gen.sh "latest"
 
 staging: clean
 	${JEKYLL} build --config _config.yml,_config.staging.yml
diff --git a/site/_data/sidebar.yaml b/site/_data/sidebar.yaml
index 9127619..3910791 100644
--- a/site/_data/sidebar.yaml
+++ b/site/_data/sidebar.yaml
@@ -45,6 +45,8 @@ groups:
     endpoint: ledger-adv-api
   - name: DistributedLog
     endpoint: distributedlog-api
+  - name: Java API Docs
+    endpoint: javadoc
 - name: Security
   dir: security
   docs:
diff --git a/site/docker/ci.sh b/site/docker/ci.sh
index 2e98840..262e2b3 100755
--- a/site/docker/ci.sh
+++ b/site/docker/ci.sh
@@ -57,6 +57,7 @@ docker run \
   -v "${BOOKKEEPER_DOC_ROOT}:${BOOKKEEPER_DOC_ROOT}" \
   -v "${LOCAL_HOME}:/home/${USER_NAME}" \
   -p 4000:4000 \
+  -e JEKYLL_ENV='production' \
   ${IMAGE_NAME}-${USER_NAME} \
   bash -c "make setup && make apache"
 
diff --git a/site/docs/4.5.0/overview/overview.md b/site/docs/4.5.0/overview/overview.md
index f2ff5b8..f5c39ba 100644
--- a/site/docs/4.5.0/overview/overview.md
+++ b/site/docs/4.5.0/overview/overview.md
@@ -35,6 +35,7 @@ It is suitable for being used in following scenerios:
 Learn more about Apache BookKeeper and what it can do for your organization:
 
 - [Apache BookKeeper 4.5.0 Release Notes](../releaseNotes)
+- [Java API docs](../../api/javadoc)
 
 Or start using Apache BookKeeper today.
 
diff --git a/site/docs/latest/overview/overview.md b/site/docs/latest/overview/overview.md
index 1c93193..9ca2698 100644
--- a/site/docs/latest/overview/overview.md
+++ b/site/docs/latest/overview/overview.md
@@ -35,6 +35,7 @@ It is suitable for being used in following scenerios:
 Learn more about Apache BookKeeper and what it can do for your organization:
 
 - [Apache BookKeeper {{ site.latest_version }} Release Notes](../releaseNotes)
+- [Java API docs](../../api/javadoc)
 
 Or start using Apache BookKeeper today.
 
diff --git a/site/scripts/javadoc-gen.sh b/site/scripts/javadoc-gen.sh
index f43795e..0998213 100755
--- a/site/scripts/javadoc-gen.sh
+++ b/site/scripts/javadoc-gen.sh
@@ -2,9 +2,42 @@
 
 source scripts/common.sh
 
-(
-  rm -rf $JAVADOC_GEN_DIR $JAVADOC_DEST_DIR
-  cd $ROOT_DIR
+function build_javadoc() {
+  version=$1
+
+  echo "Building the javadoc for version ${version}."
+  if [ "$version" == "latest" ]; then
+    javadoc_gen_dir="${ROOT_DIR}/target/site/apidocs"
+    cd $ROOT_DIR
+  else
+    javadoc_gen_dir="/tmp/bookkeeper-${version}/target/site/apidocs"
+    rm -rf /tmp/bookkeeper-${version}
+    git clone https://github.com/apache/bookkeeper /tmp/bookkeeper-${version}
+    cd /tmp/bookkeeper-${version}
+    git checkout "release-${version}"
+  fi
+  javadoc_dest_dir="${ROOT_DIR}/site/docs/${version}/api/javadoc"
+  rm -rf $javadoc_dest_dir
   mvn clean install javadoc:aggregate -DskipTests
-  mv $JAVADOC_GEN_DIR $JAVADOC_DEST_DIR
-)
+  mv $javadoc_gen_dir $javadoc_dest_dir
+
+  echo "Built the javadoc for version ${version}."
+}
+
+# get arguments
+version=$1
+shift
+
+case "${version}" in
+  latest)
+    build_javadoc ${version}
+    ;;
+  all)
+    for d in `ls ${ROOT_DIR}/site/docs`; do
+      build_javadoc $d
+    done
+    ;;
+  *)
+    echo "Unknown version '${version}' to build doc"
+    ;;
+esac

-- 
To stop receiving notification emails like this one, please contact
['"commits@bookkeeper.apache.org" <commits@bookkeeper.apache.org>'].

Mime
View raw message