margru / pybuilder-smart-copy-resources

PyBuilder plugin for copying additional resources
MIT License
0 stars 2 forks source link

pybuilder_smart_copy_resources not working recursively #12

Open farooqind opened 4 years ago

farooqind commented 4 years ago

@margru
It works for files under resources : project.set_property("smart_copy_resources", { "src/main/resources/*.json": "${dir_dist}/resources" })

but if we specify key as *"src/main/resources/"* it gives permission issue. project.set_property("smart_copy_resources", { "src/main/resources/: "${dir_dist}/resources" }) here is the error message and log:

Executing subtask from pybuilder_smart_copy_resources Copying additional resource files Copying resource c:\work\xxx\xxx\src/main/resources\xxxxxx to C:\work\xx\xxxx\target\dist\lxxxxxx-1.0\resources\xxxxxxxx Traceback (most recent call last): File "c:\users\xxxxxx\appdata\local\programs\python\python36\lib\site-packages\pybuilder\cli.py", line 413, in main environments=options.environments, tasks=arguments) File "c:\users\xxxxxx\appdata\local\programs\python\python36\lib\site-packages\pybuilder\reactor.py", line 128, in build return self.build_execution_plan(tasks, execution_plan) File "c:\users\xxxxxx\appdata\local\programs\python\python36\lib\site-packages\pybuilder\reactor.py", line 166, in build_execution_plan reactor=self) File "c:\users\xxxxxx\appdata\local\programs\python\python36\lib\site-packages\pybuilder\execution.py", line 351, in execute_execution_plan summaries.append(self.execute_task(task, *keyword_arguments)) File "c:\users\xxxxxx\appdata\local\programs\python\python36\lib\site-packages\pybuilder\execution.py", line 298, in execute_task task.execute(self.logger, keyword_arguments) File "c:\users\xxxxxx\appdata\local\programs\python\python36\lib\site-packages\pybuilder\execution.py", line 169, in execute executable.execute(argument_dict) File "c:\users\xxxxxx\appdata\local\programs\python\python36\lib\site-packages\pybuilder\execution.py", line 100, in execute self.callable(arguments) File "c:\users\xxxxxx\appdata\local\programs\python\python36\lib\site-packages\pybuilder_smart_copy_resourcesinit.py", line 74, in package smart_copy_resource(file_to_copy, os.path.basename(file_to_copy) if copy_as is None else copy_as, destination, logger, verbose=project.get_property("verbose")) File "c:\users\xxxxxx\appdata\local\programs\python\python36\lib\site-packages\pybuilder_smart_copy_resourcesinit.py", line 83, in smart_copy_resource shutil.copy(absolute_filename, absolute_target_file_name) File "c:\users\xxxxxx\appdata\local\programs\python\python36\lib\shutil.py", line 235, in copy copyfile(src, dst, follow_symlinks=follow_symlinks) File "c:\users\xxxxxx\appdata\local\programs\python\python36\lib\shutil.py", line 114, in copyfile with open(src, 'rb') as fsrc: PermissionError: [Errno 13] Permission denied: 'c:\work\xxxxxx\xxxxxx\src/main/resources\xxxxxx'

BUILD FAILED - [Errno 13] Permission denied: 'c:\work\xxxxxx\xxxxxx\src/main/resources\xxxxxx

margru commented 4 years ago

Related to #11