Skip to content

Commit e32c670

Browse files
committed
convert platform.txt when building board manager packages.
The Arduino IDE handles the tool path differently for manual installs and for packages that have been added by using the board manager. For the compile step it is possible to overcome that problem by redefining two automatic variables. These redefinitions only work for manual installs. For board manager installs they are ignored and the variable keep their automatic values. This is an ugly trick, but it works: runtime.tools.sdcc.path={runtime.hardware.path}/tools/sdcc runtime.tools.STM8Tools.path={runtime.hardware.path}/tools Apparently, this trick only works for compiler settings, not for the upload process. The upload process is not handled by arduino-build, but the IDE itself and behaves slightly differently. Problem is in Arduino/arduino-core/src/processing/app/BaseNoGui.java function createToolPreferences(): PreferencesData.removeAllKeysWithPrefix(prefix); This manual/automatic install shisma is now overcome by patching the platform.txt in the process of generating the board manager packages. Before packaging, the string "{runtime.hardware.path}/tools" is replaced by "runtime.tools.STM8Tools.path" in all tools.stm8.* lines. This is another ugly workaround, but again, it works. (hopefully)
1 parent eb7868d commit e32c670

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

board-manager/Makefile.core

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,12 @@ $(PLATFORM_ENTRY): $(COREFILE)
4343

4444
$(COREFILE): | $(COREDIR)
4545
echo "Generating the core archive file."
46-
(cd ..; git archive -v --prefix=./ --format=tar HEAD:$(SUBTREE))|\
47-
bzip2 > $(COREFILE)
46+
$(eval TMPDIR := $(shell mktemp -d))
47+
cd ..; git archive -v HEAD:sduino/stm8|tar -x -C $(TMPDIR)
48+
sed -i '/^tools\.stm8/ s#{runtime.hardware.path}/tools#{runtime.tools.STM8Tools.path}#' \
49+
$(TMPDIR)/platform.txt
50+
tar cvjf $(COREFILE) -C $(TMPDIR) .
51+
rm -rf $(TMPDIR)
4852

4953
# make a new release directory if not present
5054
#

0 commit comments

Comments
 (0)