diff --git a/scripts/build/build/targets.py b/scripts/build/build/targets.py index 725bc77f330658..be82df0e4c56f6 100644 --- a/scripts/build/build/targets.py +++ b/scripts/build/build/targets.py @@ -32,7 +32,6 @@ class Target: """Represents a build target: - Has a name identifier plus parameters on how to build it (what builder class to use and what arguments are required to produce the specified build) @@ -56,7 +55,6 @@ def Clone(self): def Extend(self, suffix, **kargs): """Creates a clone of the current object extending its build parameters. - Arguments: suffix: appended with a "-" as separator to the clone name **kargs: arguments needed to produce the new build variant @@ -320,6 +318,13 @@ def InfineonTargets(): yield target.Extend('p6-light', board=InfineonBoard.P6BOARD, app=InfineonApp.LIGHT) +def AmebaTargets(): + ameba_target = Target('ameba', AmebaBuilder) + + yield ameba_target.Extend('amebad-all-clusters', board=AmebaBoard.AMEBAD, app=AmebaApp.ALL_CLUSTERS) + yield ameba_target.Extend('amebad-light', board=AmebaBoard.AMEBAD, app=AmebaApp.LIGHT) + + ALL = [] target_generators = [ @@ -329,8 +334,8 @@ def InfineonTargets(): NrfTargets(), AndroidTargets(), MbedTargets(), - InfineonTargets() - + InfineonTargets(), + AmebaTargets() ] for generator in target_generators: @@ -343,8 +348,6 @@ def InfineonTargets(): board=TelinkBoard.TLSR9518ADK80D, app=TelinkApp.LIGHT)) ALL.append(Target('tizen-arm-light', TizenBuilder, board=TizenBoard.ARM, app=TizenApp.LIGHT)) -ALL.append(Target('ameba-amebad-all-clusters', AmebaBuilder, - board=AmebaBoard.AMEBAD, app=AmebaApp.ALL_CLUSTERS)) # have a consistent order overall ALL.sort(key=lambda t: t.name) diff --git a/scripts/build/builders/ameba.py b/scripts/build/builders/ameba.py index dad5c8d54f062e..7f3df30edf14a1 100644 --- a/scripts/build/builders/ameba.py +++ b/scripts/build/builders/ameba.py @@ -25,18 +25,23 @@ class AmebaBoard(Enum): class AmebaApp(Enum): ALL_CLUSTERS = auto() + LIGHT = auto() @property def ExampleName(self): if self == AmebaApp.ALL_CLUSTERS: return 'all-clusters-app' + elif self == AmebaApp.LIGHT: + return 'lighting-app' else: raise Exception('Unknown app type: %r' % self) @property def AppNamePrefix(self): if self == AmebaApp.ALL_CLUSTERS: - return 'chip-all-clusters-app' + return 'chip-ameba-all-clusters-app' + elif self == AmebaApp.LIGHT: + return 'chip-ameba-lighting-app' else: raise Exception('Unknown app type: %r' % self) @@ -53,8 +58,8 @@ def __init__(self, self.app = app def generate(self): - cmd = '$AMEBA_PATH/project/realtek_amebaD_va0_example/GCC-RELEASE/build.sh %s ninja %s' % ( - self.root, self.output_dir) + cmd = '$AMEBA_PATH/project/realtek_amebaD_va0_example/GCC-RELEASE/build.sh %s ninja %s %s' % ( + self.root, self.output_dir, self.app.ExampleName) self._Execute(['bash', '-c', cmd], title='Generating ' + self.identifier) diff --git a/scripts/build/testdata/all_targets_except_host.txt b/scripts/build/testdata/all_targets_except_host.txt index ecec4cd8577996..d560f0a03abef2 100644 --- a/scripts/build/testdata/all_targets_except_host.txt +++ b/scripts/build/testdata/all_targets_except_host.txt @@ -1,4 +1,5 @@ ameba-amebad-all-clusters +ameba-amebad-light android-androidstudio-arm-chip-tool android-androidstudio-arm64-chip-tool android-androidstudio-x64-chip-tool diff --git a/scripts/build/testdata/build_all_except_host.txt b/scripts/build/testdata/build_all_except_host.txt index 39e12fda82bdb3..b4e972902f9e01 100644 --- a/scripts/build/testdata/build_all_except_host.txt +++ b/scripts/build/testdata/build_all_except_host.txt @@ -2,7 +2,10 @@ cd "{root}" # Generating ameba-amebad-all-clusters -bash -c '$AMEBA_PATH/project/realtek_amebaD_va0_example/GCC-RELEASE/build.sh {root} ninja {out}/ameba-amebad-all-clusters' +bash -c '$AMEBA_PATH/project/realtek_amebaD_va0_example/GCC-RELEASE/build.sh {root} ninja {out}/ameba-amebad-all-clusters all-clusters-app' + +# Generating ameba-amebad-light +bash -c '$AMEBA_PATH/project/realtek_amebaD_va0_example/GCC-RELEASE/build.sh {root} ninja {out}/ameba-amebad-light lighting-app' # Generating JARs for Java build rules test 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 # Building ameba-amebad-all-clusters ninja -C {out}/ameba-amebad-all-clusters +# Building ameba-amebad-light +ninja -C {out}/ameba-amebad-light + # Building APP android-androidstudio-arm-chip-tool {root}/src/android/CHIPTool/gradlew -p {root}/src/android/CHIPTool -PmatterBuildSrcDir={out}/android-androidstudio-arm-chip-tool -PmatterSdkSourceBuild=true -PmatterSourceBuildAbiFilters=armeabi-v7a assembleDebug diff --git a/scripts/build/testdata/glob_star_targets_except_host.txt b/scripts/build/testdata/glob_star_targets_except_host.txt index dbcd15aec0d0a7..9717a3c3ef460a 100644 --- a/scripts/build/testdata/glob_star_targets_except_host.txt +++ b/scripts/build/testdata/glob_star_targets_except_host.txt @@ -1,4 +1,5 @@ ameba-amebad-all-clusters +ameba-amebad-light android-androidstudio-arm-chip-tool android-androidstudio-arm64-chip-tool android-androidstudio-x64-chip-tool