Uploaded image for project: 'Qt Creator'
  1. Qt Creator
  2. QTCREATORBUG-10932

Find an another alternative to 'cp -r' for deploy QMLs to iOS bundle

    XMLWordPrintable

Details

    Description

      The qtquick2applicationviewer.pri generated by QtCreator contains various code for deploying QMLs (and other) files to the application created.
      For what concerns the iOS bundle creation, the deploy command consist of:

      copyCommand += mkdir -p \"$$target\"
      copyCommand += && cp -r \"$$source\" \"$$target\"

      This has two disadvantages (from my point of view):
      1) 'cp -r' copy everything including the hiddens files. This means that in the case (very often) the files to be copied are in a directory managed by subversion or git, then all hidden data used by file revisioning systems are copied into the bundle. Not a big deal, but better to avoid.
      2) if you prefer to use Xcode instead of QtCreator, then in the Xcode project there will be no way to see the list of the deployed files. This means, that you cannot access to the QML sources for editing from the Xcode project.

      I don't know what can be the best alternative solution, but following there is my approach since Qt 5.1:

      DEPLOY_TO_BUNDLE =
      for(deploymentfolder, DEPLOYMENTFOLDERS) {
      DEPLOY_TO_BUNDLE.files += $$PWD/$$eval($${deploymentfolder}.source)
      }
      QMAKE_BUNDLE_DATA += DEPLOY_TO_BUNDLE

      Using the QMAKE_BUNDLE_DATA will solve both problems mentioned above. In fact, the hiddens files are not copied, and in the Xcode project appear a group called "Bundle Resources" containing the list of all files included into the bundle.

      Attachments

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              fawzi Fawzi Mohamed
              gianluca Gianluca Massera
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes