brooklyn-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rich...@apache.org
Subject [2/3] incubator-brooklyn git commit: allow `--skip-javadoc` on builds if javadoc is already built
Date Tue, 23 Dec 2014 11:14:14 GMT
allow `--skip-javadoc` on builds if javadoc is already built


Project: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/commit/39e02b41
Tree: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/tree/39e02b41
Diff: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/diff/39e02b41

Branch: refs/heads/master
Commit: 39e02b41fc5fa1e10896e8a3e80bcce724fceabb
Parents: e8588ef
Author: Alex Heneveld <alex.heneveld@cloudsoftcorp.com>
Authored: Mon Dec 22 19:33:26 2014 +0000
Committer: Alex Heneveld <alex.heneveld@cloudsoftcorp.com>
Committed: Mon Dec 22 19:33:26 2014 +0000

----------------------------------------------------------------------
 docs/README.md       |  5 +++++
 docs/_build/build.sh | 36 ++++++++++++++++++++++--------------
 2 files changed, 27 insertions(+), 14 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/39e02b41/docs/README.md
----------------------------------------------------------------------
diff --git a/docs/README.md b/docs/README.md
index caaea02..4fb6b5d 100644
--- a/docs/README.md
+++ b/docs/README.md
@@ -221,6 +221,11 @@ Then check in the changes (probably picking a better message than shown
here):
 
 The changes should become live within a few minutes.
 
+SVN commits can be **slow**, particularly if you've regenerated javadoc.
+(The date is included in all javadoc files so the commands above will cause *all* javadoc
to be updated.)
+Use `_build/build.sh guide-version --install --skip-javadoc` to update master while re-using
the previously installed javadoc.
+That command will fail if javadoc has not been generated for that version.
+
 
 More Notes on the Code
 ----------------------

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/39e02b41/docs/_build/build.sh
----------------------------------------------------------------------
diff --git a/docs/_build/build.sh b/docs/_build/build.sh
index ced17a7..a56f4c3 100755
--- a/docs/_build/build.sh
+++ b/docs/_build/build.sh
@@ -54,7 +54,7 @@ function parse_mode() {
     DIRS_TO_MOVE_TARGET[1]=v/latest/style
     INSTALL_RSYNC_OPTIONS=""
     INSTALL_RSYNC_SUBDIR=${DIRS_TO_MOVE_TARGET[0]}/
-    JAVADOC_TARGET=_site/${DIRS_TO_MOVE_TARGET[0]}/use/api/
+    JAVADOC_TARGET=${DIRS_TO_MOVE_TARGET[0]}/use/api/
     SUMMARY="user guide files in /${DIRS_TO_MOVE_TARGET[0]}"
     ;;
   guide-version)
@@ -67,14 +67,14 @@ function parse_mode() {
     DIRS_TO_MOVE_TARGET[1]=${DIRS_TO_MOVE_TARGET[0]}/style
     INSTALL_RSYNC_OPTIONS=""
     INSTALL_RSYNC_SUBDIR=${DIRS_TO_MOVE_TARGET[0]}/
-    JAVADOC_TARGET=_site/${DIRS_TO_MOVE_TARGET[0]}/use/api/
+    JAVADOC_TARGET=${DIRS_TO_MOVE_TARGET[0]}/use/api/
     SUMMARY="user guide files in /${DIRS_TO_MOVE_TARGET[0]}"
     ;;
   test-guide-root)
     JEKYLL_CONFIG=_config.yml,_build/config-production.yml,_build/config-exclude-all-but-guide.yml,_build/config-guide-root.yml
     DIRS_TO_MOVE[0]=guide
     DIRS_TO_MOVE_TARGET[0]=""
-    JAVADOC_TARGET=_site/use/api/
+    JAVADOC_TARGET=use/api/
     SUMMARY="user guide files in the root"
     ;;
   test-both)
@@ -83,7 +83,7 @@ function parse_mode() {
     DIRS_TO_MOVE_TARGET[0]=v/latest
     DIRS_TO_MOVE[1]=website
     DIRS_TO_MOVE_TARGET[1]=""
-    JAVADOC_TARGET=_site/${DIRS_TO_MOVE_TARGET[0]}/use/api/
+    JAVADOC_TARGET=${DIRS_TO_MOVE_TARGET[0]}/use/api/
     SUMMARY="all files, website in root and guide in /${DIRS_TO_MOVE_TARGET[0]}"
     ;;
   test-both-sub)
@@ -94,7 +94,7 @@ function parse_mode() {
     DIRS_TO_MOVE_TARGET[1]=brooklyn
     DIRS_TO_MOVE[2]=style
     DIRS_TO_MOVE_TARGET[2]=brooklyn/style
-    JAVADOC_TARGET=_site/${DIRS_TO_MOVE_TARGET[0]}/use/api/
+    JAVADOC_TARGET=${DIRS_TO_MOVE_TARGET[0]}/use/api/
     SUMMARY="all files in /brooklyn"
     ;;
   original)
@@ -168,11 +168,11 @@ function make_javadoc() {
   fi
   popd > /dev/null
   if [ ! -z "$JAVADOC_TARGET" ]; then
-    if [ ! -d "$JAVADOC_TARGET" ]; then
-      echo "ERROR: javadoc target directory $JAVADOC_TARGET gone; is there a jekyll already
watching?"
+    if [ ! -d "_site/$JAVADOC_TARGET" ]; then
+      echo "ERROR: javadoc target directory _site/$JAVADOC_TARGET gone; is there a jekyll
already watching?"
       return 1
     fi
-    mv _build/target/apidocs/* $JAVADOC_TARGET
+    mv _build/target/apidocs/* _site/$JAVADOC_TARGET
   fi
 }
 
@@ -189,12 +189,6 @@ function make_install() {
     return 1
   fi
   if [ ! -z ${QUICK_JAVADOC+SET} ]; then echo "ERROR: --install not permitted when doing
quick javadoc" ; return 1 ; fi
-  if [ ! -z ${JAVADOC_TARGET+SET} ]; then
-    if [ ! -z ${SKIP_JAVADOC+SET} ]; then
-      echo "ERROR: --install not permitted when skipping javadoc for this target which wants
to install javadoc"
-      return 1
-    fi
-  fi
 
   SITE_DIR=${BROOKLYN_SITE_DIR-../../incubator-brooklyn-site-public}
   ls $SITE_DIR/style/img/apache-brooklyn-logo-244px-wide.png > /dev/null || { echo "ERROR:
cannot find incubator-brooklyn-site-public; set BROOKLYN_SITE_DIR" ; return 1 ; }
@@ -202,6 +196,20 @@ function make_install() {
   if [ -z ${INSTALL_RSYNC_SUBDIR+SET} ]; then echo "ERROR: --install not supported for this
build" ; return 1 ; fi
   
   RSYNC_COMMAND_BASE="rsync -rvi --delete --exclude .svn"
+  
+  if [ ! -z ${JAVADOC_TARGET+SET} ]; then
+    if [ ! -z ${SKIP_JAVADOC+SET} ]; then
+      echo 'grep "Generated by javadoc" '$SITE_DIR/$INSTALL_RSYNC_SUBDIR/use/api/index.html
+      export JAVADOC_LAST_DATE=`grep "Generated by javadoc" $SITE_DIR/$INSTALL_RSYNC_SUBDIR/use/api/index.html`
+      if [ -z "$JAVADOC_LAST_DATE" ]; then
+        echo "ERROR: installing with skipped javadoc, but no previous javadoc exists"
+        return 1
+      fi
+      echo "Installing with skipped javadoc, reusing old: $JAVADOC_LAST_DATE"
+      RSYNC_COMMAND_BASE="$RSYNC_COMMAND_BASE --exclude use/api"
+    fi
+  fi
+  
   RSYNC_COMMAND="$RSYNC_COMMAND_BASE $INSTALL_RSYNC_OPTIONS ./_site/$INSTALL_RSYNC_SUBDIR
$SITE_DIR/$INSTALL_RSYNC_SUBDIR"
   echo INSTALLING to local site svn repo with: $RSYNC_COMMAND
   $RSYNC_COMMAND || return 1


Mime
View raw message