mirror of
https://github.com/cagnulein/qdomyos-zwift.git
synced 2026-02-17 16:07:43 +01:00
* Add CI scripts for iOS Qt 5.15.2 build process Introduced three CI scripts: ci_post_clone.sh for setting up Qt 5.15.2 and patched libraries, ci_pre_xcodebuild.sh for running qmake and restoring WatchOS references, and ci_post_xcodebuild.sh for post-build verification and artifact logging. These scripts automate the iOS build environment setup and validation for QDomyos-Zwift. * Update ci_post_clone.sh * Update ci_post_clone.sh * Enforce exact Qt 5.15.2 install and Xcode Cloud fixes Update CI scripts to strictly require and verify Qt 5.15.2, using aqt or Homebrew with version pinning. Add robust error handling for incorrect Qt versions, ensure patched Bluetooth libraries are present, and improve messaging. In pre-xcodebuild, verify Qt version, add Xcode Cloud build location fixes via xcconfig and pbxproj edits, and enhance error handling for project configuration. * Update ci_post_clone.sh * Use local Homebrew formula for Qt 5.15.2 installation Updated the CI post-clone script to install Qt 5.15.2 using a local Homebrew formula instead of downloading it from an external source. Added the qt5.rb formula to the repository under ci-scripts/homebrew-formulas for reproducible and reliable builds. * Update ci_post_clone.sh * Update ci_post_clone.sh * Update ci_post_clone.sh * Update ci_post_clone.sh * Update ci_post_clone.sh * Update ci_post_clone.sh * Update ci_post_clone.sh * Update ci_post_clone.sh * Update ci_post_clone.sh * Update ci_post_clone.sh * Update ci_post_clone.sh * Update ci_post_clone.sh * Update ci_post_clone.sh * Initial commit Project files added to set up the initial codebase. * Update project.pbxproj * Revert "Update project.pbxproj" This reverts commitf17455cfe7. * Revert "Initial commit" This reverts commit91c30cc8b1. * relative paths * relative paths * porting from aradar xcode project * Update project.pbxproj * Add Xcode workspace configuration files Added initial Xcode workspace files including contents.xcworkspacedata, IDEWorkspaceChecks.plist, and SwiftPM Package.resolved for project setup and dependency management. * Update project.pbxproj * Update project.pbxproj * Update project.pbxproj * Create PrivacyInfo.xcprivacy * Create PrivacyInfo.xcprivacy * Revert "Create PrivacyInfo.xcprivacy" This reverts commit5a8fb9dee5. * Revert "Update project.pbxproj" This reverts commite160c9bf6e. * Reapply "Update project.pbxproj" This reverts commit1cf0092c57. * Revert "Create PrivacyInfo.xcprivacy" This reverts commite0ede5d42d. * Revert "Update project.pbxproj" This reverts commite160c9bf6e. * Revert "Update project.pbxproj" This reverts commitf8025155cc. * Revert "Update project.pbxproj" This reverts commitac4d5f5fc0. * Revert "Add Xcode workspace configuration files" This reverts commita3aacc002b. * Revert "Update project.pbxproj" This reverts commitd5e68987e6. * Revert "porting from aradar xcode project" This reverts commit21f489b86d. * Revert "relative paths" This reverts commit2002677955. * Revert "relative paths" This reverts commit4da17e3ae9. * trying to don't change the full directory structure * Update _ci_pre_xcodebuild.sh * Update project.pbxproj * Persist and load Qt environment for CI scripts ci_post_clone.sh now saves the Qt environment variables to a persistent file (/tmp/qt_env.sh) after installation or detection. ci_pre_xcodebuild.sh is renamed and updated to load this environment file, ensuring consistent Qt configuration across CI steps. Additional debug output is added for troubleshooting. * Update ci_pre_xcodebuild.sh * Update project.pbxproj * Update ci_pre_xcodebuild.sh * Update ci_pre_xcodebuild.sh * debug * Update ci_post_clone.sh * Update project.pbxproj * Update project.pbxproj * Update ci_pre_xcodebuild.sh * Update project.pbxproj * Update project.pbxproj * Update qdomyos-zwift.pri * Update qdomyos-zwift.pri * Update qdomyos-zwift.pri * Update qdomyos-zwift.pro * Update qdomyos-zwift.pri * Update qdomyos-zwift.pri * fake xcode * foxing * Revert "foxing" This reverts commit5dd813b2f5. * Update ci_pre_xcodebuild.sh * Update ci_pre_xcodebuild.sh * signing * Update qdomyos-zwift.pro * Update ci_pre_xcodebuild.sh * Update ci_pre_xcodebuild.sh * Update ci_pre_xcodebuild.sh * Update ci_pre_xcodebuild.sh * Update ci_pre_xcodebuild.sh * Update ci_pre_xcodebuild.sh * relative path * Update project.pbxproj * Update project.pbxproj * moc relative * signing * root project * Update qdomyos-zwift.pro * Update ci_pre_xcodebuild.sh * Update ci_pre_xcodebuild.sh * Fix Xcode Cloud build: symlink to correct project with code signing qmake regenerates src/qdomyoszwift.xcodeproj without code signing during make, causing build failures. After make completes, we now: - Delete the corrupted project in src/ - Create symlink to the correct project in build-qdomyos-zwift-Qt_5_15_2_for_iOS-Debug/ - xcodebuild now uses the project with proper code signing configuration Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com> * Fix: Create fake xcodebuild BEFORE make to prevent circular failure The previous fix failed because: 1. make was calling xcodebuild with corrupted project 2. xcodebuild failed due to code signing 3. make exited with error 4. Script never reached symlink creation (circular problem) This fix: 1. Creates fake xcodebuild BEFORE make starts 2. make completes successfully (fake xcodebuild returns success) 3. Script continues and creates symlink to correct project 4. Removes fake xcodebuild from PATH 5. Real xcodebuild (from Xcode Cloud) uses symlinked project with code signing Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com> * Fix: Use absolute paths to avoid git repo not found error Problems fixed: 1. Script not executable - added chmod +x 2. cd .. after make went to wrong directory → git repo not found 3. find ../src failed after make → wrong directory Solution: - Save PROJECT_ROOT absolute path at start - Use "$PROJECT_ROOT" instead of cd .. - Use "$PROJECT_ROOT/src" instead of ../src - Made script executable (755) Now script can find git repo and source files regardless of where make leaves us. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com> * Add missing QZWidgetExtension.entitlements from master Xcode build was failing with: "Build input file cannot be found: QZWidgetExtension.entitlements" This file exists in master but was missing from xcode-cloud-scripts branch. Copied from master to fix the build error. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com> * Resolve merge conflict: use master version of settings.local.json * Copy ALL Qt-generated files from src/ to build directory Problem: qmake/make generates files (moc_*.cpp, qrc_*.cpp, qmltyperegistrations, etc.) in src/ but Xcode expects them in build-qdomyos-zwift-Qt_5_15_2_for_iOS-Debug/ Solution: After make completes, copy all generated files to build directory: - MOC files (moc_*.cpp, moc_*.cpp.json) - QRC files (qrc_*.cpp) - Object files (*.o, *.a) - QML type registrations (*_qmltyperegistrations.*) - Metatypes (*_metatypes.json, *.qmltypes) - Plugin imports (*_plugin_import.cpp) This matches the local build directory structure. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com> * Fix file copy timing - move AFTER git restore Critical bug fix: The file copy from src/ to build/ was happening BEFORE git checkout, which was then wiping out the copied files. Changes: - Move file copy to AFTER git checkout to preserve generated files - Add -print flag to show which files are being copied - Add verification step to confirm qdomyoszwift_qmltyperegistrations.cpp exists This ensures Qt-generated files (MOC, QML type registrations, etc.) are properly available in the build directory for Xcode to find them. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com> * Fix qmltyperegistrations filename mismatch Critical fix: qmake generates qdomyos-zwift_qmltyperegistrations.cpp (with hyphen) but Xcode project expects qdomyoszwift_qmltyperegistrations.cpp (no hyphen). Added: - Copy/rename step to create the non-hyphenated version Xcode expects - Handle both .cpp and .o files - Verification output to confirm file exists Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com> * Add symlink for Qt path compatibility - fix httpserver module The Qt archive contains .pri files with hardcoded absolute paths from local development machine (/Users/cagnulein/Qt/5.15.2/). When extracted on Xcode Cloud to /tmp/Qt-5.15.2/, qmake can't find httpserver and other modules because it looks in the original path. Solution: Create symlink from original path to Xcode Cloud path so qmake can find all modules including httpserver. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com> * Fix hardcoded paths in .pri files instead of using symlinks Replace sudo symlink approach (requires password) with direct path replacement in .pri files using sed. - Find all .pri files in Qt installation - Replace /Users/cagnulein/Qt/5.15.2 with /tmp/Qt-5.15.2 - Verify httpserver module .pri file is findable after fix This allows qmake to find httpserver and other modules without requiring elevated privileges. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com> * Fix Qt library relative paths in Xcode project The Xcode project contains relative paths to Qt libraries like: ../../Qt/5.15.2/ios/qml/Qt/labs/calendar/libqtlabscalendarplugin.a These relative paths don't resolve correctly on Xcode Cloud. Solution: After git restore, use sed to replace relative Qt paths with absolute paths pointing to /tmp/Qt-5.15.2/ios/ This fixes the "library 'qtlabscalendarplugin' not found" error. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com> * Add Qt/labs/calendar to library search paths The qtlabscalendarplugin library exists but wasn't in the linker's search paths, causing "library not found" error. Changes: - Add ls verification to confirm library file exists - Add /tmp/Qt-5.15.2/ios/qml/Qt/labs/calendar to LIBRARY_SEARCH_PATHS - Add debugging output to show calendar path references This ensures the linker can find libqtlabscalendarplugin.a during linking. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com> * Add all necessary Qt library search paths Instead of adding only calendar path, add ALL common Qt iOS library paths that might be missing from the committed Xcode project: - Qt/labs/* (calendar, platform) - QtCharts, QtWebView, QtPositioning, QtLocation, QtMultimedia - plugins/* (platforms, webview, texttospeech, geoservices, sqldrivers, mediaservice, playlistformats, audio) This should fix "library not found" errors for qios_debug and other Qt libraries that qmake expects to find in these directories. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com> * Replace debug Qt libraries with release versions The Qt package only contains release libraries, not debug versions. The Xcode project has some references to _debug libraries which causes the linker to look for debug versions of ALL Qt libraries, including qios_debug which doesn't exist. Solution: Use sed to replace all _debug library references with release versions: - lib*_debug.a -> lib*.a (file references) - -l*_debug -> -l* (linker flags) This fixes "library 'qios_debug' not found" and similar errors. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com> * Change all scheme configurations to Release Xcode Cloud was building in Debug mode, looking for debug Qt libraries (_debug suffix) which don't exist in the Qt package (only release libs). Changed all scheme actions to use Release configuration: - TestAction: Debug -> Release - LaunchAction: Debug -> Release - AnalyzeAction: Debug -> Release - ArchiveAction: already Release This ensures Xcode Cloud builds with release Qt libraries. qDebug output will still work in Release builds. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com> * Download and install missing qmldbg libraries The Qt package is missing libqmldbg_debugger.a and libqmldbg_nativedebugger.a which are needed for linking. Solution: Download the missing libraries from GitHub release and install them in /tmp/Qt-5.15.2/ios/plugins/qmltooling/ This fixes "Library 'qmldbg_debugger' not found" error. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com> * Fail build if qmldbg libraries are not found - Add exit 1 after error messages if files are not found - Show contents after zip extraction for debugging - Create target directory before moving files If the required libraries cannot be installed, the build must fail immediately rather than continuing without them. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com> * Download both qmldbg library files separately - Download libqmldbg_debugger.a.zip (new file with correct version) - Download libqmldbg_debugger.zip (has nativedebugger files) - Use _debug version of nativedebugger as fallback if release not found - Show all extracted files for debugging - Fail fast if required files are missing This ensures both libqmldbg_debugger.a and libqmldbg_nativedebugger.a are properly installed. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com> * Reorganize Xcode Cloud CI configuration to use dynamic project modifications This commit reorganizes the CI setup to keep project files clean and apply all modifications via CI scripts: Changes: 1. ci_post_clone.sh: Added secret.h generation from Xcode Cloud environment variables - Generates secret.h with STRAVA_SECRET_KEY, PELOTON_SECRET_KEY, SMTP credentials, etc. - Generates cesium-key.js if CESIUMKEY environment variable is provided - Matches the pattern used in GitHub workflows 2. ci_pre_xcodebuild.sh: Enhanced with comprehensive project file modifications - Added path fixes for local development paths -> Xcode Cloud paths - Added scheme modification from Debug to Release configuration - Preserved existing fixes: _debug suffix removal, library search paths, qmltyperegistrations 3. project.pbxproj and qdomyoszwift.xcscheme: Reverted to master branch versions - Project files now stay clean in the repository - All environment-specific modifications done dynamically in CI scripts 4. ci_post_xcodebuild.sh: Removed (no longer needed) Benefits: - Clean project files in repository (easier to maintain and review) - All CI-specific modifications isolated in CI scripts - Easier to debug and update CI configuration - Consistent with GitHub workflow patterns Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com> * Fix legacy build locations error by removing SYMROOT in CI script After reverting project.pbxproj to master, SYMROOT settings were restored causing: "Packages are not supported when using legacy build locations" Solution: Remove SYMROOT and OBJROOT lines dynamically in ci_pre_xcodebuild.sh instead of committing the change to project.pbxproj. This keeps project files clean while fixing the Swift package compatibility issue. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com> * Create workspace settings to disable legacy build locations The error "Packages are not supported when using legacy build locations" requires both: 1. Removing SYMROOT from project.pbxproj 2. Creating WorkspaceSettings.xcsettings and IDEWorkspaceChecks.plist These workspace files force Xcode to use the modern build system and disable legacy build locations, enabling Swift Package Manager support. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com> * Move legacy build locations fix to ci_post_clone.sh Xcode Cloud executes scripts in this order: 1. ci_post_clone.sh 2. xcodebuild -resolvePackageDependencies (was failing here) 3. ci_pre_xcodebuild.sh (never reached) The workspace settings and SYMROOT removal must happen in ci_post_clone.sh BEFORE Xcode Cloud tries to resolve package dependencies. This fixes: "Packages are not supported when using legacy build locations" Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com> * Fix absolute paths for resource files (Default-568h@2x.png) After reverting project.pbxproj to master, resource files like Default-568h@2x.png have absolute paths from local development machine: /Users/cagnulein/qdomyos-zwift/build-qdomyos-zwift-Qt_5_15_2_for_iOS-Debug/qdomyoszwift.xcodeproj/ These paths don't exist on Xcode Cloud. Convert them to relative paths: qdomyoszwift.xcodeproj/Default-568h@2x.png Added fix to both ci_post_clone.sh and ci_pre_xcodebuild.sh to ensure paths are correct throughout the build process. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com> * Fix resource file paths and sourceTree for LaunchScreen.storyboard Resource files have both absolute paths and sourceTree = "<absolute>" which prevents Xcode Cloud from finding them. Changed the fix to: 1. Convert absolute paths to relative (remove local machine prefix) 2. Change sourceTree from "<absolute>" to "<group>" This allows Xcode to find resource files relative to their group in the project structure. Fixes: Default-568h@2x.png, LaunchScreen.storyboard, and other resources Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com> * Fix sed syntax to keep quotes in resource file paths The sed was removing quotes from paths causing parse errors: path = Default-568h@2x.png (WRONG - causes parse error) Fixed to maintain quotes: path = "Default-568h@2x.png" (CORRECT) This prevents "project is damaged and cannot be opened" error. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com> * Use SOURCE_ROOT for resource file paths instead of <group> Changed sourceTree from <group> to SOURCE_ROOT with full relative path: - path = "build-qdomyos-zwift-Qt_5_15_2_for_iOS-Debug/qdomyoszwift.xcodeproj/Default-568h@2x.png" - sourceTree = SOURCE_ROOT On Xcode Cloud, SOURCE_ROOT = /Volumes/workspace/repository/, so files will be found at the correct location. Tested locally before committing to verify sed produces valid output. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com> * Fix all paths to match working version exactly Tested locally to ensure output matches the working version exactly. All key files verified: ✓ Default-568h@2x.png: MATCH ✓ LaunchScreen.storyboard: MATCH ✓ Qt5Core: MATCH ✓ virtualbike.cpp: MATCH Path fixes applied in correct order: 1. Qt paths: /Users/cagnulein/Qt/5.15.2/ios/ -> /tmp/Qt-5.15.2/ios/ 2. Source paths: /Users/cagnulein/qdomyos-zwift/src/ -> ../src/ 3. General: /Users/cagnulein/qdomyos-zwift/ -> /Volumes/workspace/repository/ 4. sourceTree fix: ../src/* files use <group> not <absolute> Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com> * Revert project files to updated master Previous revert used outdated master missing sportstechrower and filesearcher. Now reverting to updated master that includes all recent files. Tested locally - all files match working version: ✓ sportstechrower.cpp: MATCH ✓ filesearcher.cpp: MATCH ✓ Default-568h@2x.png: MATCH ✓ virtualbike.cpp: MATCH Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com> * Fix QZWidget extension version to match app version Changed MARKETING_VERSION from 1.0 to 2.20 for QZWidgetExtension to fix error: CFBundleShortVersionString Mismatch App version: 2.20 Widget version: 2.20 (was 1.0) Build number (1285) should be configured in Xcode Cloud dashboard. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com> * Use echo instead of heredoc for secret.h generation Changed from heredoc (cat << EOF) to echo statements to match GitHub workflow exactly. This should fix potential escaping issues with environment variables like PELOTON_SECRET_KEY. Now identical to GitHub workflow approach. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com> * Add permissions for Bash commands in settings --------- Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
34 lines
672 B
INI
34 lines
672 B
INI
TEMPLATE = subdirs
|
|
CONFIG+=ordered
|
|
|
|
!ios: !android: {
|
|
SUBDIRS = \
|
|
src/qdomyos-zwift-lib.pro \
|
|
src/qdomyos-zwift.pro \
|
|
tst/qdomyos-zwift-tests.pro
|
|
|
|
tst.depends = src/qdomyos-zwift-lib.pro
|
|
}
|
|
|
|
android: {
|
|
SUBDIRS = \
|
|
src/qdomyos-zwift.pro
|
|
}
|
|
|
|
ios: {
|
|
SUBDIRS = \
|
|
src/qdomyos-zwift-lib.pro \
|
|
src/qdomyos-zwift.pro
|
|
|
|
# Team signing configuration
|
|
QMAKE_IOS_DEPLOYMENT_TARGET = 12.0
|
|
QMAKE_DEVELOPMENT_TEAM = 6335M7T29D
|
|
QMAKE_CODE_SIGN_IDENTITY = "iPhone Developer"
|
|
QMAKE_CODE_SIGN_STYLE = Automatic
|
|
|
|
# Output directory configuration
|
|
DESTDIR = $$PWD/build-qdomyos-zwift-Qt_5_15_2_for_iOS-Debug
|
|
}
|
|
|
|
|