From 0aba197d89a372f769acdbdf4f90d69badf7b602 Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Mon, 2 Sep 2024 15:57:19 +0200 Subject: [PATCH] Add type support regeneration utility to 1.2.x (#170) (#177) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Add type support regeneration utility (#108) * Refs #20677: Add type support regeneration utility Signed-off-by: EduPonz * Refs #20677: Remove legacy script Signed-off-by: EduPonz * Refs #20677: Apply suggestions Signed-off-by: EduPonz --------- Signed-off-by: EduPonz * Hotfix: type regeneration script (#115) * Refs #20734: fix type regeneration script Signed-off-by: JLBuenoLopez-eProsima * Refs #20734: regenerate types using script Signed-off-by: JLBuenoLopez-eProsima --------- Signed-off-by: JLBuenoLopez-eProsima * Refs #21226: Adjust script to python version 1.2.x Signed-off-by: JesusPoderoso --------- Signed-off-by: EduPonz Signed-off-by: JLBuenoLopez-eProsima Signed-off-by: JesusPoderoso Co-authored-by: Eduardo Ponz Segrelles Co-authored-by: José Luis Bueno López <69244257+JLBuenoLopez-eProsima@users.noreply.github.com> (cherry picked from commit 8057dd0fb18b9c808d878399e9ec5c1d4e11e71d) Co-authored-by: Jesús Poderoso <120394830+JesusPoderoso@users.noreply.github.com> --- .../scripts/update_generated_code_from_idl.sh | 43 +++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100755 utils/scripts/update_generated_code_from_idl.sh diff --git a/utils/scripts/update_generated_code_from_idl.sh b/utils/scripts/update_generated_code_from_idl.sh new file mode 100755 index 00000000..381a5f03 --- /dev/null +++ b/utils/scripts/update_generated_code_from_idl.sh @@ -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}