rename empy templates (*.template) to proper file extension (.em)

This commit is contained in:
Daniel Agar
2019-06-10 12:36:16 -04:00
committed by Lorenz Meier
parent bef7a9ba8e
commit 32a89a1834
26 changed files with 25 additions and 23 deletions
+2 -2
View File
@@ -184,7 +184,7 @@ add_custom_command(OUTPUT ${uorb_headers}
-q -q
DEPENDS DEPENDS
${msg_files} ${msg_files}
templates/uorb/msg.h.template templates/uorb/msg.h.em
tools/px_generate_uorb_topic_files.py tools/px_generate_uorb_topic_files.py
COMMENT "Generating uORB topic headers" COMMENT "Generating uORB topic headers"
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
@@ -204,7 +204,7 @@ add_custom_command(OUTPUT ${uorb_sources}
-q -q
DEPENDS DEPENDS
${msg_files} ${msg_files}
templates/uorb/msg.cpp.template templates/uorb/msg.cpp.em
tools/px_generate_uorb_topic_files.py tools/px_generate_uorb_topic_files.py
COMMENT "Generating uORB topic sources" COMMENT "Generating uORB topic sources"
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
+9 -9
View File
@@ -265,15 +265,15 @@ classifier = (Classifier(os.path.abspath(args.yaml_file), msg_dir) if os.path.is
check_rtps_id_uniqueness(classifier) check_rtps_id_uniqueness(classifier)
uRTPS_CLIENT_TEMPL_FILE = 'microRTPS_client.cpp.template' uRTPS_CLIENT_TEMPL_FILE = 'microRTPS_client.cpp.em'
uRTPS_AGENT_TOPICS_H_TEMPL_FILE = 'RtpsTopics.h.template' uRTPS_AGENT_TOPICS_H_TEMPL_FILE = 'RtpsTopics.h.em'
uRTPS_AGENT_TOPICS_SRC_TEMPL_FILE = 'RtpsTopics.cpp.template' uRTPS_AGENT_TOPICS_SRC_TEMPL_FILE = 'RtpsTopics.cpp.em'
uRTPS_AGENT_TEMPL_FILE = 'microRTPS_agent.cpp.template' uRTPS_AGENT_TEMPL_FILE = 'microRTPS_agent.cpp.em'
uRTPS_AGENT_CMAKELISTS_TEMPL_FILE = 'microRTPS_agent_CMakeLists.txt.template' uRTPS_AGENT_CMAKELISTS_TEMPL_FILE = 'microRTPS_agent_CMakeLists.txt.em'
uRTPS_PUBLISHER_SRC_TEMPL_FILE = 'Publisher.cpp.template' uRTPS_PUBLISHER_SRC_TEMPL_FILE = 'Publisher.cpp.em'
uRTPS_PUBLISHER_H_TEMPL_FILE = 'Publisher.h.template' uRTPS_PUBLISHER_H_TEMPL_FILE = 'Publisher.h.em'
uRTPS_SUBSCRIBER_SRC_TEMPL_FILE = 'Subscriber.cpp.template' uRTPS_SUBSCRIBER_SRC_TEMPL_FILE = 'Subscriber.cpp.em'
uRTPS_SUBSCRIBER_H_TEMPL_FILE = 'Subscriber.h.template' uRTPS_SUBSCRIBER_H_TEMPL_FILE = 'Subscriber.h.em'
def generate_agent(out_dir): def generate_agent(out_dir):
+8 -8
View File
@@ -77,13 +77,13 @@ __license__ = "BSD"
__email__ = "thomasgubler@gmail.com" __email__ = "thomasgubler@gmail.com"
TEMPLATE_FILE = ['msg.h.template', 'msg.cpp.template'] TEMPLATE_FILE = ['msg.h.em', 'msg.cpp.em']
TOPICS_LIST_TEMPLATE_FILE = 'uORBTopics.cpp.template' TOPICS_LIST_TEMPLATE_FILE = 'uORBTopics.cpp.em'
OUTPUT_FILE_EXT = ['.h', '.cpp'] OUTPUT_FILE_EXT = ['.h', '.cpp']
INCL_DEFAULT = ['std_msgs:./msg/std_msgs'] INCL_DEFAULT = ['std_msgs:./msg/std_msgs']
PACKAGE = 'px4' PACKAGE = 'px4'
TOPICS_TOKEN = '# TOPICS ' TOPICS_TOKEN = '# TOPICS '
IDL_TEMPLATE_FILE = 'msg.idl.template' IDL_TEMPLATE_FILE = 'msg.idl.em'
class MsgScope: class MsgScope:
@@ -184,7 +184,7 @@ def generate_idl_file(filename_msg, outputdir, templatedir, package, includepath
template_file = os.path.join(templatedir, IDL_TEMPLATE_FILE) template_file = os.path.join(templatedir, IDL_TEMPLATE_FILE)
output_file = os.path.join(outputdir, IDL_TEMPLATE_FILE.replace( output_file = os.path.join(outputdir, IDL_TEMPLATE_FILE.replace(
"msg.idl.template", str(spec_short_name + "_.idl"))) "msg.idl.em", str(spec_short_name + "_.idl")))
return generate_by_template(output_file, template_file, em_globals) return generate_by_template(output_file, template_file, em_globals)
@@ -210,7 +210,7 @@ def generate_uRTPS_general(filename_send_msgs, filename_received_msgs,
template_file = os.path.join(templatedir, template_name) template_file = os.path.join(templatedir, template_name)
output_file = os.path.join( output_file = os.path.join(
outputdir, template_name.replace(".template", "")) outputdir, template_name.replace(".em", ""))
return generate_by_template(output_file, template_file, merged_em_globals) return generate_by_template(output_file, template_file, merged_em_globals)
@@ -229,7 +229,7 @@ def generate_topic_file(filename_msg, outputdir, templatedir, package, includepa
template_file = os.path.join(templatedir, template_name) template_file = os.path.join(templatedir, template_name)
output_file = os.path.join( output_file = os.path.join(
outputdir, spec_short_name + "_" + template_name.replace(".template", "")) outputdir, spec_short_name + "_" + template_name.replace(".em", ""))
return generate_by_template(output_file, template_file, em_globals) return generate_by_template(output_file, template_file, em_globals)
@@ -411,7 +411,7 @@ def generate_topics_list_file(msgdir, outputdir, templatedir):
tl_globals = {"msgs": msgs, "multi_topics": multi_topics} tl_globals = {"msgs": msgs, "multi_topics": multi_topics}
tl_template_file = os.path.join(templatedir, TOPICS_LIST_TEMPLATE_FILE) tl_template_file = os.path.join(templatedir, TOPICS_LIST_TEMPLATE_FILE)
tl_out_file = os.path.join( tl_out_file = os.path.join(
outputdir, TOPICS_LIST_TEMPLATE_FILE.replace(".template", "")) outputdir, TOPICS_LIST_TEMPLATE_FILE.replace(".em", ""))
generate_by_template(tl_out_file, tl_template_file, tl_globals) generate_by_template(tl_out_file, tl_template_file, tl_globals)
@@ -425,7 +425,7 @@ def generate_topics_list_file_from_files(files, outputdir, templatedir):
tl_globals = {"msgs": filenames, "multi_topics": multi_topics} tl_globals = {"msgs": filenames, "multi_topics": multi_topics}
tl_template_file = os.path.join(templatedir, TOPICS_LIST_TEMPLATE_FILE) tl_template_file = os.path.join(templatedir, TOPICS_LIST_TEMPLATE_FILE)
tl_out_file = os.path.join( tl_out_file = os.path.join(
outputdir, TOPICS_LIST_TEMPLATE_FILE.replace(".template", "")) outputdir, TOPICS_LIST_TEMPLATE_FILE.replace(".em", ""))
generate_by_template(tl_out_file, tl_template_file, tl_globals) generate_by_template(tl_out_file, tl_template_file, tl_globals)
+1 -1
View File
@@ -33,7 +33,7 @@
############################################################################# #############################################################################
''' '''
Helper methods & common code for the uorb message templates msg.{cpp,h}.template Helper methods & common code for the uorb message templates msg.{cpp,h}.em
Another positive effect of having the code here, is that this file will get Another positive effect of having the code here, is that this file will get
precompiled and thus message generation will be much faster precompiled and thus message generation will be much faster
+4 -2
View File
@@ -93,9 +93,11 @@ add_custom_command(
OUTPUT OUTPUT
${CMAKE_CURRENT_BINARY_DIR}/FlightTasks_generated.hpp ${CMAKE_CURRENT_BINARY_DIR}/FlightTasks_generated.hpp
${CMAKE_CURRENT_BINARY_DIR}/FlightTasks_generated.cpp ${CMAKE_CURRENT_BINARY_DIR}/FlightTasks_generated.cpp
COMMAND ${PYTHON_EXECUTABLE} generate_flight_tasks.py COMMAND ${PYTHON_EXECUTABLE} generate_flight_tasks.py ${python_args}
${python_args}
COMMENT "Generating Flight Tasks" COMMENT "Generating Flight Tasks"
DEPENDS
Templates/FlightTasks_generated.cpp.em
Templates/FlightTasks_generated.hpp.em
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
VERBATIM VERBATIM
) )
+1 -1
View File
@@ -23,5 +23,5 @@ for gen_file in args.gen_files:
"tasks_add": args.tasks_add, "tasks_add": args.tasks_add,
} }
interpreter = em.Interpreter(output=output_file, globals=em_globals) interpreter = em.Interpreter(output=output_file, globals=em_globals)
interpreter.file(open(args.directory_in + "/" + gen_file + ".template")) interpreter.file(open(args.directory_in + "/" + gen_file + ".em"))
interpreter.shutdown() interpreter.shutdown()