Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update generate_documentation.sh #7858

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
109 changes: 53 additions & 56 deletions doc/generate_documentation.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,29 +8,23 @@ GEN_PDF=false
GEN_ALL=false
INSTALL_DOX=false

command -v g++
if [ $? -ne "0" ]; then
echo "Please install g++"
exit 1
fi
find_cmd () {
missing=""

command -v cmake
if [ $? -ne "0" ]; then
echo "Please install cmake"
exit 1
fi
for cmd in "$@" ; do
command -V $cmd 2> /dev/null
if [ $? -ne "0" ]; then
missing="$missing $cmd"
fi
done

command -v git
if [ $? -ne "0" ]; then
echo "Please install git"
exit 1
fi

command -v make
if [ $? -ne "0" ]; then
echo "Please install make"
exit 1
fi
if [ -n "$missing" ]; then
echo
echo "The following executables are missing. Please install:"
echo " $missing"
exit 1
fi
}

# Checking arguments and setting appropriate option variables

Expand Down Expand Up @@ -59,54 +53,57 @@ done
# True - doxygen from "which doxygen" is used to generate documentation
# False - clones doxygen Release_1_8_13 and ./build/bin/ added to PATH

if [ $INSTALL_DOX = true ] && [ ! "$(which doxygen)" ]; then
mkdir -p build
cd build
echo "cloning doxygen 1.8.13..."
git clone --depth 1 --branch Release_1_8_13 https://github.com/doxygen/doxygen
cmake -G "Unix Makefiles" doxygen/
make
cd ..
export PATH="./build/bin/:$PATH"
if [ $INSTALL_DOX = true ] && [ ! "$(which doxygen 2>/dev/null)" ]; then
find_cmd git cmake g++ make
mkdir -p build
cd build
echo "cloning doxygen 1.8.13..."
git clone --depth 1 --branch Release_1_8_13 https://github.com/doxygen/doxygen
cmake -G "Unix Makefiles" doxygen/
make
cd ..
export PATH="./build/bin/:$PATH"
fi

# Runs script to check that all API with documentation match wolfSSL API
if [ $CHECK_API = true ]; then
./check_api.sh
./check_api.sh
fi

if [ $? = 1 ]; then
echo "Not all API match"
exit 1
echo "Not all API match"
exit 1
fi

#HTML GENERATION
if [ $GEN_HTML = true ] || [ $GEN_ALL = true ]; then
cp -r formats/html/* ./
echo "generating html..."
doxygen Doxyfile
cp html_changes/search/* html/search/
cp html_changes/*.css html/
cp html_changes/*.js html/
rm footer.html header.html
rm -rf html_changes
rm mainpage.dox
rm Doxyfile
echo "finished generating html..."
echo "To view the html files use a browser to open the index.html file located at doc/html/index.html"
find_cmd doxygen
cp -r formats/html/* ./
echo "generating html..."
doxygen Doxyfile
cp html_changes/search/* html/search/
cp html_changes/*.css html/
cp html_changes/*.js html/
rm footer.html header.html
rm -rf html_changes
rm mainpage.dox
rm Doxyfile
echo "finished generating html..."
echo "To view the html files use a browser to open the index.html file located at doc/html/index.html"
fi

#PDF GENERATION
if [ $GEN_PDF = true ] || [ $GEN_ALL = true ]; then
cp -r formats/pdf/* ./
echo "generating pdf..."
doxygen Doxyfile
cd latex/
make
mv refman.pdf ../
cd ..
rm -rf latex/
rm Doxyfile
rm header.tex
echo "finished generating pdf..."
find_cmd make doxygen
cp -r formats/pdf/* ./
echo "generating pdf..."
doxygen Doxyfile
cd latex/
make
mv refman.pdf ../
cd ..
rm -rf latex/
rm Doxyfile
rm header.tex
echo "finished generating pdf..."
fi