Skip to content

Commit

Permalink
fix(platform): use numbers in all recipe hooks (#9219)
Browse files Browse the repository at this point in the history
The Arduino Platform Specification requires that the recipe hooks are
distinguished by a number and does not endorse using text labels. Fix
all the usages of recipe hooks to use numbers.

Closes arduino/arduino-cli#2369 .
  • Loading branch information
pillo79 committed Feb 7, 2024
1 parent de1774b commit fda21f3
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions platform.txt
Original file line number Diff line number Diff line change
Expand Up @@ -191,13 +191,13 @@ recipe.hooks.prebuild.6.pattern.windows=cmd /c if not exist "{build.path}\build_

# Set -DARDUINO_CORE_BUILD only on core file compilation
file_opts.path={build.path}/file_opts
recipe.hooks.prebuild.set_core_build_flag.pattern=/usr/bin/env bash -c ": > {file_opts.path}"
recipe.hooks.core.prebuild.set_core_build_flag.pattern=/usr/bin/env bash -c "echo -DARDUINO_CORE_BUILD > {file_opts.path}"
recipe.hooks.core.postbuild.set_core_build_flag.pattern=/usr/bin/env bash -c ": > {file_opts.path}"
recipe.hooks.prebuild.7.pattern=/usr/bin/env bash -c ": > {file_opts.path}"
recipe.hooks.core.prebuild.1.pattern=/usr/bin/env bash -c "echo -DARDUINO_CORE_BUILD > {file_opts.path}"
recipe.hooks.core.postbuild.1.pattern=/usr/bin/env bash -c ": > {file_opts.path}"

recipe.hooks.prebuild.set_core_build_flag.pattern.windows=cmd /c type nul > "{file_opts.path}"
recipe.hooks.core.prebuild.set_core_build_flag.pattern.windows=cmd /c echo "-DARDUINO_CORE_BUILD" > "{file_opts.path}"
recipe.hooks.core.postbuild.set_core_build_flag.pattern.windows=cmd /c type nul > "{file_opts.path}"
recipe.hooks.prebuild.7.pattern.windows=cmd /c type nul > "{file_opts.path}"
recipe.hooks.core.prebuild.1.pattern.windows=cmd /c echo "-DARDUINO_CORE_BUILD" > "{file_opts.path}"
recipe.hooks.core.postbuild.1.pattern.windows=cmd /c type nul > "{file_opts.path}"

# Generate debug.cfg (must be postbuild)
recipe.hooks.postbuild.1.pattern=/usr/bin/env bash -c "[ {build.copy_jtag_files} -eq 0 ] || cp -f "{debug.server.openocd.scripts_dir}"board/{build.openocdscript} "{build.source.path}"/debug.cfg"
Expand Down

0 comments on commit fda21f3

Please sign in to comment.