switch getting prefs to use arduino-cli instead of arudino-builder

tmp/arduino-cli-pre-rebase
Jesse Vincent 4 years ago
parent f74b87e2de
commit 57a076b5e3
No known key found for this signature in database
GPG Key ID: CC228463465E40BC

@ -414,12 +414,6 @@ do_compile () {
local_LIBS="-libraries \"${ARDUINO_LOCAL_LIB_PATH}/libraries\"" local_LIBS="-libraries \"${ARDUINO_LOCAL_LIB_PATH}/libraries\""
fi fi
ARDUINO_PACKAGES=""
if [ -d "${ARDUINO_PACKAGE_PATH}" ]; then
# shellcheck disable=SC2089
# We want literal backslashes here, not arrays.
ARDUINO_PACKAGES="-hardware \"${ARDUINO_PACKAGE_PATH}\""
fi
SAVED_BOARD="${BOARD}" SAVED_BOARD="${BOARD}"
SAVED_FQBN="${FQBN}" SAVED_FQBN="${FQBN}"
@ -462,44 +456,19 @@ do_compile () {
FQBN="${SAVED_FQBN}" FQBN="${SAVED_FQBN}"
} }
do_compile_with_builder() {
# SC2091: We do not care if quotes or backslashes are not respected.
# SC2086: We want word splitting.
# shellcheck disable=SC2086,SC2090
"${ARDUINO_BUILDER}" \
-compile \
${ARDUINO_PACKAGES} \
-hardware "${ARDUINO_PATH}/hardware" \
-hardware "${BOARD_HARDWARE_PATH}" \
${ARDUINO_TOOLS_FLAG:+"${ARDUINO_TOOLS_FLAG}"} ${ARDUINO_TOOLS_PARAM:+"${ARDUINO_TOOLS_PARAM}"} \
-tools "${ARDUINO_BUILDER_TOOLS_PATH}" \
-fqbn "${FQBN}" \
-libraries "." \
-libraries "${KALEIDOSCOPE_DIR}" \
-libraries "${BOARD_HARDWARE_PATH}/.." \
${local_LIBS} \
${EXTRA_BUILDER_ARGS} \
-build-cache "${CORE_CACHE_PATH}" \
-build-path "${BUILD_PATH}" \
-ide-version "${ARDUINO_IDE_VERSION}" \
-built-in-libraries "${ARDUINO_PATH}/libraries" \
-prefs "compiler.cpp.extra_flags=$(printf "%q", "${LOCAL_CFLAGS}")" \
-prefs compiler.path="${COMPILER_PATH}" \
-prefs compiler.c.cmd="${_CMD_CC}" \
-prefs compiler.cpp.cmd="${_CMD_CXX}" \
-prefs compiler.ar.cmd="${_CMD_AR}" \
-prefs compiler.c.elf.cmd="${_CMD_CXX}" \
$CCACHE_ENABLE \
-warnings all \
${ARDUINO_VERBOSE} \
${ARDUINO_AVR_GCC_PREFIX_PARAM} \
"${SKETCH_FILE_PATH}"
}
dump_arduino_prefs() {
if [ "x${_ARDUINO_PREFS}x" == "xx" ]; then
_ARDUINO_PREFS=$(run_arduino_cli --fqbn "${FQBN}" compile --show-properties "${SKETCH_FILE_PATH}")
fi
echo "$_ARDUINO_PREFS"
}
do_compile_with_cli() { do_compile_with_cli() {
#-build-cache "${CORE_CACHE_PATH}" \
#$CCACHE_ENABLE \
#${ARDUINO_AVR_GCC_PREFIX_PARAM} \
run_arduino_cli compile \ run_arduino_cli compile \
--fqbn "${FQBN}" \ --fqbn "${FQBN}" \
--libraries "${KALEIDOSCOPE_DIR}/.." \ --libraries "${KALEIDOSCOPE_DIR}/.." \
@ -511,6 +480,7 @@ do_compile_with_cli() {
--build-properties "compiler.ar.cmd=${_CMD_AR}" \ --build-properties "compiler.ar.cmd=${_CMD_AR}" \
--build-properties "compiler.c.elf.cmd=${_CMD_CXX}" \ --build-properties "compiler.c.elf.cmd=${_CMD_CXX}" \
--build-properties "compiler.cpp.extra_flags=${LOCAL_CFLAGS}"\ --build-properties "compiler.cpp.extra_flags=${LOCAL_CFLAGS}"\
--warnings all \
"${SKETCH_FILE_PATH}" "${SKETCH_FILE_PATH}"
} }

@ -60,25 +60,6 @@ get_arduino_pref() {
} }
dump_arduino_prefs() {
# SKETCH and -build-path in this command are here because of a bug introduced in Arduino 1.8.10
# https://github.com/arduino/arduino-builder/issues/341
if [ "x${_ARDUINO_PREFS}x" == "xx" ]; then
_ARDUINO_PREFS=$("${ARDUINO_BUILDER}" \
-hardware "${ARDUINO_PATH}/hardware" \
-hardware "${BOARD_HARDWARE_PATH}" \
${ARDUINO_TOOLS_FLAG:+"${ARDUINO_TOOLS_FLAG}"} ${ARDUINO_TOOLS_PARAM:+"${ARDUINO_TOOLS_PARAM}"} \
-tools "${ARDUINO_BUILDER_TOOLS_PATH}" \
-fqbn "${FQBN}" \
-build-path "${ARDUINO_PATH}" \
-dump-prefs "${SKETCH_DIR}/${SKETCH}.ino" )
fi
echo "$_ARDUINO_PREFS"
}
find_device_port() { find_device_port() {
find_device_vid_pid find_device_vid_pid
DEVICE_PORT_PROBER="${KALEIDOSCOPE_BIN_DIR}/find-device-port-linux-udev" DEVICE_PORT_PROBER="${KALEIDOSCOPE_BIN_DIR}/find-device-port-linux-udev"

Loading…
Cancel
Save