#NEWLINE# def create_catkin_build_job( context , package , package_path , dependencies , force_cmake , pre_clean , prebuild = False ) : #NEWLINE# #INDENT# 'Job class for building catkin packages' #NEWLINE# pkg_dir = os . path . join ( context . source_space_abs , package_path ) #NEWLINE# build_space = context . package_build_space ( package ) #NEWLINE# devel_space = context . package_devel_space ( package ) #NEWLINE# install_space = context . package_install_space ( package ) #NEWLINE# metadata_path = context . package_metadata_path ( package ) #NEWLINE# stages = [ ] #NEWLINE# stages . append ( FunctionStage ( 'mkdir' , makedirs , path = build_space ) ) #NEWLINE# stages . append ( FunctionStage ( 'mkdir' , makedirs , path = metadata_path ) ) #NEWLINE# stages . append ( FunctionStage ( 'cache-manifest' , copyfiles , source_paths = [ os . path . join ( context . source_space_abs , package_path , 'package.xml' ) ] , dest_path = os . path . join ( metadata_path , 'package.xml' ) ) ) #NEWLINE# catkin_test_results_dir = os . path . join ( build_space , 'test_results' ) #NEWLINE# ctr_env = { #NEWLINE# #INDENT# 'CATKIN_TEST_RESULTS_DIR' : catkin_test_results_dir , #NEWLINE# 'ROS_TEST_RESULTS_DIR' : catkin_test_results_dir , #NEWLINE# #UNINDENT# } #NEWLINE# makefile_path = os . path . join ( build_space , 'Makefile' ) #NEWLINE# if ( ( not os . path . isfile ( makefile_path ) ) or force_cmake ) : #NEWLINE# #INDENT# stages . append ( FunctionStage ( 'ctr-nuke' , ctr_nuke , prefix = context . package_dest_path ( package ) ) ) #NEWLINE# stages . append ( CommandStage ( 'cmake' , ( [ CMAKE_EXEC , pkg_dir , '--no-warn-unused-cli' , ( '-DCATKIN_DEVEL_PREFIX=' + devel_space ) , ( '-DCMAKE_INSTALL_PREFIX=' + install_space ) ] + context . cmake_args ) , cwd = build_space , logger_factory = CMakeIOBufferProtocol . factory_factory ( pkg_dir ) , occupy_job = True ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# stages . append ( CommandStage ( 'check' , [ MAKE_EXEC , 'cmake_check_build_system' ] , cwd = build_space , logger_factory = CMakeIOBufferProtocol . factory_factory ( pkg_dir ) , occupy_job = True ) ) #NEWLINE# #UNINDENT# make_args = handle_make_arguments ( ( context . make_args + context . catkin_make_args ) ) #NEWLINE# env_overrides = ( ctr_env if ( 'test' in make_args ) else { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } ) #NEWLINE# if pre_clean : #NEWLINE# #INDENT# stages . append ( CommandStage ( 'preclean' , ( [ MAKE_EXEC , 'clean' ] + make_args ) , cwd = build_space ) ) #NEWLINE# #UNINDENT# stages . append ( CommandStage ( 'make' , ( [ MAKE_EXEC ] + make_args ) , cwd = build_space , env_overrides = env_overrides , logger_factory = CMakeMakeIOBufferProtocol . factory ) ) #NEWLINE# if context . link_devel : #NEWLINE# #INDENT# stages . append ( FunctionStage ( 'symlink' , link_devel_products , locked_resource = 'symlink-collisions-file' , package = package , package_path = package_path , devel_manifest_path = context . package_metadata_path ( package ) , source_devel_path = context . package_devel_space ( package ) , dest_devel_path = context . devel_space_abs , metadata_path = context . metadata_path ( ) , prebuild = prebuild ) ) #NEWLINE# #UNINDENT# if context . install : #NEWLINE# #INDENT# stages . append ( CommandStage ( 'install' , [ MAKE_EXEC , 'install' ] , cwd = build_space , logger_factory = CMakeMakeIOBufferProtocol . factory , locked_resource = 'installspace' ) ) #NEWLINE# #UNINDENT# return Job ( jid = package . name , deps = dependencies , env_loader = get_env_loader ( package , context ) , stages = stages )