pw_package: Arduino core installers and teensy presubmit
Summary of Changes
==================
1. Rename arduino build args to support cores in any location and have
consistent naming.
2. Update docs to reflect above.
3. `pw package install teensy` working with nice status message on how
to use ge pw_arduino_build_* args.
4. Added gn_teensy_build presubmit test step, not run by default.
`pw presubmit --step gn_teensy_build`
5. Added missing system_rpc_server impl for //targets/arduino. This is
just a copy of the stm32f429i one.
Build arg Change Examples
=========================
OLD:
dir_pw_third_party_arduino = "//third_party/arduino"
arduino_core_name = "teensy"
arduino_package_name = "teensy/avr"
arduino_board = "teensy41"
arduino_menu_options = ["menu.usb.serial",
"menu.opt.o2std"]
NEW:
pw_arduino_build_CORE_PATH =
"/mnt/pigweed/pigweed/.environment/packages"
pw_arduino_build_CORE_NAME = "teensy"
pw_arduino_build_PACKAGE_NAME = "teensy/avr"
pw_arduino_build_BOARD = "teensy41"
pw_arduino_build_MENU_OPTIONS = ["menu.usb.serial",
"menu.opt.o2std"]
All BUILD.gn checks for enabled arduino builds changed too:
OLD:
if (dir_pw_third_party_arduino != "") {}
NEW:
if (pw_arduino_build_CORE_PATH != "") {}
All gn target deps on arduino core sources changed.
OLD:
"$dir_pw_third_party_arduino:arduino_core_sources",
NEW:
"$dir_pw_third_party/arduino:arduino_core_sources",
Teensy package post install & status message
============================================
$ pw package status teensy
20210114 11:58:18 INF teensy is installed.
20210114 11:58:18 INF teensy currently installed in:
/mnt/pigweed/pigweed/.environment/packages/teensy
20210114 11:58:18 INF Enable by running "gn args out" and adding
these lines:
pw_arduino_build_CORE_PATH =
"/mnt/pigweed/pigweed/.environment/packages"
pw_arduino_build_CORE_NAME = "teensy"
pw_arduino_build_PACKAGE_NAME = "teensy/avr"
pw_arduino_build_BOARD = "BOARD_NAME"
20210114 11:58:18 INF Where BOARD_NAME is any supported board.
20210114 11:58:18 INF List available boards by running:
arduino_builder
--arduino-package-path
/mnt/pigweed/pigweed/.environment/packages/teensy
--arduino-package-name teensy/avr
list-boards
Requires: pigweed:29490
Change-Id: Ifd0bd214777392a29af3ab24711edf2f2c1086f3
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/26240
Commit-Queue: Anthony DiGirolamo <tonymd@google.com>
Reviewed-by: Keir Mierle <keir@google.com>
Reviewed-by: Rob Mohr <mohrr@google.com>
diff --git a/BUILD.gn b/BUILD.gn
index c2c9796..73c9f40 100644
--- a/BUILD.gn
+++ b/BUILD.gn
@@ -104,7 +104,7 @@
toolchain_prefix = "$dir_pigweed/targets/stm32f429i-disc1:stm32f429i_disc1_"
}
-if (dir_pw_third_party_arduino != "") {
+if (pw_arduino_build_CORE_PATH != "") {
_build_pigweed_default_at_all_optimization_levels("arduino") {
toolchain_prefix = "$dir_pigweed/targets/arduino:arduino_"
}