Skip to content

Commit

Permalink
Fix run list for non-cmake targets (#646)
Browse files Browse the repository at this point in the history
* Fix run list for non-cmake targets

Regression introduced in #639

was only looking for cmake targets, did not account for pure python targets

Signed-off-by: Alexis Girault <[email protected]>

* Ignore templated pathname in run list

Ignore {{cookiecutter.project_slug}}

Signed-off-by: Alexis Girault <[email protected]>

---------

Signed-off-by: Alexis Girault <[email protected]>
  • Loading branch information
agirault authored Dec 17, 2024
1 parent 158af75 commit 5fc1716
Showing 1 changed file with 24 additions and 5 deletions.
29 changes: 24 additions & 5 deletions run
Original file line number Diff line number Diff line change
Expand Up @@ -690,13 +690,13 @@ build() {
opt_prefix=""
is_app=false
is_pkg=false
if list_packages | grep -Fxq "$project"; then
if list_packages | awk '{print $1}' | grep -Fxq "$project"; then
opt_prefix="-D PKG_"
is_pkg=true
elif list_apps | grep -Fxq "$project"; then
elif list_apps | awk '{print $1}' | grep -Fxq "$project"; then
opt_prefix="-D APP_"
is_app=true
elif list_operators | grep -Fxq "$project"; then
elif list_operators | awk '{print $1}' | grep -Fxq "$project"; then
opt_prefix="-D OP_"
else
print_error "Unknown package, application, or operator: $1"
Expand Down Expand Up @@ -939,12 +939,31 @@ list_cmake_dir_options() {
echo "$cmake_add_dir" | sed -n "s|$cmake_function([[:space:]]*\([^[:space:])]*\).*|\1|p" | sort
}

list_metadata_json_dir() {
json_list=$(find $@ -name 'metadata.json' | sort -d)
for json in ${json_list}; do
local json_path=$(dirname "$json")
local json_dir=$(basename "$json_path")
if [[ "${json_dir}" =~ \{\{[^}]+\}\} ]]; then
# skip templates like {{ foo }}
continue
elif [[ ${json_dir} == "cpp" ]] || [[ ${json_dir} == "python" ]]; then
language="(${json_dir})"
name=$(basename $(dirname "$json_path"))
else
language=""
name="${json_dir}"
fi
echo $name $language
done
}

list_apps() {
list_cmake_dir_options add_holohub_application
list_metadata_json_dir ${SCRIPT_DIR}/applications ${SCRIPT_DIR}/benchmarks
}

list_operators() {
list_cmake_dir_options add_holohub_operator
list_metadata_json_dir ${SCRIPT_DIR}/operators
}

list_packages() {
Expand Down

0 comments on commit 5fc1716

Please sign in to comment.