From daa5144ccc92c9060f712f7fccfe750966186f51 Mon Sep 17 00:00:00 2001 From: Dominik Holland Date: Tue, 4 Dec 2018 14:14:19 +0100 Subject: Use the new appman qmake integration for packaging the apps Fixes: AUTOSUITE-691 Change-Id: I9e7b2f8ce6443c72e44e63b50902a50c8654bf6f Reviewed-by: Robert Griebl --- .qmake.conf | 6 +-- README.md | 52 ++--------------------- com.pelagicore.camera/app/app.pro | 8 +++- com.pelagicore.camera/com.pelagicore.camera.pro | 5 +++ com.pelagicore.camera/plugin/plugin.pro | 8 +++- com.pelagicore.netflix/com.pelagicore.netflix.pro | 11 ++++- com.pelagicore.spotify/com.pelagicore.spotify.pro | 11 ++++- qmake-features/app.prf | 10 ----- qmake-features/package.prf | 32 -------------- qmake-features/qmlplugin.prf | 23 ---------- qt-auto-extra-apps.pro | 8 ++-- 11 files changed, 44 insertions(+), 130 deletions(-) delete mode 100644 qmake-features/app.prf delete mode 100644 qmake-features/package.prf delete mode 100644 qmake-features/qmlplugin.prf diff --git a/.qmake.conf b/.qmake.conf index 9c2a768..f07e2ad 100644 --- a/.qmake.conf +++ b/.qmake.conf @@ -1,5 +1 @@ -SOURCE_DIR=$$PWD -BUILD_DIR=$$shadowed($$PWD) -QMAKEFEATURES=$$SOURCE_DIR/qmake-features - -CONFIG += package +CONFIG += am-package diff --git a/README.md b/README.md index 079e5e6..e8d4b2a 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,9 @@ This repository hosts additional apps provided for installation in the Qt Automo All apps are intended to be packaged by the appman-packager which is part of the QtApplicationManager module. +See the "Writing Applications" documentation of the QtApplicationManager for how to develop an application +and how the packaging integration works. + # Building and Packaging of Apps All apps can be build by using the following commands: @@ -14,52 +17,3 @@ $ make In addition the apps can be packaged as well using the "package" build target $ make package - -# Adding new apps -## Simple Apps - -For simple QML only apps, just add a new folder with your QML files and icon and the info.yaml for the package. -The new package needs to be added to the qmake build system. For simple apps this is done by creating a new pro file named the same way like your folder. -The pro file looks as following: - -FILES += info.yaml \ - icon.png \ - Browser.qml - -load(app) - -Also make sure the new folder is added to the toplevel pro file qt-auto-extra-apps.pro - -## Complex Apps - -For more complex apps where you need to deploy a C++ based QML plugin in addition to your QML content you need to do the following: - -1. Create a new folder as described for Simple Apps -2. Create a new "app" sub-folder and a new "plugin" subfolder -3. In the plugin subfolder you can use the qmlplugin feature file e.g. - -TEMPLATE = lib -TARGET = camera -QT += qml quick -CONFIG += plugin - -TARGET = $$qtLibraryTarget($$TARGET) -uri = camera -load(qmlplugin) - -# Input -SOURCES += \ - camera_plugin.cpp \ - camerastream.cpp - -HEADERS += \ - camera_plugin.h \ - camerastream.h - -OTHER_FILES = qmldir - -4. In the app directory you can use the same template as used in the simple app case. -5. As the package name is retrieved from the folder name, you need to manually set the package name in your app project file -e.g. NAME = com.pelagicore.camera -6. Create a sub-dirs pro file in your global app folder -7. Add your app folder to the toplevel pro file qt-auto-extra-apps.pro diff --git a/com.pelagicore.camera/app/app.pro b/com.pelagicore.camera/app/app.pro index ff6386e..b59aebe 100644 --- a/com.pelagicore.camera/app/app.pro +++ b/com.pelagicore.camera/app/app.pro @@ -1,7 +1,11 @@ +TEMPLATE = aux + FILES += info.yaml \ icon.png \ Camera.qml -NAME = com.pelagicore.camera +app.files = $$FILES +app.path = /apps/com.pelagicore.camera +INSTALLS += app -load(app) +OTHER_FILES += $$FILES diff --git a/com.pelagicore.camera/com.pelagicore.camera.pro b/com.pelagicore.camera/com.pelagicore.camera.pro index 0740149..db9ffa1 100644 --- a/com.pelagicore.camera/com.pelagicore.camera.pro +++ b/com.pelagicore.camera/com.pelagicore.camera.pro @@ -3,3 +3,8 @@ SUBDIRS += plugin \ app app.depends = plugin + +AM_MANIFEST = $$PWD/app/info.yaml +AM_PACKAGE_DIR = /apps/com.pelagicore.camera + +load(am-app) diff --git a/com.pelagicore.camera/plugin/plugin.pro b/com.pelagicore.camera/plugin/plugin.pro index 8988a37..9edcc7d 100644 --- a/com.pelagicore.camera/plugin/plugin.pro +++ b/com.pelagicore.camera/plugin/plugin.pro @@ -4,8 +4,6 @@ QT += qml quick CONFIG += plugin TARGET = $$qtLibraryTarget($$TARGET) -uri = camera -load(qmlplugin) # Input SOURCES += \ @@ -16,4 +14,10 @@ HEADERS += \ camera_plugin.h \ camerastream.h +installPath = /apps/com.pelagicore.camera/imports/camera +target.path = $$installPath +qmldir.files = qmldir +qmldir.path = $$installPath +INSTALLS += target qmldir + OTHER_FILES = qmldir diff --git a/com.pelagicore.netflix/com.pelagicore.netflix.pro b/com.pelagicore.netflix/com.pelagicore.netflix.pro index c5f9d64..a18cbbc 100644 --- a/com.pelagicore.netflix/com.pelagicore.netflix.pro +++ b/com.pelagicore.netflix/com.pelagicore.netflix.pro @@ -1,5 +1,14 @@ +TEMPLATE = aux + FILES += info.yaml \ icon.png \ Main.qml -load(app) +app.files = $$FILES +app.path = /apps/com.pelagicore.netflix +INSTALLS += app + +AM_MANIFEST = info.yaml +AM_PACKAGE_DIR = $$app.path + +load(am-app) diff --git a/com.pelagicore.spotify/com.pelagicore.spotify.pro b/com.pelagicore.spotify/com.pelagicore.spotify.pro index c5f9d64..bb3f710 100644 --- a/com.pelagicore.spotify/com.pelagicore.spotify.pro +++ b/com.pelagicore.spotify/com.pelagicore.spotify.pro @@ -1,5 +1,14 @@ +TEMPLATE = aux + FILES += info.yaml \ icon.png \ Main.qml -load(app) +app.files = $$FILES +app.path = /apps/com.pelagicore.spotify +INSTALLS += app + +AM_MANIFEST = info.yaml +AM_PACKAGE_DIR = $$app.path + +load(am-app) diff --git a/qmake-features/app.prf b/qmake-features/app.prf deleted file mode 100644 index 0329256..0000000 --- a/qmake-features/app.prf +++ /dev/null @@ -1,10 +0,0 @@ -TEMPLATE = aux - -APPMAN_APP = TRUE - -app.files = $$FILES -app.path = $$OUT_PWD/../install/ - -isEmpty(NAME): NAME = $$basename(_PRO_FILE_PWD_) - -INSTALLS += app diff --git a/qmake-features/package.prf b/qmake-features/package.prf deleted file mode 100644 index 23d9d3a..0000000 --- a/qmake-features/package.prf +++ /dev/null @@ -1,32 +0,0 @@ -# generate code coverage information using gcov/lcov/genhtml -message("PACKAGE") -CONFIG(debug,debug|release) { - equals(TEMPLATE, "subdirs") { - package.target = package - package.CONFIG = recursive - QMAKE_EXTRA_TARGETS += package - } equals(APPMAN_APP, "TRUE") { - - !isEmpty(EXTRA_METADATA): OPTIONS += --extra-metadata $$EXTRA_METADATA - !isEmpty(EXTRA_METADATA_FILE): OPTIONS += --extra-metadata-file $$EXTRA_METADATA_FILE - !isEmpty(EXTRA_SIGNED_METADATA): OPTIONS += --extra-signed-metadata $$EXTRA_SIGNED_METADATA - !isEmpty(EXTRA_SIGNED_METADATA_FILE): OPTIONS += --extra-signed-metadata-file $$EXTRA_SIGNED_METADATA_FILE - - # The actual packaging step - package.CONFIG += recursive - package.commands += @echo && echo "PACKAGING $$NAME" && echo && - package.commands += $$[QT_HOST_BINS]/appman-packager create-package $${OPTIONS} $${BUILD_DIR}/$${NAME}.pkg $$OUT_PWD/../install - build_pass|!debug_and_release:package.depends = install - - QMAKE_EXTRA_TARGETS *= package - - QMAKE_CLEAN += $${BUILD_DIR}/$${NAME}.pkg - } else { - # Create a dummy target for all other project files - package.CONFIG += recursive - build_pass|!debug_and_release:package.depends = install - - QMAKE_EXTRA_TARGETS *= package - } -} - diff --git a/qmake-features/qmlplugin.prf b/qmake-features/qmlplugin.prf deleted file mode 100644 index 59b3895..0000000 --- a/qmake-features/qmlplugin.prf +++ /dev/null @@ -1,23 +0,0 @@ -# Add a long padded rpath, so the installer can replace it with a relative rpath -QMAKE_RPATHDIR += "$$INSTALL_PREFIX/long_padding/long_padding/long_padding/long_padding/long_padding\ - long_padding/long_padding/long_padding/long_padding/long_padding/long_padding/" - -CONFIG += skip_target_version_ext -TARGET = $$qtLibraryTarget($$TARGET) -DESTDIR = $$OUT_PWD/imports/$$replace(uri, \\., /) - -OTHER_FILES = qmldir - -!equals(_PRO_FILE_PWD_, $$OUT_PWD) { - copy_qmldir.target = $$replace(DESTDIR, /, $$QMAKE_DIR_SEP)$${QMAKE_DIR_SEP}qmldir - copy_qmldir.depends = $$replace(_PRO_FILE_PWD_, /, $$QMAKE_DIR_SEP)$${QMAKE_DIR_SEP}qmldir - copy_qmldir.commands = $(COPY_FILE) \"$$copy_qmldir.depends\" \"$$copy_qmldir.target\" - QMAKE_EXTRA_TARGETS += copy_qmldir - PRE_TARGETDEPS += $$copy_qmldir.target -} - -qmldir.files = qmldir -installPath = $$OUT_PWD/../install/imports/$$replace(uri, \\., /) -qmldir.path = $$installPath -target.path = $$installPath -INSTALLS += target qmldir diff --git a/qt-auto-extra-apps.pro b/qt-auto-extra-apps.pro index 288d59e..a4ec8fe 100644 --- a/qt-auto-extra-apps.pro +++ b/qt-auto-extra-apps.pro @@ -1,6 +1,4 @@ TEMPLATE = subdirs -SUBDIRS = com.pelagicore.camera - -OTHER_FILES += qmake-features/qmlplugin.prf \ - qmake-features/app.prf \ - qmake-features/package.prf \ +SUBDIRS = com.pelagicore.camera \ + com.pelagicore.spotify \ + com.pelagicore.netflix -- cgit v1.2.3