From eb8131efbd2e6c9dcb92f272dc25be9e60dca822 Mon Sep 17 00:00:00 2001 From: Andrei Litvin Date: Fri, 2 Jun 2023 12:55:05 -0400 Subject: [PATCH] Stop generating BridgeGlobalStructs.h for dynamic-bridge-app (#27020) * Stop generating BridgeGlobalStructs.h * Restyled by autopep8 * Remove more references to BridgeGlobalStructs * undo submodule changes --------- Co-authored-by: Andrei Litvin Co-authored-by: Restyled.io --- examples/dynamic-bridge-app/linux/BUILD.gn | 1 - scripts/py_matter_idl/BUILD.gn | 4 --- .../generators/bridge/BridgeClustersCpp.jinja | 1 - .../bridge/BridgeClustersHeader.jinja | 2 -- .../matter_idl/generators/bridge/__init__.py | 9 ----- .../matter_idl/tests/available_tests.yaml | 5 --- .../bridge/BridgeGlobalStructs.h | 13 ------- .../bridge/DemoClusterServer.h | 1 - .../bridge/BridgeGlobalStructs.h | 13 ------- .../cluster_with_commands/bridge/OnOff.h | 1 - .../bridge/BridgeGlobalStructs.h | 36 ------------------- .../bridge/DemoClusterServer.h | 1 - .../bridge/BridgeGlobalStructs.h | 13 ------- .../several_clusters/bridge/FirstServer.h | 1 - .../several_clusters/bridge/SecondServer.h | 1 - .../outputs/several_clusters/bridge/Third.h | 1 - .../several_clusters/bridge/ThirdServer.h | 1 - .../bridge/BridgeGlobalStructs.h | 13 ------- .../simple_attribute/bridge/MyClusterServer.h | 1 - 19 files changed, 118 deletions(-) delete mode 100644 scripts/py_matter_idl/matter_idl/tests/outputs/cluster_struct_attribute/bridge/BridgeGlobalStructs.h delete mode 100644 scripts/py_matter_idl/matter_idl/tests/outputs/cluster_with_commands/bridge/BridgeGlobalStructs.h delete mode 100644 scripts/py_matter_idl/matter_idl/tests/outputs/global_struct_attribute/bridge/BridgeGlobalStructs.h delete mode 100644 scripts/py_matter_idl/matter_idl/tests/outputs/several_clusters/bridge/BridgeGlobalStructs.h delete mode 100644 scripts/py_matter_idl/matter_idl/tests/outputs/simple_attribute/bridge/BridgeGlobalStructs.h diff --git a/examples/dynamic-bridge-app/linux/BUILD.gn b/examples/dynamic-bridge-app/linux/BUILD.gn index 52fe054ecdd571..08c718915eb7e3 100644 --- a/examples/dynamic-bridge-app/linux/BUILD.gn +++ b/examples/dynamic-bridge-app/linux/BUILD.gn @@ -40,7 +40,6 @@ chip_codegen("chip-bridge-codegen") { "bridge/Switch.h", "bridge/TemperatureMeasurement.h", "bridge/BridgeClustersImpl.h", - "bridge/BridgeGlobalStructs.h", ] } diff --git a/scripts/py_matter_idl/BUILD.gn b/scripts/py_matter_idl/BUILD.gn index 4a82d06a13dcfb..06bdb3da4a673b 100644 --- a/scripts/py_matter_idl/BUILD.gn +++ b/scripts/py_matter_idl/BUILD.gn @@ -39,19 +39,16 @@ pw_python_package("matter_idl") { "matter_idl/tests/inputs/several_clusters.matter", "matter_idl/tests/inputs/simple_attribute.matter", "matter_idl/tests/outputs/cluster_struct_attribute/bridge/BridgeClustersImpl.h", - "matter_idl/tests/outputs/cluster_struct_attribute/bridge/BridgeGlobalStructs.h", "matter_idl/tests/outputs/cluster_struct_attribute/bridge/DemoClusterServer.h", "matter_idl/tests/outputs/cluster_struct_attribute/jni/DemoClusterClient-ReadImpl.cpp", "matter_idl/tests/outputs/cluster_struct_attribute/jni/DemoClusterClient-InvokeSubscribeImpl.cpp", "matter_idl/tests/outputs/global_struct_attribute/bridge/BridgeClustersImpl.h", - "matter_idl/tests/outputs/global_struct_attribute/bridge/BridgeGlobalStructs.h", "matter_idl/tests/outputs/global_struct_attribute/bridge/DemoClusterServer.h", "matter_idl/tests/outputs/global_struct_attribute/jni/DemoClusterClient-ReadImpl.cpp", "matter_idl/tests/outputs/global_struct_attribute/jni/DemoClusterClient-InvokeSubscribeImpl.cpp", "matter_idl/tests/outputs/optional_argument/jni/MyClusterClient-ReadImpl.cpp", "matter_idl/tests/outputs/optional_argument/jni/MyClusterClient-InvokeSubscribeImpl.cpp", "matter_idl/tests/outputs/several_clusters/bridge/BridgeClustersImpl.h", - "matter_idl/tests/outputs/several_clusters/bridge/BridgeGlobalStructs.h", "matter_idl/tests/outputs/several_clusters/bridge/FirstServer.h", "matter_idl/tests/outputs/several_clusters/bridge/SecondServer.h", "matter_idl/tests/outputs/several_clusters/bridge/Third.h", @@ -65,7 +62,6 @@ pw_python_package("matter_idl") { "matter_idl/tests/outputs/several_clusters/jni/SecondClient-InvokeSubscribeImpl.cpp", "matter_idl/tests/outputs/several_clusters/jni/ThirdClient-InvokeSubscribeImpl.cpp", "matter_idl/tests/outputs/simple_attribute/bridge/BridgeClustersImpl.h", - "matter_idl/tests/outputs/simple_attribute/bridge/BridgeGlobalStructs.h", "matter_idl/tests/outputs/simple_attribute/bridge/MyClusterServer.h", "matter_idl/tests/outputs/simple_attribute/jni/MyClusterClient-ReadImpl.cpp", "matter_idl/tests/outputs/simple_attribute/jni/MyClusterClient-InvokeSubscribeImpl.cpp", diff --git a/scripts/py_matter_idl/matter_idl/generators/bridge/BridgeClustersCpp.jinja b/scripts/py_matter_idl/matter_idl/generators/bridge/BridgeClustersCpp.jinja index 14a6aca640b0ad..4a6514bed3e421 100644 --- a/scripts/py_matter_idl/matter_idl/generators/bridge/BridgeClustersCpp.jinja +++ b/scripts/py_matter_idl/matter_idl/generators/bridge/BridgeClustersCpp.jinja @@ -1,6 +1,5 @@ #pragma once -#include "BridgeGlobalStructs.h" #include "GeneratedClusters.h" namespace clusters { diff --git a/scripts/py_matter_idl/matter_idl/generators/bridge/BridgeClustersHeader.jinja b/scripts/py_matter_idl/matter_idl/generators/bridge/BridgeClustersHeader.jinja index 698da602ccf698..452cdb845916a6 100644 --- a/scripts/py_matter_idl/matter_idl/generators/bridge/BridgeClustersHeader.jinja +++ b/scripts/py_matter_idl/matter_idl/generators/bridge/BridgeClustersHeader.jinja @@ -1,7 +1,5 @@ #include -#include "bridge/BridgeGlobalStructs.h" - namespace clusters { {%- for cluster in clusters %} diff --git a/scripts/py_matter_idl/matter_idl/generators/bridge/__init__.py b/scripts/py_matter_idl/matter_idl/generators/bridge/__init__.py index a4f7e60b537554..ef6f812de35def 100644 --- a/scripts/py_matter_idl/matter_idl/generators/bridge/__init__.py +++ b/scripts/py_matter_idl/matter_idl/generators/bridge/__init__.py @@ -179,12 +179,3 @@ def internal_render_all(self): 'idl': self.idl, } ) - - self.internal_render_one_output( - template_path="BridgeClustersGlobalStructs.jinja", - output_file_name="bridge/BridgeGlobalStructs.h", - vars={ - 'idl': self.idl, - 'structs': self.idl.structs, - } - ) diff --git a/scripts/py_matter_idl/matter_idl/tests/available_tests.yaml b/scripts/py_matter_idl/matter_idl/tests/available_tests.yaml index 15d10402db20de..7646b1d3d14a06 100644 --- a/scripts/py_matter_idl/matter_idl/tests/available_tests.yaml +++ b/scripts/py_matter_idl/matter_idl/tests/available_tests.yaml @@ -54,22 +54,18 @@ java-class: bridge: inputs/simple_attribute.matter: bridge/BridgeClustersImpl.h: outputs/simple_attribute/bridge/BridgeClustersImpl.h - bridge/BridgeGlobalStructs.h: outputs/simple_attribute/bridge/BridgeGlobalStructs.h bridge/MyClusterServer.h: outputs/simple_attribute/bridge/MyClusterServer.h inputs/global_struct_attribute.matter: bridge/BridgeClustersImpl.h: outputs/global_struct_attribute/bridge/BridgeClustersImpl.h - bridge/BridgeGlobalStructs.h: outputs/global_struct_attribute/bridge/BridgeGlobalStructs.h bridge/DemoClusterServer.h: outputs/global_struct_attribute/bridge/DemoClusterServer.h inputs/cluster_struct_attribute.matter: bridge/BridgeClustersImpl.h: outputs/cluster_struct_attribute/bridge/BridgeClustersImpl.h - bridge/BridgeGlobalStructs.h: outputs/cluster_struct_attribute/bridge/BridgeGlobalStructs.h bridge/DemoClusterServer.h: outputs/cluster_struct_attribute/bridge/DemoClusterServer.h inputs/several_clusters.matter: bridge/BridgeClustersImpl.h: outputs/several_clusters/bridge/BridgeClustersImpl.h - bridge/BridgeGlobalStructs.h: outputs/several_clusters/bridge/BridgeGlobalStructs.h bridge/FirstServer.h: outputs/several_clusters/bridge/FirstServer.h bridge/SecondServer.h: outputs/several_clusters/bridge/SecondServer.h bridge/ThirdServer.h: outputs/several_clusters/bridge/ThirdServer.h @@ -77,7 +73,6 @@ bridge: inputs/cluster_with_commands.matter: bridge/BridgeClustersImpl.h: outputs/cluster_with_commands/bridge/BridgeClustersImpl.h - bridge/BridgeGlobalStructs.h: outputs/cluster_with_commands/bridge/BridgeGlobalStructs.h bridge/OnOff.h: outputs/cluster_with_commands/bridge/OnOff.h cpp-app: diff --git a/scripts/py_matter_idl/matter_idl/tests/outputs/cluster_struct_attribute/bridge/BridgeGlobalStructs.h b/scripts/py_matter_idl/matter_idl/tests/outputs/cluster_struct_attribute/bridge/BridgeGlobalStructs.h deleted file mode 100644 index d8fdc6c0b4556a..00000000000000 --- a/scripts/py_matter_idl/matter_idl/tests/outputs/cluster_struct_attribute/bridge/BridgeGlobalStructs.h +++ /dev/null @@ -1,13 +0,0 @@ -#pragma once - -#include -#include - -#include -#include - -namespace clusters { - - - -} diff --git a/scripts/py_matter_idl/matter_idl/tests/outputs/cluster_struct_attribute/bridge/DemoClusterServer.h b/scripts/py_matter_idl/matter_idl/tests/outputs/cluster_struct_attribute/bridge/DemoClusterServer.h index eac0b0aeca0d1c..b6abee142e78ce 100644 --- a/scripts/py_matter_idl/matter_idl/tests/outputs/cluster_struct_attribute/bridge/DemoClusterServer.h +++ b/scripts/py_matter_idl/matter_idl/tests/outputs/cluster_struct_attribute/bridge/DemoClusterServer.h @@ -1,6 +1,5 @@ #pragma once -#include "BridgeGlobalStructs.h" #include "GeneratedClusters.h" namespace clusters { diff --git a/scripts/py_matter_idl/matter_idl/tests/outputs/cluster_with_commands/bridge/BridgeGlobalStructs.h b/scripts/py_matter_idl/matter_idl/tests/outputs/cluster_with_commands/bridge/BridgeGlobalStructs.h deleted file mode 100644 index d8fdc6c0b4556a..00000000000000 --- a/scripts/py_matter_idl/matter_idl/tests/outputs/cluster_with_commands/bridge/BridgeGlobalStructs.h +++ /dev/null @@ -1,13 +0,0 @@ -#pragma once - -#include -#include - -#include -#include - -namespace clusters { - - - -} diff --git a/scripts/py_matter_idl/matter_idl/tests/outputs/cluster_with_commands/bridge/OnOff.h b/scripts/py_matter_idl/matter_idl/tests/outputs/cluster_with_commands/bridge/OnOff.h index 1e34c2c7953418..383751db0cd325 100644 --- a/scripts/py_matter_idl/matter_idl/tests/outputs/cluster_with_commands/bridge/OnOff.h +++ b/scripts/py_matter_idl/matter_idl/tests/outputs/cluster_with_commands/bridge/OnOff.h @@ -1,6 +1,5 @@ #pragma once -#include "BridgeGlobalStructs.h" #include "GeneratedClusters.h" namespace clusters { diff --git a/scripts/py_matter_idl/matter_idl/tests/outputs/global_struct_attribute/bridge/BridgeGlobalStructs.h b/scripts/py_matter_idl/matter_idl/tests/outputs/global_struct_attribute/bridge/BridgeGlobalStructs.h deleted file mode 100644 index 19f6189f7b59b2..00000000000000 --- a/scripts/py_matter_idl/matter_idl/tests/outputs/global_struct_attribute/bridge/BridgeGlobalStructs.h +++ /dev/null @@ -1,36 +0,0 @@ -#pragma once - -#include -#include - -#include -#include - -namespace clusters { - - -struct LabelStruct -{ - CHIP_ERROR Decode(chip::TLV::TLVReader & reader) - { - chip::app::Clusters::detail::Structs::LabelStruct::DecodableType t; - CHIP_ERROR err = t.Decode(reader); - if(err == CHIP_NO_ERROR) { - chip::Value::Assign(label, t.label); - chip::Value::Assign(value, t.value); - } - return err; - } - - CHIP_ERROR Encode(chip::TLV::TLVWriter & writer, chip::TLV::Tag tag) const - { - chip::app::Clusters::detail::Structs::LabelStruct::Type t; - chip::Value::Assign(t.label, label); - chip::Value::Assign(t.value, value); - return t.Encode(writer, tag); - } - std::string label; - std::string value; -}; - -} diff --git a/scripts/py_matter_idl/matter_idl/tests/outputs/global_struct_attribute/bridge/DemoClusterServer.h b/scripts/py_matter_idl/matter_idl/tests/outputs/global_struct_attribute/bridge/DemoClusterServer.h index 3c6feeb5a3baba..a449dc374a0862 100644 --- a/scripts/py_matter_idl/matter_idl/tests/outputs/global_struct_attribute/bridge/DemoClusterServer.h +++ b/scripts/py_matter_idl/matter_idl/tests/outputs/global_struct_attribute/bridge/DemoClusterServer.h @@ -1,6 +1,5 @@ #pragma once -#include "BridgeGlobalStructs.h" #include "GeneratedClusters.h" namespace clusters { diff --git a/scripts/py_matter_idl/matter_idl/tests/outputs/several_clusters/bridge/BridgeGlobalStructs.h b/scripts/py_matter_idl/matter_idl/tests/outputs/several_clusters/bridge/BridgeGlobalStructs.h deleted file mode 100644 index d8fdc6c0b4556a..00000000000000 --- a/scripts/py_matter_idl/matter_idl/tests/outputs/several_clusters/bridge/BridgeGlobalStructs.h +++ /dev/null @@ -1,13 +0,0 @@ -#pragma once - -#include -#include - -#include -#include - -namespace clusters { - - - -} diff --git a/scripts/py_matter_idl/matter_idl/tests/outputs/several_clusters/bridge/FirstServer.h b/scripts/py_matter_idl/matter_idl/tests/outputs/several_clusters/bridge/FirstServer.h index 2786817c0dc8a5..5cb389e01564d1 100644 --- a/scripts/py_matter_idl/matter_idl/tests/outputs/several_clusters/bridge/FirstServer.h +++ b/scripts/py_matter_idl/matter_idl/tests/outputs/several_clusters/bridge/FirstServer.h @@ -1,6 +1,5 @@ #pragma once -#include "BridgeGlobalStructs.h" #include "GeneratedClusters.h" namespace clusters { diff --git a/scripts/py_matter_idl/matter_idl/tests/outputs/several_clusters/bridge/SecondServer.h b/scripts/py_matter_idl/matter_idl/tests/outputs/several_clusters/bridge/SecondServer.h index 71905bf252bd60..a0d24591b94c62 100644 --- a/scripts/py_matter_idl/matter_idl/tests/outputs/several_clusters/bridge/SecondServer.h +++ b/scripts/py_matter_idl/matter_idl/tests/outputs/several_clusters/bridge/SecondServer.h @@ -1,6 +1,5 @@ #pragma once -#include "BridgeGlobalStructs.h" #include "GeneratedClusters.h" namespace clusters { diff --git a/scripts/py_matter_idl/matter_idl/tests/outputs/several_clusters/bridge/Third.h b/scripts/py_matter_idl/matter_idl/tests/outputs/several_clusters/bridge/Third.h index 3b15195c0af9e4..55344700f7814d 100644 --- a/scripts/py_matter_idl/matter_idl/tests/outputs/several_clusters/bridge/Third.h +++ b/scripts/py_matter_idl/matter_idl/tests/outputs/several_clusters/bridge/Third.h @@ -1,6 +1,5 @@ #pragma once -#include "BridgeGlobalStructs.h" #include "GeneratedClusters.h" namespace clusters { diff --git a/scripts/py_matter_idl/matter_idl/tests/outputs/several_clusters/bridge/ThirdServer.h b/scripts/py_matter_idl/matter_idl/tests/outputs/several_clusters/bridge/ThirdServer.h index d2f8bccb12d648..67176424a52608 100644 --- a/scripts/py_matter_idl/matter_idl/tests/outputs/several_clusters/bridge/ThirdServer.h +++ b/scripts/py_matter_idl/matter_idl/tests/outputs/several_clusters/bridge/ThirdServer.h @@ -1,6 +1,5 @@ #pragma once -#include "BridgeGlobalStructs.h" #include "GeneratedClusters.h" namespace clusters { diff --git a/scripts/py_matter_idl/matter_idl/tests/outputs/simple_attribute/bridge/BridgeGlobalStructs.h b/scripts/py_matter_idl/matter_idl/tests/outputs/simple_attribute/bridge/BridgeGlobalStructs.h deleted file mode 100644 index d8fdc6c0b4556a..00000000000000 --- a/scripts/py_matter_idl/matter_idl/tests/outputs/simple_attribute/bridge/BridgeGlobalStructs.h +++ /dev/null @@ -1,13 +0,0 @@ -#pragma once - -#include -#include - -#include -#include - -namespace clusters { - - - -} diff --git a/scripts/py_matter_idl/matter_idl/tests/outputs/simple_attribute/bridge/MyClusterServer.h b/scripts/py_matter_idl/matter_idl/tests/outputs/simple_attribute/bridge/MyClusterServer.h index 831b39de9cfca4..47445252f41f77 100644 --- a/scripts/py_matter_idl/matter_idl/tests/outputs/simple_attribute/bridge/MyClusterServer.h +++ b/scripts/py_matter_idl/matter_idl/tests/outputs/simple_attribute/bridge/MyClusterServer.h @@ -1,6 +1,5 @@ #pragma once -#include "BridgeGlobalStructs.h" #include "GeneratedClusters.h" namespace clusters {