Skip to content

Commit

Permalink
Restyle
Browse files Browse the repository at this point in the history
  • Loading branch information
andy31415 committed Mar 15, 2022
1 parent 0fc0ed0 commit 929dde0
Showing 1 changed file with 22 additions and 16 deletions.
38 changes: 22 additions & 16 deletions scripts/build/build/targets.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,6 @@ def AppendVariant(self, **args):
"""
self.variants.append(BuildVariant(**args))


def AllVariants(self):
"""
Yields a list of acceptable variants for the given targets.
Expand All @@ -168,13 +167,14 @@ def AllVariants(self):
yield target

# skip variants that do not work for this target
ok_variants = [v for v in self.variants if v.validator.Accept(target.name)]
ok_variants = [
v for v in self.variants if v.validator.Accept(target.name)]

# Build every possible variant
for variant_count in range(1, len(ok_variants) + 1):
for subgroup in combinations(ok_variants, variant_count):
if HasConflicts(subgroup):
continue
continue

# Target ready to be created - no conflicts
variant_target = target.Clone()
Expand All @@ -185,13 +185,12 @@ def AllVariants(self):
# Only a few are whitelisted for globs
if '-'.join([o.name for o in subgroup]) not in self.glob_whitelist:
if not variant_target.glob_blacklist_reason:
variant_target = variant_target.GlobBlacklist('Reduce default build variants')
variant_target = variant_target.GlobBlacklist(
'Reduce default build variants')

yield variant_target




def HostTargets():
target = Target(HostBoard.NATIVE.PlatformName(), HostBuilder)
targets = [
Expand Down Expand Up @@ -220,7 +219,6 @@ def HostTargets():
app_targets.append(target.Extend('door-lock', app=HostApp.LOCK))
app_targets.append(target.Extend('shell', app=HostApp.SHELL))


builder = VariantBuilder([])

# Possible build variants. Note that number of potential
Expand All @@ -229,13 +227,15 @@ def HostTargets():
builder.AppendVariant(name="no-ble", enable_ble=False),
builder.AppendVariant(name="tsan", conflicts=['asan'], use_tsan=True),
builder.AppendVariant(name="asan", conflicts=['tsan'], use_asan=True),
builder.AppendVariant(name="libfuzzer", use_libfuzzer=True, use_clang=True),
builder.AppendVariant(name="test-group", validator=AcceptNameWithSubstrings(['-all-clusters', '-chip-tool']), test_group=True),
builder.AppendVariant(name="same-event-loop", validator=AcceptNameWithSubstrings(['-chip-tool']), separate_event_loop=False),
builder.AppendVariant(
name="libfuzzer", use_libfuzzer=True, use_clang=True),
builder.AppendVariant(name="test-group", validator=AcceptNameWithSubstrings(
['-all-clusters', '-chip-tool']), test_group=True),
builder.AppendVariant(name="same-event-loop", validator=AcceptNameWithSubstrings(
['-chip-tool']), separate_event_loop=False),

builder.WhitelistVariantNameForGlob('ipv6only')


for target in app_targets:
if 'rpc-console' in target.name:
# rpc console has only one build variant right now
Expand Down Expand Up @@ -306,22 +306,28 @@ def Efr32Targets():
builder = VariantBuilder([])

for board_target in board_targets:
builder.targets.append(board_target.Extend('window-covering', app=Efr32App.WINDOW_COVERING))
builder.targets.append(board_target.Extend('switch', app=Efr32App.SWITCH))
builder.targets.append(board_target.Extend('unit-test', app=Efr32App.UNIT_TEST))
builder.targets.append(board_target.Extend('light', app=Efr32App.LIGHT))
builder.targets.append(board_target.Extend(
'window-covering', app=Efr32App.WINDOW_COVERING))
builder.targets.append(board_target.Extend(
'switch', app=Efr32App.SWITCH))
builder.targets.append(board_target.Extend(
'unit-test', app=Efr32App.UNIT_TEST))
builder.targets.append(
board_target.Extend('light', app=Efr32App.LIGHT))
builder.targets.append(board_target.Extend('lock', app=Efr32App.LOCK))

# Possible build variants. Note that number of potential
# builds is exponential here
builder.AppendVariant(name="rpc", validator=AcceptNameWithSubstrings(['-light', '-lock']), enable_rpcs=True)
builder.AppendVariant(name="rpc", validator=AcceptNameWithSubstrings(
['-light', '-lock']), enable_rpcs=True)
builder.AppendVariant(name="with-ota-requestor", enable_ota_requestor=True)

builder.WhitelistVariantNameForGlob('rpc')

for target in builder.AllVariants():
yield target


def NrfTargets():
target = Target('nrf', NrfConnectBuilder)

Expand Down

0 comments on commit 929dde0

Please sign in to comment.