import tempfile ardupilot_path = "/home/tobias/git/ardupilot" ardupilot_project_name = "ArduCopter" eclipse_workspace = "/home/tobias/workspace_cpp" eclipse_project = "ArduCopter" eclipse_configuration = "Release" system_tmp_dir = tempfile.gettempdir() a = ardupilot_2_eclipse.ardupilot_eclipse(eclipse_workspace, eclipse_project, ardupilot_path, ardupilot_project_name, system_tmp_dir, ["apm2-quad"] ) a.copy_ardupilot_to_eclipse(link = True, dont_include_pde = False, ask = True ) a.set_includes(eclipse_configuration) a.set_excludes(eclipse_configuration) a.write_xml()
g_link = parser.add_mutually_exclusive_group() g_link.add_argument("--no-link", action = "store_false", dest = "link", help = "copy ardupilot files into eclipse project") g_link.add_argument("--link", action = "store_true", dest = "link", help = "(default) symlink ardupilot files into eclipse project") g_pde = parser.add_mutually_exclusive_group() g_pde.add_argument("--dont-include-pde", action = "store_true", dest = "dont_include_pde", help = "use \"main cpp\" generated by ardupilot makefile (pde code pasted)") g_pde.add_argument("--include-pde", action = "store_false", dest = "dont_include_pde", help = "(default) generate \"main cpp\" that includes pde files") parser.add_argument("--dont-ask", action = "store_false", dest = "ask", help = "don't get confirmation for copying/deleting/linking files") args = parser.parse_args() a = ardupilot_2_eclipse.ardupilot_eclipse(args.eclipse_workspace, args.eclipse_project, args.ardupilot_path, args.ardupilot_project, args.tmp, args.arg ) a.copy_ardupilot_to_eclipse(link = args.link, dont_include_pde = args.dont_include_pde, ask = args.ask ) a.set_includes(args.cfg) a.set_excludes(args.cfg) a.write_xml()
if __name__ == "__main__": """ template main with hardcodes paths to automate the conversion process with python. """ import ardupilot_2_eclipse import tempfile ardupilot_path = "/home/tobias/git/ardupilot" ardupilot_project_name = "ArduCopter" eclipse_workspace = "/home/tobias/workspace_cpp" eclipse_project = "ArduCopter" eclipse_configuration = "Release" system_tmp_dir = tempfile.gettempdir() a = ardupilot_2_eclipse.ardupilot_eclipse(eclipse_workspace, eclipse_project, ardupilot_path, ardupilot_project_name, system_tmp_dir, ["apm2-quad"]) a.copy_ardupilot_to_eclipse(link=True, dont_include_pde=False, ask=True) a.set_includes(eclipse_configuration) a.set_excludes(eclipse_configuration) a.write_xml()