Skip to content

Commit

Permalink
feat: change screenshot image format from Jpeg to WebP (#273)
Browse files Browse the repository at this point in the history
* feat: add webp encoding wrapper

* fix: spm and podspec

* fix: make buildSdk

* chore: cleanup vendored files

* fix: remove uncalled vendored code

* fix: do not force unwrap

* fix: revert sample app local changes

* chore: refactored folder structure

* fix: add objc to PostHogSDK

* fix:

* fix: lint

* fix: builds

* fix: tests

* fix: typo

* fix: remove clamp to range

* fix: replace assertion with custom implementation

* fix: revert objective-c example by reworking umbrella header

* fix: tests

* fix: build

* feat: remove unused webp options

* fix: lint

* fix:

* fix: ci build attempt

* fix: test Wnon-modular-include-in-framework-module in CI

* chore: cleanup and silencing warnings

* fix: project file
  • Loading branch information
ioannisj authored Jan 8, 2025
1 parent 3f58707 commit 83ed3b4
Show file tree
Hide file tree
Showing 153 changed files with 47,431 additions and 158 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
## Next

- feat: change screenshot encoding format from JPEG to WebP ([#273](https://github.com/PostHog/posthog-ios/pull/273))

## 3.18.0 - 2024-12-27

- feat: add `postHogNoMask` SwiftUI view modifier to explicitly mark any View as non-maskable ([#277](https://github.com/PostHog/posthog-ios/pull/277))
Expand Down
26 changes: 13 additions & 13 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,25 @@ build: buildSdk buildExamples

buildSdk:
set -o pipefail && xcrun xcodebuild -downloadAllPlatforms
set -o pipefail && xcrun xcodebuild build -scheme PostHog -destination generic/platform=ios | xcpretty #ios
set -o pipefail && xcrun xcodebuild clean build -scheme PostHog -destination generic/platform=ios | xcpretty #ios
set -o pipefail && xcrun swift build --arch arm64 #macOS
set -o pipefail && xcrun xcodebuild build -scheme PostHog -destination generic/platform=macos | xcpretty #macOS
set -o pipefail && xcrun xcodebuild build -scheme PostHog -destination generic/platform=tvos | xcpretty #tvOS
set -o pipefail && xcrun xcodebuild build -scheme PostHog -destination generic/platform=watchos | xcpretty #watchOS
set -o pipefail && xcrun xcodebuild build -scheme PostHog -destination 'platform=visionOS Simulator,name=Apple Vision Pro' | xcpretty #visionOS
set -o pipefail && xcrun xcodebuild clean build -scheme PostHog -destination generic/platform=macos | xcpretty #macOS
set -o pipefail && xcrun xcodebuild clean build -scheme PostHog -destination generic/platform=tvos | xcpretty #tvOS
set -o pipefail && xcrun xcodebuild clean build -scheme PostHog -destination generic/platform=watchos | xcpretty #watchOS
set -o pipefail && xcrun xcodebuild clean build -scheme PostHog -destination 'platform=visionOS Simulator,name=Apple Vision Pro' | xcpretty #visionOS

buildExamples:
set -o pipefail && xcrun xcodebuild -downloadAllPlatforms
set -o pipefail && xcrun xcodebuild build -scheme PostHogExample -destination generic/platform=ios | xcpretty #ios
set -o pipefail && xcrun xcodebuild build -scheme PostHogExample -destination 'platform=visionOS Simulator,name=Apple Vision Pro' | xcpretty #visionOS
set -o pipefail && xcrun xcodebuild build -scheme PostHogObjCExample -destination generic/platform=ios | xcpretty #ObjC
set -o pipefail && xcrun xcodebuild build -scheme PostHogExampleMacOS -destination generic/platform=macos | xcpretty #macOS
set -o pipefail && xcrun xcodebuild build -scheme 'PostHogExampleWatchOS Watch App' -destination generic/platform=watchos | xcpretty #watchOS
set -o pipefail && xcrun xcodebuild build -scheme PostHogExampleTvOS -destination generic/platform=tvos | xcpretty #watchOS
set -o pipefail && xcrun xcodebuild clean build -scheme PostHogExample -destination generic/platform=ios | xcpretty #ios
set -o pipefail && xcrun xcodebuild clean build -scheme PostHogExample -destination 'platform=visionOS Simulator,name=Apple Vision Pro' | xcpretty #visionOS
set -o pipefail && xcrun xcodebuild clean build -scheme PostHogObjCExample -destination generic/platform=ios | xcpretty #ObjC
set -o pipefail && xcrun xcodebuild clean build -scheme PostHogExampleMacOS -destination generic/platform=macos | xcpretty #macOS
set -o pipefail && xcrun xcodebuild clean build -scheme 'PostHogExampleWatchOS Watch App' -destination generic/platform=watchos | xcpretty #watchOS
set -o pipefail && xcrun xcodebuild clean build -scheme PostHogExampleTvOS -destination generic/platform=tvos | xcpretty #watchOS
cd PostHogExampleWithPods && pod install
cd ..
set -o pipefail && xcrun xcodebuild build -workspace PostHogExampleWithPods/PostHogExampleWithPods.xcworkspace -scheme PostHogExampleWithPods -destination generic/platform=ios | xcpretty #CocoaPods
set -o pipefail && xcrun xcodebuild build -scheme PostHogExampleWithSPM -destination generic/platform=ios | xcpretty #SPM
set -o pipefail && xcrun xcodebuild clean build -workspace PostHogExampleWithPods/PostHogExampleWithPods.xcworkspace -scheme PostHogExampleWithPods -destination generic/platform=ios | xcpretty #CocoaPods
set -o pipefail && xcrun xcodebuild clean build -scheme PostHogExampleWithSPM -destination generic/platform=ios | xcpretty #SPM

format: swiftLint swiftFormat

Expand Down
14 changes: 13 additions & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,20 @@ let package = Package(
// Targets can depend on other targets in this package, and on products in packages this package depends on.
.target(
name: "PostHog",
dependencies: ["libwebp"],
path: "PostHog",
resources: [
.copy("Resources/PrivacyInfo.xcprivacy"),
]
),
.target(
name: "libwebp",
path: "vendor/libwebp",
sources: ["src", "include"],
cSettings: [
.headerSearchPath("include"),
]
),
.testTarget(
name: "PostHogTests",
dependencies: [
Expand All @@ -39,7 +48,10 @@ let package = Package(
"OHHTTPStubs",
.product(name: "OHHTTPStubsSwift", package: "OHHTTPStubs"),
],
path: "PostHogTests"
path: "PostHogTests",
resources: [
.process("Resources"),
]
),
]
)
3 changes: 2 additions & 1 deletion PostHog.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ Pod::Spec.new do |s|
s.frameworks = 'Foundation'

s.source_files = [
'PostHog/**/*.{swift,h,hpp,m,mm,c,cpp}'
'PostHog/**/*.{swift,h,hpp,m,mm,c,cpp}',
'vendor/libwebp/**/*.{h,c}'
]
s.resource_bundles = { "PostHog" => "PostHog/Resources/PrivacyInfo.xcprivacy" }
end
Loading

0 comments on commit 83ed3b4

Please sign in to comment.