2929from ros2pkg .api .create import create_package_environment
3030from ros2pkg .api .create import populate_ament_cmake
3131from ros2pkg .api .create import populate_ament_python
32+ from ros2pkg .api .create import populate_ament_cargo
3233from ros2pkg .api .create import populate_cmake
3334from ros2pkg .api .create import populate_cpp_library
3435from ros2pkg .api .create import populate_cpp_node
3536from ros2pkg .api .create import populate_python_libary
3637from ros2pkg .api .create import populate_python_node
38+ from ros2pkg .api .create import populate_rust_node
3739
3840from ros2pkg .verb import VerbExtension
3941
@@ -69,7 +71,7 @@ def add_arguments(self, parser, cli_name):
6971 parser .add_argument (
7072 '--build-type' ,
7173 default = 'ament_cmake' ,
72- choices = ['cmake' , 'ament_cmake' , 'ament_python' ],
74+ choices = ['cmake' , 'ament_cmake' , 'ament_cargo' , ' ament_python' ],
7375 help = 'The build type to process the package with' )
7476 parser .add_argument (
7577 '--dependencies' ,
@@ -199,6 +201,9 @@ def get_git_config(key: str) -> Optional[str]:
199201 if args .build_type == 'ament_cmake' :
200202 populate_ament_cmake (package , package_directory , node_name , library_name )
201203
204+ if args .build_type == 'ament_cargo' :
205+ populate_ament_cargo (package , package_directory , node_name , library_name )
206+
202207 if args .build_type == 'ament_python' :
203208 if not source_directory :
204209 return 'unable to create source folder in ' + args .destination_directory
@@ -224,6 +229,14 @@ def get_git_config(key: str) -> Optional[str]:
224229 library_name
225230 )
226231
232+ if args .build_type == 'ament_cargo' :
233+ populate_rust_node (
234+ package ,
235+ source_directory ,
236+ include_directory ,
237+ library_name
238+ )
239+
227240 if args .license in available_licenses :
228241 with open (os .path .join (package_directory , 'LICENSE' ), 'w' ) as outfp :
229242 for lic in available_licenses [args .license ]:
0 commit comments