Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added builder for energy-management-app for Linux (host) and ESP32 #31353

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions scripts/build/build/targets.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ def BuildHostTarget():
TargetPart('lit-icd', app=HostApp.LIT_ICD),
TargetPart('air-quality-sensor', app=HostApp.AIR_QUALITY_SENSOR),
TargetPart('network-manager', app=HostApp.NETWORK_MANAGER),
TargetPart('energy-management', app=HostApp.ENERGY_MANAGEMENT),
]

if (HostBoard.NATIVE.PlatformName() == 'darwin'):
Expand Down Expand Up @@ -180,6 +181,7 @@ def BuildHostTarget():
target.AppendModifier('test', extra_tests=True)
target.AppendModifier('rpc', enable_rpcs=True)
target.AppendModifier('with-ui', imgui_ui=True)
target.AppendModifier('evse-test-event', enable_test_event_triggers=['EVSE']).OnlyIfRe('-energy-management')

return target

Expand All @@ -199,6 +201,7 @@ def BuildEsp32Target():
target.AppendFixedTargets([
TargetPart('all-clusters', app=Esp32App.ALL_CLUSTERS),
TargetPart('all-clusters-minimal', app=Esp32App.ALL_CLUSTERS_MINIMAL),
TargetPart('energy-management', app=Esp32App.ENERGY_MANAGEMENT),
TargetPart('ota-provider', app=Esp32App.OTA_PROVIDER),
TargetPart('ota-requestor', app=Esp32App.OTA_REQUESTOR),
TargetPart('shell', app=Esp32App.SHELL),
Expand Down
5 changes: 5 additions & 0 deletions scripts/build/builders/esp32.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ class Esp32Board(Enum):
class Esp32App(Enum):
ALL_CLUSTERS = auto()
ALL_CLUSTERS_MINIMAL = auto()
ENERGY_MANAGEMENT = auto()
LIGHT = auto()
LOCK = auto()
SHELL = auto()
Expand All @@ -45,6 +46,8 @@ def ExamplePath(self):
return 'examples/all-clusters-app'
elif self == Esp32App.ALL_CLUSTERS_MINIMAL:
return 'examples/all-clusters-minimal-app'
elif self == Esp32App.ENERGY_MANAGEMENT:
return 'examples/energy-management-app'
elif self == Esp32App.LIGHT:
return 'examples/lighting-app'
elif self == Esp32App.LOCK:
Expand All @@ -70,6 +73,8 @@ def AppNamePrefix(self):
return 'chip-all-clusters-app'
elif self == Esp32App.ALL_CLUSTERS_MINIMAL:
return 'chip-all-clusters-minimal-app'
elif self == Esp32App.ENERGY_MANAGEMENT:
return 'chip-energy-management-app'
elif self == Esp32App.LIGHT:
return 'chip-lighting-app'
elif self == Esp32App.LOCK:
Expand Down
13 changes: 12 additions & 1 deletion scripts/build/builders/host.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ class HostApp(Enum):
LIT_ICD = auto()
AIR_QUALITY_SENSOR = auto()
NETWORK_MANAGER = auto()
ENERGY_MANAGEMENT = auto()

def ExamplePath(self):
if self == HostApp.ALL_CLUSTERS:
Expand Down Expand Up @@ -139,6 +140,8 @@ def ExamplePath(self):
return 'air-quality-sensor-app/linux'
elif self == HostApp.NETWORK_MANAGER:
return 'network-manager-app/linux'
elif self == HostApp.ENERGY_MANAGEMENT:
return 'energy-management-app/linux'
else:
raise Exception('Unknown app type: %r' % self)

Expand Down Expand Up @@ -239,6 +242,9 @@ def OutputNames(self):
elif self == HostApp.LIT_ICD:
yield 'lit-icd-app'
yield 'lit-icd-app.map'
elif self == HostApp.ENERGY_MANAGEMENT:
yield 'chip-energy-management-app'
yield 'chip-energy-management-app.map'
else:
raise Exception('Unknown app type: %r' % self)

Expand Down Expand Up @@ -291,7 +297,8 @@ def __init__(self, root, runner, app: HostApp, board=HostBoard.NATIVE,
separate_event_loop=True, fuzzing_type: HostFuzzingType = HostFuzzingType.NONE, use_clang=False,
interactive_mode=True, extra_tests=False, use_platform_mdns=False, enable_rpcs=False,
use_coverage=False, use_dmalloc=False, minmdns_address_policy=None,
minmdns_high_verbosity=False, imgui_ui=False, crypto_library: HostCryptoLibrary = None):
minmdns_high_verbosity=False, imgui_ui=False, crypto_library: HostCryptoLibrary = None,
enable_test_event_triggers=None):
super(HostBuilder, self).__init__(
root=os.path.join(root, 'examples', app.ExamplePath()),
runner=runner)
Expand Down Expand Up @@ -392,6 +399,10 @@ def __init__(self, root, runner, app: HostApp, board=HostBoard.NATIVE,
if crypto_library:
self.extra_gn_options.append(crypto_library.gn_argument)

if enable_test_event_triggers is not None:
if 'EVSE' in enable_test_event_triggers:
self.extra_gn_options.append('chip_enable_energy_evse_trigger=true')

if self.board == HostBoard.ARM64:
if not use_clang:
raise Exception("Cross compile only supported using clang")
Expand Down
4 changes: 2 additions & 2 deletions scripts/build/testdata/all_targets_linux_x64.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ ti-cc13x2x7_26x2x7-{lighting,lock,pump,pump-controller}[-mtd]
ti-cc13x4_26x4-{all-clusters,lighting,lock,pump,pump-controller}[-mtd][-ftd]
cyw30739-cyw930739m2evb_01-{light,lock,ota-requestor,switch}
efr32-{brd4161a,brd4187c,brd4186c,brd4163a,brd4164a,brd4166a,brd4170a,brd4186a,brd4187a,brd4304a,brd4338a}-{window-covering,switch,unit-test,light,lock,thermostat,pump}[-rpc][-with-ota-requestor][-icd][-low-power][-shell][-no_logging][-openthread_mtd][-enable_heap_monitoring][-no_openthread_cli][-show_qr_code][-wifi][-rs911x][-wf200][-wifi_ipv4][-917_soc][-additional_data_advertising][-use_ot_lib][-use_ot_coap_lib][-no-version][-skip_rps_generation]
esp32-{m5stack,c3devkit,devkitc,qemu}-{all-clusters,all-clusters-minimal,ota-provider,ota-requestor,shell,light,lock,bridge,temperature-measurement,ota-requestor,tests}[-rpc][-ipv6only][-tracing]
esp32-{m5stack,c3devkit,devkitc,qemu}-{all-clusters,all-clusters-minimal,energy-management,ota-provider,ota-requestor,shell,light,lock,bridge,temperature-measurement,ota-requestor,tests}[-rpc][-ipv6only][-tracing]
genio-lighting-app
linux-fake-tests[-mbedtls][-boringssl][-asan][-tsan][-ubsan][-libfuzzer][-ossfuzz][-coverage][-dmalloc][-clang]
linux-{x64,arm64}-{rpc-console,all-clusters,all-clusters-minimal,chip-tool,thermostat,java-matter-controller,kotlin-matter-controller,minmdns,light,lock,shell,ota-provider,ota-requestor,simulated-app1,simulated-app2,python-bindings,tv-app,tv-casting-app,bridge,tests,chip-cert,address-resolve-tool,contact-sensor,dishwasher,microwave-oven,refrigerator,rvc,air-purifier,lit-icd,air-quality-sensor,network-manager}[-nodeps][-platform-mdns][-minmdns-verbose][-libnl][-same-event-loop][-no-interactive][-ipv6only][-no-ble][-no-wifi][-no-thread][-mbedtls][-boringssl][-asan][-tsan][-ubsan][-libfuzzer][-ossfuzz][-coverage][-dmalloc][-clang][-test][-rpc][-with-ui]
linux-{x64,arm64}-{rpc-console,all-clusters,all-clusters-minimal,chip-tool,thermostat,java-matter-controller,kotlin-matter-controller,minmdns,light,lock,shell,ota-provider,ota-requestor,simulated-app1,simulated-app2,python-bindings,tv-app,tv-casting-app,bridge,tests,chip-cert,address-resolve-tool,contact-sensor,dishwasher,microwave-oven,refrigerator,rvc,air-purifier,lit-icd,air-quality-sensor,network-manager,energy-management}[-nodeps][-platform-mdns][-minmdns-verbose][-libnl][-same-event-loop][-no-interactive][-ipv6only][-no-ble][-no-wifi][-no-thread][-mbedtls][-boringssl][-asan][-tsan][-ubsan][-libfuzzer][-ossfuzz][-coverage][-dmalloc][-clang][-test][-rpc][-with-ui][-evse-test-event]
linux-x64-efr32-test-runner[-clang]
imx-{chip-tool,lighting-app,thermostat,all-clusters-app,all-clusters-minimal-app,ota-provider-app}[-release]
infineon-psoc6-{lock,light,all-clusters,all-clusters-minimal}[-ota][-updateimage]
Expand Down
Loading