Added new features to ottto script.
+ Updated date. + Added new function to generate ctags for code navigation. + Updated code formatting function with Cpp formatting.
This commit is contained in:
parent
79e8629823
commit
89b22f27de
1 changed files with 21 additions and 3 deletions
24
otto.sh
24
otto.sh
|
|
@ -1,6 +1,6 @@
|
|||
#!/bin/sh
|
||||
# Author: Jake Goodwin
|
||||
# Date: 2024
|
||||
# Date: 2025
|
||||
# Filename: otto.sh
|
||||
|
||||
WCH_TC="$(pwd)/riscv32-toolchain.cmake"
|
||||
|
|
@ -10,20 +10,37 @@ TEMPLATE_FILES=".template_files"
|
|||
MODULE_DIR="${TEMPLATE_FILES}/modules"
|
||||
CHIP="ch32v003"
|
||||
|
||||
generate_tags_file () {
|
||||
uctags --recurse=yes \
|
||||
--languages=C,C++,Asm \
|
||||
--extras=+q \
|
||||
--fields=+iaS \
|
||||
--exclude=extern \
|
||||
--exclude=build \
|
||||
--exclude=.git \
|
||||
--exclude=.template_files \
|
||||
.
|
||||
}
|
||||
|
||||
format_source_code () {
|
||||
#Get a list of all C files
|
||||
source_c_files=$(find ./src -name '*.c')
|
||||
source_c_files=$(find ./src ./tests -name '*.c')
|
||||
for f in $source_c_files; do
|
||||
clang-format -i -style=file $f
|
||||
done
|
||||
|
||||
#Get a list of all H files
|
||||
source_h_files=$(find ./src -name '*.h')
|
||||
source_h_files=$(find ./src ./tests -name '*.h')
|
||||
for f in $source_h_files; do
|
||||
clang-format -i -style=file $f
|
||||
done
|
||||
|
||||
#Get a list of all Cpp files.
|
||||
source_cpp_files=$(find ./src ./tests -name '*.cpp')
|
||||
for f in $source_cpp_files; do
|
||||
clang-format -i -style=file $f
|
||||
done
|
||||
|
||||
echo "Applying Formating standard!"
|
||||
}
|
||||
|
||||
|
|
@ -270,6 +287,7 @@ flash_microcontroller () {
|
|||
}
|
||||
|
||||
run_c_tests () {
|
||||
generate_tags_file()
|
||||
format_source_code
|
||||
clear_cmake_cache
|
||||
cmake -DUNIT_TESTING=ON -DCMAKE_VERBOSE_MAKEFILE=${CMAKE_VERBOSE} ../
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue