Skip to content

Commit

Permalink
Update .auto-build.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
Erriez committed Aug 21, 2022
1 parent 5851902 commit 8d1edf8
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 17 deletions.
68 changes: 52 additions & 16 deletions .auto-build.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,27 @@
#/bin/bash
#
# MIT License
#
# Copyright (c) 2022 Erriez
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
#

# Automatic build script
#
Expand All @@ -8,8 +31,22 @@
# Exit immediately if a command exits with a non-zero status.
set -e

DOXYGEN_PDF="ErriezOregonTHN128.pdf"

echo "Starting auto-build script..."

function setup_virtualenv()
{
if [ ! -d ".venv" ]; then
virtualenv .venv
source .venv/bin/activate
pip3 install platformio==6.1.4
deactivate
fi

source .venv/bin/activate
}

function autobuild()
{
# Set environment variables
Expand Down Expand Up @@ -43,29 +80,28 @@ function autobuild()

function generate_doxygen()
{
echo "Generate Doxygen HTML..."

DOXYGEN_PDF="ErriezOregonTHN128.pdf"
if [ ! -f Doxyfile ]; then
return
fi

# Cleanup
rm -rf html latex
echo "Generate Doxygen HTML..."

# Generate Doxygen HTML and Latex
doxygen Doxyfile

# Allow filenames starting with an underscore
echo "" > html/.nojekyll
# Allow filenames starting with an underscore
echo "" > docs/html/.nojekyll

# Generate PDF when script is not running on Travis-CI
if [[ -z ${TRAVIS_BUILD_DIR} ]]; then
# Generate Doxygen PDF
make -C latex
# Generate Doxygen PDF
make -C docs/latex

# Copy PDF to root directory
cp latex/refman.pdf ./${DOXYGEN_PDF}
fi
# Copy PDF to root directory
cp docs/latex/refman.pdf ./${DOXYGEN_PDF}

# Cleanup
#rm -rf docs
}

setup_virtualenv
autobuild
generate_doxygen

generate_doxygen
2 changes: 1 addition & 1 deletion Doxyfile
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ PROJECT_LOGO = extras/OregonTHN128.png
# entered, it will be relative to the location where doxygen was started. If
# left blank the current directory will be used.

OUTPUT_DIRECTORY =
OUTPUT_DIRECTORY = docs

# 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

0 comments on commit 8d1edf8

Please sign in to comment.