Skip to content

Commit

Permalink
fix: react native expo failing builds (#281)
Browse files Browse the repository at this point in the history
* fix: react native expo failing builds

* chore: update CHANGELOG

* fix: makefile
  • Loading branch information
ioannisj authored Jan 13, 2025
1 parent 3b9f16a commit 423170f
Show file tree
Hide file tree
Showing 137 changed files with 946 additions and 962 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
## Next

- fix: RN Expo builds failing ([#281](https://github.com/PostHog/posthog-ios/pull/281))

## 3.19.0 - 2025-01-08

- feat: ability to manually start and stop session recordings ([#276](https://github.com/PostHog/posthog-ios/pull/276))
Expand Down
31 changes: 28 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,36 @@ buildExamples:
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 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

## Build with dynamic framework
cd PostHogExampleWithPods && \
pod install && \
cd .. && \
xcrun xcodebuild clean build \
-workspace PostHogExampleWithPods/PostHogExampleWithPods.xcworkspace \
-scheme PostHogExampleWithPods \
-destination generic/platform=ios | xcpretty

## Build with static library
cd PostHogExampleWithPods && \
cp Podfile{,.backup} && \
cp Podfile.static Podfile && \
cp PostHogExampleWithPods.xcodeproj/project.pbxproj{,.backup} && \
pod install && \
cd .. && \
xcrun xcodebuild clean build \
-workspace PostHogExampleWithPods/PostHogExampleWithPods.xcworkspace \
-scheme PostHogExampleWithPods \
-destination generic/platform=ios | xcpretty

## Restore original files
cd PostHogExampleWithPods && \
mv Podfile{.backup,} && \
pod install && \
mv PostHogExampleWithPods.xcodeproj/project.pbxproj{.backup,}


format: swiftLint swiftFormat

swiftLint:
Expand Down
12 changes: 8 additions & 4 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ let package = Package(
name: "PostHog",
targets: ["PostHog"]
),
.library(
name: "phlibwebp",
targets: ["phlibwebp"]
),
],
dependencies: [
// Dependencies declare other packages that this package depends on.
Expand All @@ -25,18 +29,18 @@ 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"],
dependencies: ["phlibwebp"],
path: "PostHog",
resources: [
.copy("Resources/PrivacyInfo.xcprivacy"),
]
),
.target(
name: "libwebp",
name: "phlibwebp",
path: "vendor/libwebp",
sources: ["src", "include"],
publicHeadersPath: ".",
cSettings: [
.headerSearchPath("include"),
.headerSearchPath("."),
]
),
.testTarget(
Expand Down
1,144 changes: 546 additions & 598 deletions PostHog.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions PostHog/Utils/UIImage+WebP.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
import Accelerate
import CoreGraphics
import Foundation
#if canImport(libwebp)
#if canImport(phlibwebp)
// SPM package is linked via a lib since mix-code is not yet supported
import libwebp
import phlibwebp
#endif
import UIKit

Expand Down
5 changes: 5 additions & 0 deletions PostHogExampleWithPods/Podfile.static
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
platform :ios, '16.0'

target 'PostHogExampleWithPods' do
pod 'PostHog', :path => '../'
end
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@
#include <stdlib.h>
#include <string.h>

#include "vp8i_enc.h"
#include "dsp.h"
#include "filters_utils.h"
#include "quant_levels_utils.h"
#include "utils.h"
#include "encode.h"
#include "format_constants.h"
#include "./vp8i_enc.h"
#include "./dsp.h"
#include "./filters_utils.h"
#include "./quant_levels_utils.h"
#include "./utils.h"
#include "./encode.h"
#include "./format_constants.h"

// -----------------------------------------------------------------------------
// Encodes the given alpha data via specified compression method 'method'.
Expand All @@ -45,7 +45,7 @@
// invalid quality or method, or
// memory allocation for the compressed data fails.

#include "vp8li_enc.h"
#include "./vp8li_enc.h"

static int EncodeLossless(const uint8_t* const data, int width, int height,
int effort_level, // in [0..6] range
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
//
// Author: Skal ([email protected])

#include "utils.h"
#include "dsp.h"
#include "./utils.h"
#include "./dsp.h"

// Tables can be faster on some platform but incur some extra binary size (~2k).
#if !defined(USE_TABLES_FOR_ALPHA_MULT)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@
//
// Author: Skal ([email protected])

#include "dsp.h"
#include "./dsp.h"

#if defined(WEBP_USE_NEON)

#include "neon.h"
#include "./neon.h"

//------------------------------------------------------------------------------

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
//
// Author: Skal ([email protected])

#include "dsp.h"
#include "./dsp.h"

#if defined(WEBP_USE_SSE2)
#include <emmintrin.h>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
//
// Author: Skal ([email protected])

#include "dsp.h"
#include "./dsp.h"

#if defined(WEBP_USE_SSE41)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
#include <stdlib.h>
#include <string.h>

#include "vp8i_enc.h"
#include "cost_enc.h"
#include "utils.h"
#include "./vp8i_enc.h"
#include "./cost_enc.h"
#include "./utils.h"

#define MAX_ITERS_K_MEANS 6

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@

#include <string.h>

#include "lossless_common.h"
#include "backward_references_enc.h"
#include "histogram_enc.h"
#include "color_cache_utils.h"
#include "utils.h"
#include "./lossless_common.h"
#include "./backward_references_enc.h"
#include "./histogram_enc.h"
#include "./color_cache_utils.h"
#include "./utils.h"

#define VALUES_IN_BYTE 256

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,16 @@
// Author: Jyrki Alakuijala ([email protected])
//

#include "backward_references_enc.h"

#include "dsp.h"
#include "lossless.h"
#include "lossless_common.h"
#include "histogram_enc.h"
#include "vp8i_enc.h"
#include "color_cache_utils.h"
#include "utils.h"
#include "encode.h"
#include "./backward_references_enc.h"

#include "./dsp.h"
#include "./lossless.h"
#include "./lossless_common.h"
#include "./histogram_enc.h"
#include "./vp8i_enc.h"
#include "./color_cache_utils.h"
#include "./utils.h"
#include "./encode.h"

#define MIN_BLOCK_SIZE 256 // minimum block size for backward references

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@
#define WEBP_ENC_BACKWARD_REFERENCES_ENC_H_

#include <stdlib.h>
#include "types.h"
#include "utils.h"
#include "encode.h"
#include "format_constants.h"
#include "./types.h"
#include "./utils.h"
#include "./encode.h"
#include "./format_constants.h"

#ifdef __cplusplus
extern "C" {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@
// Author: Skal ([email protected])

#ifdef HAVE_CONFIG_H
#include "config.h"
#include "./config.h"
#endif

#include "cpu.h"
#include "utils.h"
#include "./cpu.h"
#include "./utils.h"

//------------------------------------------------------------------------------
// VP8BitReader
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@
#ifndef WEBP_UTILS_BIT_READER_UTILS_H_
#define WEBP_UTILS_BIT_READER_UTILS_H_

#include "utils.h"
#include "./utils.h"
#ifdef _MSC_VER
#include <stdlib.h> // _byteswap_ulong
#endif
#include "cpu.h"
#include "types.h"
#include "./cpu.h"
#include "./types.h"

// Warning! This macro triggers quite some MACRO wizardry around func signature!
#if !defined(BITTRACE)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
#include <string.h> // for memcpy()
#include <stdlib.h>

#include "bit_writer_utils.h"
#include "endian_inl_utils.h"
#include "utils.h"
#include "./bit_writer_utils.h"
#include "./endian_inl_utils.h"
#include "./utils.h"

//------------------------------------------------------------------------------
// VP8BitWriter
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#ifndef WEBP_UTILS_BIT_WRITER_UTILS_H_
#define WEBP_UTILS_BIT_WRITER_UTILS_H_

#include "types.h"
#include "./types.h"

#ifdef __cplusplus
extern "C" {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@

#include <stdlib.h>
#include <string.h>
#include "color_cache_utils.h"
#include "utils.h"
#include "./color_cache_utils.h"
#include "./utils.h"

//------------------------------------------------------------------------------
// VP8LColorCache.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@
#ifndef WEBP_UTILS_COLOR_CACHE_UTILS_H_
#define WEBP_UTILS_COLOR_CACHE_UTILS_H_

#include "utils.h"
#include "dsp.h"
#include "types.h"
#include "./utils.h"
#include "./dsp.h"
#include "./types.h"

#ifdef __cplusplus
extern "C" {
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@
// Author: Skal ([email protected])

#ifdef HAVE_CONFIG_H
#include "config.h"
#include "./config.h"
#endif

#include "encode.h"
#include "./encode.h"

//------------------------------------------------------------------------------
// WebPConfig
Expand Down
4 changes: 2 additions & 2 deletions vendor/libwebp/src/dsp/cost.c → vendor/libwebp/cost.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
//
// Author: Skal ([email protected])

#include "dsp.h"
#include "cost_enc.h"
#include "./dsp.h"
#include "./cost_enc.h"

//------------------------------------------------------------------------------
// Boolean-cost cost table
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
//
// Author: Skal ([email protected])

#include "cost_enc.h"
#include "./cost_enc.h"

//------------------------------------------------------------------------------
// Level cost tables
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
#define WEBP_ENC_COST_ENC_H_

#include <stdlib.h>
#include "vp8i_enc.h"
#include "./vp8i_enc.h"

#ifdef __cplusplus
extern "C" {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@
//
// ARM NEON version of cost functions

#include "dsp.h"
#include "./dsp.h"

#if defined(WEBP_USE_NEON)

#include "neon.h"
#include "cost_enc.h"
#include "./neon.h"
#include "./cost_enc.h"

static const uint8_t position[16] = { 1, 2, 3, 4, 5, 6, 7, 8,
9, 10, 11, 12, 13, 14, 15, 16 };
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@
//
// Author: Skal ([email protected])

#include "dsp.h"
#include "./dsp.h"

#if defined(WEBP_USE_SSE2)
#include <emmintrin.h>

#include "cost_enc.h"
#include "vp8i_enc.h"
#include "utils.h"
#include "./cost_enc.h"
#include "./vp8i_enc.h"
#include "./utils.h"

//------------------------------------------------------------------------------

Expand Down
Loading

0 comments on commit 423170f

Please sign in to comment.