-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add type support regeneration utility (#108)
* Refs #20677: Add type support regeneration utility Signed-off-by: EduPonz <[email protected]> * Refs #20677: Remove legacy script Signed-off-by: EduPonz <[email protected]> * Refs #20677: Apply suggestions Signed-off-by: EduPonz <[email protected]> --------- Signed-off-by: EduPonz <[email protected]>
- Loading branch information
Showing
2 changed files
with
46 additions
and
7 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
#!/usr/bin/env bash | ||
|
||
idl_files=( | ||
'./fastdds_python/test/types/test_modules.idl' | ||
'./fastdds_python/test/types/test_complete.idl' | ||
'./fastdds_python/test/types/test_included_modules.idl' | ||
'./fastdds_python_examples/HelloWorldExample/HelloWorld.idl' | ||
) | ||
|
||
red='\E[1;31m' | ||
yellow='\E[1;33m' | ||
textreset='\E[1;0m' | ||
|
||
current_dir=$(git rev-parse --show-toplevel) | ||
|
||
if [[ ! "$(pwd -P)" -ef "${current_dir}" ]]; then | ||
echo -e "${red}This script must be executed in the repository root directory.${textreset}" | ||
exit -1 | ||
fi | ||
|
||
if [[ -z "$(which fastddsgen)" ]]; then | ||
echo "Cannot find fastddsgen. Please, include it in PATH environment variable" | ||
exit -1 | ||
fi | ||
|
||
ret_value=0 | ||
|
||
for idl_file in "${idl_files[@]}"; do | ||
idl_dir=$(dirname "${idl_file}") | ||
file_from_gen=$(basename "${idl_file}") | ||
|
||
echo -e "Processing ${yellow}${idl_file}${textreset}" | ||
|
||
cd "${idl_dir}" | ||
|
||
echo "Running: fastddsgen -cdr both -replace -flat-output-dir -python ${file_from_gen}" | ||
fastddsgen -cdr both -replace -flat-output-dir -python ${file_from_gen} | ||
|
||
if [[ $? != 0 ]]; then | ||
ret_value=-1 | ||
fi | ||
|
||
cd - | ||
done | ||
|
||
exit ${ret_value} |