From b57c954b3478ba15eba2fc81dfe37eea15b16573 Mon Sep 17 00:00:00 2001 From: "a.yankovich" Date: Tue, 23 Oct 2018 12:40:48 +0300 Subject: [PATCH 1/2] ref #81 fix build debub windows version --- SoundBand/syncengine.h | 1 - Sync/ETcpSocket.h | 4 ++-- Sync/Log.h | 2 +- Sync/Sync.pro | 3 +++ Sync/mysql.h | 3 ++- Sync/node.h | 3 ++- Sync/playlist.h | 3 ++- Sync/song.h | 8 ++++---- 8 files changed, 16 insertions(+), 11 deletions(-) diff --git a/SoundBand/syncengine.h b/SoundBand/syncengine.h index 1e6d7c3..641a88c 100644 --- a/SoundBand/syncengine.h +++ b/SoundBand/syncengine.h @@ -4,7 +4,6 @@ #include #include - /** * @brief The SyncEngine class - this class is interface between syncLine and qml application. */ diff --git a/Sync/ETcpSocket.h b/Sync/ETcpSocket.h index a45c52a..355111d 100755 --- a/Sync/ETcpSocket.h +++ b/Sync/ETcpSocket.h @@ -5,7 +5,7 @@ #include #include #include "syncpackage.h" - +#include "sync_global.h" /** * @brief The ETcpSocket class @@ -29,7 +29,7 @@ */ -class ETcpSocket:public QObject +class SYNCSHARED_EXPORT ETcpSocket:public QObject { Q_OBJECT private: diff --git a/Sync/Log.h b/Sync/Log.h index 23f91c9..e9165c4 100644 --- a/Sync/Log.h +++ b/Sync/Log.h @@ -6,7 +6,7 @@ #include #include "sync_global.h" -enum SYNCSHARED_EXPORT LogType{ERROR, WARNING, INFORMATION, NONE}; +enum LogType{ERROR, WARNING, INFORMATION, NONE}; class SYNCSHARED_EXPORT Log { diff --git a/Sync/Sync.pro b/Sync/Sync.pro index d5a279a..f9f56a4 100644 --- a/Sync/Sync.pro +++ b/Sync/Sync.pro @@ -11,6 +11,9 @@ TEMPLATE = lib include($$PWD/../deploy.pri); include('$$PWD/../QuasarAppLib/QuasarLib.pri'); +DEFINES += SYNC_LIBRARY + + DISTFILES += \ sql/InitLacaleDataBase.sql diff --git a/Sync/mysql.h b/Sync/mysql.h index 9939f65..161732c 100644 --- a/Sync/mysql.h +++ b/Sync/mysql.h @@ -2,11 +2,12 @@ #define MYSQL_H #include #include "playlist.h" +#include "sync_global.h" class QSqlDatabase; class QSqlQuery; -class MySql +class SYNCSHARED_EXPORT MySql { private: QSqlDatabase *db; diff --git a/Sync/node.h b/Sync/node.h index d8fc79d..08aad86 100644 --- a/Sync/node.h +++ b/Sync/node.h @@ -5,11 +5,12 @@ #include #include "basepackage.h" #include "syncpackage.h" +#include "sync_global.h" /** * @brief The Node class is tcp server class */ -class Node:public QTcpServer{ +class SYNCSHARED_EXPORT Node:public QTcpServer{ Q_OBJECT private: QTimer *timer; diff --git a/Sync/playlist.h b/Sync/playlist.h index 3dd0ed0..75d6cf2 100644 --- a/Sync/playlist.h +++ b/Sync/playlist.h @@ -2,12 +2,13 @@ #define PLAYLIST_H #include #include "song.h" +#include "sync_global.h" /** * @brief The PlayList class * palyList with songs info */ -class PlayList +class SYNCSHARED_EXPORT PlayList { private: /** diff --git a/Sync/song.h b/Sync/song.h index fd2ca0e..429545e 100644 --- a/Sync/song.h +++ b/Sync/song.h @@ -5,7 +5,7 @@ #include #include "chronotime.h" #include - +#include "sync_global.h" /** * @brief The Syncer struct * @@ -27,7 +27,7 @@ struct Syncer * @brief The SongHeader class sound header with media information * (id,size and name) */ -class SongHeader{ +class SYNCSHARED_EXPORT SongHeader{ protected: bool getName(QString &name, const QUrl& url)const; bool getSize(int &size, const QUrl& url)const; @@ -61,7 +61,7 @@ public: * @brief The Song class * into this calss added mediadata of playable media file. */ -class Song : public SongHeader { +class SYNCSHARED_EXPORT Song : public SongHeader { private: QByteArray source; public: @@ -82,7 +82,7 @@ public: * @brief The SongStorage class * header with url to song source */ -class SongStorage : public SongHeader { +class SYNCSHARED_EXPORT SongStorage : public SongHeader { private: QUrl url; public: From 5065cdd6fc08a472c784fe320b5c31b6b4604631 Mon Sep 17 00:00:00 2001 From: EndrII Date: Thu, 25 Oct 2018 19:54:40 +0300 Subject: [PATCH 2/2] win build fix --- CQtDeployer | 2 +- QuasarAppLib | 2 +- SoundBand.pro | 5 +- SoundBand/SoundBand.pro | 8 +++- Sync/Sync.pri | 13 ++---- Sync/Sync.pro | 7 ++- installer/config/controlScript.js | 7 +++ installer/deploy/deploy.bat | 26 +++++++++++ installer/deploy/deploy.pro | 41 ---------------- installer/deploy/targetList.pri | 2 + installer/installer.pro | 44 ++++-------------- .../SoundBand/{data => extra}/icons/icon.png | Bin installer/packages/SoundBand/snap.pro | 2 +- tests/tests.pro | 8 +++- 14 files changed, 74 insertions(+), 93 deletions(-) create mode 100644 installer/deploy/deploy.bat delete mode 100644 installer/deploy/deploy.pro rename installer/packages/SoundBand/{data => extra}/icons/icon.png (100%) diff --git a/CQtDeployer b/CQtDeployer index 56a93aa..7c3b80c 160000 --- a/CQtDeployer +++ b/CQtDeployer @@ -1 +1 @@ -Subproject commit 56a93aaf65cbf04ac06f400473563b95262ceec5 +Subproject commit 7c3b80c6600fe883df0331682dcdb9931542ad82 diff --git a/QuasarAppLib b/QuasarAppLib index 745a66b..8b0865e 160000 --- a/QuasarAppLib +++ b/QuasarAppLib @@ -1 +1 @@ -Subproject commit 745a66bd5bc9c0f9bd2f0add1e35a3b00f7d70a0 +Subproject commit 8b0865e9142457ec96e0bf434f85636dd7e1a906 diff --git a/SoundBand.pro b/SoundBand.pro index 702bd50..21fc428 100644 --- a/SoundBand.pro +++ b/SoundBand.pro @@ -2,9 +2,8 @@ TEMPLATE = subdirs CONFIG += ordered -message( DEPLOY_FILES_MASTER = $$DEPLOY_FILES) -ENABLE_SNAP = 0 #only linux +ENABLE_SNAP = 1 #only linux ENABLE_INSTALLER = 1 #only desctop SUBDIRS += QuasarAppLib/QuasarApp.pro \ @@ -33,7 +32,7 @@ equals( ENABLE_INSTALLER, 1) { } equals( ENABLE_SNAP, 1) { - !android:{ + unix:!android:{ message(desktopVersion: enabled) CONFIG(release, debug|release): { diff --git a/SoundBand/SoundBand.pro b/SoundBand/SoundBand.pro index d94c4aa..79a7439 100644 --- a/SoundBand/SoundBand.pro +++ b/SoundBand/SoundBand.pro @@ -18,6 +18,13 @@ DEFINES += QT_DEPRECATED_WARNINGS TARGET = SoundBand +CONFIG(release, debug|release): { + DESTDIR = $$PWD/build/release + +} else { + DESTDIR = $$PWD/build/debug +} + SOURCES += main.cpp \ syncengine.cpp \ imageprovider.cpp \ @@ -59,7 +66,6 @@ HEADERS += \ playlistsmodel.h \ currentplaylistmodel.h -include($$PWD/../deploy.pri) include($$PWD/../Sync/Sync.pri) include('$$PWD/../QuasarAppLib/QuasarLib.pri'); diff --git a/Sync/Sync.pri b/Sync/Sync.pri index b695787..ef1ca01 100644 --- a/Sync/Sync.pri +++ b/Sync/Sync.pri @@ -9,15 +9,12 @@ SYNC_LIB = 1 #DEPENDS -OLD_DEST_DIR=$$DESTDIR -OLD_SOUND=$$SOUND_BAND_MODULE; -SOUND_BAND_MODULE = sync -include($$PWD/../deploy.pri) +CONFIG(release, debug|release): { + LIBS += -L"$$PWD/build/release" -lSync -LIBS += -L"$$DESTDIR/" -lSync - -SOUND_BAND_MODULE = $$OLD_SOUND -DESTDIR = $$OLD_DEST_DIR +} else { + LIBS += -L"$$PWD/build/debug" -lSync +} INCLUDEPATH += "$$PWD/" diff --git a/Sync/Sync.pro b/Sync/Sync.pro index f9f56a4..70fd3ad 100644 --- a/Sync/Sync.pro +++ b/Sync/Sync.pro @@ -8,11 +8,16 @@ greaterThan(QT_MAJOR_VERSION, 4): QT += widgets TARGET = Sync TEMPLATE = lib -include($$PWD/../deploy.pri); include('$$PWD/../QuasarAppLib/QuasarLib.pri'); DEFINES += SYNC_LIBRARY +CONFIG(release, debug|release): { + DESTDIR = $$PWD/build/release + +} else { + DESTDIR = $$PWD/build/debug +} DISTFILES += \ sql/InitLacaleDataBase.sql diff --git a/installer/config/controlScript.js b/installer/config/controlScript.js index 13d3c85..b07edbf 100644 --- a/installer/config/controlScript.js +++ b/installer/config/controlScript.js @@ -2,9 +2,16 @@ function Controller() { installer.uninstallationFinished.connect(this, Controller.prototype.uninstallationFinished); installer.installationFinished.connect(this, Controller.prototype.installationFinished); + runProgramControl(); } +function runProgramControl() { + if (systemInfo.kernelType === "winnt") { + installer.setValue("RunProgram", "@TargetDir@/SoundBand.exe"); + } +} + Controller.prototype.uninstallationFinished = function() { diff --git a/installer/deploy/deploy.bat b/installer/deploy/deploy.bat new file mode 100644 index 0000000..0c709f7 --- /dev/null +++ b/installer/deploy/deploy.bat @@ -0,0 +1,26 @@ +echo off + +set deploy=%1 +set qmldir=%2 + +SET CURRENTDIR=%3 + +echo on +RMDIR /S /Q "%CURRENTDIR%\packages\SoundBand\data" +RMDIR /S /Q "%CURRENTDIR%\packages\SoundBand.tests\data" + +MKDIR "%CURRENTDIR%\packages\SoundBand\data" +MKDIR "%CURRENTDIR%\packages\SoundBand.tests\data" + +xcopy \d \y \r \f "%CURRENTDIR%packages\SoundBand\extra" "%CURRENTDIR%\packages\SoundBand\data" + + +copy /Y "%CURRENTDIR%\..\SoundBand\build\release\SoundBand.exe" "%CURRENTDIR%\packages\SoundBand\data\SoundBand.exe" +copy /Y "%CURRENTDIR%\..\QuasarAppLib\build\release\QuasarApp.dll" "%CURRENTDIR%\packages\SoundBand\data\QuasarApp.dll" +copy /Y "%CURRENTDIR%\..\Sync\build\release\Sync.dll" "%CURRENTDIR%\packages\SoundBand\data\Sync.dll" +copy /Y "%CURRENTDIR%\..\tests\build\release\test.exe" "%CURRENTDIR%\packages\SoundBand.Tests\data\test.exe" + +%deploy% --qmldir %qmldir% "%CURRENTDIR%\packages\SoundBand\data\SoundBand.exe" +%deploy% --qmldir %qmldir% "%CURRENTDIR%\packages\SoundBand\data\QuasarApp.dll" +%deploy% --qmldir %qmldir% "%CURRENTDIR%\packages\SoundBand\data\Sync.dll" + diff --git a/installer/deploy/deploy.pro b/installer/deploy/deploy.pro deleted file mode 100644 index 8e69c6e..0000000 --- a/installer/deploy/deploy.pro +++ /dev/null @@ -1,41 +0,0 @@ -TEMPLATE = aux - -INSTALLER = deployApp - -INPUT = DEPLOY_FILES -deployApp.input = INPUT -deployApp.output = $$INSTALLER - - -QT_DIR = $$dirname(QMAKE_QMAKE) -QML_DIR = $$QT_DIR/../qml - - -WINDEPLY = $$QT_DIR/windeployqt.exe -MACDEPLY = $$QT_DIR/macdeployqt -LINUXDEPLOY = $$PWD/linuxdeployqt-continuous-x86_64.AppImage - -message( QML_DIR = $$QML_DIR) -message( WINDEPLY = $$WINDEPLY) -message( MACDEPLY = $$MACDEPLY) -message( LINUXDEPLOY = $$LINUXDEPLOY) - -win32 { - deployApp.commands += "$$WINDEPLY --qmldir $$QML_DIR $$DEPLOY_FILES" -} - -unix { - deployApp.commands += "$$LINUXDEPLOY --qmldir=$$QML_DIR --qmake=$$QMAKE_QMAKE $$DEPLOY_FILES" -} - -mac { - deployApp.commands += "$$MACDEPLY --qmldir $$QML_DIR $$DEPLOY_FILES" -} - message( deployComand = "$$deployApp.commands") - -commands += "chmod +x $$LINUXDEPLOY" - -for(command, commands) { - system($$command)|error("Failed to run: $$command") -} - diff --git a/installer/deploy/targetList.pri b/installer/deploy/targetList.pri index b7694d7..e856cb4 100644 --- a/installer/deploy/targetList.pri +++ b/installer/deploy/targetList.pri @@ -3,6 +3,8 @@ # windows win32 { TARGET_LIST += SoundBand.exe + TARGET_LIST += Sync.dll + TARGET_LIST += QUasarApp.dll } # linux diff --git a/installer/installer.pro b/installer/installer.pro index 4421e72..fee9d96 100644 --- a/installer/installer.pro +++ b/installer/installer.pro @@ -1,6 +1,4 @@ include($$PWD/deploy/targetList.pri) -include($$PWD/deploy/deployFiles.pri) - TEMPLATE = aux @@ -20,51 +18,33 @@ QT_DIR = $$dirname(QMAKE_QMAKE) QML_DIR = $$PWD/../SoundBand -WINDEPLY = $$QT_DIR/windeployqt.exe -MACDEPLY = $$QT_DIR/macdeployqt -LINUXDEPLOY = $$PWD/../CQtDeployer/build/cqtdeployer +WINDEPLOY = $$QT_DIR/windeployqt.exe +WINDEPLOY_RUN = $$PWD/deploy/deploy.bat -message( QML_DIR = $$QML_DIR) -message( WINDEPLY = $$WINDEPLY) -message( MACDEPLY = $$MACDEPLY) -message( LINUXDEPLOY = $$LINUXDEPLOY) +LINUXDEPLOY = $$PWD/../CQtDeployer/build/cqtdeployer win32 { OUT_FILE = SoundBandInstaller.exe LUPDATE = $$QT_DIR/lupdate.exe LRELEASE = $$QT_DIR/lrelease.exe + } -message( QT_DIR = $$QT_DIR) -message( LUPDATE = $$LUPDATE) -message( LRELEASE = $$LRELEASE) -message( DEPLOY_FILES = $$DEPLOY_FILES) - -# todo get inpot files +#prepare start win32 { - for(command, TARGET_LIST) { - installerApp.commands += $$WINDEPLY --qmldir $$QML_DIR $$TARGET_PATH/$$command && - } + installerApp.commands += $$WINDEPLOY_RUN $$WINDEPLOY $$QML_DIR $$shell_path($$PWD) && } +#prepare end unix { for(command, TARGET_LIST) { - installerApp.commands += $$LINUXDEPLOY -bin $$TARGET_PATH/$$command clear -qmlDir $$QML_DIR -qmake $$QMAKE_QMAKE && - } -} - -macx { - for(command, TARGET_LIST) { - installerApp.commands += $$MACDEPLY --qmldir $$QML_DIR $$TARGET_PATH/$$command && + installerApp.commands += $$LINUXDEPLOY -bin $$DESTDIR/$$command clear -qmlDir $$QML_DIR -qmake $$QMAKE_QMAKE && } } installerApp.commands += $$QT_DIR/../../../Tools/QtInstallerFramework/3.0/bin/binarycreator --offline-only -c $$PWD/config/config.xml -p $$PWD/packages $$PWD/$$OUT_FILE --verbose -f installerApp.CONFIG += target_predeps no_link combine - - - message( installComands = "$$installerApp.commands") commands += "$$LUPDATE $$PWD/packages/SoundBand/meta/installscript.js -ts $$PWD/packages/SoundBand/meta/ru.ts" @@ -89,10 +69,6 @@ DISTFILES += \ packages/SoundBand/meta/ru.ts \ packages/SoundBand.Tests/meta/installscript.js \ packages/SoundBand.Tests/meta/package.xml \ - packages/SoundBand.Tests/meta/ru.ts + packages/SoundBand.Tests/meta/ru.ts \ + deploy/deploy.bat -#unix:extraclean.commands = chmod +x $$PWD/scripts/clear.sh && $$PWD/scripts/clear.sh -#win32:extraclean.commands = $$PWD/scripts/clear.bat; - -#distclean.depends = extraclean -#QMAKE_EXTRA_TARGETS += distclean extraclean diff --git a/installer/packages/SoundBand/data/icons/icon.png b/installer/packages/SoundBand/extra/icons/icon.png similarity index 100% rename from installer/packages/SoundBand/data/icons/icon.png rename to installer/packages/SoundBand/extra/icons/icon.png diff --git a/installer/packages/SoundBand/snap.pro b/installer/packages/SoundBand/snap.pro index f57fe57..68fec10 100644 --- a/installer/packages/SoundBand/snap.pro +++ b/installer/packages/SoundBand/snap.pro @@ -1,5 +1,5 @@ include($$PWD/../../deploy/targetList.pri) -include($$PWD/../../deploy/deployFiles.pri) +include($$PWD/../../../deploy.pri) TEMPLATE = aux diff --git a/tests/tests.pro b/tests/tests.pro index 2bb9002..6745b2c 100644 --- a/tests/tests.pro +++ b/tests/tests.pro @@ -7,7 +7,12 @@ CONFIG -= app_bundle TEMPLATE = app TARGET = test -SOUND_BAND_MODULE=test +CONFIG(release, debug|release): { + DESTDIR = $$PWD/build/release + +} else { + DESTDIR = $$PWD/build/debug +} SOURCES += \ tst_synctest.cpp @@ -16,6 +21,5 @@ SOURCES += \ RESOURCES += \ res.qrc -include($$PWD/../deploy.pri) include($$PWD/../Sync/Sync.pri) include('$$PWD/../QuasarAppLib/QuasarLib.pri');