diff options
author | Alessandro Portale <alessandro.portale@nokia.com> | 2010-07-29 17:28:28 +0200 |
---|---|---|
committer | Alessandro Portale <alessandro.portale@nokia.com> | 2010-07-29 17:29:19 +0200 |
commit | 54a9900c0acc7271478c74c10bab6758d77d7c06 (patch) | |
tree | 4568970ee28839455a493e432b106ce322f57dd5 /src/plugins/qmlprojectmanager | |
parent | b15851f6d57ba451d8a832ba071c6d51a732deb2 (diff) | |
download | qt-creator-54a9900c0acc7271478c74c10bab6758d77d7c06.tar.gz |
Improve deployment of qml apps
Diffstat (limited to 'src/plugins/qmlprojectmanager')
-rw-r--r-- | src/plugins/qmlprojectmanager/wizards/qmlstandaloneapp.cpp | 8 | ||||
-rw-r--r-- | src/plugins/qmlprojectmanager/wizards/templates/app.pro | 78 |
2 files changed, 57 insertions, 29 deletions
diff --git a/src/plugins/qmlprojectmanager/wizards/qmlstandaloneapp.cpp b/src/plugins/qmlprojectmanager/wizards/qmlstandaloneapp.cpp index f45d30977c..d8cc339225 100644 --- a/src/plugins/qmlprojectmanager/wizards/qmlstandaloneapp.cpp +++ b/src/plugins/qmlprojectmanager/wizards/qmlstandaloneapp.cpp @@ -271,7 +271,13 @@ QByteArray QmlStandaloneApp::generateProFile(const QString *errorMessage) const } else if (line.contains(QLatin1String("# TARGETUID3"))) { valueOnNextLine = symbianTargetUid(); } else if (line.contains(QLatin1String("# DEPLOYMENTFOLDERS"))) { - valueOnNextLine = path(QmlDir, AppProfileRelative); + // Eat lines + do { + line = in.readLine(); + } while (!(line.isNull() || line.contains(QLatin1String("# DEPLOYMENTFOLDERS_END")))); + out << "folder_01.source = " << path(QmlDir, AppProfileRelative) << endl; + out << "folder_01.target = qml" << endl; + out << "DEPLOYMENTFOLDERS = folder_01" << endl; } else if (line.contains(QLatin1String("# ORIENTATIONLOCK")) && m_orientation == QmlStandaloneApp::Auto) { uncommentNextLine = true; } else if (line.contains(QLatin1String("# NETWORKACCESS")) && !m_networkEnabled) { diff --git a/src/plugins/qmlprojectmanager/wizards/templates/app.pro b/src/plugins/qmlprojectmanager/wizards/templates/app.pro index 697c5b0587..1faf7f87af 100644 --- a/src/plugins/qmlprojectmanager/wizards/templates/app.pro +++ b/src/plugins/qmlprojectmanager/wizards/templates/app.pro @@ -1,13 +1,9 @@ -QT += declarative - -# MAINQML # -OTHER_FILES = qml/app.qml -SOURCES = cpp/main.cpp cpp/qmlapplicationview.cpp -HEADERS = cpp/qmlapplicationview.h -INCLUDEPATH += cpp - +# Add more folders to ship with the application, here # DEPLOYMENTFOLDERS # -DEPLOYMENTFOLDERS = qml/app +folder_01.source = qml/app +folder_01.target = qml +DEPLOYMENTFOLDERS = folder_01 +# DEPLOYMENTFOLDERS_END # # Avoid auto screen rotation # ORIENTATIONLOCK # @@ -17,45 +13,71 @@ DEFINES += ORIENTATIONLOCK # NETWORKACCESS # DEFINES += NETWORKACCESS +# MAINQML # +OTHER_FILES = qml/app/app.qml + +# TARGETUID3 # +symbian:TARGET.UID3 = 0xE1111234 + + + + +# Edit the code below on your own risk. + +QT += declarative + +SOURCES = cpp/main.cpp cpp/qmlapplicationview.cpp +HEADERS = cpp/qmlapplicationview.h +INCLUDEPATH += cpp + symbian { - # TARGETUID3 # - TARGET.UID3 = 0xE1111234 ICON = cpp/symbianicon.svg + contains(DEFINES, ORIENTATIONLOCK):LIBS += -lavkon -leikcore -leiksrv -lcone + contains(DEFINES, NETWORKACCESS):TARGET.CAPABILITY += NetworkServices for(deploymentfolder, DEPLOYMENTFOLDERS) { item = item$${deploymentfolder} itemsources = $${item}.sources - $$itemsources = $${deploymentfolder} + $$itemsources = $$eval($${deploymentfolder}.source) itempath = $${item}.path - $$itempath = qml + $$itempath= $$eval($${deploymentfolder}.target) DEPLOYMENT += $$item } - contains(DEFINES, ORIENTATIONLOCK):LIBS += -lavkon -leikcore -leiksrv -lcone - contains(DEFINES, NETWORKACCESS):TARGET.CAPABILITY += NetworkServices } else:win32 { - # Ossi will want to kill me when he reads this - # TODO: Let Ossi do some deployment-via-qmake magic - !isEqual(PWD,$$OUT_PWD):!contains(CONFIG, build_pass) { - copyCommand = @echo Copying Qml files... + !isEqual(PWD,$$OUT_PWD) { + copyCommand = @echo Copying application data... for(deploymentfolder, DEPLOYMENTFOLDERS) { - pathSegments = $$split(deploymentfolder, /) - sourceAndTarget = $$PWD/$$deploymentfolder $$OUT_PWD/qml/$$last(pathSegments) + source = $$eval($${deploymentfolder}.source) + target = $$eval($${deploymentfolder}.target) + pathSegments = $$split(source, /) + sourceAndTarget = $$PWD/$$source $$OUT_PWD/$$target/$$last(pathSegments) copyCommand += && $(COPY_DIR) $$replace(sourceAndTarget, /, \\) } - copyqmlfiles.commands = $$copyCommand - first.depends = $(first) copyqmlfiles - QMAKE_EXTRA_TARGETS += first copyqmlfiles + copydeploymentfolders.commands = $$copyCommand + first.depends = $(first) copydeploymentfolders + QMAKE_EXTRA_TARGETS += first copydeploymentfolders } } else:if(maemo5|maemo6) { for(deploymentfolder, DEPLOYMENTFOLDERS) { item = item$${deploymentfolder} itemfiles = $${item}.files - $$itemfiles = $${deploymentfolder} + $$itemfiles = $$eval($${deploymentfolder}.source) itempath = $${item}.path - $$itempath = /opt/share/qml + $$itempath = /opt/share/$$eval($${deploymentfolder}.target) INSTALLS += $$item } target.path = /opt/bin INSTALLS += target -} else { - # TODO: make this work +} else { #linux + !isEqual(PWD,$$OUT_PWD) { + copyCommand = @echo Copying application data... + for(deploymentfolder, DEPLOYMENTFOLDERS) { + source = $$eval($${deploymentfolder}.source) + target = $$OUT_PWD/$$eval($${deploymentfolder}.target)/$$last(pathSegments) + copyCommand += && $(MKDIR) $$target + copyCommand += && $(COPY_DIR) $$PWD/$$source $$target + } + copydeploymentfolders.commands = $$copyCommand + first.depends = $(first) copydeploymentfolders + QMAKE_EXTRA_TARGETS += first copydeploymentfolders + } } |