diff --git a/.github/actions/create-package/create-package.sh b/.github/actions/create-package/create-package.sh index 7c6405f2c9..70ef3974e2 100755 --- a/.github/actions/create-package/create-package.sh +++ b/.github/actions/create-package/create-package.sh @@ -52,7 +52,8 @@ wayland-decoration-client,wayland-graphics-integration-client,wayland-shell-inte create_package_macos() { echo "::group::Clean" make clean - mv bin Pencil2D + mkdir Pencil2D + mv app/Pencil2D.app Pencil2D/ pushd Pencil2D >/dev/null echo "::endgroup::" @@ -88,16 +89,19 @@ create_package_macos() { } create_package_windows() { + echo "::group::Set up application files" + nmake install INSTALL_ROOT="$(cygpath -w "${PWD}/Pencil2D")" + echo "::endgroup::" + echo "Copy FFmpeg plugin" local platform="${INPUT_ARCH%%_*}" local ffmpeg="ffmpeg-${platform}.zip" curl -fsSLO "https://github.com/pencil2d/pencil2d-deps/releases/download/ffmpge-v4.1.1/$ffmpeg" "${WINDIR}\\System32\\tar" xf "${ffmpeg}" - mkdir bin/plugins - mv "ffmpeg.exe" bin/plugins/ + mkdir Pencil2D/plugins + mv "ffmpeg.exe" Pencil2D/plugins/ rm -rf "${ffmpeg}" - mv bin Pencil2D echo "Remove files" find \( -name '*.pdb' -o -name '*.ilk' \) -delete echo "::group::Deploy Qt libraries" diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 70196cd4fa..bd7be4bd7e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -92,7 +92,7 @@ jobs: - name: Configure build run: mkdir build; ${{runner.os == 'Linux' && matrix.qt == 6 && 'qmake6' || 'qmake'}} - -o build PREFIX=/usr CONFIG+=release CONFIG+=GIT + -o build PREFIX=/usr CONFIG-=debug_and_release CONFIG+=release CONFIG+=GIT CONFIG+=PENCIL2D_${{github.ref == 'refs/heads/release' && 'RELEASE' || 'NIGHTLY'}} ${{matrix.qt == 6 && 'CONFIG+=c++17 QMAKE_CXX_FLAGS+=-std=c++17' || ''}} @@ -102,7 +102,7 @@ jobs: - name: Run tests env: { QT_QPA_PLATFORM: minimal } - run: build/tests/bin/tests + run: build/tests/tests - name: Create package id: package diff --git a/app/app.pro b/app/app.pro index 714312b77f..5ebdfa0655 100644 --- a/app/app.pro +++ b/app/app.pro @@ -6,18 +6,11 @@ ! include( ../util/common.pri ) { error( Could not find the common.pri file! ) } -QT += core widgets gui xml multimedia svg network - TEMPLATE = app -TARGET = pencil2d -QMAKE_APPLICATION_BUNDLE_NAME = Pencil2D - CONFIG += precompile_header lrelease embed_translations +QT += core widgets gui xml multimedia svg network -DESTDIR = ../bin -MOC_DIR = .moc -OBJECTS_DIR = .obj -UI_DIR = .ui +TARGET = pencil2d RESOURCES += data/app.qrc @@ -111,7 +104,6 @@ HEADERS += \ src/checkupdatesdialog.h \ src/presetdialog.h \ src/repositionframesdialog.h \ - src/presetdialog.h \ src/commandlineparser.h \ src/commandlineexporter.h \ src/statusbar.h \ @@ -219,10 +211,30 @@ macx { QMAKE_BUNDLE_DATA += FILE_ICONS QMAKE_TARGET_BUNDLE_PREFIX += org.pencil2d + QMAKE_APPLICATION_BUNDLE_NAME = Pencil2D } win32 { + target.path = / + visualelements.path = / + visualelements.files = data/pencil2d.VisualElementsManifest.xml $$OUT_PWD\resources.pri + visualelements.CONFIG += no_check_exist + visualelements.depends += resources.pri + resources.path = /resources + resources.files = data/resources/* + + PRI_CONFIG = data/resources.xml + PRI_INDEX_NAME = Pencil2D RC_FILE = data/pencil2d.rc + INSTALLS += target visualelements resources + + makepri.name = makepri + makepri.input = PRI_CONFIG + makepri.output = ${QMAKE_FILE_IN_BASE}.pri + makepri.commands = makepri new /o /in $$PRI_INDEX_NAME /pr ${QMAKE_FILE_PATH} /cf ${QMAKE_FILE_IN} /of ${QMAKE_FILE_OUT} + silent: makepri.commands = @echo makepri ${QMAKE_FILE_IN} && $$makepri.commands + makepri.CONFIG = no_link + QMAKE_EXTRA_COMPILERS += makepri } unix:!macx { @@ -253,8 +265,9 @@ unix:!macx { INCLUDEPATH += ../../core_lib/src -CONFIG(debug,debug|release) BUILDTYPE = debug -CONFIG(release,debug|release) BUILDTYPE = release +BUILDTYPE = +debug_and_release:CONFIG(debug,debug|release) BUILDTYPE = debug +debug_and_release:CONFIG(release,debug|release) BUILDTYPE = release win32-msvc* { LIBS += -L$$OUT_PWD/../core_lib/$$BUILDTYPE/ -lcore_lib diff --git a/app/data/pencil2d.VisualElementsManifest.xml b/app/data/pencil2d.VisualElementsManifest.xml new file mode 100644 index 0000000000..3a00d0349a --- /dev/null +++ b/app/data/pencil2d.VisualElementsManifest.xml @@ -0,0 +1,8 @@ + + + diff --git a/app/data/resources.xml b/app/data/resources.xml new file mode 100644 index 0000000000..f45b34273e --- /dev/null +++ b/app/data/resources.xml @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/app/data/resources/tile150.scale-100.png b/app/data/resources/tile150.scale-100.png new file mode 100644 index 0000000000..14c3ed0fb8 Binary files /dev/null and b/app/data/resources/tile150.scale-100.png differ diff --git a/app/data/resources/tile150.scale-140.png b/app/data/resources/tile150.scale-140.png new file mode 100644 index 0000000000..43814c90bd Binary files /dev/null and b/app/data/resources/tile150.scale-140.png differ diff --git a/app/data/resources/tile150.scale-180.png b/app/data/resources/tile150.scale-180.png new file mode 100644 index 0000000000..724ae3f707 Binary files /dev/null and b/app/data/resources/tile150.scale-180.png differ diff --git a/app/data/resources/tile150.scale-80.png b/app/data/resources/tile150.scale-80.png new file mode 100644 index 0000000000..e94cf43fbb Binary files /dev/null and b/app/data/resources/tile150.scale-80.png differ diff --git a/app/data/resources/tile70.scale-100.png b/app/data/resources/tile70.scale-100.png new file mode 100644 index 0000000000..c2816b92cc Binary files /dev/null and b/app/data/resources/tile70.scale-100.png differ diff --git a/app/data/resources/tile70.scale-140.png b/app/data/resources/tile70.scale-140.png new file mode 100644 index 0000000000..6166fa8383 Binary files /dev/null and b/app/data/resources/tile70.scale-140.png differ diff --git a/app/data/resources/tile70.scale-180.png b/app/data/resources/tile70.scale-180.png new file mode 100644 index 0000000000..e50c2d3206 Binary files /dev/null and b/app/data/resources/tile70.scale-180.png differ diff --git a/app/data/resources/tile70.scale-80.png b/app/data/resources/tile70.scale-80.png new file mode 100644 index 0000000000..ad5a9c2f0b Binary files /dev/null and b/app/data/resources/tile70.scale-80.png differ diff --git a/core_lib/core_lib.pro b/core_lib/core_lib.pro index 2b25e8d863..14cff7b596 100644 --- a/core_lib/core_lib.pro +++ b/core_lib/core_lib.pro @@ -6,17 +6,12 @@ ! include( ../util/common.pri ) { error( Could not find the common.pri file! ) } -QT += core widgets gui xml multimedia svg - TEMPLATE = lib CONFIG += staticlib precompile_header +QT += core widgets gui xml multimedia svg RESOURCES += data/core_lib.qrc -MOC_DIR = .moc -OBJECTS_DIR = .obj -UI_DIR = .ui - INCLUDEPATH += src \ src/graphics \ src/graphics/bitmap \ diff --git a/tests/tests.pro b/tests/tests.pro index 9bba5c9f3e..e229371c8a 100644 --- a/tests/tests.pro +++ b/tests/tests.pro @@ -6,18 +6,12 @@ ! include( ../util/common.pri ) { error( Could not find the common.pri file! ) } -QT += core widgets gui xml multimedia svg testlib - TEMPLATE = app - -TARGET = tests - CONFIG += console CONFIG -= app_bundle +QT += core widgets gui xml multimedia svg testlib -MOC_DIR = .moc -OBJECTS_DIR = .obj -DESTDIR = bin +TARGET = tests RESOURCES += data/tests.qrc @@ -52,8 +46,9 @@ SOURCES += \ INCLUDEPATH += $$PWD/../core_lib/src -CONFIG(debug,debug|release) BUILDTYPE = debug -CONFIG(release,debug|release) BUILDTYPE = release +BUILDTYPE = +debug_and_release:CONFIG(debug,debug|release) BUILDTYPE = debug +debug_and_release:CONFIG(release,debug|release) BUILDTYPE = release win32-msvc* { LIBS += -L$$OUT_PWD/../core_lib/$$BUILDTYPE/ -lcore_lib diff --git a/util/appveyor-mingw.yml b/util/appveyor-mingw.yml index 8eceeea8c6..06f45461a3 100644 --- a/util/appveyor-mingw.yml +++ b/util/appveyor-mingw.yml @@ -35,11 +35,11 @@ build_script: - mingw32-make -j2 after_build: - - windeployqt "%APPVEYOR_BUILD_FOLDER%\build\bin\pencil2d.exe" - + - windeployqt "%APPVEYOR_BUILD_FOLDER%\build\app\release\pencil2d.exe" + test_script: - echo "Running tests" - - cd "%APPVEYOR_BUILD_FOLDER%\build\tests\bin" + - cd "%APPVEYOR_BUILD_FOLDER%\build\tests\release" - tests.exe for: @@ -70,4 +70,4 @@ for: matrix: exclude: - image: Visual Studio 2015 - platform: x64 \ No newline at end of file + platform: x64 diff --git a/util/appveyor-msvc.yml b/util/appveyor-msvc.yml index 96820dca61..a5cf034496 100644 --- a/util/appveyor-msvc.yml +++ b/util/appveyor-msvc.yml @@ -34,11 +34,11 @@ build_script: - nmake after_build: - - windeployqt "%APPVEYOR_BUILD_FOLDER%\build\bin\pencil2d.exe" + - windeployqt "%APPVEYOR_BUILD_FOLDER%\build\app\release\pencil2d.exe" test_script: - echo "Running tests" - - tests\bin\tests.exe + - tests\release\tests.exe for: - matrix: @@ -87,4 +87,4 @@ for: matrix: exclude: - image: Visual Studio 2013 - platform: x64 \ No newline at end of file + platform: x64 diff --git a/util/common.pri b/util/common.pri index f9fc6dea96..f23947401b 100644 --- a/util/common.pri +++ b/util/common.pri @@ -1,4 +1,3 @@ - VERSION = 0.6.6 DEFINES += APP_VERSION=\\\"$$VERSION\\\"