Skip to content

Commit 6e95da6

Browse files
authored
Add type support regeneration utility (#108)
* Refs #20677: Add type support regeneration utility Signed-off-by: EduPonz <eduardoponz@eprosima.com> * Refs #20677: Remove legacy script Signed-off-by: EduPonz <eduardoponz@eprosima.com> * Refs #20677: Apply suggestions Signed-off-by: EduPonz <eduardoponz@eprosima.com> --------- Signed-off-by: EduPonz <eduardoponz@eprosima.com>
1 parent 6004ecb commit 6e95da6

2 files changed

Lines changed: 46 additions & 7 deletions

File tree

fastdds_python/test/types/generate.sh

Lines changed: 0 additions & 7 deletions
This file was deleted.
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
#!/usr/bin/env bash
2+
3+
idl_files=(
4+
'./fastdds_python/test/types/test_modules.idl'
5+
'./fastdds_python/test/types/test_complete.idl'
6+
'./fastdds_python/test/types/test_included_modules.idl'
7+
'./fastdds_python_examples/HelloWorldExample/HelloWorld.idl'
8+
)
9+
10+
red='\E[1;31m'
11+
yellow='\E[1;33m'
12+
textreset='\E[1;0m'
13+
14+
current_dir=$(git rev-parse --show-toplevel)
15+
16+
if [[ ! "$(pwd -P)" -ef "${current_dir}" ]]; then
17+
echo -e "${red}This script must be executed in the repository root directory.${textreset}"
18+
exit -1
19+
fi
20+
21+
if [[ -z "$(which fastddsgen)" ]]; then
22+
echo "Cannot find fastddsgen. Please, include it in PATH environment variable"
23+
exit -1
24+
fi
25+
26+
ret_value=0
27+
28+
for idl_file in "${idl_files[@]}"; do
29+
idl_dir=$(dirname "${idl_file}")
30+
file_from_gen=$(basename "${idl_file}")
31+
32+
echo -e "Processing ${yellow}${idl_file}${textreset}"
33+
34+
cd "${idl_dir}"
35+
36+
echo "Running: fastddsgen -cdr both -replace -flat-output-dir -python ${file_from_gen}"
37+
fastddsgen -cdr both -replace -flat-output-dir -python ${file_from_gen}
38+
39+
if [[ $? != 0 ]]; then
40+
ret_value=-1
41+
fi
42+
43+
cd -
44+
done
45+
46+
exit ${ret_value}

0 commit comments

Comments
 (0)