Skip to content

Commit

Permalink
Add new targets to build_examples.py
Browse files Browse the repository at this point in the history
  • Loading branch information
Damian-Nordic committed Apr 8, 2022
1 parent d89643d commit 4fc2c13
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 5 deletions.
4 changes: 3 additions & 1 deletion scripts/build/build/targets.py
Original file line number Diff line number Diff line change
Expand Up @@ -382,10 +382,12 @@ def NrfTargets():
target.Extend('nrf52840dk', board=NrfBoard.NRF52840DK),
]

# Enable nrf52840dongle for lighting app only
# Enable nrf52840dongle for all-clusters and lighting app only
yield target.Extend('nrf52840dongle-all-clusters', board=NrfBoard.NRF52840DONGLE, app=NrfApp.ALL_CLUSTERS)
yield target.Extend('nrf52840dongle-light', board=NrfBoard.NRF52840DONGLE, app=NrfApp.LIGHT)

for target in targets:
yield target.Extend('all-clusters', app=NrfApp.ALL_CLUSTERS)
yield target.Extend('lock', app=NrfApp.LOCK)
yield target.Extend('light', app=NrfApp.LIGHT)
yield target.Extend('shell', app=NrfApp.SHELL)
Expand Down
15 changes: 11 additions & 4 deletions scripts/build/builders/nrf.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@


class NrfApp(Enum):
ALL_CLUSTERS = auto()
LIGHT = auto()
LOCK = auto()
SHELL = auto()
Expand All @@ -29,7 +30,9 @@ class NrfApp(Enum):
UNIT_TESTS = auto()

def AppPath(self):
if self == NrfApp.LIGHT:
if self == NrfApp.ALL_CLUSTERS:
return 'examples/all-clusters-app'
elif self == NrfApp.LIGHT:
return 'examples/lighting-app'
elif self == NrfApp.LOCK:
return 'examples/lock-app'
Expand All @@ -45,7 +48,9 @@ def AppPath(self):
raise Exception('Unknown app type: %r' % self)

def AppNamePrefix(self):
if self == NrfApp.LIGHT:
if self == NrfApp.ALL_CLUSTERS:
return 'chip-nrf-all-clusters-example'
elif self == NrfApp.LIGHT:
return 'chip-nrf-lighting-example'
elif self == NrfApp.LOCK:
return 'chip-nrf-lock-example'
Expand All @@ -61,7 +66,9 @@ def AppNamePrefix(self):
raise Exception('Unknown app type: %r' % self)

def _FlashBundlePrefix(self):
if self == NrfApp.LIGHT:
if self == NrfApp.ALL_CLUSTERS:
return 'chip-nrfconnect-all-clusters-example'
elif self == NrfApp.LIGHT:
return 'chip-nrfconnect-lighting-example'
elif self == NrfApp.LOCK:
return 'chip-nrfconnect-lock-example'
Expand Down Expand Up @@ -148,7 +155,7 @@ def generate(self):
if self.enable_rpcs:
flags.append("-DOVERLAY_CONFIG=rpc.overlay")

if self.board == NrfBoard.NRF52840DONGLE:
if self.board == NrfBoard.NRF52840DONGLE and self.app != NrfApp.ALL_CLUSTERS:
flags.append("-DCONF_FILE=prj_no_dfu.conf")

build_flags = " -- " + " ".join(flags) if len(flags) > 0 else ""
Expand Down
3 changes: 3 additions & 0 deletions scripts/build/testdata/all_targets_except_host.txt
Original file line number Diff line number Diff line change
Expand Up @@ -173,13 +173,16 @@ mbed-CY8CPROTO_062_4343W-shell-debug (NOGLOB: Compile only for debugging purpose
mbed-CY8CPROTO_062_4343W-shell-develop (NOGLOB: Compile only for debugging purpose - https://os.mbed.com/docs/mbed-os/latest/program-setup/build-profiles-and-rules.html)
mbed-CY8CPROTO_062_4343W-shell-release
nrf-native-posix-64-tests
nrf-nrf52840dk-all-clusters
nrf-nrf52840dk-light
nrf-nrf52840dk-light-rpc
nrf-nrf52840dk-lock
nrf-nrf52840dk-pump
nrf-nrf52840dk-pump-controller
nrf-nrf52840dk-shell
nrf-nrf52840dongle-all-clusters
nrf-nrf52840dongle-light
nrf-nrf5340dk-all-clusters
nrf-nrf5340dk-light
nrf-nrf5340dk-light-rpc (NOGLOB: Compile failure due to pw_build args not forwarded to proto compiler. https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/66760)
nrf-nrf5340dk-lock
Expand Down
24 changes: 24 additions & 0 deletions scripts/build/testdata/build_all_except_host.txt
Original file line number Diff line number Diff line change
Expand Up @@ -818,6 +818,11 @@ bash -c 'source "$ZEPHYR_BASE/zephyr-env.sh";
export GNUARMEMB_TOOLCHAIN_PATH="$PW_ARM_CIPD_INSTALL_DIR";
west build --cmake-only -d {out}/nrf-native-posix-64-tests -b native_posix_64 {root}/src/test_driver/nrfconnect'

# Generating nrf-nrf52840dk-all-clusters
bash -c 'source "$ZEPHYR_BASE/zephyr-env.sh";
export GNUARMEMB_TOOLCHAIN_PATH="$PW_ARM_CIPD_INSTALL_DIR";
west build --cmake-only -d {out}/nrf-nrf52840dk-all-clusters -b nrf52840dk_nrf52840 {root}/examples/all-clusters-app/nrfconnect'

# Generating nrf-nrf52840dk-light
bash -c 'source "$ZEPHYR_BASE/zephyr-env.sh";
export GNUARMEMB_TOOLCHAIN_PATH="$PW_ARM_CIPD_INSTALL_DIR";
Expand Down Expand Up @@ -848,11 +853,21 @@ bash -c 'source "$ZEPHYR_BASE/zephyr-env.sh";
export GNUARMEMB_TOOLCHAIN_PATH="$PW_ARM_CIPD_INSTALL_DIR";
west build --cmake-only -d {out}/nrf-nrf52840dk-shell -b nrf52840dk_nrf52840 {root}/examples/shell/nrfconnect'

# Generating nrf-nrf52840dongle-all-clusters
bash -c 'source "$ZEPHYR_BASE/zephyr-env.sh";
export GNUARMEMB_TOOLCHAIN_PATH="$PW_ARM_CIPD_INSTALL_DIR";
west build --cmake-only -d {out}/nrf-nrf52840dongle-all-clusters -b nrf52840dongle_nrf52840 {root}/examples/all-clusters-app/nrfconnect'

# Generating nrf-nrf52840dongle-light
bash -c 'source "$ZEPHYR_BASE/zephyr-env.sh";
export GNUARMEMB_TOOLCHAIN_PATH="$PW_ARM_CIPD_INSTALL_DIR";
west build --cmake-only -d {out}/nrf-nrf52840dongle-light -b nrf52840dongle_nrf52840 {root}/examples/lighting-app/nrfconnect -- -DCONF_FILE=prj_no_dfu.conf'

# Generating nrf-nrf5340dk-all-clusters
bash -c 'source "$ZEPHYR_BASE/zephyr-env.sh";
export GNUARMEMB_TOOLCHAIN_PATH="$PW_ARM_CIPD_INSTALL_DIR";
west build --cmake-only -d {out}/nrf-nrf5340dk-all-clusters -b nrf5340dk_nrf5340_cpuapp {root}/examples/all-clusters-app/nrfconnect'

# Generating nrf-nrf5340dk-light
bash -c 'source "$ZEPHYR_BASE/zephyr-env.sh";
export GNUARMEMB_TOOLCHAIN_PATH="$PW_ARM_CIPD_INSTALL_DIR";
Expand Down Expand Up @@ -1725,6 +1740,9 @@ ninja -C {out}/nrf-native-posix-64-tests
# Run Tests nrf-native-posix-64-tests
ctest --build-nocmake -V --output-on-failure --test-dir {out}/nrf-native-posix-64-tests

# Building nrf-nrf52840dk-all-clusters
ninja -C {out}/nrf-nrf52840dk-all-clusters

# Building nrf-nrf52840dk-light
ninja -C {out}/nrf-nrf52840dk-light

Expand All @@ -1743,9 +1761,15 @@ ninja -C {out}/nrf-nrf52840dk-pump-controller
# Building nrf-nrf52840dk-shell
ninja -C {out}/nrf-nrf52840dk-shell

# Building nrf-nrf52840dongle-all-clusters
ninja -C {out}/nrf-nrf52840dongle-all-clusters

# Building nrf-nrf52840dongle-light
ninja -C {out}/nrf-nrf52840dongle-light

# Building nrf-nrf5340dk-all-clusters
ninja -C {out}/nrf-nrf5340dk-all-clusters

# Building nrf-nrf5340dk-light
ninja -C {out}/nrf-nrf5340dk-light

Expand Down
3 changes: 3 additions & 0 deletions scripts/build/testdata/glob_star_targets_except_host.txt
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,16 @@ mbed-CY8CPROTO_062_4343W-lock-release
mbed-CY8CPROTO_062_4343W-pigweed-release
mbed-CY8CPROTO_062_4343W-shell-release
nrf-native-posix-64-tests
nrf-nrf52840dk-all-clusters
nrf-nrf52840dk-light
nrf-nrf52840dk-light-rpc
nrf-nrf52840dk-lock
nrf-nrf52840dk-pump
nrf-nrf52840dk-pump-controller
nrf-nrf52840dk-shell
nrf-nrf52840dongle-all-clusters
nrf-nrf52840dongle-light
nrf-nrf5340dk-all-clusters
nrf-nrf5340dk-light
nrf-nrf5340dk-lock
nrf-nrf5340dk-pump
Expand Down

0 comments on commit 4fc2c13

Please sign in to comment.