Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
JoshLafleur committed Nov 7, 2023
1 parent 3550a56 commit ba83e57
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 14 deletions.
9 changes: 5 additions & 4 deletions components/steering_wheel/SConscript
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ OPENOCD_INTERFACE = "stlink"
OPENOCD_BOARD = "stm32f103c8"


env = Environment(tools=["arm-none-eabi", "chip_config", "st-flash", "openocd"])
env = Environment(tools=["arm-none-eabi", "chip_config", "st-flash", "openocd", "doxygen"])
rtos_env = Environment(tools=["arm-none-eabi"])

env.Tool("compilation_db")
Expand Down Expand Up @@ -240,9 +240,10 @@ env.Alias("build", built())
env.Depends(built(), env["LINKSCRIPT"])
env.Default("build")

print(env.Dump())
env.Alias("doc", env.doxygen("doxygen_stw.conf"))
env.Depends("doc", built())
env["DOXYGENDIR"] = Dir("#/docs/components/docs-stw/")
env["DOXYGENCONF"] = File("doxygen_stw.conf")
env.Alias("doc", env.doxygen("$DOXYGENCONF"))
env.Clean("doc", "docs/components/docs-stw/")

# setup additional targets
env.Alias("cdb", env.CompilationDatabase("build/compile_commands.json"))
Expand Down
4 changes: 2 additions & 2 deletions components/steering_wheel/doxygen_stw.conf
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,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 = ../../docs/components/docs-stw/
OUTPUT_DIRECTORY = docs/components/docs-stw/

# 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 Expand Up @@ -864,7 +864,7 @@ WARN_LOGFILE =
# spaces. See also FILE_PATTERNS and EXTENSION_MAPPING
# Note: If this tag is empty the current directory is searched.

INPUT = README.md generated/ HW/ include/ lib/ RTOS/ src/
INPUT = components/steering_wheel/README.md components/steering_wheel/generated/ components/steering_wheel/HW/ components/steering_wheel/include/ components/steering_wheel/lib/lib_FTDI_FT81x/src/ components/steering_wheel/lib/lib_FTDI_FT81x/include/ components/steering_wheel/RTOS/ components/steering_wheel/src/

# This tag can be used to specify the character encoding of the source files
# that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,26 +4,27 @@
# @author Joshua Lafleur ([email protected])
# @date 2023-11-07

from os.path import join
from SCons.Script import *

def _get_doxygen_cmd(config_file):
env["doxyconf"] = config_file
return f"doxygen $config_file"

def _doxygen_emitter(target, source, env):
output_dir = str(source[0].dir)
if str(target[0]) == str(source[0]):
target = env.File(os.path.join(output_dir, 'html', 'index.html'))
return target, source

def generate(env):
'''
Generates the SCons tools in the environment
@param Environment variable to be modified
@retval None
'''

env.AddMethod(_get_doxygen_cmd, "doxygen")
env["DOXYGEN"] = "/bin/doxygen"

env["BUILDERS"]["doxygen"] = SCons.Builder.Builder(
#action="$DOXYGEN $SOURCE $args",
action="echo 'Building documentation...'"
#action="$DOXYGEN $DOXYGENCONF $args",
action="$DOXYGEN $SOURCE $args",
emitter=_doxygen_emitter
)

def exists():
Expand Down

0 comments on commit ba83e57

Please sign in to comment.