Skip to content

Commit

Permalink
Fixed the building of javadoc/doxygen/pydoc on site2 build (apache#3639)
Browse files Browse the repository at this point in the history
  • Loading branch information
merlimat authored Feb 21, 2019
1 parent c31ccd1 commit 6e54f89
Show file tree
Hide file tree
Showing 7 changed files with 44 additions and 9 deletions.
2 changes: 1 addition & 1 deletion pulsar-client-cpp/Doxyfile
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ PROJECT_LOGO =
# entered, it will be relative to the location where doxygen was started. If
# left blank the current directory will be used.

OUTPUT_DIRECTORY = ../site/api/cpp
OUTPUT_DIRECTORY = ../generated-site/api/cpp

# If the CREATE_SUBDIRS tag is set to YES then doxygen will create 4096 sub-
# directories (in 2 levels) under the output directory of each output format and
Expand Down
2 changes: 1 addition & 1 deletion site2/tools/docker-build-site.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,4 @@ CROWDIN_DOCUSAURUS_API_KEY=${CROWDIN_DOCUSAURUS_API_KEY:-UNSET}

DOCKER_CMD="docker run -i -e CI_USER=$CI_USER -e CI_GROUP=$CI_GROUP -e CROWDIN_DOCUSAURUS_PROJECT_ID=${CROWDIN_DOCUSAURUS_PROJECT_ID} -e CROWDIN_DOCUSAURUS_API_KEY=${CROWDIN_DOCUSAURUS_API_KEY} -v $ROOT_DIR:/pulsar $IMAGE"

$DOCKER_CMD bash -l -c 'cd /pulsar/site2/website && yarn && yarn write-translations && yarn run crowdin-upload && yarn run crowdin-download && yarn build && node ./scripts/replace.js && rm -rf /pulsar/generated-site/content && mkdir -p /pulsar/generated-site/content && cp -R ./build/pulsar/* /pulsar/generated-site/content'
$DOCKER_CMD bash -l -c '/pulsar/site/tools/generate-api-docs.sh && cd /pulsar/site2/website && yarn && yarn write-translations && yarn run crowdin-upload && yarn run crowdin-download && yarn build && node ./scripts/replace.js && rm -rf /pulsar/generated-site/content && mkdir -p /pulsar/generated-site/content && cp -R ./build/pulsar/* /pulsar/generated-site/content'
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,18 @@
# under the License.
#

set -x -e

ROOT_DIR=$(git rev-parse --show-toplevel)
DOXYGEN=doxygen
TMP_DIR=$(mktemp -d)

mkdir -p $ROOT_DIR/generated-site/api/cpp

(
cd $ROOT_DIR/pulsar-client-cpp
$DOXYGEN Doxyfile
)

mv api/cpp $TMP_DIR
mv $TMP_DIR/cpp/html api/cpp
mv $ROOT_DIR/generated-site/api/cpp $TMP_DIR
mv $TMP_DIR/cpp/html $ROOT_DIR/generated-site/api/cpp
31 changes: 31 additions & 0 deletions site2/tools/generate-api-docs.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#!/bin/bash
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#

set -x -e

SCRIPT_DIR=`dirname "$0"`

cd $SCRIPT_DIR

./doxygen-doc-gen.sh

./javadoc-gen.sh

./python-doc-gen.sh
9 changes: 5 additions & 4 deletions site/scripts/javadoc-gen.sh → site2/tools/javadoc-gen.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@


ROOT_DIR=$(git rev-parse --show-toplevel)
DEST_DIR=$ROOT_DIR/generated-site
JDK_COMMON_PKGS=java.lang:java.util:java.util.concurrent:java.nio:java.net:java.io

(
Expand All @@ -31,20 +32,20 @@ JDK_COMMON_PKGS=java.lang:java.util:java.util.concurrent:java.nio:java.net:java.
-windowtitle "Pulsar Client Java API" \
-doctitle "Pulsar Client Java API" \
-overview site/javadoc/client.html \
-d site/api/client \
-d $DEST_DIR/api/client \
-subpackages org.apache.pulsar.client.api \
-noqualifier $JDK_COMMON_PKGS \
-notimestamp \
-Xdoclint:none \
`find pulsar-client/src/main/java/org/apache/pulsar/client/api -name *.java`
`find pulsar-client-api/src/main/java/org/apache/pulsar/client/api -name *.java`

# Java admin
javadoc \
-quiet \
-windowtitle "Pulsar Admin Java API" \
-doctitle "Pulsar Admin Java API" \
-overview site/javadoc/admin.html \
-d site/api/admin \
-d $DEST_DIR/api/admin \
-noqualifier $JDK_COMMON_PKGS \
-notimestamp \
-Xdoclint:none \
Expand All @@ -57,7 +58,7 @@ JDK_COMMON_PKGS=java.lang:java.util:java.util.concurrent:java.nio:java.net:java.
-windowtitle "Pulsar Functions Java SDK" \
-doctitle "Pulsar Functions Java SDK" \
-overview site/javadoc/pulsar-functions.html \
-d site/api/pulsar-functions \
-d $DEST_DIR/api/pulsar-functions \
-noqualifier $JDK_COMMON_PKGS \
-notimestamp \
-Xdoclint:none \
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ ROOT_DIR=$(git rev-parse --show-toplevel)
# so that Pdoc can import the module
pip install pulsar-client

DESTINATION=$ROOT_DIR/site/api/python
DESTINATION=$ROOT_DIR/generated-site/api/python
rm -fr $DESTINATION/{index.html,functions,pulsar}
PYTHONPATH=$ROOT_DIR/pulsar-client-cpp/python pdoc pulsar \
--html \
Expand Down

0 comments on commit 6e54f89

Please sign in to comment.