Skip to content

Commit

Permalink
Update espidf.py
Browse files Browse the repository at this point in the history
  • Loading branch information
Jason2866 authored Oct 30, 2024
1 parent 5009075 commit 7f9e5a2
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions builder/frameworks/espidf.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,8 +204,15 @@ def HandleArduinoCOMPONENTsettings(env):
if idf_custom_component_add != "":
for entry in idf_custom_component_add:
# add entrys to json
print("*** Adding component:",entry)
# todo idf_component_json["dependencies"][entry]
if "@" in entry:
idf_comp_entry = str(entry.split("@")[0]).replace(" ", "")
idf_comp_vers = str(entry.split("@")[1]).replace(" ", "")
else:
idf_comp_entry = str(entry).replace(" ", "")
idf_comp_vers = "*"
print("*** Adding component:", idf_comp_entry, idf_comp_vers)
new_entry = {idf_comp_entry: {"version": idf_comp_vers}}
idf_component_json["dependencies"].update(new_entry)

idf_component_yml_file = open(os.path.join(ARDUINO_FRAMEWORK_DIR, "idf_component.yml"),"w")
yaml.dump(idf_component_json, idf_component_yml_file)
Expand Down

0 comments on commit 7f9e5a2

Please sign in to comment.