From 0c5fd789f8c0419555d97d66b2cb191b7e63bc0c Mon Sep 17 00:00:00 2001 From: Hamed Masafi Date: Thu, 8 Aug 2019 19:49:12 +0430 Subject: [PATCH 01/16] appveyor fixed [skip ci] (#52) * update appveyor * update appveyor * update appveyor * update appveyor * update appveyor * update appveyor * update appveyor * update appveyor * remove % from variable name * add cotation to variable call * path correction * path correction * path correction * path correction * removed test script * md fix [slip ci] * ready to merge [skip ci] --- README.md | 25 +++++++++++----------- appveyor.yml | 59 ++++++++++++++++++++++++++-------------------------- 2 files changed, 42 insertions(+), 42 deletions(-) diff --git a/README.md b/README.md index 6410c7f..b1fd7d0 100644 --- a/README.md +++ b/README.md @@ -9,21 +9,20 @@ ## Features: - - - Easy to use - - Support PosgtreSQL, MySQL, SQLite and Microsoft Sql Server - - Automatically create and update database - - IDE auto complete support, No hard-code nedded - - Table join detect - - Suppor every Qt types. [Full list](doc/datatypes.md) + - Easy to use + - Support PosgtreSQL, MySQL, SQLite and Microsoft Sql Server + - Automatically create and update database + - IDE auto complete support, No hard-code nedded + - Table join detect + - Suppor every Qt types. [Full list](doc/datatypes.md) ## Getting start -* [Sample codes](doc/start.md) -* [Shared pointer and regular mode](sharedpointer.md) -* [Create database class](database.md) -* [Create table class](table.md) -* [Using queries](query.md) -* [Supported data types](datatypes.md) + - [Sample codes](doc/start.md) + - [Shared pointer and regular mode](sharedpointer.md) + - [Create database class](database.md) + - [Create table class](table.md) + - [Using queries](query.md) + - [Supported data types](datatypes.md) ### Donate Butcoin address: 1Dn1WHKkaxanXe4cTGDk4cFRRABxLUpEVj diff --git a/appveyor.yml b/appveyor.yml index 8d29458..d850a8d 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,54 +1,55 @@ version: '{branch}-{build}' +clone_depth: 50 + +branches: + only: + - master + environment: matrix: + - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 + QTDIR: C:\Qt\5.13.0\msvc2017 + VCVARS: C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars32.bat + PLATFORM: + VER_SUFFIX: win32 + - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 + QTDIR: C:\Qt\5.13.0\msvc2017_64 + VCVARS: C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars64.bat + PLATFORM: + VER_SUFFIX: win64 + - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015 + QTDIR: C:\Qt\5.11\msvc2015 + VCVARS: C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat + PLATFORM: x86 + VER_SUFFIX: win32 + - QTDIR: C:\Qt\5.13.0\mingw73_64 - QTDIR: C:\Qt\5.13.0\mingw73_32 - - QTDIR: C:\Qt\5.13.0\msvc2015_64 - - QTDIR: C:\Qt\5.13.0\msvc2017 - - QTDIR: C:\Qt\5.13.0\msvc2017_64 - QTDIR: C:\Qt\5.11.3\mingw53_32 - - QTDIR: C:\Qt\5.10.1\msvc2017_64 - - QTDIR: C:\Qt\5.10.1\winrt_armv7_msvc2017 - - QTDIR: C:\Qt\5.10.1\winrt_x86_msvc2017 - - QTDIR: C:\Qt\5.10.1\winrt_x64_msvc2017 - - QTDIR: C:\Qt\5.9.7\msvc2017_64 - - QTDIR: C:\Qt\5.9.7\winrt_armv7_msvc2017 - - QTDIR: C:\Qt\5.9.7\winrt_x86_msvc2017 - - QTDIR: C:\Qt\5.9.7\winrt_x64_msvc2017 - - QTDIR: C:\Qt\5.7.0\mingw53_32 - - QTDIR: C:\Qt\5.7.0\msvc2015 - -configuration: - - debug - - release clone_script: - cmd: git clone -q --recursive --branch=%APPVEYOR_REPO_BRANCH% https://github.com/%APPVEYOR_REPO_NAME%.git %APPVEYOR_BUILD_FOLDER% - cmd: git checkout -qf %APPVEYOR_REPO_COMMIT% install: - - '%QTDIR%\bin\qtenv2.bat' - - qmake -v - - if %QTDIR:_64=%==%QTDIR% ( set ARCH=x86 ) else set ARCH=x64 - - if %QTDIR:msvc=%==%QTDIR% g++ --version + - git submodule update --init --recursive + - set PATH=%PATH%;%QTDIR%\bin + - call "%QTDIR%\bin\qtenv2.bat" - if %QTDIR:msvc=%==%QTDIR% set make=mingw32-make.exe - - if %QTDIR:msvc=%==%QTDIR% %make% --version - - if not %QTDIR:msvc2013=%==%QTDIR% call "%ProgramFiles(x86)%\Microsoft Visual Studio 12.0\VC\vcvarsall.bat" %ARCH% - - if not %QTDIR:msvc2015=%==%QTDIR% call "%ProgramFiles(x86)%\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" %ARCH% - if not %QTDIR:msvc=%==%QTDIR% set make=nmake.exe - - if not %QTDIR:msvc=%==%QTDIR% %make% /? > nul + - if defined VCVARS call "%VCVARS%" + - qmake -v before_build: # Prepare the out-of-source build directory. - mkdir %APPVEYOR_BUILD_FOLDER%-build - - qmake -o %APPVEYOR_BUILD_FOLDER%-build -r -Wall -Wlogic -Wparser CONFIG+=%CONFIGURATION% %APPVEYOR_BUILD_FOLDER% + - qmake -o %APPVEYOR_BUILD_FOLDER%-build -r -Wall -Wlogic -Wparser %APPVEYOR_BUILD_FOLDER% build_script: - cd %APPVEYOR_BUILD_FOLDER%-build - echo 'QT -= gui' >> %APPVEYOR_BUILD_FOLDER%\ci-test-init.pri - '%make%' -test_script: - # @todo output using Qt's -xunitxml option - - if not %CONFIGURATION%==debug %make% check TESTARGS=-silent +#test_script: +# - if not %CONFIGURATION%==debug %make% check TESTARGS=-silent From a3a4720c5ab08b2975a84f971d761bb20a594c7f Mon Sep 17 00:00:00 2001 From: Hamed Masafi Date: Mon, 27 Jul 2020 12:52:52 +0430 Subject: [PATCH 02/16] try to init github ci --- .github/workflows/qt.yml | 152 +++++++++++++++++++++++++++++++++++++++ .travis.yml | 79 -------------------- appveyor.yml | 55 -------------- 3 files changed, 152 insertions(+), 134 deletions(-) create mode 100644 .github/workflows/qt.yml delete mode 100644 .travis.yml delete mode 100644 appveyor.yml diff --git a/.github/workflows/qt.yml b/.github/workflows/qt.yml new file mode 100644 index 0000000..25998da --- /dev/null +++ b/.github/workflows/qt.yml @@ -0,0 +1,152 @@ +name: CI build + +on: [push] + +jobs: + build: + strategy: + fail-fast: false + matrix: + version: + - 5.15.0 + platform: + - gcc_64 + - android + - msvc2019 + - msvc2019_64 + - winrt_x64_msvc2019 + - winrt_x86_msvc2019 + - winrt_armv7_msvc2019 + - mingw81_64 + - mingw81_32 + - clang_64 + - ios + + include: + - platform: gcc_64 + os: ubuntu-latest + - platform: android + os: ubuntu-latest + - platform: msvc2019_64 + os: windows-latest + - platform: msvc2019 + os: windows-latest + - platform: winrt_x64_msvc2019 + os: windows-latest + - platform: winrt_x86_msvc2019 + os: windows-latest + - platform: winrt_armv7_msvc2019 + os: windows-latest + - platform: mingw81_64 + os: windows-latest + - platform: mingw81_32 + os: windows-latest + - platform: clang_64 + os: macos-latest + - platform: ios + os: macos-latest + + runs-on: ${{matrix.os}} + steps: + - uses: actions/checkout@v1 + with: + submodules: recursive + - uses: actions/setup-python@v1 + - uses: Skycoder42/action-setup-qt@master + id: qt + with: + version: ${{matrix.version}} + platform: ${{matrix.platform}} + packages: qt.tools.ifw.32 + - name: install packagekit + if: matrix.platform == 'gcc_64' + run: | + sudo apt-get -qq install packagekit + export PKG_CONFIG_PATH=${{steps.qt.outputs.qtdir}}/lib/pkgconfig/:$PKG_CONFIG_PATH + echo "::set-env name=PKG_CONFIG_PATH::$PKG_CONFIG_PATH" + - name: build PackageKit-Qt + if: steps.cache-qt.outputs.cache-hit != 'true' && matrix.platform == 'gcc_64' + run: | + sed -i 's/set(BUILD_SHARED_LIBS ON)/set(BUILD_SHARED_LIBS OFF)/g' CMakeLists.txt + export CMAKE_PREFIX_PATH=${{steps.qt.outputs.qtdir}}:$CMAKE_PREFIX_PATH + mkdir build && cd build + cmake \ + "-DCMAKE_INSTALL_PREFIX=$(qmake -query QT_INSTALL_PREFIX)" \ + "-DCMAKE_INSTALL_LIBDIR=$(qmake -query QT_INSTALL_LIBS)" \ + "-DCMAKE_INSTALL_INCLUDEDIR=$(qmake -query QT_INSTALL_HEADERS)" \ + ".." + ${{steps.qt.outputs.make}} + ${{steps.qt.outputs.make}} install + pkg-config --exists packagekitqt5 + working-directory: src/3rdparty/PackageKit-Qt + - name: qmake + run: | + qmake CONFIG+=install_ok QT_PLATFORM=${{matrix.platform}} "QT_TOOL_PATH=${{steps.qt.outputs.qtdir}}/Tools" + ${{steps.qt.outputs.make}} qmake_all + - name: make module + run: | + ${{steps.qt.outputs.make}} + ${{steps.qt.outputs.make}} INSTALL_ROOT="${{steps.qt.outputs.installdir}}" install + - name: make tests + if: steps.qt.outputs.tests == 'true' && !contains(matrix.platform, 'mingw') + run: | + ${{steps.qt.outputs.make}} all + ${{steps.qt.outputs.make}} ${{steps.qt.outputs.testflags}} run-tests + - name: make examples + if: matrix.platform == 'gcc_64' + run: | + ${{steps.qt.outputs.make}} sub-examples + cd examples && ${{steps.qt.outputs.make}} INSTALL_ROOT="${{steps.qt.outputs.installdir}}" install + - name: make doc + if: matrix.platform == 'gcc_64' + run: | + ${{steps.qt.outputs.make}} doxygen + cd doc && ${{steps.qt.outputs.make}} INSTALL_ROOT="${{steps.qt.outputs.installdir}}" install + - name: upload examples to releases + uses: Skycoder42/action-upload-release@master + if: matrix.platform == 'gcc_64' && startsWith(github.ref, 'refs/tags/') + with: + repo_token: ${{secrets.GITHUB_TOKEN}} + directory: ${{steps.qt.outputs.outdir}} + platform: examples + asset_name: qtautoupdater-examples-${{matrix.version}} + tag: ${{github.ref}} + overwrite: true + - name: upload doc to releases + uses: Skycoder42/action-upload-release@master + if: matrix.platform == 'gcc_64' && startsWith(github.ref, 'refs/tags/') + with: + repo_token: ${{secrets.GITHUB_TOKEN}} + directory: ${{steps.qt.outputs.outdir}} + platform: doc + asset_name: qtautoupdater-doc-${{matrix.version}} + tag: ${{github.ref}} + overwrite: true + - name: upload module to releases + uses: Skycoder42/action-upload-release@master + if: startsWith(github.ref, 'refs/tags/') + with: + repo_token: ${{secrets.GITHUB_TOKEN}} + directory: ${{steps.qt.outputs.outdir}} + platform: ${{matrix.platform}} + asset_name: qtautoupdater-${{matrix.platform}}-${{matrix.version}} + tag: ${{github.ref}} + overwrite: true + + deploy: + if: startsWith(github.ref, 'refs/tags/') + needs: build + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v1 + with: + submodules: recursive + path: source + - uses: actions/setup-python@v1 + - uses: Skycoder42/action-deploy-qt@master + with: + token: ${{secrets.GITHUB_TOKEN}} + version: 5.15.0 + host: ${{secrets.SSHFS_HOST}} + key: ${{secrets.SSHFS_KEY}} + port: ${{secrets.SSHFS_PORT}} diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 33819c8..0000000 --- a/.travis.yml +++ /dev/null @@ -1,79 +0,0 @@ -#Based on https://github.com/pcolby/libqtaws/blob/master/.travis.yml -language: cpp - -branches: - only: - - master - -os: - - linux - - osx - -dist: trusty - -compiler: - - clang - - gcc - -env: - matrix: - - QT=59 BREW=ex PPA=beineri/opt-qt591-trusty - - QT=59 BREW=ex PPA=beineri/opt-qt592-trusty - - QT=59 BREW=ex PPA=beineri/opt-qt593-trusty - - QT=59 BREW=ex PPA=beineri/opt-qt594-trusty - - QT=59 BREW=ex PPA=beineri/opt-qt595-trusty - - QT=59 BREW=ex PPA=beineri/opt-qt596-trusty - - QT=510 BREW=ex PPA=beineri/opt-qt-5.10.1-trusty - -matrix: - exclude: - - { os: osx, env: QT=59 BREW=ex PPA=beineri/opt-qt591-trusty } - - { os: osx, env: QT=59 BREW=ex PPA=beineri/opt-qt592-trusty } - - { os: osx, env: QT=59 BREW=ex PPA=beineri/opt-qt593-trusty } - - { os: osx, env: QT=59 BREW=ex PPA=beineri/opt-qt594-trusty } - - { os: osx, env: QT=59 BREW=ex PPA=beineri/opt-qt595-trusty } - - { os: osx, env: QT=59 BREW=ex PPA=beineri/opt-qt596-trusty } - - { os: osx, env: QT=510 BREW=ex PPA=beineri/opt-qt-5.10.1-trusty } - -addons: - coverity_scan: - project: - name: "HamedMasafi/Nut" - description: "Build submitted via Travis CI" - # notification_email: em@h - build_command_prepend: > - cp -a "$TRAVIS_BUILD_DIR" "$TRAVIS_BUILD_DIR-scan" && - pushd "$TRAVIS_BUILD_DIR-scan" && - qmake -qt=qt5 -Wall -Wlogic -Wparser CONFIG+=debug_and_release - build_command: make all - #branch_pattern: coverity - -before_install: - - '[[ "$TRAVIS_OS_NAME" != linux || -z "$PPA" ]] || sudo add-apt-repository -y ppa:$PPA' - - '[ "$TRAVIS_OS_NAME" != linux ] || sudo apt-get -qy update' - - '[ "$TRAVIS_OS_NAME" != osx ] || brew update' - -install: - - '[ "$TRAVIS_OS_NAME" != linux ] || sudo apt-get -qy install cppcheck doxygen graphviz lcov' - - '[[ "$TRAVIS_OS_NAME" != linux || "$PPA" != */opt-* ]] || sudo apt-get -qy install qt${QT}base qt${QT}xmlpatterns' - - '[[ "$TRAVIS_OS_NAME" != linux || "$PPA" == */opt-* ]] || sudo apt-get -qy install qt5-qmake qtbase5-dev libqt5xmlpatterns5-dev' - - '[ "$TRAVIS_OS_NAME" != linux ] || gem install lcoveralls' - - '[ "$TRAVIS_OS_NAME" != osx ] || brew install cppcheck doxygen graphviz qt$BREW' - - '[ "$TRAVIS_OS_NAME" != osx ] || brew link --force qt$BREW' - - qmake -v - -before_script: - - '[[ "$TRAVIS_OS_NAME" != linux || "$CXX" != clang++ ]] || export QMAKESPEC=linux-clang' - - '[[ "$TRAVIS_OS_NAME" != linux || "$CXX" != g++ ]] || export QMAKESPEC=linux-g++' - - '[[ "$TRAVIS_OS_NAME" != osx || "$CXX" != clang++ ]] || export QMAKESPEC=macx-clang' - - '[[ "$TRAVIS_OS_NAME" != osx || "$CXX" != g++ ]] || export QMAKESPEC=macx-g++' - - '[[ "$TRAVIS_OS_NAME" != linux || "$PPA" != */opt-* ]] || . /opt/qt$QT/bin/qt$QT-env.sh' - - '[[ "$TRAVIS_OS_NAME" != linux || "$PPA" == */opt-* ]] || export QT_SELECT=qt5' - - mkdir -p "$TRAVIS_BUILD_DIR-build" - - cd "$TRAVIS_BUILD_DIR-build" - - echo 'QT -= gui' >> "$TRAVIS_BUILD_DIR/ci-test-init.pri" - - qmake -r -Wall -Wlogic -Wparser CONFIG+=debug_and_release "$TRAVIS_BUILD_DIR/nut.pro" - -script: - - make -C "$TRAVIS_BUILD_DIR-build" all - - make -C "$TRAVIS_BUILD_DIR-build" -j2 check TESTARGS=-silent diff --git a/appveyor.yml b/appveyor.yml deleted file mode 100644 index d850a8d..0000000 --- a/appveyor.yml +++ /dev/null @@ -1,55 +0,0 @@ -version: '{branch}-{build}' - -clone_depth: 50 - -branches: - only: - - master - -environment: - matrix: - - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 - QTDIR: C:\Qt\5.13.0\msvc2017 - VCVARS: C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars32.bat - PLATFORM: - VER_SUFFIX: win32 - - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 - QTDIR: C:\Qt\5.13.0\msvc2017_64 - VCVARS: C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars64.bat - PLATFORM: - VER_SUFFIX: win64 - - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015 - QTDIR: C:\Qt\5.11\msvc2015 - VCVARS: C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat - PLATFORM: x86 - VER_SUFFIX: win32 - - - QTDIR: C:\Qt\5.13.0\mingw73_64 - - QTDIR: C:\Qt\5.13.0\mingw73_32 - - QTDIR: C:\Qt\5.11.3\mingw53_32 - -clone_script: - - cmd: git clone -q --recursive --branch=%APPVEYOR_REPO_BRANCH% https://github.com/%APPVEYOR_REPO_NAME%.git %APPVEYOR_BUILD_FOLDER% - - cmd: git checkout -qf %APPVEYOR_REPO_COMMIT% - -install: - - git submodule update --init --recursive - - set PATH=%PATH%;%QTDIR%\bin - - call "%QTDIR%\bin\qtenv2.bat" - - if %QTDIR:msvc=%==%QTDIR% set make=mingw32-make.exe - - if not %QTDIR:msvc=%==%QTDIR% set make=nmake.exe - - if defined VCVARS call "%VCVARS%" - - qmake -v - -before_build: - # Prepare the out-of-source build directory. - - mkdir %APPVEYOR_BUILD_FOLDER%-build - - qmake -o %APPVEYOR_BUILD_FOLDER%-build -r -Wall -Wlogic -Wparser %APPVEYOR_BUILD_FOLDER% - -build_script: - - cd %APPVEYOR_BUILD_FOLDER%-build - - echo 'QT -= gui' >> %APPVEYOR_BUILD_FOLDER%\ci-test-init.pri - - '%make%' - -#test_script: -# - if not %CONFIGURATION%==debug %make% check TESTARGS=-silent From cdc5b04c569d108851b697fcd98a90ee09808d3f Mon Sep 17 00:00:00 2001 From: Hamed Masafi Date: Mon, 27 Jul 2020 13:00:40 +0430 Subject: [PATCH 03/16] try 2 --- .github/workflows/qt.yml | 56 ---------------------------------------- 1 file changed, 56 deletions(-) diff --git a/.github/workflows/qt.yml b/.github/workflows/qt.yml index 25998da..48aa071 100644 --- a/.github/workflows/qt.yml +++ b/.github/workflows/qt.yml @@ -58,27 +58,6 @@ jobs: version: ${{matrix.version}} platform: ${{matrix.platform}} packages: qt.tools.ifw.32 - - name: install packagekit - if: matrix.platform == 'gcc_64' - run: | - sudo apt-get -qq install packagekit - export PKG_CONFIG_PATH=${{steps.qt.outputs.qtdir}}/lib/pkgconfig/:$PKG_CONFIG_PATH - echo "::set-env name=PKG_CONFIG_PATH::$PKG_CONFIG_PATH" - - name: build PackageKit-Qt - if: steps.cache-qt.outputs.cache-hit != 'true' && matrix.platform == 'gcc_64' - run: | - sed -i 's/set(BUILD_SHARED_LIBS ON)/set(BUILD_SHARED_LIBS OFF)/g' CMakeLists.txt - export CMAKE_PREFIX_PATH=${{steps.qt.outputs.qtdir}}:$CMAKE_PREFIX_PATH - mkdir build && cd build - cmake \ - "-DCMAKE_INSTALL_PREFIX=$(qmake -query QT_INSTALL_PREFIX)" \ - "-DCMAKE_INSTALL_LIBDIR=$(qmake -query QT_INSTALL_LIBS)" \ - "-DCMAKE_INSTALL_INCLUDEDIR=$(qmake -query QT_INSTALL_HEADERS)" \ - ".." - ${{steps.qt.outputs.make}} - ${{steps.qt.outputs.make}} install - pkg-config --exists packagekitqt5 - working-directory: src/3rdparty/PackageKit-Qt - name: qmake run: | qmake CONFIG+=install_ok QT_PLATFORM=${{matrix.platform}} "QT_TOOL_PATH=${{steps.qt.outputs.qtdir}}/Tools" @@ -87,41 +66,6 @@ jobs: run: | ${{steps.qt.outputs.make}} ${{steps.qt.outputs.make}} INSTALL_ROOT="${{steps.qt.outputs.installdir}}" install - - name: make tests - if: steps.qt.outputs.tests == 'true' && !contains(matrix.platform, 'mingw') - run: | - ${{steps.qt.outputs.make}} all - ${{steps.qt.outputs.make}} ${{steps.qt.outputs.testflags}} run-tests - - name: make examples - if: matrix.platform == 'gcc_64' - run: | - ${{steps.qt.outputs.make}} sub-examples - cd examples && ${{steps.qt.outputs.make}} INSTALL_ROOT="${{steps.qt.outputs.installdir}}" install - - name: make doc - if: matrix.platform == 'gcc_64' - run: | - ${{steps.qt.outputs.make}} doxygen - cd doc && ${{steps.qt.outputs.make}} INSTALL_ROOT="${{steps.qt.outputs.installdir}}" install - - name: upload examples to releases - uses: Skycoder42/action-upload-release@master - if: matrix.platform == 'gcc_64' && startsWith(github.ref, 'refs/tags/') - with: - repo_token: ${{secrets.GITHUB_TOKEN}} - directory: ${{steps.qt.outputs.outdir}} - platform: examples - asset_name: qtautoupdater-examples-${{matrix.version}} - tag: ${{github.ref}} - overwrite: true - - name: upload doc to releases - uses: Skycoder42/action-upload-release@master - if: matrix.platform == 'gcc_64' && startsWith(github.ref, 'refs/tags/') - with: - repo_token: ${{secrets.GITHUB_TOKEN}} - directory: ${{steps.qt.outputs.outdir}} - platform: doc - asset_name: qtautoupdater-doc-${{matrix.version}} - tag: ${{github.ref}} - overwrite: true - name: upload module to releases uses: Skycoder42/action-upload-release@master if: startsWith(github.ref, 'refs/tags/') From 5445ca989fd5215f87e449841fedc78c1f4dc507 Mon Sep 17 00:00:00 2001 From: Hamed Masafi Date: Mon, 27 Jul 2020 13:32:33 +0430 Subject: [PATCH 04/16] try 3 --- .github/workflows/qt.yml | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/.github/workflows/qt.yml b/.github/workflows/qt.yml index 48aa071..8364f90 100644 --- a/.github/workflows/qt.yml +++ b/.github/workflows/qt.yml @@ -62,6 +62,28 @@ jobs: run: | qmake CONFIG+=install_ok QT_PLATFORM=${{matrix.platform}} "QT_TOOL_PATH=${{steps.qt.outputs.qtdir}}/Tools" ${{steps.qt.outputs.make}} qmake_all + - name: install packagekit + if: matrix.platform == 'gcc_64' + run: | + sudo apt-get -qq install packagekit + export PKG_CONFIG_PATH=${{steps.qt.outputs.qtdir}}/lib/pkgconfig/:$PKG_CONFIG_PATH + echo "::set-env name=PKG_CONFIG_PATH::$PKG_CONFIG_PATH" + - name: build PackageKit-Qt + if: steps.cache-qt.outputs.cache-hit != 'true' && matrix.platform == 'gcc_64' + run: | + sed -i 's/set(BUILD_SHARED_LIBS ON)/set(BUILD_SHARED_LIBS OFF)/g' CMakeLists.txt + export CMAKE_PREFIX_PATH=${{steps.qt.outputs.qtdir}}:$CMAKE_PREFIX_PATH + mkdir build && cd build + cmake \ + "-DCMAKE_INSTALL_PREFIX=$(qmake -query QT_INSTALL_PREFIX)" \ + "-DCMAKE_INSTALL_LIBDIR=$(qmake -query QT_INSTALL_LIBS)" \ + "-DCMAKE_INSTALL_INCLUDEDIR=$(qmake -query QT_INSTALL_HEADERS)" \ + ".." + ${{steps.qt.outputs.make}} + ${{steps.qt.outputs.make}} install + pkg-config --exists packagekitqt5 + working-directory: src/3rdparty/PackageKit-Qt + - name: make module run: | ${{steps.qt.outputs.make}} From 5cc2153ae8f759d30e0c25ec853bd4d09c4f4c87 Mon Sep 17 00:00:00 2001 From: Hamed Masafi Date: Mon, 27 Jul 2020 13:38:16 +0430 Subject: [PATCH 05/16] try 4 --- .github/workflows/qt.yml | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/.github/workflows/qt.yml b/.github/workflows/qt.yml index 8364f90..df65111 100644 --- a/.github/workflows/qt.yml +++ b/.github/workflows/qt.yml @@ -58,10 +58,6 @@ jobs: version: ${{matrix.version}} platform: ${{matrix.platform}} packages: qt.tools.ifw.32 - - name: qmake - run: | - qmake CONFIG+=install_ok QT_PLATFORM=${{matrix.platform}} "QT_TOOL_PATH=${{steps.qt.outputs.qtdir}}/Tools" - ${{steps.qt.outputs.make}} qmake_all - name: install packagekit if: matrix.platform == 'gcc_64' run: | @@ -83,11 +79,11 @@ jobs: ${{steps.qt.outputs.make}} install pkg-config --exists packagekitqt5 working-directory: src/3rdparty/PackageKit-Qt - - - name: make module + - name: qmake run: | - ${{steps.qt.outputs.make}} - ${{steps.qt.outputs.make}} INSTALL_ROOT="${{steps.qt.outputs.installdir}}" install + qmake CONFIG+=install_ok QT_PLATFORM=${{matrix.platform}} "QT_TOOL_PATH=${{steps.qt.outputs.qtdir}}/Tools" + ${{steps.qt.outputs.make}} qmake_all + - name: upload module to releases uses: Skycoder42/action-upload-release@master if: startsWith(github.ref, 'refs/tags/') From 859e2d4c8cfb0725bdd8a2dbcc2aeafbedccefa1 Mon Sep 17 00:00:00 2001 From: Hamed Masafi Date: Mon, 27 Jul 2020 13:45:00 +0430 Subject: [PATCH 06/16] add pro file name to qmake command on ci --- .github/workflows/qt.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/qt.yml b/.github/workflows/qt.yml index df65111..f407da4 100644 --- a/.github/workflows/qt.yml +++ b/.github/workflows/qt.yml @@ -81,7 +81,7 @@ jobs: working-directory: src/3rdparty/PackageKit-Qt - name: qmake run: | - qmake CONFIG+=install_ok QT_PLATFORM=${{matrix.platform}} "QT_TOOL_PATH=${{steps.qt.outputs.qtdir}}/Tools" + qmake CONFIG+=install_ok QT_PLATFORM=${{matrix.platform}} "QT_TOOL_PATH=${{steps.qt.outputs.qtdir}}/Tools" nut.pro ${{steps.qt.outputs.make}} qmake_all - name: upload module to releases From eb1c7c61475b6142df580ae19f3ef0232b0cd9e8 Mon Sep 17 00:00:00 2001 From: Hamed Masafi Date: Mon, 27 Jul 2020 13:50:04 +0430 Subject: [PATCH 07/16] add badge to readme --- .github/workflows/qt.yml | 21 --------------------- README.md | 2 ++ 2 files changed, 2 insertions(+), 21 deletions(-) diff --git a/.github/workflows/qt.yml b/.github/workflows/qt.yml index f407da4..79cfc52 100644 --- a/.github/workflows/qt.yml +++ b/.github/workflows/qt.yml @@ -58,27 +58,6 @@ jobs: version: ${{matrix.version}} platform: ${{matrix.platform}} packages: qt.tools.ifw.32 - - name: install packagekit - if: matrix.platform == 'gcc_64' - run: | - sudo apt-get -qq install packagekit - export PKG_CONFIG_PATH=${{steps.qt.outputs.qtdir}}/lib/pkgconfig/:$PKG_CONFIG_PATH - echo "::set-env name=PKG_CONFIG_PATH::$PKG_CONFIG_PATH" - - name: build PackageKit-Qt - if: steps.cache-qt.outputs.cache-hit != 'true' && matrix.platform == 'gcc_64' - run: | - sed -i 's/set(BUILD_SHARED_LIBS ON)/set(BUILD_SHARED_LIBS OFF)/g' CMakeLists.txt - export CMAKE_PREFIX_PATH=${{steps.qt.outputs.qtdir}}:$CMAKE_PREFIX_PATH - mkdir build && cd build - cmake \ - "-DCMAKE_INSTALL_PREFIX=$(qmake -query QT_INSTALL_PREFIX)" \ - "-DCMAKE_INSTALL_LIBDIR=$(qmake -query QT_INSTALL_LIBS)" \ - "-DCMAKE_INSTALL_INCLUDEDIR=$(qmake -query QT_INSTALL_HEADERS)" \ - ".." - ${{steps.qt.outputs.make}} - ${{steps.qt.outputs.make}} install - pkg-config --exists packagekitqt5 - working-directory: src/3rdparty/PackageKit-Qt - name: qmake run: | qmake CONFIG+=install_ok QT_PLATFORM=${{matrix.platform}} "QT_TOOL_PATH=${{steps.qt.outputs.qtdir}}/Tools" nut.pro diff --git a/README.md b/README.md index 36a9326..49a2025 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ # Nut + +[![Build Status](https://github.com/HamedMasafi/Nut/workflows/qt/badge.svg)](https://github.com/HamedMasafi/Nut/actions) [![Travis build Status](https://travis-ci.org/HamedMasafi/Nut.svg?branch=master)](https://travis-ci.org/HamedMasafi/Nut) [![Appveyor build Status](https://ci.appveyor.com/api/projects/status/ebthxq6syuxob6jx?svg=true)](https://ci.appveyor.com/project/HamedMasafi/nut) [![GitLicense](https://gitlicense.com/badge/hamedmasafi/nut)](https://gitlicense.com/license/hamedmasafi/nut) From b62635419b8034493e7a9211f65a8b70045ca639 Mon Sep 17 00:00:00 2001 From: Hamed Masafi Date: Mon, 27 Jul 2020 13:52:48 +0430 Subject: [PATCH 08/16] [skip ci] --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 49a2025..cb1e7ab 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # Nut -[![Build Status](https://github.com/HamedMasafi/Nut/workflows/qt/badge.svg)](https://github.com/HamedMasafi/Nut/actions) +![CI build](https://github.com/HamedMasafi/Nut/workflows/CI%20build/badge.svg) [![Travis build Status](https://travis-ci.org/HamedMasafi/Nut.svg?branch=master)](https://travis-ci.org/HamedMasafi/Nut) [![Appveyor build Status](https://ci.appveyor.com/api/projects/status/ebthxq6syuxob6jx?svg=true)](https://ci.appveyor.com/project/HamedMasafi/nut) [![GitLicense](https://gitlicense.com/badge/hamedmasafi/nut)](https://gitlicense.com/license/hamedmasafi/nut) From e3a9b26c1dffa77e4bd6eea0a44203741e9c61b2 Mon Sep 17 00:00:00 2001 From: Hamed Masafi Date: Mon, 27 Jul 2020 13:53:18 +0430 Subject: [PATCH 09/16] [skip ci] --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index cb1e7ab..5f9ffb3 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # Nut -![CI build](https://github.com/HamedMasafi/Nut/workflows/CI%20build/badge.svg) +[![CI build](https://github.com/HamedMasafi/Nut/workflows/CI%20build/badge.svg)](https://github.com/HamedMasafi/Nut/actions) [![Travis build Status](https://travis-ci.org/HamedMasafi/Nut.svg?branch=master)](https://travis-ci.org/HamedMasafi/Nut) [![Appveyor build Status](https://ci.appveyor.com/api/projects/status/ebthxq6syuxob6jx?svg=true)](https://ci.appveyor.com/project/HamedMasafi/nut) [![GitLicense](https://gitlicense.com/badge/hamedmasafi/nut)](https://gitlicense.com/license/hamedmasafi/nut) From 1e548048c02f4f61bedb461b8cbbda58bc8c45b0 Mon Sep 17 00:00:00 2001 From: Hamed Masafi Date: Mon, 27 Jul 2020 13:53:52 +0430 Subject: [PATCH 10/16] remove travis and appvior badges --- README.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/README.md b/README.md index 5f9ffb3..57b9e59 100644 --- a/README.md +++ b/README.md @@ -2,8 +2,6 @@ [![CI build](https://github.com/HamedMasafi/Nut/workflows/CI%20build/badge.svg)](https://github.com/HamedMasafi/Nut/actions) -[![Travis build Status](https://travis-ci.org/HamedMasafi/Nut.svg?branch=master)](https://travis-ci.org/HamedMasafi/Nut) -[![Appveyor build Status](https://ci.appveyor.com/api/projects/status/ebthxq6syuxob6jx?svg=true)](https://ci.appveyor.com/project/HamedMasafi/nut) [![GitLicense](https://gitlicense.com/badge/hamedmasafi/nut)](https://gitlicense.com/license/hamedmasafi/nut) [![Codacy Badge](https://api.codacy.com/project/badge/Grade/f3802610beb946068f6cd2c2b6608a8b)](https://www.codacy.com/app/HamedMasafi/Nut?utm_source=github.com&utm_medium=referral&utm_content=HamedMasafi/Nut&utm_campaign=Badge_Grade) From 11e8e7c910389ca0b527820d9088956bac8533db Mon Sep 17 00:00:00 2001 From: Hamed Masafi Date: Mon, 27 Jul 2020 16:57:13 +0430 Subject: [PATCH 11/16] remove ios from ci --- .github/workflows/qt.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/qt.yml b/.github/workflows/qt.yml index 79cfc52..58f7997 100644 --- a/.github/workflows/qt.yml +++ b/.github/workflows/qt.yml @@ -20,7 +20,6 @@ jobs: - mingw81_64 - mingw81_32 - clang_64 - - ios include: - platform: gcc_64 @@ -43,8 +42,6 @@ jobs: os: windows-latest - platform: clang_64 os: macos-latest - - platform: ios - os: macos-latest runs-on: ${{matrix.os}} steps: From 8cfd3ff55b7032086a1ea34849f4bdec5a34f78a Mon Sep 17 00:00:00 2001 From: Hamed Masafi Date: Mon, 27 Jul 2020 17:44:14 +0430 Subject: [PATCH 12/16] fix typo in bulkInserter --- src/bulkinserter.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bulkinserter.cpp b/src/bulkinserter.cpp index ddebc4b..4320ac4 100644 --- a/src/bulkinserter.cpp +++ b/src/bulkinserter.cpp @@ -36,7 +36,7 @@ void Nut::BulkInserter::insert(std::initializer_list vars) int Nut::BulkInserter::apply() { - auto sql = _database->sqlGenertor()->insertBulk(_className, _fields, variants); + auto sql = _database->sqlGenerator()->insertBulk(_className, _fields, variants); QSqlQuery q = _database->exec(sql); return q.numRowsAffected(); } From 2c1b8d17c2f6e1df1a76fd45d1fed1776aa18a6e Mon Sep 17 00:00:00 2001 From: Hamed Masafi Date: Mon, 27 Jul 2020 18:11:37 +0430 Subject: [PATCH 13/16] test make --- .github/workflows/qt.yml | 7 +++++-- 3rdparty/serializer | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/qt.yml b/.github/workflows/qt.yml index 58f7997..b63c6ef 100644 --- a/.github/workflows/qt.yml +++ b/.github/workflows/qt.yml @@ -59,7 +59,10 @@ jobs: run: | qmake CONFIG+=install_ok QT_PLATFORM=${{matrix.platform}} "QT_TOOL_PATH=${{steps.qt.outputs.qtdir}}/Tools" nut.pro ${{steps.qt.outputs.make}} qmake_all - + - name: make module + run: | + ${{steps.qt.outputs.make}} + ${{steps.qt.outputs.make}} INSTALL_ROOT="${{steps.qt.outputs.installdir}}" install - name: upload module to releases uses: Skycoder42/action-upload-release@master if: startsWith(github.ref, 'refs/tags/') @@ -67,7 +70,7 @@ jobs: repo_token: ${{secrets.GITHUB_TOKEN}} directory: ${{steps.qt.outputs.outdir}} platform: ${{matrix.platform}} - asset_name: qtautoupdater-${{matrix.platform}}-${{matrix.version}} + asset_name: nut-${{matrix.platform}}-${{matrix.version}} tag: ${{github.ref}} overwrite: true diff --git a/3rdparty/serializer b/3rdparty/serializer index 51500a4..7845ef5 160000 --- a/3rdparty/serializer +++ b/3rdparty/serializer @@ -1 +1 @@ -Subproject commit 51500a497933444196942ee0db6628338a0422af +Subproject commit 7845ef5a232ca7c16a0f8200843202b423fe2564 From 36d28a9fde1919b421a58a76dd6c2000137a07dd Mon Sep 17 00:00:00 2001 From: Hamed Masafi Date: Tue, 28 Jul 2020 12:55:06 +0430 Subject: [PATCH 14/16] fix: symbol export errors on msvc --- 3rdparty/serializer | 2 +- src/bulkinserter.cpp | 2 +- src/bulkinserter.h | 2 +- src/changelogtable.h | 2 +- src/database_p.h | 2 +- src/databasemodel.h | 2 +- src/defines.h | 18 +++++-- src/generators/mysqlgenerator.h | 2 +- src/generators/postgresqlgenerator.h | 2 +- src/generators/sqlgeneratorbase_p.h | 2 +- src/generators/sqlitegenerator.h | 2 +- src/generators/sqlservergenerator.h | 2 +- src/phrases/conditionalphrase.cpp | 2 +- src/phrases/conditionalphrase.h | 27 +++++----- src/phrases/fieldphrase.h | 28 ++++++---- src/phrases/numericphrase.h | 43 +++++++-------- src/query.h | 2 +- src/query_p.h | 2 +- src/querybase_p.h | 2 +- src/sqlmodel_p.h | 2 +- src/src.pri | 1 - src/src.pro | 72 ++++++++++++++++++++++++-- src/tablemodel.h | 2 +- src/tableset.h | 2 +- src/tablesetbase_p.h | 2 +- test/common/nut-lib.pri | 7 +-- test/tst_basic/tst_basic.pro | 1 - test/tst_benckmark/tst_benckmark.pro | 1 - test/tst_datatypes/tst_datatypes.pro | 2 - test/tst_datetime/tst_datetime.pro | 1 - test/tst_generators/tst_generators.pro | 2 - test/tst_json/tst_json.pro | 2 - test/tst_phrases/tst_phrases.pro | 1 - test/tst_quuid/tst_quuid.pro | 1 - test/tst_upgrades/tst_upgrades.pro | 1 - 35 files changed, 157 insertions(+), 89 deletions(-) diff --git a/3rdparty/serializer b/3rdparty/serializer index 51500a4..5b30b13 160000 --- a/3rdparty/serializer +++ b/3rdparty/serializer @@ -1 +1 @@ -Subproject commit 51500a497933444196942ee0db6628338a0422af +Subproject commit 5b30b13af9b9537d4226c922d04106dc4ba0595b diff --git a/src/bulkinserter.cpp b/src/bulkinserter.cpp index ddebc4b..4320ac4 100644 --- a/src/bulkinserter.cpp +++ b/src/bulkinserter.cpp @@ -36,7 +36,7 @@ void Nut::BulkInserter::insert(std::initializer_list vars) int Nut::BulkInserter::apply() { - auto sql = _database->sqlGenertor()->insertBulk(_className, _fields, variants); + auto sql = _database->sqlGenerator()->insertBulk(_className, _fields, variants); QSqlQuery q = _database->exec(sql); return q.numRowsAffected(); } diff --git a/src/bulkinserter.h b/src/bulkinserter.h index 734689a..c8b40db 100644 --- a/src/bulkinserter.h +++ b/src/bulkinserter.h @@ -11,7 +11,7 @@ NUT_BEGIN_NAMESPACE class PhraseList; class Database; -class BulkInserter +class NUT_EXPORT BulkInserter { Database *_database; QString _className; diff --git a/src/changelogtable.h b/src/changelogtable.h index 4d580de..e42b61d 100644 --- a/src/changelogtable.h +++ b/src/changelogtable.h @@ -26,7 +26,7 @@ NUT_BEGIN_NAMESPACE -class ChangeLogTable : public Table +class NUT_EXPORT ChangeLogTable : public Table { Q_OBJECT diff --git a/src/database_p.h b/src/database_p.h index c07b0a8..a93f105 100644 --- a/src/database_p.h +++ b/src/database_p.h @@ -30,7 +30,7 @@ NUT_BEGIN_NAMESPACE class ChangeLogTable; -class DatabasePrivate //: public QSharedData +class NUT_EXPORT DatabasePrivate //: public QSharedData { Database *q_ptr; Q_DECLARE_PUBLIC(Database) diff --git a/src/databasemodel.h b/src/databasemodel.h index e32e23a..8afe966 100644 --- a/src/databasemodel.h +++ b/src/databasemodel.h @@ -33,7 +33,7 @@ NUT_BEGIN_NAMESPACE class TableModel; struct RelationModel; -class DatabaseModel : public QList +class NUT_EXPORT DatabaseModel : public QList { QString _databaseClassName; int _version; diff --git a/src/defines.h b/src/defines.h index 24bbd05..b098d11 100644 --- a/src/defines.h +++ b/src/defines.h @@ -31,10 +31,20 @@ #include #include -#ifdef NUT_COMPILE_STATIC -# define NUT_EXPORT +#if defined(NUT_SHARED) || !defined(NUT_STATIC) +# ifdef NUT_STATIC +# error "Both NUT_SHARED and NUT_STATIC defined, please make up your mind" +# endif +# ifndef NUT_SHARED +# define NUT_SHARED +# endif +# if defined(NUT_BUILD_LIB) +# define NUT_EXPORT Q_DECL_EXPORT +# else +# define NUT_EXPORT Q_DECL_IMPORT +# endif #else -# define NUT_EXPORT Q_DECL_EXPORT +# define NUT_EXPORT #endif #define NUT_INFO(type, name, value) \ @@ -45,7 +55,7 @@ Q_CLASSINFO(__nut_NAME_PERFIX type #name #value, \ type "\n" #name "\n" value) -#define NUT_FIELD_PERFIX +#define NUT_FIELD_PREFIX #define NUT_FIELD_POSTFIX Field // Database diff --git a/src/generators/mysqlgenerator.h b/src/generators/mysqlgenerator.h index 4d38fa9..b4bbed3 100644 --- a/src/generators/mysqlgenerator.h +++ b/src/generators/mysqlgenerator.h @@ -26,7 +26,7 @@ NUT_BEGIN_NAMESPACE -class MySqlGenerator : public SqlGeneratorBase +class NUT_EXPORT MySqlGenerator : public SqlGeneratorBase { public: explicit MySqlGenerator(Database *parent = nullptr); diff --git a/src/generators/postgresqlgenerator.h b/src/generators/postgresqlgenerator.h index 3c1188c..49de129 100644 --- a/src/generators/postgresqlgenerator.h +++ b/src/generators/postgresqlgenerator.h @@ -26,7 +26,7 @@ NUT_BEGIN_NAMESPACE -class PostgreSqlGenerator : public SqlGeneratorBase +class NUT_EXPORT PostgreSqlGenerator : public SqlGeneratorBase { private: bool readInsideParentese(QString &text, QString &out); diff --git a/src/generators/sqlgeneratorbase_p.h b/src/generators/sqlgeneratorbase_p.h index 82ba188..821195f 100644 --- a/src/generators/sqlgeneratorbase_p.h +++ b/src/generators/sqlgeneratorbase_p.h @@ -37,7 +37,7 @@ class DatabaseModel; class TableModel; class Database; struct RelationModel; -class SqlGeneratorBase : public QObject +class NUT_EXPORT SqlGeneratorBase : public QObject { // Q_OBJECT diff --git a/src/generators/sqlitegenerator.h b/src/generators/sqlitegenerator.h index b0f2f0e..4d2a4ff 100644 --- a/src/generators/sqlitegenerator.h +++ b/src/generators/sqlitegenerator.h @@ -26,7 +26,7 @@ NUT_BEGIN_NAMESPACE -class SqliteGenerator : public SqlGeneratorBase +class NUT_EXPORT SqliteGenerator : public SqlGeneratorBase { public: explicit SqliteGenerator(Database *parent = nullptr); diff --git a/src/generators/sqlservergenerator.h b/src/generators/sqlservergenerator.h index 10c18de..3618f80 100644 --- a/src/generators/sqlservergenerator.h +++ b/src/generators/sqlservergenerator.h @@ -26,7 +26,7 @@ NUT_BEGIN_NAMESPACE -class SqlServerGenerator : public SqlGeneratorBase +class NUT_EXPORT SqlServerGenerator : public SqlGeneratorBase { public: explicit SqlServerGenerator(Database *parent = nullptr); diff --git a/src/phrases/conditionalphrase.cpp b/src/phrases/conditionalphrase.cpp index 6201762..1fe6b27 100644 --- a/src/phrases/conditionalphrase.cpp +++ b/src/phrases/conditionalphrase.cpp @@ -35,7 +35,7 @@ ConditionalPhrase::ConditionalPhrase(const ConditionalPhrase &other) } #ifdef Q_COMPILER_RVALUE_REFS -ConditionalPhrase::ConditionalPhrase(const ConditionalPhrase &&other) +ConditionalPhrase::ConditionalPhrase(ConditionalPhrase &&other) { this->data = qMove(other.data); } diff --git a/src/phrases/conditionalphrase.h b/src/phrases/conditionalphrase.h index 8f7f9a5..49c6aaa 100644 --- a/src/phrases/conditionalphrase.h +++ b/src/phrases/conditionalphrase.h @@ -33,6 +33,7 @@ ConditionalPhrase operator op(const QVariant &other) \ { \ return ConditionalPhrase(this, cond, other); \ } + class NUT_EXPORT ConditionalPhrase { public: @@ -42,7 +43,7 @@ public: ConditionalPhrase(); ConditionalPhrase(const ConditionalPhrase &other); #ifdef Q_COMPILER_RVALUE_REFS - ConditionalPhrase(const ConditionalPhrase &&other); + ConditionalPhrase(ConditionalPhrase &&other); #endif explicit ConditionalPhrase(const PhraseData *data); ConditionalPhrase(AbstractFieldPhrase *, PhraseData::Condition); @@ -69,24 +70,24 @@ public: #define DECLARE_CONDITIONALPHRASE_OPERATORS(op) \ -ConditionalPhrase operator op(const ConditionalPhrase &l, const ConditionalPhrase &r); \ -ConditionalPhrase operator op(const ConditionalPhrase &l, ConditionalPhrase &&r); \ -ConditionalPhrase operator op(ConditionalPhrase &&l, const ConditionalPhrase &r); \ -ConditionalPhrase operator op(ConditionalPhrase &&l, ConditionalPhrase &&r); + ConditionalPhrase NUT_EXPORT operator op(const ConditionalPhrase &l, const ConditionalPhrase &r); \ + ConditionalPhrase NUT_EXPORT operator op(const ConditionalPhrase &l, ConditionalPhrase &&r); \ + ConditionalPhrase NUT_EXPORT operator op(ConditionalPhrase &&l, const ConditionalPhrase &r); \ + ConditionalPhrase NUT_EXPORT operator op(ConditionalPhrase &&l, ConditionalPhrase &&r); DECLARE_CONDITIONALPHRASE_OPERATORS(==) DECLARE_CONDITIONALPHRASE_OPERATORS(&&) DECLARE_CONDITIONALPHRASE_OPERATORS(||) -ConditionalPhrase operator <(AbstractFieldPhrase &l, ConditionalPhrase &&r); -ConditionalPhrase operator <=(AbstractFieldPhrase &l, ConditionalPhrase &&r); -ConditionalPhrase operator >(AbstractFieldPhrase &l, ConditionalPhrase &&r); -ConditionalPhrase operator >=(AbstractFieldPhrase &l, ConditionalPhrase &&r); +ConditionalPhrase NUT_EXPORT operator <(AbstractFieldPhrase &l, ConditionalPhrase &&r); +ConditionalPhrase NUT_EXPORT operator <=(AbstractFieldPhrase &l, ConditionalPhrase &&r); +ConditionalPhrase NUT_EXPORT operator >(AbstractFieldPhrase &l, ConditionalPhrase &&r); +ConditionalPhrase NUT_EXPORT operator >=(AbstractFieldPhrase &l, ConditionalPhrase &&r); -ConditionalPhrase operator <(ConditionalPhrase &&l, ConditionalPhrase &&r); -ConditionalPhrase operator <=(ConditionalPhrase &&l, ConditionalPhrase &&r); -ConditionalPhrase operator >(ConditionalPhrase &&l, ConditionalPhrase &&r); -ConditionalPhrase operator >=(ConditionalPhrase &&l, ConditionalPhrase &&r); +ConditionalPhrase NUT_EXPORT operator <(ConditionalPhrase &&l, ConditionalPhrase &&r); +ConditionalPhrase NUT_EXPORT operator <=(ConditionalPhrase &&l, ConditionalPhrase &&r); +ConditionalPhrase NUT_EXPORT operator >(ConditionalPhrase &&l, ConditionalPhrase &&r); +ConditionalPhrase NUT_EXPORT operator >=(ConditionalPhrase &&l, ConditionalPhrase &&r); NUT_END_NAMESPACE diff --git a/src/phrases/fieldphrase.h b/src/phrases/fieldphrase.h index 6ec3bf4..ff2e223 100644 --- a/src/phrases/fieldphrase.h +++ b/src/phrases/fieldphrase.h @@ -27,27 +27,33 @@ NUT_BEGIN_NAMESPACE -template -class NUT_EXPORT FieldPhrase : public AbstractFieldPhrase +template +class FieldPhrase : public AbstractFieldPhrase { public: FieldPhrase(const char *className, const char *s) : AbstractFieldPhrase(className, s) {} - AssignmentPhrase operator =(const QVariant &other) { - return AssignmentPhrase(this, other); - } - - ConditionalPhrase operator ==(const QVariant &other) { - return ConditionalPhrase(this, PhraseData::Equal, other); - } + virtual ~FieldPhrase() {} + AssignmentPhrase operator =(const QVariant &other); + ConditionalPhrase operator ==(const QVariant &other); }; +template +Q_OUTOFLINE_TEMPLATE AssignmentPhrase FieldPhrase::operator =(const QVariant &other) { + return AssignmentPhrase(this, other); +} + +template +Q_OUTOFLINE_TEMPLATE ConditionalPhrase FieldPhrase::operator ==(const QVariant &other) { + return ConditionalPhrase(this, PhraseData::Equal, other); +} + template<> -class NUT_EXPORT FieldPhrase : public AbstractFieldPhrase +class FieldPhrase : public AbstractFieldPhrase { public: FieldPhrase(const char *className, const char *s) : @@ -75,7 +81,7 @@ public: } template<> -class NUT_EXPORT FieldPhrase : public AbstractFieldPhrase +class FieldPhrase : public AbstractFieldPhrase { public: FieldPhrase(const char *className, const char *s) : diff --git a/src/phrases/numericphrase.h b/src/phrases/numericphrase.h index ab9db31..39cd615 100644 --- a/src/phrases/numericphrase.h +++ b/src/phrases/numericphrase.h @@ -12,23 +12,13 @@ NUT_BEGIN_NAMESPACE return ConditionalPhrase(this, cond, other); \ } -template -class FieldPhrase::value || std::is_integral::value - >::type> - : public AbstractFieldPhrase +class NumericFieldPhrase : public AbstractFieldPhrase { public: - FieldPhrase(const char *className, const char *s) : + NumericFieldPhrase(const char *className, const char *s) : AbstractFieldPhrase(className, s) {} - AssignmentPhrase operator =(const QVariant &other) { - return AssignmentPhrase(this, other); - } - AssignmentPhrase operator =(ConditionalPhrase &&other) { - return AssignmentPhrase(new PhraseData(data, PhraseData::Equal, other.data)); - } ConditionalPhrase between(const QVariant &min, const QVariant &max) { return ConditionalPhrase(this, PhraseData::Between, @@ -65,25 +55,32 @@ public: #define SPECIALIZATION_NUMERIC_TYPE(type) \ template<> \ - class FieldPhrase : public NumericPhrase \ + class FieldPhrase : public NumericFieldPhrase \ { \ public: \ FieldPhrase(const char *className, const char *s) : \ - NumericPhrase(className, s) \ + NumericFieldPhrase(className, s) \ {} \ + AssignmentPhrase operator =(const QVariant &other) { \ + return AssignmentPhrase(this, other); \ + } \ + AssignmentPhrase operator =(ConditionalPhrase &&other) { \ + return AssignmentPhrase(new PhraseData(data, PhraseData::Equal, other.data)); \ + } \ }; -//SPECIALIZATION_NUMERIC_TYPE(qint8) -//SPECIALIZATION_NUMERIC_TYPE(qint16) -//SPECIALIZATION_NUMERIC_TYPE(qint32) -//SPECIALIZATION_NUMERIC_TYPE(qint64) +SPECIALIZATION_NUMERIC_TYPE(qint8) +SPECIALIZATION_NUMERIC_TYPE(qint16) +SPECIALIZATION_NUMERIC_TYPE(qint32) +SPECIALIZATION_NUMERIC_TYPE(qint64) -//SPECIALIZATION_NUMERIC_TYPE(quint8) -//SPECIALIZATION_NUMERIC_TYPE(quint16) -//SPECIALIZATION_NUMERIC_TYPE(quint32) -//SPECIALIZATION_NUMERIC_TYPE(quint64) +SPECIALIZATION_NUMERIC_TYPE(quint8) +SPECIALIZATION_NUMERIC_TYPE(quint16) +SPECIALIZATION_NUMERIC_TYPE(quint32) +SPECIALIZATION_NUMERIC_TYPE(quint64) -//SPECIALIZATION_NUMERIC_TYPE(qreal) +SPECIALIZATION_NUMERIC_TYPE(qreal) +SPECIALIZATION_NUMERIC_TYPE(float) NUT_END_NAMESPACE diff --git a/src/query.h b/src/query.h index 70ff85d..444f4b5 100644 --- a/src/query.h +++ b/src/query.h @@ -49,7 +49,7 @@ NUT_BEGIN_NAMESPACE template - class NUT_EXPORT Query : public QueryBase +class Query : public QueryBase { QueryPrivate *d_ptr; Q_DECLARE_PRIVATE(Query) diff --git a/src/query_p.h b/src/query_p.h index 2b65dfb..aee891c 100644 --- a/src/query_p.h +++ b/src/query_p.h @@ -33,7 +33,7 @@ class Database; class TableSetBase; class QueryBase; struct RelationModel; -class QueryPrivate : public QSharedData { +class NUT_EXPORT QueryPrivate : public QSharedData { QueryBase *q_ptr; Q_DECLARE_PUBLIC(QueryBase) diff --git a/src/querybase_p.h b/src/querybase_p.h index d1066b0..d99e113 100644 --- a/src/querybase_p.h +++ b/src/querybase_p.h @@ -33,7 +33,7 @@ NUT_BEGIN_NAMESPACE //TODO: remove this class class Table; class TableSetBase; -class QueryBase : public QObject +class NUT_EXPORT QueryBase : public QObject { Q_OBJECT diff --git a/src/sqlmodel_p.h b/src/sqlmodel_p.h index 26c7730..7db807e 100644 --- a/src/sqlmodel_p.h +++ b/src/sqlmodel_p.h @@ -10,7 +10,7 @@ NUT_BEGIN_NAMESPACE class SqlModel; class Table; class TableModel; -class SqlModelPrivate : public QSharedData { +class NUT_EXPORT SqlModelPrivate : public QSharedData { public: explicit SqlModelPrivate(SqlModel *parent); diff --git a/src/src.pri b/src/src.pri index 79319e3..502aaaa 100644 --- a/src/src.pri +++ b/src/src.pri @@ -65,5 +65,4 @@ SOURCES += \ $$PWD/phrases/phraselist.cpp \ $$PWD/phrases/datephrase.cpp - include($$PWD/../3rdparty/serializer/src/src.pri) diff --git a/src/src.pro b/src/src.pro index 5f96880..fb87f27 100644 --- a/src/src.pro +++ b/src/src.pro @@ -4,7 +4,73 @@ TARGET = nut TEMPLATE = lib CONFIG += c++11 -DEFINES += QT_DEPRECATED_WARNINGS NUT_COMPILE_STATIC +DEFINES += QT_DEPRECATED_WARNINGS NUT_SHARED NUT_BUILD_LIB -include($$PWD/src.pri) -include($$PWD/../ci-test-init.pri) +DEFINES += NUT_SHARED_POINTER + +HEADERS += \ + $$PWD/generators/sqlgeneratorbase_p.h \ + $$PWD/generators/postgresqlgenerator.h \ + $$PWD/generators/mysqlgenerator.h \ + $$PWD/generators/sqlitegenerator.h \ + $$PWD/generators/sqlservergenerator.h \ + $$PWD/tablesetbasedata.h \ + $$PWD/types/dbgeography.h \ + $$PWD/tableset.h \ + $$PWD/defines_p.h \ + $$PWD/defines.h \ + $$PWD/query.h \ + $$PWD/databasemodel.h \ + $$PWD/changelogtable.h \ + $$PWD/tablesetbase_p.h \ + $$PWD/querybase_p.h \ + $$PWD/tablemodel.h \ + $$PWD/query_p.h \ + $$PWD/table.h \ + $$PWD/database.h \ + $$PWD/database_p.h \ + $$PWD/serializableobject.h \ + $$PWD/sqlmodel.h \ + $$PWD/sqlmodel_p.h \ + $$PWD/phrase.h \ + $$PWD/phrases/abstractfieldphrase.h \ + $$PWD/phrases/assignmentphrase.h \ + $$PWD/phrases/assignmentphraselist.h \ + $$PWD/phrases/conditionalphrase.h \ + $$PWD/phrases/fieldphrase.h \ + $$PWD/phrases/phrasedata.h \ + $$PWD/phrases/phrasedatalist.h \ + $$PWD/phrases/phraselist.h \ + $$PWD/phrases/datephrase.h \ + $$PWD/table_p.h + +SOURCES += \ + $$PWD/generators/sqlgeneratorbase.cpp \ + $$PWD/generators/postgresqlgenerator.cpp \ + $$PWD/generators/mysqlgenerator.cpp \ + $$PWD/generators/sqlitegenerator.cpp \ + $$PWD/generators/sqlservergenerator.cpp \ + $$PWD/types/dbgeography.cpp \ + $$PWD/tableset.cpp \ + $$PWD/query.cpp \ + $$PWD/databasemodel.cpp \ + $$PWD/tablesetbase.cpp \ + $$PWD/changelogtable.cpp \ + $$PWD/querybase.cpp \ + $$PWD/tablemodel.cpp \ + $$PWD/table.cpp \ + $$PWD/database.cpp \ + $$PWD/serializableobject.cpp \ + $$PWD/sqlmodel.cpp \ + $$PWD/phrase.cpp \ + $$PWD/phrases/abstractfieldphrase.cpp \ + $$PWD/phrases/assignmentphrase.cpp \ + $$PWD/phrases/assignmentphraselist.cpp \ + $$PWD/phrases/conditionalphrase.cpp \ + $$PWD/phrases/fieldphrase.cpp \ + $$PWD/phrases/phrasedata.cpp \ + $$PWD/phrases/phrasedatalist.cpp \ + $$PWD/phrases/phraselist.cpp \ + $$PWD/phrases/datephrase.cpp + +include($$PWD/../3rdparty/serializer/src/src.pri) diff --git a/src/tablemodel.h b/src/tablemodel.h index 1fa89ae..f0e3b23 100644 --- a/src/tablemodel.h +++ b/src/tablemodel.h @@ -30,7 +30,7 @@ class QJsonObject; NUT_BEGIN_NAMESPACE class TableModel; -struct FieldModel{ +struct NUT_EXPORT FieldModel{ explicit FieldModel() : name(QString()), defaultValue(QString()) { diff --git a/src/tableset.h b/src/tableset.h index d066584..7153c2e 100644 --- a/src/tableset.h +++ b/src/tableset.h @@ -43,7 +43,7 @@ class BulkInserter; class Database; template -class NUT_EXPORT TableSet : public TableSetBase +class TableSet : public TableSetBase { public: typedef T value_type; diff --git a/src/tablesetbase_p.h b/src/tablesetbase_p.h index f5805ba..9513316 100644 --- a/src/tablesetbase_p.h +++ b/src/tablesetbase_p.h @@ -33,7 +33,7 @@ NUT_BEGIN_NAMESPACE class Table; class Database; class TableSetBaseData; -class TableSetBase : public QObject +class NUT_EXPORT TableSetBase : public QObject { public: diff --git a/test/common/nut-lib.pri b/test/common/nut-lib.pri index 12b9974..d8b2f31 100644 --- a/test/common/nut-lib.pri +++ b/test/common/nut-lib.pri @@ -1,11 +1,12 @@ win32 { - CONFIG(debug,debug|release): LIBDIR = $$absolute_path($$OUT_PWD/../../src/debug) - CONFIG(release,debug|release): LIBDIR = $$absolute_path($$OUT_PWD/../../src/release) + CONFIG(debug,debug|release): LIBDIR = $$absolute_path($$OUT_PWD/../../src/debug) + CONFIG(release,debug|release): LIBDIR = $$absolute_path($$OUT_PWD/../../src/release) } else { - LIBDIR = $$absolute_path($$OUT_PWD/../../src) + LIBDIR = $$absolute_path($$OUT_PWD/../../src) } LIBS += -L$$LIBDIR -lnut INCLUDEPATH += $$PWD/../../src $$PWD/../common DEFINES += NUT_SHARED_POINTER +DEFINES += NUT_PATH=\\\"$$PWD/../../\\\" diff --git a/test/tst_basic/tst_basic.pro b/test/tst_basic/tst_basic.pro index 24ffb66..c2e5ca2 100644 --- a/test/tst_basic/tst_basic.pro +++ b/test/tst_basic/tst_basic.pro @@ -24,4 +24,3 @@ HEADERS += \ ../common/score.h \ tst_basic.h -include($$PWD/../../ci-test-init.pri) diff --git a/test/tst_benckmark/tst_benckmark.pro b/test/tst_benckmark/tst_benckmark.pro index 48bd4f5..19fd248 100644 --- a/test/tst_benckmark/tst_benckmark.pro +++ b/test/tst_benckmark/tst_benckmark.pro @@ -24,4 +24,3 @@ HEADERS += \ ../common/score.h \ tst_benchmark.h -include($$PWD/../../ci-test-init.pri) diff --git a/test/tst_datatypes/tst_datatypes.pro b/test/tst_datatypes/tst_datatypes.pro index a690739..ca0be8c 100644 --- a/test/tst_datatypes/tst_datatypes.pro +++ b/test/tst_datatypes/tst_datatypes.pro @@ -16,5 +16,3 @@ HEADERS += \ db.h \ sampletable.h \ tst_datatypes.h - -include($$PWD/../../ci-test-init.pri) diff --git a/test/tst_datetime/tst_datetime.pro b/test/tst_datetime/tst_datetime.pro index 7a9a327..d48e3ae 100644 --- a/test/tst_datetime/tst_datetime.pro +++ b/test/tst_datetime/tst_datetime.pro @@ -17,4 +17,3 @@ HEADERS += \ sampletable.h \ tst_datetime.h -include($$PWD/../../ci-test-init.pri) diff --git a/test/tst_generators/tst_generators.pro b/test/tst_generators/tst_generators.pro index dc81002..97c1cb9 100644 --- a/test/tst_generators/tst_generators.pro +++ b/test/tst_generators/tst_generators.pro @@ -12,5 +12,3 @@ SOURCES += \ HEADERS += \ tst_generators.h - -include($$PWD/../../ci-test-init.pri) diff --git a/test/tst_json/tst_json.pro b/test/tst_json/tst_json.pro index 04f053c..f224c0b 100644 --- a/test/tst_json/tst_json.pro +++ b/test/tst_json/tst_json.pro @@ -15,5 +15,3 @@ HEADERS += \ tst_json.h \ db.h \ sampletable.h - -include($$PWD/../../ci-test-init.pri) diff --git a/test/tst_phrases/tst_phrases.pro b/test/tst_phrases/tst_phrases.pro index d287bac..80a4ed7 100644 --- a/test/tst_phrases/tst_phrases.pro +++ b/test/tst_phrases/tst_phrases.pro @@ -13,4 +13,3 @@ SOURCES += \ HEADERS += \ tst_phrases.h -include($$PWD/../../ci-test-init.pri) diff --git a/test/tst_quuid/tst_quuid.pro b/test/tst_quuid/tst_quuid.pro index da1afd9..627d2db 100644 --- a/test/tst_quuid/tst_quuid.pro +++ b/test/tst_quuid/tst_quuid.pro @@ -17,4 +17,3 @@ HEADERS += \ test.h \ tst_uuid.h -include($$PWD/../../ci-test-init.pri) diff --git a/test/tst_upgrades/tst_upgrades.pro b/test/tst_upgrades/tst_upgrades.pro index 8493a14..7c1e5be 100644 --- a/test/tst_upgrades/tst_upgrades.pro +++ b/test/tst_upgrades/tst_upgrades.pro @@ -23,4 +23,3 @@ HEADERS += \ db3.h \ table3.h -include($$PWD/../../ci-test-init.pri) From 46846ae24f9d6698eeb7bb29f4a71688ad31db59 Mon Sep 17 00:00:00 2001 From: Hamed Masafi Date: Tue, 28 Jul 2020 18:37:56 +0430 Subject: [PATCH 15/16] ci 3 --- .github/workflows/qt.yml | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/.github/workflows/qt.yml b/.github/workflows/qt.yml index af26e49..fa162c3 100644 --- a/.github/workflows/qt.yml +++ b/.github/workflows/qt.yml @@ -59,26 +59,18 @@ jobs: run: | qmake CONFIG+=install_ok QT_PLATFORM=${{matrix.platform}} "QT_TOOL_PATH=${{steps.qt.outputs.qtdir}}/Tools" nut.pro ${{steps.qt.outputs.make}} qmake_all -<<<<<<< HEAD - - name: make module + - name: make lib run: | ${{steps.qt.outputs.make}} ${{steps.qt.outputs.make}} INSTALL_ROOT="${{steps.qt.outputs.installdir}}" install -======= - ->>>>>>> 29aaab8228f2f4c9d7c6651941f6614130c02d1d - - name: upload module to releases + - name: upload lib to releases uses: Skycoder42/action-upload-release@master if: startsWith(github.ref, 'refs/tags/') with: repo_token: ${{secrets.GITHUB_TOKEN}} directory: ${{steps.qt.outputs.outdir}} platform: ${{matrix.platform}} -<<<<<<< HEAD asset_name: nut-${{matrix.platform}}-${{matrix.version}} -======= - asset_name: qtautoupdater-${{matrix.platform}}-${{matrix.version}} ->>>>>>> 29aaab8228f2f4c9d7c6651941f6614130c02d1d tag: ${{github.ref}} overwrite: true From 4982742925cbabff17f4bf45f831e816df8628ae Mon Sep 17 00:00:00 2001 From: Hamed Masafi Date: Wed, 29 Jul 2020 09:34:45 +0430 Subject: [PATCH 16/16] remove unneeded files --- 3rdparty/serializer | 2 +- ci-test-init.pri | 4 ---- nut-dynamic.pro | 10 ---------- 3 files changed, 1 insertion(+), 15 deletions(-) delete mode 100644 ci-test-init.pri delete mode 100644 nut-dynamic.pro diff --git a/3rdparty/serializer b/3rdparty/serializer index 7845ef5..5b30b13 160000 --- a/3rdparty/serializer +++ b/3rdparty/serializer @@ -1 +1 @@ -Subproject commit 7845ef5a232ca7c16a0f8200843202b423fe2564 +Subproject commit 5b30b13af9b9537d4226c922d04106dc4ba0595b diff --git a/ci-test-init.pri b/ci-test-init.pri deleted file mode 100644 index 7e8ac7a..0000000 --- a/ci-test-init.pri +++ /dev/null @@ -1,4 +0,0 @@ -#QT -= gui - -DEFINES += NUT_PATH=\\\"$$PWD/../../\\\" - diff --git a/nut-dynamic.pro b/nut-dynamic.pro deleted file mode 100644 index b19d9e8..0000000 --- a/nut-dynamic.pro +++ /dev/null @@ -1,10 +0,0 @@ -QT += sql gui - -TARGET = nut -TEMPLATE = lib -CONFIG += c++11 - -DEFINES += QT_DEPRECATED_WARNINGS NUT_COMPILE_STATIC - -include($$PWD/src/src.pri) -include($$PWD/3rdparty/serializer/src/src.pri)