Excluding DEPLOYMENT Folders or QML Folder Disappears
Preface: I'm using a slightly older version of QtCreator 2.2.1, and I'm somewhat loathe to upgrade, because I'd rather not "rock the boat" at the moment with my currently-stable code base. If that's what's required to solve the problem, though, then I'm willing to try it.
I'm switching from Git to Mercurial on one of my Symbian-based development projects so that I can more easily have nested projects. To this end, I've created a library of QML components that I want to include as a sub-directory under the main qml directory. The problem is that the new QML sub-directory now includes a .hg sub-sub-directory that I don't want to include in the final deployment. So, for a simplistic example:
With this in place, the entire contents of the qml/tool-library/.hg directory are included in the DEPLOYMENT. I've tried a couple of methods to try and get around this.
First: Try Excluding from DEPLOYMENT
I tried to subtract the .hg folder from the DEPLOYMENT in the .pro file:
@hgfiles.sources = qml/.hg
DEPLOYMENT -= hgfiles@
I also tried:
@hgfiles.sources = qml/.hg/*
DEPLOYMENT -= hgfiles@
No joy in Mudville, I'm afraid. I also played around with trying to remove things via the DEPLOYMENTFOLDERS, but as I expected (based on my reading of the qmlapplicationviewer.pri file), it didn't work.
Second: Cause QML Folder to Disappear
I tried manually setting up the DEPLOYMENTFOLDERS variable:
@folder_qml.source = qml/.qml qml/.js
folder_qml.target = qml
folder_components.source = qml/tool-library/.qml qml/tool-library/.js qml/tool-library/gfx
folder_components.target = qml/tool-library
DEPLOYMENTFOLDERS = folder_qml folder_components@
This works perfectly, as far as the resulting .pkg file, in that only the desired files are included. Unfortunately, the QML section of the Projects tool window in the IDE disappears, and I can't access any of the related QML files.
Any suggestions on a solution to this?
A cruel hack would be:
Add QML files as OTHER_FILES in .pro file. Those files will not be included in deployment, but will show up in Qt Creator. So it should solve the issue while not braking anything else. If you are concernde that your .pro file will look ugly, though, you can consider including thid directive in a .pri file :)
A short example taken from my project, just to give you a visual representation of my words :)
.... blah blah blah and so on ....