From e54c3f0d52109d68679d04ab9e960adfddc9b30f Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Wed, 13 Sep 2023 16:58:21 +0300 Subject: [PATCH] Probe if bundles are ready. --- .cirrus.yml | 2 +- appveyor.yml | 4 ++-- dmg.qbs | 21 ++++++++++++++++++++- 3 files changed, 23 insertions(+), 4 deletions(-) diff --git a/.cirrus.yml b/.cirrus.yml index 7ded0b316..1ea8d4e68 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -259,7 +259,7 @@ macos_task_template: &MACOS_TASK_TEMPLATE - qbs-config defaultProfile qt6 - qbs config profiles.qt6.baseProfile clang - qbs build -f valentina.qbs -d $CIRRUS_WORKING_DIR/build --command-echo-mode command-line --jobs $(nproc) config:release modules.buildconfig.enableUnitTests:false modules.buildconfig.enableMultiBundle:${MULTI_BUNDLE} qbs.installRoot:$CIRRUS_WORKING_DIR/build/install-root profile:qt6 project.enableConan:true project.minimumMacosVersion:${MACOS_DEPLOYMENT_TARGET} modules.buildconfig.enableCcache:${ENABLE_CCACHE} project.conanProfiles:valentina moduleProviders.qbspkgconfig.extraPaths:$(brew --prefix qt6)/lib/pkgconfig,$(brew --prefix openssl@1.1)/lib/pkgconfig 'modules.buildconfig.signingIdentity:$MACOS_CERTIFICATE_NAME' - - qbs build -f valentina.qbs -d $CIRRUS_WORKING_DIR/build -p 'Valentina DMG' --jobs $(nproc) config:release modules.buildconfig.enableUnitTests:false modules.buildconfig.enableMultiBundle:${MULTI_BUNDLE} qbs.installRoot:$CIRRUS_WORKING_DIR/build/install-root profile:qt6 project.enableConan:true project.minimumMacosVersion:${MACOS_DEPLOYMENT_TARGET} modules.buildconfig.enableCcache:${ENABLE_CCACHE} project.conanProfiles:valentina moduleProviders.qbspkgconfig.extraPaths:$(brew --prefix qt6)/lib/pkgconfig,$(brew --prefix openssl@1.1)/lib/pkgconfig 'modules.buildconfig.signingIdentity:$MACOS_CERTIFICATE_NAME' + - qbs build -f valentina.qbs -d $CIRRUS_WORKING_DIR/build -p 'Valentina DMG' --force-probe-execution --jobs $(nproc) config:release modules.buildconfig.enableUnitTests:false modules.buildconfig.enableMultiBundle:${MULTI_BUNDLE} qbs.installRoot:$CIRRUS_WORKING_DIR/build/install-root profile:qt6 project.enableConan:true project.minimumMacosVersion:${MACOS_DEPLOYMENT_TARGET} modules.buildconfig.enableCcache:${ENABLE_CCACHE} project.conanProfiles:valentina moduleProviders.qbspkgconfig.extraPaths:$(brew --prefix qt6)/lib/pkgconfig,$(brew --prefix openssl@1.1)/lib/pkgconfig 'modules.buildconfig.signingIdentity:$MACOS_CERTIFICATE_NAME' # Store the notarization credentials so that we can prevent a UI password dialog # from blocking the CI - echo "Create keychain profile" diff --git a/appveyor.yml b/appveyor.yml index 31836fef6..dba3de3ac 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -726,7 +726,7 @@ for: - qbs config defaultProfile qt6 - qbs config profiles.qt6.baseProfile clang - qbs build -f valentina.qbs -d ${APPVEYOR_BUILD_FOLDER}/build --jobs $(nproc) config:release modules.buildconfig.enableUnitTests:false modules.buildconfig.enableMultiBundle:${MULTI_BUNDLE} qbs.installRoot:${APPVEYOR_BUILD_FOLDER}/build/install-root profile:qt6 project.enableConan:true project.minimumMacosVersion:${MACOS_DEPLOYMENT_TARGET} modules.buildconfig.enableCcache:false moduleProviders.qbspkgconfig.extraPaths:$(brew --prefix openssl@1.1)/lib/pkgconfig 'modules.buildconfig.signingIdentity:$MACOS_CERTIFICATE_NAME' - - qbs build -f valentina.qbs -d ${APPVEYOR_BUILD_FOLDER}/build -p 'Valentina DMG' --jobs $(nproc) config:release modules.buildconfig.enableUnitTests:false modules.buildconfig.enableMultiBundle:${MULTI_BUNDLE} qbs.installRoot:${APPVEYOR_BUILD_FOLDER}/build/install-root profile:qt6 project.enableConan:true project.minimumMacosVersion:${MACOS_DEPLOYMENT_TARGET} modules.buildconfig.enableCcache:false moduleProviders.qbspkgconfig.extraPaths:$(brew --prefix openssl@1.1)/lib/pkgconfig 'modules.buildconfig.signingIdentity:$MACOS_CERTIFICATE_NAME' + - qbs build -f valentina.qbs -d ${APPVEYOR_BUILD_FOLDER}/build -p 'Valentina DMG' --force-probe-execution --jobs $(nproc) config:release modules.buildconfig.enableUnitTests:false modules.buildconfig.enableMultiBundle:${MULTI_BUNDLE} qbs.installRoot:${APPVEYOR_BUILD_FOLDER}/build/install-root profile:qt6 project.enableConan:true project.minimumMacosVersion:${MACOS_DEPLOYMENT_TARGET} modules.buildconfig.enableCcache:false moduleProviders.qbspkgconfig.extraPaths:$(brew --prefix openssl@1.1)/lib/pkgconfig 'modules.buildconfig.signingIdentity:$MACOS_CERTIFICATE_NAME' # Store the notarization credentials so that we can prevent a UI password dialog # from blocking the CI - echo "Create keychain profile" @@ -838,7 +838,7 @@ for: - qbs config defaultProfile qt6 - qbs config profiles.qt6.baseProfile clang - qbs build -f valentina.qbs -d ${APPVEYOR_BUILD_FOLDER}/build --jobs $(nproc) config:release modules.buildconfig.enableUnitTests:false modules.buildconfig.enableMultiBundle:${MULTI_BUNDLE} qbs.installRoot:${APPVEYOR_BUILD_FOLDER}/build/install-root profile:qt6 project.enableConan:true project.minimumMacosVersion:${MACOS_DEPLOYMENT_TARGET} modules.buildconfig.enableCcache:false 'modules.buildconfig.signingIdentity:$MACOS_CERTIFICATE_NAME' - - qbs build -f valentina.qbs -d ${APPVEYOR_BUILD_FOLDER}/build -p 'Valentina DMG' --jobs $(nproc) config:release modules.buildconfig.enableUnitTests:false modules.buildconfig.enableMultiBundle:${MULTI_BUNDLE} qbs.installRoot:${APPVEYOR_BUILD_FOLDER}/build/install-root profile:qt6 project.enableConan:true project.minimumMacosVersion:${MACOS_DEPLOYMENT_TARGET} modules.buildconfig.enableCcache:false moduleProviders.qbspkgconfig.extraPaths:$(brew --prefix openssl@1.1)/lib/pkgconfig 'modules.buildconfig.signingIdentity:$MACOS_CERTIFICATE_NAME' + - qbs build -f valentina.qbs -d ${APPVEYOR_BUILD_FOLDER}/build -p 'Valentina DMG' --force-probe-execution --jobs $(nproc) config:release modules.buildconfig.enableUnitTests:false modules.buildconfig.enableMultiBundle:${MULTI_BUNDLE} qbs.installRoot:${APPVEYOR_BUILD_FOLDER}/build/install-root profile:qt6 project.enableConan:true project.minimumMacosVersion:${MACOS_DEPLOYMENT_TARGET} modules.buildconfig.enableCcache:false moduleProviders.qbspkgconfig.extraPaths:$(brew --prefix openssl@1.1)/lib/pkgconfig 'modules.buildconfig.signingIdentity:$MACOS_CERTIFICATE_NAME' # notarytool supported since XCode 13. First we need to backport it. - curl https://bitbucket.org/valentinaproject/valentinaproject.bitbucket.io/downloads/notarytool.tar.xz --output $HOME/notarytool.tar.xz --silent - tar -xf $HOME/notarytool.tar.xz diff --git a/dmg.qbs b/dmg.qbs index 08ae6c674..669266716 100755 --- a/dmg.qbs +++ b/dmg.qbs @@ -1,3 +1,6 @@ +import qbs.File +import qbs.FileInfo + VAppleApplicationDiskImage { Depends { name: "buildconfig" } Depends { name: "ib" } @@ -5,13 +8,29 @@ VAppleApplicationDiskImage { Depends { name: "Tape"; condition: buildconfig.enableMultiBundle } Depends { name: "Puzzle"; condition: buildconfig.enableMultiBundle } - condition: qbs.targetOS.contains("macos") + condition: qbs.targetOS.contains("macos") && bundleProbe.ready name: "Valentina DMG" targetName: "valentina" version: buildconfig.projectVersion builtByDefault: false codesign.enableCodeSigning: buildconfig.enableCodeSigning + Probe { + id: bundleProbe + property string root: absoluteSourceBase + property bool enableMultiBundle: buildconfig.enableMultiBundle + property bool ready + configure: { + if (!enableMultiBundle) + ready = File.exists(FileInfo.joinPaths(root, "Valentina.app")); + else + ready = File.exists(FileInfo.joinPaths(root, "Valentina.app")) + && File.exists(FileInfo.joinPaths(root, "Tape.app")) + && File.exists(FileInfo.joinPaths(root, "Puzzle.app")); + found = true; + } + } + Properties { condition: qbs.buildVariant !== "release" codesign.codesignFlags: ["--deep"]