g-sherman / plugin_build_tool

Python command line tool for compiling and deploying QGIS plugins
GNU General Public License v2.0
39 stars 18 forks source link

Deploy extra dirs before files for ensuring dir creation #14

Open jmonticolo opened 5 years ago

jmonticolo commented 5 years ago

When an Qt .ui file is in a subfolder, an error occurs on pb_tool deploy because the distant directory is not created. Part of QGIS 3.x plugin's pb_tool.cfg file :

[...]
# Other ui files for dialogs you create (these will be compiled)
compiled_ui_files: ui/my_second_dialog.ui
[...]
# Other directories to be deployed with the plugin.
# These must be subdirectories under the plugin directory
extra_dirs: ui

With the actual pb_tool version, an error occurs during deployment :

Copying ui/my_second_dialog.py ----> ERROR
Copying resources.py
Copying metadata.txt
Copying icon.png
Copying contents of ui to /home/me/.local/share/QGIS/QGIS3/profiles/default/python/plugins/my_plugin
Copying help/build/html to /home/me/.local/share/QGIS/QGIS3/profiles/default/python/plugins/my_plugin/help

ERRORS:
Error copying files: ui/my_second_dialog.py, No such file or directory

The modification I've made is to deploy extra directories before files to avoid this error. The Qt .ui file will be deployed with its compiled version.