Skip to content

Commit 7e95208

Browse files
committed
Refactor unified build modifier logic in targets.py to clarify group conditions for app compatibility
1 parent cef194a commit 7e95208

File tree

1 file changed

+13
-23
lines changed

1 file changed

+13
-23
lines changed

scripts/build/build/targets.py

Lines changed: 13 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -208,30 +208,20 @@ def BuildHostTarget():
208208
# Standalone modifiers
209209
target.AppendModifier('no-read-client', chip_enable_read_client=False)
210210

211-
# Unified build modifier - automatically selects compatible group
212-
# The unified_group is determined by the combination of other modifiers
211+
# Unified build modifier
212+
# Main group: apps that work with default settings can always use -unified
213+
# Group 2: energy-management, jf-admin-app, light-data-model-no-unique-id can use -unified
214+
# ONLY when -no-read-client is also present
215+
# Group 3: fabric-admin, fabric-bridge, jf-control-app can use -unified
216+
# ONLY when -rpc is also present
213217
target.AppendModifier('unified', unified=True).OnlyIfRe(
214-
"-(" + "|".join([
215-
# keep-sorted start
216-
'air-purifier',
217-
'bridge',
218-
'closure',
219-
'energy-management',
220-
'fabric-admin',
221-
'fabric-bridge',
222-
'jf-admin-app',
223-
'jf-control-app',
224-
'light',
225-
'light-data-model-no-unique-id',
226-
'lock',
227-
'microwave-oven',
228-
'ota-provider',
229-
'rvc',
230-
'thermostat',
231-
'tv-app',
232-
'water-leak-detector',
233-
# keep-sorted end
234-
]) + ")-")
218+
# Main group - always allow unified
219+
"-(air-purifier|bridge|closure|light(?!-data-model-no-unique-id)|lock|microwave-oven|ota-provider|rvc|thermostat|tv-app|water-leak-detector)-[^-]*(-[^-]*)*-unified|"
220+
# Group 2 - only with -no-read-client and -unified
221+
"-(energy-management|jf-admin-app|light-data-model-no-unique-id)(-[^-]*)*-no-read-client(-[^-]*)*-unified|"
222+
# Group 3 - only with -rpc and -unified
223+
"-(fabric-admin|fabric-bridge|jf-control-app)(-[^-]*)*-rpc(-[^-]*)*-unified"
224+
)
235225

236226
return target
237227

0 commit comments

Comments
 (0)