@@ -196,17 +196,8 @@ def on_install(self, context):
196
196
'lib' , 'java' ,
197
197
os .path .basename (filename )))
198
198
199
- #Deploy jars
200
- filesDir = os .path .join (context .build_space , 'share' , context .package_manifest .name , 'java' )
201
- if os .path .exists (filesDir ):
202
- for filename in os .listdir (filesDir ):
203
- deploy_file (
204
- context , context .build_space ,
205
- os .path .join (
206
- 'share' ,
207
- context .package_manifest .name ,
208
- 'java' ,
209
- os .path .basename (filename )))
199
+ #Deploy share files
200
+ self .deploy_files (context , os .path .join ('share' , context .package_manifest .name , 'java' ))
210
201
211
202
#Deploy scripts
212
203
filesDir = os .path .join (context .build_space , 'bin' )
@@ -233,6 +224,19 @@ def on_uninstall(self, context):
233
224
cmd += ['clean' ]
234
225
235
226
yield BuildAction (cmd , cwd = context .source_space )
227
+
228
+ def deploy_files (self , context , filesDir ):
229
+ dir = os .path .join (context .build_space , filesDir )
230
+
231
+ if os .path .exists (dir ):
232
+ for filename in os .listdir (dir ):
233
+ if not os .path .isdir (os .path .join (dir , os .path .basename (filename ))):
234
+ deploy_file (
235
+ context ,
236
+ context .build_space ,
237
+ os .path .join (filesDir , os .path .basename (filename )))
238
+ else :
239
+ self .deploy_files (context , os .path .join (filesDir , os .path .basename (filename )))
236
240
237
241
def get_environment_hook_template_path (self , name ):
238
242
return pkg_resources .resource_filename ('ament_build_type_gradle' , 'template/environment_hook/' + name )
0 commit comments