Skip to content

Commit

Permalink
[Meta]: Update Arduino library generation script to remove systec
Browse files Browse the repository at this point in the history
Updated the the arduino library script to remove the systec driver.
Moved this script into the script directory.
  • Loading branch information
ad3154 committed Feb 9, 2024
1 parent 867d2c0 commit 1f924f0
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions generateArduinoLibrary.py → scripts/generateArduinoLibrary.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def fixup_header_paths(fileName):
f.write(newdata)
f.close()

arduinoLibPath = "arduino_library/"
arduinoLibPath = "../arduino_library/"
sourceDir = "src"
sourcePath = arduinoLibPath + sourceDir

Expand All @@ -78,9 +78,9 @@ def fixup_header_paths(fileName):

print("Copying source files to library")

copyfiles(".", sourcePath, "*.cpp")
copyfiles(".", sourcePath, "*.hpp")
copyfiles(".", sourcePath, "*.tpp")
copyfiles("../", sourcePath, "*.cpp")
copyfiles("../", sourcePath, "*.hpp")
copyfiles("../", sourcePath, "*.tpp")

print("Pruning unneeded files for Arduino platform")

Expand Down Expand Up @@ -119,6 +119,8 @@ def fixup_header_paths(fileName):
"can_hardware_interface.cpp",
"socketcand_windows_network_client.hpp",
"socketcand_windows_network_client.cpp",
"sys_tec_windows_plugin.hpp",
"sys_tec_windows_plugin.cpp",
"CMakeCXXCompilerId.cpp"]

for punableFile in filePruneList:
Expand All @@ -128,7 +130,7 @@ def fixup_header_paths(fileName):

print("Generating isobus.hpp from files in " + "./" + sourcePath + "/*.hpp")
headers = [os.path.normpath(i) for i in glob.glob("./" + sourcePath + "/*.hpp")]
strippedHeaders = list(map(lambda x: x.replace('arduino_library\\src\\','').replace('arduino_library/src/',''),headers))
strippedHeaders = list(map(lambda x: x.replace('..\\arduino_library\\src\\','').replace('../arduino_library/src/',''),headers))
print("Headers ", strippedHeaders)
f = open(os.path.join(sourcePath, "AgIsoStack.hpp"), "w")
write_isobus_hpp(strippedHeaders, f)
Expand Down

0 comments on commit 1f924f0

Please sign in to comment.