| 1 | name: TwidgetDemoMac |
| 2 | options: |
| 3 | bundleIdPrefix: org.telegram.widgetsandbox |
| 4 | deploymentTarget: |
| 5 | macOS: "13.0" |
| 6 | xcodeVersion: "26.0" |
| 7 | packages: |
| 8 | WidgetSandbox: |
| 9 | path: ../../.. # the repo root holds Package.swift (packages/ios) |
| 10 | targets: |
| 11 | TwidgetDemoMac: |
| 12 | type: application |
| 13 | platform: macOS |
| 14 | # The SwiftUI sources and the corpus are the iOS demo's; the few platform |
| 15 | # differences are `#if os(macOS)` branches in DemoPlatform.swift. |
| 16 | sources: |
| 17 | - path: ../../ios/DemoApp/Sources |
| 18 | - path: ../../ios/DemoApp/Corpus |
| 19 | type: folder |
| 20 | buildPhase: resources |
| 21 | preBuildScripts: |
| 22 | - name: Build the Blitz renderer (cargo; TW_NATIVE_RENDERERS=YES only) |
| 23 | script: "[ \"$TW_NATIVE_RENDERERS\" = YES ] || exit 0; \"$SRCROOT/../../renderer-blitz/build-apple.sh\"" |
| 24 | basedOnDependencyAnalysis: false |
| 25 | - name: Build the litehtml renderer (cmake; TW_NATIVE_RENDERERS=YES only) |
| 26 | script: "[ \"$TW_NATIVE_RENDERERS\" = YES ] || exit 0; \"$SRCROOT/../../renderer-litehtml/build-apple.sh\"" |
| 27 | basedOnDependencyAnalysis: false |
| 28 | dependencies: |
| 29 | - package: WidgetSandbox |
| 30 | info: |
| 31 | path: Info.plist |
| 32 | properties: |
| 33 | NSAppTransportSecurity: |
| 34 | NSAllowsLocalNetworking: true |
| 35 | LSMinimumSystemVersion: "$(MACOSX_DEPLOYMENT_TARGET)" |
| 36 | NSPrincipalClass: NSApplication |
| 37 | LSApplicationCategoryType: public.app-category.developer-tools |
| 38 | settings: |
| 39 | base: |
| 40 | SWIFT_VERSION: "5.0" |
| 41 | # Native renderer prototypes (dev tooling, frozen since 2026-10-30: docs/decisions.md, |
| 42 | # "The renderer prototypes are frozen"): the Rust static library from renderer-blitz/ |
| 43 | # and the C++ one from renderer-litehtml/, built by the pre-build script phases, linked |
| 44 | # and compiled in (Swift condition TW_NATIVE_RENDERERS) only when the build passes |
| 45 | # TW_NATIVE_RENDERERS=YES, e.g. on the xcodebuild command line. |
| 46 | TW_NATIVE_RENDERERS: NO |
| 47 | TW_NATIVE_RENDERER_CONDITION_YES: TW_NATIVE_RENDERERS |
| 48 | TW_NATIVE_RENDERER_LDFLAGS_YES: ["-ltwidget_blitz", "-ltwidget_litehtml", "-lc++", "-framework", "CoreText", "-framework", "CoreGraphics", "-framework", "ImageIO", "-liconv"] |
| 49 | SWIFT_ACTIVE_COMPILATION_CONDITIONS: ["$(inherited)", "$(TW_NATIVE_RENDERER_CONDITION_$(TW_NATIVE_RENDERERS))"] |
| 50 | SWIFT_OBJC_BRIDGING_HEADER: ../../ios/DemoApp/BridgingHeader.h |
| 51 | LIBRARY_SEARCH_PATHS: ["$(inherited)", "$(SRCROOT)/../../renderer-blitz/target/apple/$(PLATFORM_NAME)", "$(SRCROOT)/../../renderer-litehtml/target/apple/$(PLATFORM_NAME)"] |
| 52 | OTHER_LDFLAGS: ["$(inherited)", "$(TW_NATIVE_RENDERER_LDFLAGS_$(TW_NATIVE_RENDERERS))"] |
| 53 | PRODUCT_BUNDLE_IDENTIFIER: org.telegram.widgetsandbox.TwidgetDemoMac |
| 54 | # Dev tool, never distributed: ad-hoc signature, no team, no sandbox |
| 55 | # (the attack runner must reach the canary on 127.0.0.1:9999 itself). |
| 56 | CODE_SIGN_STYLE: Manual |
| 57 | CODE_SIGN_IDENTITY: "-" |
| 58 | DEVELOPMENT_TEAM: "" |
| 59 | ENABLE_HARDENED_RUNTIME: NO |
| 60 | ENABLE_APP_SANDBOX: NO |
| 61 | COMBINE_HIDPI_IMAGES: YES |
| 62 | |