Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[21226] Add type support regeneration utility to 1.2.x (backport #170) #177

Merged
merged 1 commit into from
Sep 2, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions utils/scripts/update_generated_code_from_idl.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
#!/usr/bin/env bash

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

cd ./fastdds_python/test/types
echo -e "Processing ${yellow}test_complete.idl${textreset}"
echo "Running: fastddsgen -replace -python test_complete.idl"
fastddsgen -replace -python test_complete.idl
if [[ $? != 0 ]]; then
ret_value=-1
fi
cd -

if [[ $ret_value != -1 ]]; then
cd "./fastdds_python_examples/HelloWorldExample"

echo -e "Processing ${yellow}HelloWorld.idl${textreset}"
echo "Running: fastddsgen -replace -python HelloWorld.idl"
fastddsgen -replace -python HelloWorld.idl
fi

if [[ $? != 0 ]]; then
ret_value=-1
fi
cd -

exit ${ret_value}