Skip to content

Commit 4446041

Browse files
pankorepull[bot]
authored andcommitted
[Ameba]Update scripts/build (#12740)
1 parent 2e893f9 commit 4446041

File tree

5 files changed

+26
-10
lines changed

5 files changed

+26
-10
lines changed

scripts/build/build/targets.py

+9-6
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@
3232

3333
class Target:
3434
"""Represents a build target:
35-
3635
Has a name identifier plus parameters on how to build it (what
3736
builder class to use and what arguments are required to produce
3837
the specified build)
@@ -56,7 +55,6 @@ def Clone(self):
5655

5756
def Extend(self, suffix, **kargs):
5857
"""Creates a clone of the current object extending its build parameters.
59-
6058
Arguments:
6159
suffix: appended with a "-" as separator to the clone name
6260
**kargs: arguments needed to produce the new build variant
@@ -320,6 +318,13 @@ def InfineonTargets():
320318
yield target.Extend('p6-light', board=InfineonBoard.P6BOARD, app=InfineonApp.LIGHT)
321319

322320

321+
def AmebaTargets():
322+
ameba_target = Target('ameba', AmebaBuilder)
323+
324+
yield ameba_target.Extend('amebad-all-clusters', board=AmebaBoard.AMEBAD, app=AmebaApp.ALL_CLUSTERS)
325+
yield ameba_target.Extend('amebad-light', board=AmebaBoard.AMEBAD, app=AmebaApp.LIGHT)
326+
327+
323328
ALL = []
324329

325330
target_generators = [
@@ -329,8 +334,8 @@ def InfineonTargets():
329334
NrfTargets(),
330335
AndroidTargets(),
331336
MbedTargets(),
332-
InfineonTargets()
333-
337+
InfineonTargets(),
338+
AmebaTargets()
334339
]
335340

336341
for generator in target_generators:
@@ -343,8 +348,6 @@ def InfineonTargets():
343348
board=TelinkBoard.TLSR9518ADK80D, app=TelinkApp.LIGHT))
344349
ALL.append(Target('tizen-arm-light', TizenBuilder,
345350
board=TizenBoard.ARM, app=TizenApp.LIGHT))
346-
ALL.append(Target('ameba-amebad-all-clusters', AmebaBuilder,
347-
board=AmebaBoard.AMEBAD, app=AmebaApp.ALL_CLUSTERS))
348351

349352
# have a consistent order overall
350353
ALL.sort(key=lambda t: t.name)

scripts/build/builders/ameba.py

+8-3
Original file line numberDiff line numberDiff line change
@@ -25,18 +25,23 @@ class AmebaBoard(Enum):
2525

2626
class AmebaApp(Enum):
2727
ALL_CLUSTERS = auto()
28+
LIGHT = auto()
2829

2930
@property
3031
def ExampleName(self):
3132
if self == AmebaApp.ALL_CLUSTERS:
3233
return 'all-clusters-app'
34+
elif self == AmebaApp.LIGHT:
35+
return 'lighting-app'
3336
else:
3437
raise Exception('Unknown app type: %r' % self)
3538

3639
@property
3740
def AppNamePrefix(self):
3841
if self == AmebaApp.ALL_CLUSTERS:
39-
return 'chip-all-clusters-app'
42+
return 'chip-ameba-all-clusters-app'
43+
elif self == AmebaApp.LIGHT:
44+
return 'chip-ameba-lighting-app'
4045
else:
4146
raise Exception('Unknown app type: %r' % self)
4247

@@ -53,8 +58,8 @@ def __init__(self,
5358
self.app = app
5459

5560
def generate(self):
56-
cmd = '$AMEBA_PATH/project/realtek_amebaD_va0_example/GCC-RELEASE/build.sh %s ninja %s' % (
57-
self.root, self.output_dir)
61+
cmd = '$AMEBA_PATH/project/realtek_amebaD_va0_example/GCC-RELEASE/build.sh %s ninja %s %s' % (
62+
self.root, self.output_dir, self.app.ExampleName)
5863
self._Execute(['bash', '-c', cmd],
5964
title='Generating ' + self.identifier)
6065

scripts/build/testdata/all_targets_except_host.txt

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
ameba-amebad-all-clusters
2+
ameba-amebad-light
23
android-androidstudio-arm-chip-tool
34
android-androidstudio-arm64-chip-tool
45
android-androidstudio-x64-chip-tool

scripts/build/testdata/build_all_except_host.txt

+7-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,10 @@
22
cd "{root}"
33

44
# Generating ameba-amebad-all-clusters
5-
bash -c '$AMEBA_PATH/project/realtek_amebaD_va0_example/GCC-RELEASE/build.sh {root} ninja {out}/ameba-amebad-all-clusters'
5+
bash -c '$AMEBA_PATH/project/realtek_amebaD_va0_example/GCC-RELEASE/build.sh {root} ninja {out}/ameba-amebad-all-clusters all-clusters-app'
6+
7+
# Generating ameba-amebad-light
8+
bash -c '$AMEBA_PATH/project/realtek_amebaD_va0_example/GCC-RELEASE/build.sh {root} ninja {out}/ameba-amebad-light lighting-app'
69

710
# Generating JARs for Java build rules test
811
python3 build/chip/java/tests/generate_jars_for_test.py
@@ -582,6 +585,9 @@ gn gen --check --fail-on-unused-args --export-compile-commands --root={root}/exa
582585
# Building ameba-amebad-all-clusters
583586
ninja -C {out}/ameba-amebad-all-clusters
584587

588+
# Building ameba-amebad-light
589+
ninja -C {out}/ameba-amebad-light
590+
585591
# Building APP android-androidstudio-arm-chip-tool
586592
{root}/src/android/CHIPTool/gradlew -p {root}/src/android/CHIPTool -PmatterBuildSrcDir={out}/android-androidstudio-arm-chip-tool -PmatterSdkSourceBuild=true -PmatterSourceBuildAbiFilters=armeabi-v7a assembleDebug
587593

scripts/build/testdata/glob_star_targets_except_host.txt

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
ameba-amebad-all-clusters
2+
ameba-amebad-light
23
android-androidstudio-arm-chip-tool
34
android-androidstudio-arm64-chip-tool
45
android-androidstudio-x64-chip-tool

0 commit comments

Comments
 (0)