Skip to content

Commit 2180994

Browse files
ksperling-applepull[bot]
authored andcommitted
Tidy up dependencies of //examples/platform/linux:app-main (#26408)
* Remove CommonRpc.h (identical copy of Rpc.h) * Remove some unused GN imports * Run zap_cluster_list.py directly instead of through gn_run_binary.py * Tidy up dependencies of //examples/platform/linux:app-main - Use deps instead of public_deps where possible - Only build shell commands if chip_build_libshell is true - Remove explicit //src/lib/shell dependencies, it's already pulled in by //src/lib * Fix tv-app / tv-casting-app deps and don't import args.gni directly
1 parent a718fd0 commit 2180994

File tree

20 files changed

+54
-120
lines changed

20 files changed

+54
-120
lines changed

examples/all-clusters-app/all-clusters-common/src/binding-handler.cpp

+9-9
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,17 @@
1717

1818
#include "binding-handler.h"
1919

20-
#include "app-common/zap-generated/ids/Clusters.h"
21-
#include "app-common/zap-generated/ids/Commands.h"
22-
#include "app/CommandSender.h"
23-
#include "app/clusters/bindings/BindingManager.h"
24-
#include "app/server/Server.h"
25-
#include "controller/InvokeInteraction.h"
26-
#include "lib/core/CHIPError.h"
27-
#include "platform/CHIPDeviceLayer.h"
20+
#include <app-common/zap-generated/ids/Clusters.h>
21+
#include <app-common/zap-generated/ids/Commands.h>
22+
#include <app/CommandSender.h>
23+
#include <app/clusters/bindings/BindingManager.h>
24+
#include <app/server/Server.h>
25+
#include <controller/InvokeInteraction.h>
26+
#include <lib/core/CHIPError.h>
27+
#include <platform/CHIPDeviceLayer.h>
2828

2929
#if defined(ENABLE_CHIP_SHELL)
30-
#include "lib/shell/Engine.h"
30+
#include <lib/shell/Engine.h> // nogncheck
3131

3232
using chip::Shell::Engine;
3333
using chip::Shell::shell_command_t;

examples/contact-sensor-app/contact-sensor-common/BUILD.gn

-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
# limitations under the License.
1414

1515
import("//build_overrides/chip.gni")
16-
import("${chip_root}/examples/common/pigweed/pigweed_rpcs.gni")
1716
import("${chip_root}/src/app/chip_data_model.gni")
1817

1918
chip_data_model("contact-sensor-common") {

examples/light-switch-app/light-switch-common/BUILD.gn

-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
# limitations under the License.
1414

1515
import("//build_overrides/chip.gni")
16-
import("${chip_root}/examples/common/pigweed/pigweed_rpcs.gni")
1716
import("${chip_root}/src/app/chip_data_model.gni")
1817

1918
chip_data_model("light-switch-common") {

examples/lighting-app/lighting-common/BUILD.gn

-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
# limitations under the License.
1414

1515
import("//build_overrides/chip.gni")
16-
import("${chip_root}/examples/common/pigweed/pigweed_rpcs.gni")
1716
import("${chip_root}/src/app/chip_data_model.gni")
1817

1918
config("config") {

examples/lighting-app/qpg/zap/BUILD.gn

-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
# limitations under the License.
1414

1515
import("//build_overrides/chip.gni")
16-
import("${chip_root}/examples/common/pigweed/pigweed_rpcs.gni")
1716
import("${chip_root}/src/app/chip_data_model.gni")
1817

1918
chip_data_model("zap") {

examples/lock-app/lock-common/BUILD.gn

-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
# limitations under the License.
1414

1515
import("//build_overrides/chip.gni")
16-
import("${chip_root}/examples/common/pigweed/pigweed_rpcs.gni")
1716
import("${chip_root}/src/app/chip_data_model.gni")
1817

1918
chip_data_model("lock-common") {

examples/lock-app/nxp/zap/BUILD.gn

-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
# limitations under the License.
1414

1515
import("//build_overrides/chip.gni")
16-
import("${chip_root}/examples/common/pigweed/pigweed_rpcs.gni")
1716
import("${chip_root}/src/app/chip_data_model.gni")
1817

1918
chip_data_model("zap") {

examples/lock-app/qpg/zap/BUILD.gn

-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
# limitations under the License.
1414

1515
import("//build_overrides/chip.gni")
16-
import("${chip_root}/examples/common/pigweed/pigweed_rpcs.gni")
1716
import("${chip_root}/src/app/chip_data_model.gni")
1817

1918
chip_data_model("zap") {

examples/platform/linux/AppMain.cpp

+2-3
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
#include <platform/CHIPDeviceLayer.h>
2020
#include <platform/PlatformManager.h>
2121

22-
#include <app/clusters/network-commissioning/network-commissioning.h>
2322
#include <app/server/OnboardingCodesUtil.h>
2423
#include <app/server/Server.h>
2524
#include <crypto/CHIPCryptoPAL.h>
@@ -53,12 +52,12 @@
5352

5453
#if defined(ENABLE_CHIP_SHELL)
5554
#include <CommissioneeShellCommands.h>
56-
#include <lib/shell/Engine.h>
55+
#include <lib/shell/Engine.h> // nogncheck
5756
#include <thread>
5857
#endif
5958

6059
#if defined(PW_RPC_ENABLED)
61-
#include <CommonRpc.h>
60+
#include <Rpc.h>
6261
#endif
6362

6463
#if CHIP_CONFIG_TRANSPORT_TRACE_ENABLED

examples/platform/linux/BUILD.gn

+20-31
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,8 @@ source_set("app-main") {
3535
"AppMain.h",
3636
"CommissionableInit.cpp",
3737
"CommissionableInit.h",
38-
"CommissioneeShellCommands.cpp",
39-
"CommissioneeShellCommands.h",
4038
"CommissionerMain.cpp",
4139
"CommissionerMain.h",
42-
"ControllerShellCommands.cpp",
43-
"ControllerShellCommands.h",
4440
"LinuxCommissionableDataProvider.cpp",
4541
"LinuxCommissionableDataProvider.h",
4642
"NamedPipeCommands.cpp",
@@ -53,29 +49,32 @@ source_set("app-main") {
5349
"testing/CustomCSRResponseOperationalKeyStore.h",
5450
]
5551

56-
defines = []
52+
public_deps = [
53+
"${chip_root}/src/lib",
54+
"${chip_root}/src/platform/logging:force_stdio",
55+
]
56+
deps = [
57+
":ota-test-event-trigger",
58+
"${chip_root}/examples/providers:device_info_provider",
59+
"${chip_root}/src/app/server",
60+
]
5761

5862
if (chip_enable_pw_rpc) {
5963
defines += [ "PW_RPC_ENABLED" ]
6064
}
65+
6166
if (chip_build_libshell) {
6267
defines += [ "ENABLE_CHIP_SHELL" ]
68+
sources += [
69+
"CommissioneeShellCommands.cpp",
70+
"CommissioneeShellCommands.h",
71+
"ControllerShellCommands.cpp",
72+
"ControllerShellCommands.h",
73+
]
6374
}
6475

65-
public_deps = [
66-
":ota-test-event-trigger",
67-
"${chip_root}/examples/providers:device_info_provider",
68-
"${chip_root}/src/app/server",
69-
"${chip_root}/src/credentials:default_attestation_verifier",
70-
"${chip_root}/src/lib",
71-
"${chip_root}/src/lib/shell",
72-
"${chip_root}/src/lib/shell:shell_core",
73-
"${chip_root}/src/platform/logging:force_stdio",
74-
]
75-
7676
if (chip_enable_transport_trace) {
77-
public_deps +=
78-
[ "${chip_root}/examples/common/tracing:trace_handlers_decoder" ]
77+
deps += [ "${chip_root}/examples/common/tracing:trace_handlers_decoder" ]
7978
}
8079

8180
public_configs = [ ":app-main-config" ]
@@ -88,25 +87,15 @@ source_set("commissioner-main") {
8887
"CommissionerMain.h",
8988
]
9089

91-
defines = []
92-
93-
if (chip_enable_pw_rpc) {
94-
defines += [ "PW_RPC_ENABLED" ]
95-
}
9690
if (chip_build_libshell) {
9791
defines += [ "ENABLE_CHIP_SHELL" ]
9892
}
9993

100-
public_deps = [
101-
"${chip_root}/src/app/server",
102-
"${chip_root}/src/credentials:default_attestation_verifier",
103-
"${chip_root}/src/lib",
104-
"${chip_root}/src/lib/shell",
105-
"${chip_root}/src/lib/shell:shell_core",
106-
]
94+
public_deps = [ "${chip_root}/src/lib" ]
95+
deps = [ "${chip_root}/src/app/server" ]
10796

10897
if (chip_enable_transport_trace) {
109-
public_deps += [ "${chip_root}/examples/common/tracing:trace_handlers" ]
98+
deps += [ "${chip_root}/examples/common/tracing:trace_handlers" ]
11099
}
111100

112101
public_configs = [ ":app-main-config" ]

examples/platform/linux/CommissionerMain.cpp

-4
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,6 @@
5555
#include <lib/core/CHIPPersistentStorageDelegate.h>
5656
#include <platform/KeyValueStoreManager.h>
5757

58-
#if defined(PW_RPC_ENABLED)
59-
#include <CommonRpc.h>
60-
#endif
61-
6258
#if CHIP_CONFIG_TRANSPORT_TRACE_ENABLED
6359
#include "TraceHandlers.h"
6460
#endif // CHIP_CONFIG_TRANSPORT_TRACE_ENABLED

examples/platform/linux/CommonRpc.h

-27
This file was deleted.

examples/platform/nxp/se05x/linux/AppMain.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@
6060
#endif
6161

6262
#if defined(PW_RPC_ENABLED)
63-
#include <CommonRpc.h>
63+
#include <Rpc.h>
6464
#endif
6565

6666
#if CHIP_CONFIG_TRANSPORT_TRACE_ENABLED

examples/platform/nxp/se05x/linux/BUILD.gn

-2
Original file line numberDiff line numberDiff line change
@@ -108,8 +108,6 @@ source_set("commissioner-main") {
108108
"${chip_root}/src/app/server",
109109
"${chip_root}/src/credentials:default_attestation_verifier",
110110
"${chip_root}/src/lib",
111-
"${chip_root}/src/lib/shell",
112-
"${chip_root}/src/lib/shell:shell_core",
113111
]
114112

115113
if (chip_enable_transport_trace) {

examples/tv-app/linux/AppImpl.cpp

-3
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,6 @@
3232
#include <inttypes.h>
3333
#include <lib/core/CHIPCore.h>
3434
#include <lib/core/DataModelTypes.h>
35-
#include <lib/shell/Commands.h>
36-
#include <lib/shell/Engine.h>
37-
#include <lib/shell/commands/Help.h>
3835
#include <lib/support/CHIPArgParser.hpp>
3936
#include <lib/support/CHIPMem.h>
4037
#include <lib/support/CodeUtils.h>

examples/tv-app/linux/BUILD.gn

+9-16
Original file line numberDiff line numberDiff line change
@@ -14,28 +14,16 @@
1414

1515
import("//build_overrides/build.gni")
1616
import("//build_overrides/chip.gni")
17-
import("args.gni")
18-
1917
import("${chip_root}/build/chip/tools.gni")
18+
import("${chip_root}/src/lib/lib.gni")
2019

2120
assert(chip_build_tools)
2221

23-
config("config") {
24-
include_dirs = [
25-
".",
26-
"${chip_root}/zzz_generated/chip-tv-app",
27-
"${chip_root}/src/lib",
28-
]
29-
30-
cflags = [ "-Wconversion" ]
31-
}
32-
3322
executable("chip-tv-app") {
3423
sources = [
3524
"${chip_root}/examples/tv-app/tv-common/include/CHIPProjectAppConfig.h",
3625
"AppImpl.cpp",
3726
"AppImpl.h",
38-
"AppPlatformShellCommands.cpp",
3927
"ZclCallbacks.cpp",
4028
"include/account-login/AccountLoginManager.cpp",
4129
"include/account-login/AccountLoginManager.h",
@@ -74,11 +62,16 @@ executable("chip-tv-app") {
7462
]
7563

7664
cflags = [ "-Wconversion" ]
77-
78-
public_configs = [ ":config" ]
65+
defines = []
66+
include_dirs = [
67+
".",
68+
"${chip_root}/zzz_generated/chip-tv-app",
69+
"${chip_root}/src/lib",
70+
]
7971

8072
if (chip_build_libshell) {
81-
cflags += [ "-DENABLE_CHIP_SHELL" ]
73+
defines += [ "ENABLE_CHIP_SHELL" ]
74+
sources += [ "AppPlatformShellCommands.cpp" ]
8275
}
8376

8477
output_dir = root_out_dir

examples/tv-app/linux/main.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
#include "include/wake-on-lan/WakeOnLanManager.h"
4242

4343
#if defined(ENABLE_CHIP_SHELL)
44-
#include <lib/shell/Engine.h>
44+
#include <lib/shell/Engine.h> // nogncheck
4545
#endif
4646

4747
using namespace chip;

examples/tv-casting-app/linux/BUILD.gn

+7-5
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,14 @@
1414

1515
import("//build_overrides/build.gni")
1616
import("//build_overrides/chip.gni")
17-
import("args.gni")
18-
1917
import("${chip_root}/build/chip/tools.gni")
18+
import("${chip_root}/src/lib/lib.gni")
2019

2120
assert(chip_build_tools)
2221

2322
executable("chip-tv-casting-app") {
2423
sources = [
2524
"${chip_root}/examples/tv-casting-app/tv-casting-common/include/CHIPProjectAppConfig.h",
26-
"CastingShellCommands.cpp",
27-
"CastingShellCommands.h",
2825
"CastingUtils.cpp",
2926
"CastingUtils.h",
3027
"main.cpp",
@@ -39,13 +36,18 @@ executable("chip-tv-casting-app") {
3936
"${chip_root}/third_party/jsoncpp",
4037
]
4138

39+
defines = []
4240
include_dirs =
4341
[ "${chip_root}/examples/tv-casting-app/tv-casting-common/include" ]
4442

4543
cflags = [ "-Wconversion" ]
4644

4745
if (chip_build_libshell) {
48-
cflags += [ "-DENABLE_CHIP_SHELL" ]
46+
defines += [ "ENABLE_CHIP_SHELL" ]
47+
sources += [
48+
"CastingShellCommands.cpp",
49+
"CastingShellCommands.h",
50+
]
4951
}
5052

5153
output_dir = root_out_dir

examples/tv-casting-app/linux/main.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
#include "CastingUtils.h"
2626
#if defined(ENABLE_CHIP_SHELL)
2727
#include "CastingShellCommands.h"
28-
#include <lib/shell/Engine.h>
28+
#include <lib/shell/Engine.h> // nogncheck
2929
#include <thread>
3030
#endif
3131

0 commit comments

Comments
 (0)