You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kudu.apache.org by mp...@apache.org on 2016/07/26 22:36:18 UTC

incubator-kudu git commit: Fix a couple bugs in make_site.sh

Repository: incubator-kudu
Updated Branches:
  refs/heads/master 96c096010 -> 9cd393607


Fix a couple bugs in make_site.sh

This patch fixes a couple minor script bugs:

* zip command should not quote arguments
* doxygen output appears in build dir, not source dir

Also makes a couple other minor changes:

* Run doxygen by default so people updating the site don't tend to
  forget to run it, but retain an option to skip it
* Add a --help option to the command

Tested on Ubuntu 16.04 in both default and --no-doxygen modes, with and
without doxygen installed.

Change-Id: I3332fc36c9e33baed82f3eabfb5866a9cd41422f
Reviewed-on: http://gerrit.cloudera.org:8080/3780
Tested-by: Kudu Jenkins
Reviewed-by: Adar Dembo <ad...@cloudera.com>


Project: http://git-wip-us.apache.org/repos/asf/incubator-kudu/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-kudu/commit/9cd39360
Tree: http://git-wip-us.apache.org/repos/asf/incubator-kudu/tree/9cd39360
Diff: http://git-wip-us.apache.org/repos/asf/incubator-kudu/diff/9cd39360

Branch: refs/heads/master
Commit: 9cd3936073572dac93157a9a79e4811df3b60bb4
Parents: 96c0960
Author: Mike Percy <mp...@apache.org>
Authored: Tue Jul 26 14:38:05 2016 -0700
Committer: Mike Percy <mp...@apache.org>
Committed: Tue Jul 26 22:36:04 2016 +0000

----------------------------------------------------------------------
 docs/support/scripts/make_site.sh | 31 ++++++++++++++++++++++---------
 1 file changed, 22 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/9cd39360/docs/support/scripts/make_site.sh
----------------------------------------------------------------------
diff --git a/docs/support/scripts/make_site.sh b/docs/support/scripts/make_site.sh
index 0960682..110984e 100755
--- a/docs/support/scripts/make_site.sh
+++ b/docs/support/scripts/make_site.sh
@@ -19,8 +19,6 @@
 # under the License.
 #
 # This script generates site documentation and Javadocs.
-#
-# Usage: make_site.sh
 ########################################################################
 set -e
 
@@ -29,15 +27,30 @@ SOURCE_ROOT=$(cd $(dirname $0)/../../..; pwd)
 BUILD_ROOT="$SOURCE_ROOT/build/$BUILD_TYPE"
 SITE_OUTPUT_DIR="$BUILD_ROOT/site"
 
+OPT_DOXYGEN=1 # By default, build doxygen docs.
+
+usage() {
+  echo "Usage: $0 [--no-doxygen]"
+  echo "Specify --no-doxygen to skip generation of the C++ client API docs"
+  exit 1
+}
+
 if [ $# -gt 0 ]; then
   for arg in $*; do
     case $arg in
-      "doxygen")  OPT_DOXYGEN=1 ;;
-      *)          echo "unknown option: $arg"; exit 1 ;;
+      "--no-doxygen")  OPT_DOXYGEN='' ;;
+      "--help")        usage ;;
+      "-h")            usage ;;
+      *)               echo "Unknown command-line option: $arg"; usage ;;
     esac
   done
 fi
 
+if [ -n "$OPT_DOXYGEN" ] && ! which doxygen >/dev/null 2>&1; then
+  echo "Error: doxygen not found."
+  usage
+fi
+
 set -x
 
 cd "$SOURCE_ROOT"
@@ -55,11 +68,11 @@ $SOURCE_ROOT/build-support/enable_devtoolset.sh \
     -DNO_TESTS=1 \
     -DCMAKE_BUILD_TYPE=$BUILD_TYPE \
     $SOURCE_ROOT
+MAKE_TARGETS=all
 if [ -n "$OPT_DOXYGEN" ]; then
-  make -j$(getconf _NPROCESSORS_ONLN) all doxygen
-else
-  make -j$(getconf _NPROCESSORS_ONLN)
+  MAKE_TARGETS="$MAKE_TARGETS doxygen"
 fi
+make -j$(getconf _NPROCESSORS_ONLN) $MAKE_TARGETS
 
 # Check out the gh-pages repo into $SITE_OUTPUT_DIR
 git clone -q $(git config --get remote.origin.url) --reference $SOURCE_ROOT -b gh-pages --depth 1 "$SITE_OUTPUT_DIR"
@@ -94,7 +107,7 @@ cp -au "$SOURCE_ROOT/java/target/site/apidocs" "$SITE_OUTPUT_DIR/"
 if [ -n "$OPT_DOXYGEN" ]; then
   CPP_CLIENT_API_SUBDIR="cpp-client-api"
   rm -Rf "$SITE_OUTPUT_DIR/$CPP_CLIENT_API_SUBDIR"
-  cp -a "$SOURCE_ROOT/docs/doxygen/client_api/html" "$SITE_OUTPUT_DIR/$CPP_CLIENT_API_SUBDIR"
+  cp -a "$BUILD_ROOT/docs/doxygen/client_api/html" "$SITE_OUTPUT_DIR/$CPP_CLIENT_API_SUBDIR"
 fi
 
 SITE_SUBDIRS="docs apidocs"
@@ -104,7 +117,7 @@ fi
 
 cd "$SITE_OUTPUT_DIR"
 SITE_ARCHIVE="$SITE_OUTPUT_DIR/website_archive.zip"
-zip -rq "$SITE_ARCHIVE" "$SITE_SUBDIRS"
+zip -rq "$SITE_ARCHIVE" $SITE_SUBDIRS
 
 echo "Generated web site at $SITE_OUTPUT_DIR"
 echo "Docs zip generated at $SITE_ARCHIVE"