Skip to content

Commit

Permalink
Allow interactive mode to be disabled for some build variants
Browse files Browse the repository at this point in the history
  • Loading branch information
vivien-apple committed Mar 30, 2022
1 parent c31bab8 commit e2f2d65
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/examples-linux-arm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ jobs:
./scripts/run_in_build_env.sh \
"./scripts/build/build_examples.py \
--target linux-arm64-all-clusters \
--target linux-arm64-chip-tool-ipv6only \
--target linux-arm64-chip-tool-no-interactive-ipv6only \
--target linux-arm64-door-lock \
--target linux-arm64-minmdns \
--target linux-arm64-thermostat-no-ble \
Expand Down
16 changes: 13 additions & 3 deletions examples/chip-tool/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ assert(chip_build_tools)
declare_args() {
# Use a separate eventloop for CHIP tasks
config_use_separate_eventloop = true
config_use_interactive_mode = true
}

config("config") {
Expand All @@ -32,10 +33,16 @@ config("config") {
"${chip_root}/src/lib",
]

defines = [ "CONFIG_USE_SEPARATE_EVENTLOOP=${config_use_separate_eventloop}" ]
defines = [
"CONFIG_USE_SEPARATE_EVENTLOOP=${config_use_separate_eventloop}",
"CONFIG_USE_INTERACTIVE_MODE=${config_use_interactive_mode}",
]

cflags = [ "-Wconversion" ]
libs = [ "readline" ]

if (config_use_interactive_mode) {
libs = [ "readline" ]
}
}

static_library("chip-tool-utils") {
Expand All @@ -54,7 +61,6 @@ static_library("chip-tool-utils") {
"commands/discover/DiscoverCommand.cpp",
"commands/discover/DiscoverCommissionablesCommand.cpp",
"commands/discover/DiscoverCommissionersCommand.cpp",
"commands/interactive/InteractiveCommands.cpp",

# TODO - enable CommissionedListCommand once DNS Cache is implemented
# "commands/pairing/CommissionedListCommand.cpp",
Expand All @@ -69,6 +75,10 @@ static_library("chip-tool-utils") {
"config/PersistentStorage.cpp",
]

if (config_use_interactive_mode) {
sources += [ "commands/interactive/InteractiveCommands.cpp" ]
}

public_deps = [
"${chip_root}/src/app/server",
"${chip_root}/src/app/tests/suites/commands/commissioner",
Expand Down
2 changes: 2 additions & 0 deletions examples/chip-tool/commands/interactive/Commands.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@ void registerCommandsInteractive(Commands & commands, CredentialIssuerCommands *
const char * clusterName = "interactive";

commands_list clusterCommands = {
#if CONFIG_USE_INTERACTIVE_MODE
make_unique<InteractiveStartCommand>(&commands, credsIssuerConfig),
#endif // CONFIG_USE_INTERACTIVE_MODE
};

commands.Register(clusterName, clusterCommands);
Expand Down
2 changes: 2 additions & 0 deletions scripts/build/build/targets.py
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,8 @@ def HostTargets():
['-all-clusters', '-chip-tool']), test_group=True),
builder.AppendVariant(name="same-event-loop", validator=AcceptNameWithSubstrings(
['-chip-tool']), separate_event_loop=False),
builder.AppendVariant(name="no-interactive", validator=AcceptNameWithSubstrings(
['-chip-tool']), interactive_mode=False),
builder.AppendVariant(name="ipv6only", enable_ipv4=False),
builder.AppendVariant(name="no-ble", enable_ble=False),
builder.AppendVariant(name="no-wifi", enable_wifi=False),
Expand Down

0 comments on commit e2f2d65

Please sign in to comment.