Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -170,18 +170,18 @@ jobs:
platform: "iOS"
device: "iPhone 16 Pro"

- run: bazel build --config=ci-mac -- //ios/demo:PlayerUIDemo
- run: bazel build --config=ci-mac -- //apple/demo:PlayerUIDemo

- run:
name: Test Prebuild
command: |
bazel build \
--config=ci-mac \
$(bazel query "kind(ios_unit_test, //ios/...)") \
$(bazel query "kind(ios_unit_test, //apple/...)") \
$(bazel query "kind(ios_unit_test, //plugins/...)") \
$(bazel query "kind(ios_ui_test, //ios/...)") \
$(bazel query "kind(ios_ui_test, //apple/...)") \
$(bazel query "kind(ios_ui_test, //plugins/...)") \
$(bazel query "attr(name, '.*SwiftLint', //ios/...)") \
$(bazel query "attr(name, '.*SwiftLint', //apple/...)") \
$(bazel query "attr(name, '.*SwiftLint', //plugins/...)")
- run:
name: Tests
Expand All @@ -193,16 +193,16 @@ jobs:
--combined_report=lcov \
--test_output=all \
--test_timeout=1800 \
$(bazel query "kind(ios_unit_test, //ios/...)") \
$(bazel query "kind(ios_unit_test, //apple/...)") \
$(bazel query "kind(ios_unit_test, //plugins/...)") \
$(bazel query "kind(ios_ui_test, //ios/...)") \
$(bazel query "kind(ios_ui_test, //apple/...)") \
$(bazel query "kind(ios_ui_test, //plugins/...)")
- run:
name: Lint
command: |
bazel test \
--config=ci-mac \
$(bazel query "attr(name, '.*SwiftLint', //ios/...)") \
$(bazel query "attr(name, '.*SwiftLint', //apple/...)") \
$(bazel query "attr(name, '.*SwiftLint', //plugins/...)")

- run:
Expand Down Expand Up @@ -234,9 +234,9 @@ jobs:
- attach_workspace:
at: ~/player

- run: bazel build --config=ci -- $(bazel query 'kind(".*_test", //...) except filter("ios|swiftui", //...)') -//android/demo:android_instrumentation_test
- run: bazel build --config=ci -- $(bazel query 'kind(".*_test", //...) except filter("apple|ios", //...)') -//android/demo:android_instrumentation_test

- run: bazel test --config=ci -- $(bazel query 'kind(".*_test", //...) except filter("ios|swiftui", //...)') -//android/demo:android_instrumentation_test
- run: bazel test --config=ci -- $(bazel query 'kind(".*_test", //...) except filter("apple|ios", //...)') -//android/demo:android_instrumentation_test

- run:
when: always
Expand Down Expand Up @@ -300,7 +300,7 @@ jobs:
- v1-bazel-cache-core-main

- run: |
BUNDLE_TARGETS=$(bazel query "kind(.*_test, //...) except filter('android|ios|swiftui', //...)" --output label 2>/dev/null | tr '\n' ' ')
BUNDLE_TARGETS=$(bazel query "kind(.*_test, //...) except filter('android|apple|ios', //...)" --output label 2>/dev/null | tr '\n' ' ')
bazel coverage --combined_report=lcov --config=ci -- $BUNDLE_TARGETS

- run:
Expand Down
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,10 @@ xcui.json
#SPM
.build
.swiftpm
ios/PlayerUI.xcodeproj
apple/PlayerUI.xcodeproj

# Bundles used by cocoapods for development
ios/*/*/Resources/**/*.js
apple/*/*/Resources/**/*.js

# File used in CI to pass build number between iOS and release stage
.ios-build-number
Expand Down
84 changes: 42 additions & 42 deletions BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -108,88 +108,88 @@ assemble_pod(
]),
data = {
# Core
"//ios/core:PlayerUI_Sources": "ios/core/",
"//core/player:player_native_bundle": "ios/core/Resources/",
"//plugins/partial-match-fingerprint/core:core_native_bundle": "ios/core/Resources/",
"//core/partial-match-registry:partial-match-registry_native_bundle": "ios/core/Resources/",
"//apple/core:PlayerUI_Sources": "apple/core/",
"//core/player:player_native_bundle": "apple/core/Resources/",
"//plugins/partial-match-fingerprint/core:core_native_bundle": "apple/core/Resources/",
"//core/partial-match-registry:partial-match-registry_native_bundle": "apple/core/Resources/",

# SwiftUI
"//ios/swiftui:PlayerUISwiftUI_Sources": "ios/swiftui/",
"//apple/ios:PlayerUISwiftUI_Sources": "apple/ios/",

# Logger
"//ios/logger:PlayerUILogger_Sources": "ios/logger/",
"//apple/logger:PlayerUILogger_Sources": "apple/logger/",

# Test Utilities
"//ios/test-utils-core:PlayerUITestUtilitiesCore_Sources": "ios/test-utils-core/",
"//ios/test-utils:PlayerUITestUtilities_Sources": "ios/test-utils/",
"//core/make-flow:make-flow_native_bundle": "ios/test-utils-core/Resources/",
"//apple/test-utils-core:PlayerUITestUtilitiesCore_Sources": "apple/test-utils-core/",
"//apple/test-utils:PlayerUITestUtilities_Sources": "apple/test-utils/",
"//core/make-flow:make-flow_native_bundle": "apple/test-utils-core/Resources/",

# Plugins #

# Async Node
"//plugins/async-node/ios:PlayerUIAsyncNodePlugin_Sources": "plugins/async-node/ios/",
"//plugins/async-node/core:core_native_bundle": "plugins/async-node/ios/Resources/",
"//plugins/async-node/apple:PlayerUIAsyncNodePlugin_Sources": "plugins/async-node/apple/",
"//plugins/async-node/core:core_native_bundle": "plugins/async-node/apple/Resources/",

# Beacon
"//plugins/beacon/ios:PlayerUIBaseBeaconPlugin_Sources": "plugins/beacon/ios/",
"//plugins/beacon/swiftui:PlayerUIBeaconPlugin_Sources": "plugins/beacon/swiftui/",
"//plugins/beacon/core:core_native_bundle": "plugins/beacon/ios/Resources/",
"//plugins/beacon/apple:PlayerUIBaseBeaconPlugin_Sources": "plugins/beacon/apple/",
"//plugins/beacon/ios:PlayerUIBeaconPlugin_Sources": "plugins/beacon/ios/",
"//plugins/beacon/core:core_native_bundle": "plugins/beacon/apple/Resources/",

# Check Path
"//plugins/check-path/ios:PlayerUICheckPathPlugin_Sources": "plugins/check-path/ios/",
"//plugins/check-path/swiftui:PlayerUISwiftUICheckPathPlugin_Sources": "plugins/check-path/swiftui/",
"//plugins/check-path/core:core_native_bundle": "plugins/check-path/ios/Resources/",
"//plugins/check-path/apple:PlayerUICheckPathPlugin_Sources": "plugins/check-path/apple/",
"//plugins/check-path/ios:PlayerUISwiftUICheckPathPlugin_Sources": "plugins/check-path/ios/",
"//plugins/check-path/core:core_native_bundle": "plugins/check-path/apple/Resources/",

# Common Expressions
"//plugins/common-expressions/ios:PlayerUICommonExpressionsPlugin_Sources": "plugins/common-expressions/ios/",
"//plugins/common-expressions/core:core_native_bundle": "plugins/common-expressions/ios/Resources/",
"//plugins/common-expressions/apple:PlayerUICommonExpressionsPlugin_Sources": "plugins/common-expressions/apple/",
"//plugins/common-expressions/core:core_native_bundle": "plugins/common-expressions/apple/Resources/",

# Common Types
"//plugins/common-types/ios:PlayerUICommonTypesPlugin_Sources": "plugins/common-types/ios/",
"//plugins/common-types/core:core_native_bundle": "plugins/common-types/ios/Resources/",
"//plugins/common-types/apple:PlayerUICommonTypesPlugin_Sources": "plugins/common-types/apple/",
"//plugins/common-types/core:core_native_bundle": "plugins/common-types/apple/Resources/",

# Computed Properties
"//plugins/computed-properties/ios:PlayerUIComputedPropertiesPlugin_Sources": "plugins/computed-properties/ios/",
"//plugins/computed-properties/core:core_native_bundle": "plugins/computed-properties/ios/Resources/",
"//plugins/computed-properties/apple:PlayerUIComputedPropertiesPlugin_Sources": "plugins/computed-properties/apple/",
"//plugins/computed-properties/core:core_native_bundle": "plugins/computed-properties/apple/Resources/",

# Console Logger (PrintLoggerPlugin)
"//plugins/console-logger/ios:PlayerUIPrintLoggerPlugin_Sources": "plugins/console-logger/ios/",
"//plugins/console-logger/apple:PlayerUIPrintLoggerPlugin_Sources": "plugins/console-logger/apple/",

# Expression
"//plugins/expression/ios:PlayerUIExpressionPlugin_Sources": "plugins/expression/ios/",
"//plugins/expression/core:core_native_bundle": "plugins/expression/ios/Resources/",
"//plugins/expression/apple:PlayerUIExpressionPlugin_Sources": "plugins/expression/apple/",
"//plugins/expression/core:core_native_bundle": "plugins/expression/apple/Resources/",

# External Action
"//plugins/external-action/ios:PlayerUIExternalActionPlugin_Sources": "plugins/external-action/ios/",
"//plugins/external-action/swiftui:PlayerUIExternalActionViewModifierPlugin_Sources": "plugins/external-action/swiftui/",
"//plugins/external-action/core:core_native_bundle": "plugins/external-action/ios/Resources/",
"//plugins/external-action/apple:PlayerUIExternalActionPlugin_Sources": "plugins/external-action/apple/",
"//plugins/external-action/ios:PlayerUIExternalActionViewModifierPlugin_Sources": "plugins/external-action/ios/",
"//plugins/external-action/core:core_native_bundle": "plugins/external-action/apple/Resources/",

# Metrics
"//plugins/metrics/swiftui:PlayerUIMetricsPlugin_Sources": "plugins/metrics/swiftui/",
"//plugins/metrics/core:core_native_bundle": "plugins/metrics/swiftui/Resources/",
"//plugins/metrics/ios:PlayerUIMetricsPlugin_Sources": "plugins/metrics/ios/",
"//plugins/metrics/core:core_native_bundle": "plugins/metrics/ios/Resources/",

# Pending Transaction
"//plugins/pending-transaction/swiftui:PlayerUISwiftUIPendingTransactionPlugin_Sources": "plugins/pending-transaction/swiftui/",
"//plugins/pending-transaction/ios:PlayerUISwiftUIPendingTransactionPlugin_Sources": "plugins/pending-transaction/ios/",

# PubSub
"//plugins/pubsub/ios:PlayerUIPubSubPlugin_Sources": "plugins/pubsub/ios/",
"//plugins/pubsub/core:core_native_bundle": "plugins/pubsub/ios/Resources/",
"//plugins/pubsub/apple:PlayerUIPubSubPlugin_Sources": "plugins/pubsub/apple/",
"//plugins/pubsub/core:core_native_bundle": "plugins/pubsub/apple/Resources/",

# Reference Assets
"//plugins/reference-assets/swiftui:PlayerUIReferenceAssets_Sources": "plugins/reference-assets/swiftui/",
"//plugins/reference-assets/swiftui/Resources:PlayerUIReferenceAssets_Resources": "plugins/reference-assets/swiftui/Resources/",
"//plugins/reference-assets/core:core_native_bundle": "plugins/reference-assets/swiftui/Resources/js/",
"//plugins/reference-assets/ios:PlayerUIReferenceAssets_Sources": "plugins/reference-assets/ios/",
"//plugins/reference-assets/ios/Resources:PlayerUIReferenceAssets_Resources": "plugins/reference-assets/ios/Resources/",
"//plugins/reference-assets/core:core_native_bundle": "plugins/reference-assets/ios/Resources/js/",

# Stage Revert Data
"//plugins/stage-revert-data/ios:PlayerUIStageRevertDataPlugin_Sources": "plugins/stage-revert-data/ios/",
"//plugins/stage-revert-data/core:core_native_bundle": "plugins/stage-revert-data/ios/Resources/",
"//plugins/stage-revert-data/apple:PlayerUIStageRevertDataPlugin_Sources": "plugins/stage-revert-data/apple/",
"//plugins/stage-revert-data/core:core_native_bundle": "plugins/stage-revert-data/apple/Resources/",

# Transition
"//plugins/transition/swiftui:PlayerUITransitionPlugin_Sources": "plugins/transition/swiftui",
"//plugins/transition/ios:PlayerUITransitionPlugin_Sources": "plugins/transition/ios",

# Types Provider
"//plugins/types-provider/ios:PlayerUITypesProviderPlugin_Sources": "plugins/types-provider/ios/",
"//plugins/types-provider/core:core_native_bundle": "plugins/types-provider/ios/Resources/",
"//plugins/types-provider/apple:PlayerUITypesProviderPlugin_Sources": "plugins/types-provider/apple/",
"//plugins/types-provider/core:core_native_bundle": "plugins/types-provider/apple/Resources/",
},
podspec = ":PlayerUI_Podspec",
)
Expand Down
18 changes: 15 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -161,16 +161,28 @@ iOS Development requires a bit more set-up.

### To Run

1. Generate the core files that the Apple platforms depend on.

Without `just`:
```bash
bazel build -- $(bazel query "attr(name, 'native_bundle', //...)" --output label 2>/dev/null | tr '\n' ' ')
```

With `just`:
```bash
just build-core-native
```

1. Generate the `.xcodeproj` to open and work in Xcode.

```bash
bazel run //ios:xcodeproj
bazel run //apple:xcodeproj
```

1. Open the `.xcodeproj`. If Xcode is your default app for xcodeprojs, you can use this:

```bash
open ios/PlayerUI.xcodeproj/
open apple/PlayerUI.xcodeproj/
```

> [!IMPORTANT]
Expand All @@ -186,7 +198,7 @@ iOS Development requires a bit more set-up.
The demo app can also be built and launched in a simulator from the command line with bazel:

```bash
bazel run //ios/demo:PlayerUIDemo
bazel run //apple/demo:PlayerUIDemo
```

## Submitting a Pull Request
Expand Down
16 changes: 8 additions & 8 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ let package = Package(
.product(name: "SwiftHooks", package: "swift-hooks"),
.target(name: "PlayerUILogger")
],
path: "ios/core",
path: "apple/core",
resources: [
.process("Resources")
]
Expand All @@ -81,14 +81,14 @@ let package = Package(
.product(name: "SwiftHooks", package: "swift-hooks"),
.target(name: "PlayerUI")
],
path: "ios/swiftui"
path: "apple/ios"
),
.target(
name: "PlayerUILogger",
dependencies: [
.product(name: "SwiftHooks", package: "swift-hooks"),
],
path: "ios/logger"
path: "apple/logger"
),
.target(
name: "PlayerUIReferenceAssets",
Expand All @@ -98,7 +98,7 @@ let package = Package(
.target(name: "PlayerUIBeaconPlugin"),
.target(name: "PlayerUISwiftUIPendingTransactionPlugin")
],
path: "plugins/reference-assets/swiftui",
path: "plugins/reference-assets/ios",
resources: [
.process("Resources")
]
Expand All @@ -109,7 +109,7 @@ let package = Package(
.target(name: "PlayerUI"),
.target(name: "PlayerUISwiftUI")
],
path: "ios/test-utils-core",
path: "apple/test-utils-core",
resources: [
.process("Resources")
]
Expand All @@ -120,7 +120,7 @@ let package = Package(
.target(name: "PlayerUI"),
.target(name: "PlayerUITestUtilitiesCore")
],
path: "ios/test-utils",
path: "apple/test-utils",
linkerSettings: [.linkedFramework("XCTest")]
)
] + plugins.map(\.0)
Expand All @@ -143,7 +143,7 @@ extension Target {
dependencies: [
.target(name: "PlayerUI")
],
path: "plugins/\(plugin.path)/ios",
path: "plugins/\(plugin.path)/apple",
resources: resources
)
}
Expand All @@ -156,7 +156,7 @@ extension Target {
.target(name: "PlayerUI"),
.target(name: "PlayerUISwiftUI")
] + plugin.dependencies.map { Dependency.target(name: "PlayerUI\($0)") },
path: "plugins/\(plugin.path)/swiftui",
path: "plugins/\(plugin.path)/ios",
resources: resources
)
}
Expand Down
Loading