From 5c59934365318af924bcdd6f0733eea03c030c99 Mon Sep 17 00:00:00 2001 From: Andrei Litvin Date: Mon, 4 Mar 2024 16:59:39 -0500 Subject: [PATCH] Move EventLoggingTypes.h and EventHeader.h to be seen by GN (#32416) * Move EventHeader and EventLoggingTypes into MessageDef because that seems to be the pimary use * Fix compile and lints * Restyle --- .github/workflows/lint.yml | 2 -- examples/chip-tool/BUILD.gn | 2 +- .../commands/clusters/DataModelLogger.h | 2 +- .../commands/common/RemoteDataModelLogger.h | 2 +- src/access/BUILD.gn | 19 +++++++++++++++---- src/app/BUILD.gn | 2 ++ src/app/EventManagement.h | 2 +- src/app/MessageDef/BUILD.gn | 13 +++++++++++++ src/app/MessageDef/EventDataIB.h | 4 ++-- src/app/{ => MessageDef}/EventHeader.h | 3 ++- src/app/{ => MessageDef}/EventLoggingTypes.h | 0 src/app/ReadClient.h | 2 +- src/app/common/BUILD.gn | 1 + src/app/tests/TestEventLogging.cpp | 2 +- src/app/tests/TestEventLoggingNoUTCTime.cpp | 2 +- src/app/tests/TestEventOverflow.cpp | 2 +- .../tests/TestFabricScopedEventLogging.cpp | 2 +- src/app/tests/integration/MockEvents.cpp | 2 +- .../templates/app/cluster-objects.zapt | 2 +- src/controller/java/AndroidCallbacks.cpp | 2 +- .../Framework/CHIP/MTRBaseDevice_Internal.h | 4 ++-- .../CHIP/MTRBaseSubscriptionCallback.h | 2 +- .../CHIP/MTREventTLVValueDecoder_Internal.h | 2 +- .../MTREventTLVValueDecoder-src.zapt | 4 ++-- .../zap-generated/MTREventTLVValueDecoder.mm | 4 ++-- .../zap-generated/cluster-objects.h | 2 +- 26 files changed, 56 insertions(+), 30 deletions(-) rename src/app/{ => MessageDef}/EventHeader.h (97%) rename src/app/{ => MessageDef}/EventLoggingTypes.h (100%) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index dca562c57bf2f1..8bb1f394d49bde 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -97,8 +97,6 @@ jobs: --known-failure app/CommandHandlerInterface.h \ --known-failure app/CommandSenderLegacyCallback.h \ --known-failure app/data-model/ListLargeSystemExtensions.h \ - --known-failure app/EventHeader.h \ - --known-failure app/EventLoggingTypes.h \ --known-failure app/ReadHandler.h \ --known-failure app/ReadPrepareParams.h \ --known-failure app/reporting/tests/MockReportScheduler.cpp \ diff --git a/examples/chip-tool/BUILD.gn b/examples/chip-tool/BUILD.gn index a27c3cd65716bd..ccf7deb44e617f 100644 --- a/examples/chip-tool/BUILD.gn +++ b/examples/chip-tool/BUILD.gn @@ -86,7 +86,7 @@ static_library("chip-tool-utils") { "commands/storage/StorageManagementCommand.cpp", ] - deps = [] + deps = [ "${chip_root}/src/app/MessageDef:events" ] if (config_use_interactive_mode) { sources += [ "commands/interactive/InteractiveCommands.cpp" ] diff --git a/examples/chip-tool/commands/clusters/DataModelLogger.h b/examples/chip-tool/commands/clusters/DataModelLogger.h index 1d9d1e1ccd6955..a9ccf4d12b3716 100644 --- a/examples/chip-tool/commands/clusters/DataModelLogger.h +++ b/examples/chip-tool/commands/clusters/DataModelLogger.h @@ -23,7 +23,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/examples/chip-tool/commands/common/RemoteDataModelLogger.h b/examples/chip-tool/commands/common/RemoteDataModelLogger.h index 7c93a50aa1f191..41aadc996230fc 100644 --- a/examples/chip-tool/commands/common/RemoteDataModelLogger.h +++ b/examples/chip-tool/commands/common/RemoteDataModelLogger.h @@ -20,7 +20,7 @@ #include #include -#include +#include #include #include #include diff --git a/src/access/BUILD.gn b/src/access/BUILD.gn index f1cc73c8f7262c..8d2c4b504975ee 100644 --- a/src/access/BUILD.gn +++ b/src/access/BUILD.gn @@ -14,16 +14,26 @@ import("//build_overrides/chip.gni") +source_set("types") { + sources = [ + "AuthMode.h", + "Privilege.h", + "RequestPath.h", + "SubjectDescriptor.h", + ] + + public_deps = [ + "${chip_root}/src/lib/core", + "${chip_root}/src/lib/core:types", + ] +} + static_library("access") { output_name = "libaccess" sources = [ "AccessControl.cpp", "AccessControl.h", - "AuthMode.h", - "Privilege.h", - "RequestPath.h", - "SubjectDescriptor.h", "examples/ExampleAccessControlDelegate.cpp", "examples/ExampleAccessControlDelegate.h", "examples/PermissiveAccessControlDelegate.cpp", @@ -33,6 +43,7 @@ static_library("access") { cflags = [ "-Wconversion" ] public_deps = [ + ":types", "${chip_root}/src/lib/core", "${chip_root}/src/lib/core:types", "${chip_root}/src/lib/support", diff --git a/src/app/BUILD.gn b/src/app/BUILD.gn index 1d76b5b695af38..4f45321a181663 100644 --- a/src/app/BUILD.gn +++ b/src/app/BUILD.gn @@ -192,6 +192,8 @@ static_library("interaction-model") { "reporting/reporting.h", ] + deps = [ "${chip_root}/src/app/MessageDef:events" ] + public_deps = [ ":app_config", ":constants", diff --git a/src/app/EventManagement.h b/src/app/EventManagement.h index 950efdc2bae867..97bf333929d518 100644 --- a/src/app/EventManagement.h +++ b/src/app/EventManagement.h @@ -27,9 +27,9 @@ #pragma once #include "EventLoggingDelegate.h" -#include "EventLoggingTypes.h" #include #include +#include #include #include #include diff --git a/src/app/MessageDef/BUILD.gn b/src/app/MessageDef/BUILD.gn index 18b254038fe2b8..97bc81596a8644 100644 --- a/src/app/MessageDef/BUILD.gn +++ b/src/app/MessageDef/BUILD.gn @@ -13,6 +13,18 @@ # limitations under the License. import("//build_overrides/chip.gni") +source_set("events") { + sources = [ + "EventHeader.h", + "EventLoggingTypes.h", + ] + + deps = [ + "${chip_root}/src/access:types", + "${chip_root}/src/app:paths", + ] +} + source_set("MessageDef") { sources = [ "ArrayBuilder.cpp", @@ -112,6 +124,7 @@ source_set("MessageDef") { ] deps = [ + ":events", "${chip_root}/src/app:app_config", "${chip_root}/src/app:constants", "${chip_root}/src/app:paths", diff --git a/src/app/MessageDef/EventDataIB.h b/src/app/MessageDef/EventDataIB.h index 77dcfe77e214fe..72f5997ab47918 100644 --- a/src/app/MessageDef/EventDataIB.h +++ b/src/app/MessageDef/EventDataIB.h @@ -27,8 +27,8 @@ #include "StructBuilder.h" #include "StructParser.h" #include -#include -#include +#include +#include #include #include #include diff --git a/src/app/EventHeader.h b/src/app/MessageDef/EventHeader.h similarity index 97% rename from src/app/EventHeader.h rename to src/app/MessageDef/EventHeader.h index 72887962a9348e..8e587404a9166a 100644 --- a/src/app/EventHeader.h +++ b/src/app/MessageDef/EventHeader.h @@ -18,8 +18,9 @@ #pragma once -#include "ConcreteEventPath.h" #include "EventLoggingTypes.h" + +#include #include namespace chip { diff --git a/src/app/EventLoggingTypes.h b/src/app/MessageDef/EventLoggingTypes.h similarity index 100% rename from src/app/EventLoggingTypes.h rename to src/app/MessageDef/EventLoggingTypes.h diff --git a/src/app/ReadClient.h b/src/app/ReadClient.h index d3fb370febe25c..8562090018bda0 100644 --- a/src/app/ReadClient.h +++ b/src/app/ReadClient.h @@ -27,8 +27,8 @@ #include #include #include -#include #include +#include #include #include #include diff --git a/src/app/common/BUILD.gn b/src/app/common/BUILD.gn index b1ad03e9da261f..d43911b0a798fd 100644 --- a/src/app/common/BUILD.gn +++ b/src/app/common/BUILD.gn @@ -48,6 +48,7 @@ static_library("cluster-objects") { public_deps = [ ":ids", "${chip_root}/src/app:paths", + "${chip_root}/src/app/MessageDef:events", "${chip_root}/src/app/data-model", "${chip_root}/src/app/util:types", "${chip_root}/src/lib/core", diff --git a/src/app/tests/TestEventLogging.cpp b/src/app/tests/TestEventLogging.cpp index baf43d6b398707..19eb3633f94ee0 100644 --- a/src/app/tests/TestEventLogging.cpp +++ b/src/app/tests/TestEventLogging.cpp @@ -24,9 +24,9 @@ #include #include -#include #include #include +#include #include #include #include diff --git a/src/app/tests/TestEventLoggingNoUTCTime.cpp b/src/app/tests/TestEventLoggingNoUTCTime.cpp index 8360f9a0813e98..b556f856150682 100644 --- a/src/app/tests/TestEventLoggingNoUTCTime.cpp +++ b/src/app/tests/TestEventLoggingNoUTCTime.cpp @@ -23,9 +23,9 @@ #include #include -#include #include #include +#include #include #include #include diff --git a/src/app/tests/TestEventOverflow.cpp b/src/app/tests/TestEventOverflow.cpp index 3edc62a0445ca1..c649326cc60aeb 100644 --- a/src/app/tests/TestEventOverflow.cpp +++ b/src/app/tests/TestEventOverflow.cpp @@ -23,9 +23,9 @@ */ #include -#include #include #include +#include #include #include #include diff --git a/src/app/tests/TestFabricScopedEventLogging.cpp b/src/app/tests/TestFabricScopedEventLogging.cpp index d016ad5183e1c0..64a0f4b91614b2 100644 --- a/src/app/tests/TestFabricScopedEventLogging.cpp +++ b/src/app/tests/TestFabricScopedEventLogging.cpp @@ -24,9 +24,9 @@ #include #include -#include #include #include +#include #include #include #include diff --git a/src/app/tests/integration/MockEvents.cpp b/src/app/tests/integration/MockEvents.cpp index 1883075c3ea5f8..18e2f9727812e8 100644 --- a/src/app/tests/integration/MockEvents.cpp +++ b/src/app/tests/integration/MockEvents.cpp @@ -25,8 +25,8 @@ #include "MockEvents.h" #include "common.h" -#include #include +#include #include #include #include diff --git a/src/app/zap-templates/templates/app/cluster-objects.zapt b/src/app/zap-templates/templates/app/cluster-objects.zapt index 1453523b1b7986..949a964b4ab83b 100644 --- a/src/app/zap-templates/templates/app/cluster-objects.zapt +++ b/src/app/zap-templates/templates/app/cluster-objects.zapt @@ -8,7 +8,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/src/controller/java/AndroidCallbacks.cpp b/src/controller/java/AndroidCallbacks.cpp index fc9fbe02f12292..7605ec63e7e321 100644 --- a/src/controller/java/AndroidCallbacks.cpp +++ b/src/controller/java/AndroidCallbacks.cpp @@ -21,7 +21,7 @@ #include #include #endif -#include +#include #include #include #include diff --git a/src/darwin/Framework/CHIP/MTRBaseDevice_Internal.h b/src/darwin/Framework/CHIP/MTRBaseDevice_Internal.h index 4ebc454925a4a4..8998f6821fa39e 100644 --- a/src/darwin/Framework/CHIP/MTRBaseDevice_Internal.h +++ b/src/darwin/Framework/CHIP/MTRBaseDevice_Internal.h @@ -23,9 +23,9 @@ #include #include #include -#include -#include #include +#include +#include #include #include #include diff --git a/src/darwin/Framework/CHIP/MTRBaseSubscriptionCallback.h b/src/darwin/Framework/CHIP/MTRBaseSubscriptionCallback.h index 371bd8db3a4bd0..47dedec029c674 100644 --- a/src/darwin/Framework/CHIP/MTRBaseSubscriptionCallback.h +++ b/src/darwin/Framework/CHIP/MTRBaseSubscriptionCallback.h @@ -22,7 +22,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/src/darwin/Framework/CHIP/MTREventTLVValueDecoder_Internal.h b/src/darwin/Framework/CHIP/MTREventTLVValueDecoder_Internal.h index eeacb2ea06d41f..8bbdd10a3264be 100644 --- a/src/darwin/Framework/CHIP/MTREventTLVValueDecoder_Internal.h +++ b/src/darwin/Framework/CHIP/MTREventTLVValueDecoder_Internal.h @@ -21,7 +21,7 @@ #import #include -#include +#include #include #include diff --git a/src/darwin/Framework/CHIP/templates/MTREventTLVValueDecoder-src.zapt b/src/darwin/Framework/CHIP/templates/MTREventTLVValueDecoder-src.zapt index 470221c850066e..14064a2f596e29 100644 --- a/src/darwin/Framework/CHIP/templates/MTREventTLVValueDecoder-src.zapt +++ b/src/darwin/Framework/CHIP/templates/MTREventTLVValueDecoder-src.zapt @@ -12,8 +12,8 @@ #include #include #include -#include -#include +#include +#include #include using namespace chip; diff --git a/src/darwin/Framework/CHIP/zap-generated/MTREventTLVValueDecoder.mm b/src/darwin/Framework/CHIP/zap-generated/MTREventTLVValueDecoder.mm index 3e36773ffebd99..8cee876330760b 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTREventTLVValueDecoder.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTREventTLVValueDecoder.mm @@ -25,8 +25,8 @@ #include #include #include -#include -#include +#include +#include #include #include #include diff --git a/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h b/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h index 89c36f3c6f147d..fab6d5838e007e 100644 --- a/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h +++ b/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h @@ -24,7 +24,7 @@ #include #include #include -#include +#include #include #include #include