Skip to content
This repository was archived by the owner on Aug 23, 2018. It is now read-only.

Commit f190947

Browse files
author
Erwan Le Huitouze
committed
Update AmentGradle build type to deploy sub dir in share directory
1 parent 3d3c59e commit f190947

File tree

1 file changed

+15
-11
lines changed
  • ament_build_type_gradle/ament_build_type_gradle

1 file changed

+15
-11
lines changed

ament_build_type_gradle/ament_build_type_gradle/__init__.py

+15-11
Original file line numberDiff line numberDiff line change
@@ -196,17 +196,8 @@ def on_install(self, context):
196196
'lib', 'java',
197197
os.path.basename(filename)))
198198

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'))
210201

211202
#Deploy scripts
212203
filesDir = os.path.join(context.build_space, 'bin')
@@ -233,6 +224,19 @@ def on_uninstall(self, context):
233224
cmd += ['clean']
234225

235226
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)))
236240

237241
def get_environment_hook_template_path(self, name):
238242
return pkg_resources.resource_filename('ament_build_type_gradle', 'template/environment_hook/' + name)

0 commit comments

Comments
 (0)