Skip to content

Commit d52234c

Browse files
authored
Remove CHIPClusters.h and corresponding .zapt file from the build (#32004)
* Completely remove all references to CHIPClusters.h * Restyle * Remove references to CHIPClusters.zapt as well * Use BaseCluster instead of specific clusters * Fix names and includes
1 parent 61724ee commit d52234c

File tree

15 files changed

+13
-223
lines changed

15 files changed

+13
-223
lines changed

build/chip/chip_codegen.cmake

-2
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,6 @@ endfunction()
108108
# GENERATOR "app-templates"
109109
# OUTPUTS
110110
# "zap-generated/access.h",
111-
# "zap-generated/CHIPClusters.h"
112111
# "zap-generated/endpoint_config.h",
113112
# "zap-generated/gen_config.h",
114113
# "zap-generated/IMClusterCommandHandler.cpp"
@@ -162,7 +161,6 @@ function(chip_zapgen TARGET_NAME)
162161
SET(EXTRA_DEPENDENCIES
163162
"${CHIP_ROOT}/src/app/zap-templates/partials/header.zapt"
164163
"${CHIP_ROOT}/src/app/zap-templates/templates/app/access.zapt"
165-
"${CHIP_ROOT}/src/app/zap-templates/templates/app/CHIPClusters.zapt"
166164
"${CHIP_ROOT}/src/app/zap-templates/templates/app/endpoint_config.zapt"
167165
"${CHIP_ROOT}/src/app/zap-templates/templates/app/gen_config.zapt"
168166
"${CHIP_ROOT}/src/app/zap-templates/templates/app/im-cluster-command-handler.zapt"

build/chip/chip_codegen.gni

-1
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,6 @@ template("_chip_build_time_zapgen") {
144144

145145
# Application templates, actually generating files
146146
"${_template_dir}/access.zapt",
147-
"${_template_dir}/CHIPClusters.zapt",
148147
"${_template_dir}/endpoint_config.zapt",
149148
"${_template_dir}/gen_config.zapt",
150149
"${_template_dir}/im-cluster-command-handler.zapt",

build/chip/esp32/esp32_codegen.cmake

-1
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@ macro(chip_app_component_zapgen ZAP_NAME)
6161
GENERATOR "app-templates"
6262
OUTPUTS
6363
"zap-generated/access.h"
64-
"zap-generated/CHIPClusters.h"
6564
"zap-generated/endpoint_config.h"
6665
"zap-generated/gen_config.h"
6766
"zap-generated/IMClusterCommandHandler.cpp"

examples/thermostat/asr/include/CHIPClusters.h

-80
This file was deleted.

examples/tv-app/android/java/TVApp-JNI.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,14 @@
3434
#include <app/app-platform/ContentAppPlatform.h>
3535
#include <app/server/Dnssd.h>
3636
#include <app/server/java/AndroidAppServerWrapper.h>
37+
#include <controller/CHIPCluster.h>
3738
#include <credentials/DeviceAttestationCredsProvider.h>
3839
#include <credentials/examples/DeviceAttestationCredsExample.h>
3940
#include <jni.h>
4041
#include <lib/core/CHIPError.h>
4142
#include <lib/support/CHIPJNIError.h>
4243
#include <lib/support/JniReferences.h>
4344
#include <lib/support/JniTypeWrappers.h>
44-
#include <zap-generated/CHIPClusters.h>
4545

4646
using namespace chip;
4747
using namespace chip::app;
@@ -216,7 +216,7 @@ class MyPostCommissioningListener : public PostCommissioningListener
216216
const SessionHandle & sessionHandle) override
217217
{
218218
// read current binding list
219-
chip::Controller::BindingCluster cluster(exchangeMgr, sessionHandle, kTargetBindingClusterEndpointId);
219+
chip::Controller::ClusterBase cluster(exchangeMgr, sessionHandle, kTargetBindingClusterEndpointId);
220220

221221
cacheContext(vendorId, productId, nodeId, exchangeMgr, sessionHandle);
222222

examples/tv-app/tv-common/src/AppTv.cpp

+5-4
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,17 @@
2121

2222
#include "AppTv.h"
2323

24+
#include <cstdio>
25+
#include <inttypes.h>
26+
2427
#include <app-common/zap-generated/attributes/Accessors.h>
2528
#include <app-common/zap-generated/ids/Attributes.h>
2629
#include <app-common/zap-generated/ids/Clusters.h>
2730
#include <app/CommandHandler.h>
2831
#include <app/server/Dnssd.h>
2932
#include <app/server/Server.h>
3033
#include <app/util/af.h>
31-
#include <cstdio>
32-
#include <inttypes.h>
34+
#include <controller/CHIPCluster.h>
3335
#include <lib/core/CHIPCore.h>
3436
#include <lib/core/DataModelTypes.h>
3537
#include <lib/support/CHIPArgParser.hpp>
@@ -38,7 +40,6 @@
3840
#include <lib/support/ZclString.h>
3941
#include <platform/CHIPDeviceLayer.h>
4042
#include <platform/DeviceInstanceInfoProvider.h>
41-
#include <zap-generated/CHIPClusters.h>
4243

4344
#if CHIP_DEVICE_CONFIG_ENABLE_BOTH_COMMISSIONER_AND_COMMISSIONEE
4445
#include <controller/CHIPDeviceController.h>
@@ -126,7 +127,7 @@ class MyPostCommissioningListener : public PostCommissioningListener
126127
const SessionHandle & sessionHandle) override
127128
{
128129
// read current binding list
129-
chip::Controller::BindingCluster cluster(exchangeMgr, sessionHandle, kTargetBindingClusterEndpointId);
130+
chip::Controller::ClusterBase cluster(exchangeMgr, sessionHandle, kTargetBindingClusterEndpointId);
130131

131132
cacheContext(vendorId, productId, nodeId, exchangeMgr, sessionHandle);
132133

examples/virtual-device-app/android/java/DeviceApp-JNI.cpp

-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@
3434
#include <lib/support/CHIPJNIError.h>
3535
#include <lib/support/JniReferences.h>
3636
#include <lib/support/JniTypeWrappers.h>
37-
#include <zap-generated/CHIPClusters.h>
3837

3938
using namespace chip;
4039
using namespace chip::app;

scripts/tools/zap/tests/available_tests.yaml

-2
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,13 @@
1212
# and the expected content for those output files.
1313
inputs/all-clusters-app.zap:
1414
../../../../src/app/zap-templates/app-templates.json:
15-
CHIPClusters.h: outputs/all-clusters-app/app-templates/CHIPClusters.h
1615
endpoint_config.h: outputs/all-clusters-app/app-templates/endpoint_config.h
1716
gen_config.h: outputs/all-clusters-app/app-templates/gen_config.h
1817
access.h: outputs/all-clusters-app/app-templates/access.h
1918
IMClusterCommandHandler.cpp: outputs/all-clusters-app/app-templates/IMClusterCommandHandler.cpp
2019

2120
inputs/lighting-app.zap:
2221
../../../../src/app/zap-templates/app-templates.json:
23-
CHIPClusters.h: outputs/lighting-app/app-templates/CHIPClusters.h
2422
endpoint_config.h: outputs/lighting-app/app-templates/endpoint_config.h
2523
gen_config.h: outputs/lighting-app/app-templates/gen_config.h
2624
access.h: outputs/lighting-app/app-templates/access.h

scripts/tools/zap/tests/outputs/all-clusters-app/app-templates/CHIPClusters.h

-41
This file was deleted.

scripts/tools/zap/tests/outputs/lighting-app/app-templates/CHIPClusters.h

-41
This file was deleted.

src/app/chip_data_model.cmake

-1
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,6 @@ function(chip_configure_data_model APP_TARGET)
123123
GENERATOR "app-templates"
124124
OUTPUTS
125125
"zap-generated/access.h"
126-
"zap-generated/CHIPClusters.h"
127126
"zap-generated/endpoint_config.h"
128127
"zap-generated/gen_config.h"
129128
"zap-generated/IMClusterCommandHandler.cpp"

src/app/chip_data_model.gni

+6-8
Original file line numberDiff line numberDiff line change
@@ -66,24 +66,22 @@ template("chip_data_model") {
6666
input = rebase_path(invoker.zap_file)
6767
generator = "app-templates"
6868

69+
# NOTE: these files MUST be in sync with outputs in
70+
# src/app/zap-templates/app-templates.json
6971
outputs = [
7072
"zap-generated/access.h",
7173
"zap-generated/gen_config.h",
7274
"zap-generated/endpoint_config.h",
7375
]
7476

77+
# NOTE: these are ALSO auto-generated but handled below:
78+
# "zap-generated/IMClusterCommandHandler.cpp"
79+
# -> contains one large DispatchSingleClusterCommand and DispatchServerCommand
80+
7581
if (chip_code_pre_generated_directory == "") {
7682
prune_outputs = []
7783
}
7884

79-
if (chip_controller) {
80-
outputs += [ "zap-generated/CHIPClusters.h" ]
81-
} else {
82-
if (defined(prune_outputs)) {
83-
prune_outputs += [ "zap-generated/CHIPClusters.h" ]
84-
}
85-
}
86-
8785
# TODO: It is unclear here why `zap_pregenerated_dir` has any relevance
8886
# in including IMClusterCommandHandler or not.
8987
#

src/app/zap-templates/app-templates.json

-5
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,6 @@
3535
"name": "CHIP Client Callbacks for Interaction Model",
3636
"output": "IMClusterCommandHandler.cpp"
3737
},
38-
{
39-
"path": "templates/app/CHIPClusters.zapt",
40-
"name": "C++ ZCL API Header",
41-
"output": "CHIPClusters.h"
42-
},
4338
{
4439
"path": "templates/app/access.zapt",
4540
"name": "Matter access definitions",

src/app/zap-templates/templates/app/CHIPClusters.zapt

-24
This file was deleted.

src/lib/shell/commands/BUILD.gn

-10
Original file line numberDiff line numberDiff line change
@@ -56,16 +56,6 @@ source_set("commands") {
5656
if (chip_enable_ota_requestor && chip_device_platform != "none" &&
5757
chip_device_platform != "linux" && chip_device_platform != "darwin") {
5858
sources += [ "Ota.cpp" ]
59-
60-
# TODO: the ota commands in shell should use the interfaces in /src/app/clusters/ota-requestor
61-
#
62-
# Awkward dependencies below say:
63-
# - codegen via zap the CHIPClusters.h (which is the CLIENT SIDE)
64-
# - ensure include path can see zap-generated/CHIPClusters.h
65-
deps = [ "${chip_root}/src/controller/data_model:data_model_zapgen_files" ]
66-
67-
configs +=
68-
[ "${chip_root}/src/controller/data_model:data_model_zapgen_config" ]
6959
}
7060

7161
if (chip_system_config_provide_statistics) {

0 commit comments

Comments
 (0)