Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add visionOS Support #9

Merged
merged 16 commits into from
Nov 19, 2024
3 changes: 3 additions & 0 deletions AnalyticsConnector.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ Pod::Spec.new do |spec|
spec.watchos.deployment_target = '3.0'
spec.watchos.source_files = 'sources/AnalyticsConnector/**/*.{h,swift}'

spec.visionos.deployment_target = '1.0'
spec.visionos.source_files = 'sources/AnalyticsConnector/**/*.{h,swift}'

spec.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES' }

end
8 changes: 4 additions & 4 deletions AnalyticsConnector.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -270,12 +270,12 @@
PRODUCT_BUNDLE_IDENTIFIER = com.amplitude.AnalyticsConnector;
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
SUPPORTED_PLATFORMS = "appletvos appletvsimulator iphoneos iphonesimulator macosx watchos watchsimulator";
SUPPORTED_PLATFORMS = "appletvos appletvsimulator iphoneos iphonesimulator macosx watchos watchsimulator xros xrsimulator";
SUPPORTS_MACCATALYST = YES;
SWIFT_INSTALL_OBJC_HEADER = YES;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2,3,4,6";
TARGETED_DEVICE_FAMILY = "1,2,3,4,6,7";
TVOS_DEPLOYMENT_TARGET = 9.0;
WATCHOS_DEPLOYMENT_TARGET = 3.0;
};
Expand Down Expand Up @@ -304,11 +304,11 @@
PRODUCT_BUNDLE_IDENTIFIER = com.amplitude.AnalyticsConnector;
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
SUPPORTED_PLATFORMS = "appletvos appletvsimulator iphoneos iphonesimulator macosx watchos watchsimulator";
SUPPORTED_PLATFORMS = "appletvos appletvsimulator iphoneos iphonesimulator macosx watchos watchsimulator xros xrsimulator";
SUPPORTS_MACCATALYST = YES;
SWIFT_INSTALL_OBJC_HEADER = YES;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2,3,4,6";
TARGETED_DEVICE_FAMILY = "1,2,3,4,6,7";
TVOS_DEPLOYMENT_TARGET = 9.0;
WATCHOS_DEPLOYMENT_TARGET = 3.0;
};
Expand Down
44 changes: 44 additions & 0 deletions [email protected]
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
// swift-tools-version:5.9
// The swift-tools-version declares the minimum version of Swift required to build this package.

import PackageDescription

let package = Package(
name: "analytics-connector-ios",
platforms: [
.iOS(.v10),
.macOS(.v10_13),
.tvOS(.v9),
.watchOS(.v3),
.visionOS(.v1),
],
products: [
// Products define the executables and libraries a package produces, and make them visible to other packages.
.library(
name: "AnalyticsConnector",
targets: ["AnalyticsConnector"]
),
.library(
name: "AnalyticsConnectorFramework",
targets: ["AnalyticsConnectorFramework"]
)
],
dependencies: [
// Dependencies declare other packages that this package depends on.
],
targets: [
// Targets are the basic building blocks of a package. A target can define a module or a test suite.
.target(
name: "AnalyticsConnector",
path: "Sources/AnalyticsConnector",
exclude: ["Info.plist"]),
.binaryTarget(name: "AnalyticsConnectorFramework",
url: "https://github.com/amplitude/analytics-connector-ios/releases/download/v1.2.4/AnalyticsConnector.xcframework.zip",
checksum: "605073ac7b478d9bd5fad41505377f50f3d10250771435dd2f04003bcaf9c820"),
sojingle marked this conversation as resolved.
Show resolved Hide resolved
.testTarget(
name: "AnalyticsConnectorTests",
dependencies: ["AnalyticsConnector"],
path: "Tests/AnalyticsConnectorTests",
exclude: ["Info.plist"]),
]
)
2 changes: 1 addition & 1 deletion scripts/build_framework.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ SCHEME="AnalyticsConnector"
FRAMEWORK="AnalyticsConnector"
BUILD_DIR="./.build/artifacts"
OUTPUT_PATH="$BUILD_DIR/$FRAMEWORK.xcframework"
PLATFORMS=("iOS" "iOS Simulator" "macOS" "macOS Cataylst" "watchOS" "watchOS Simulator" "tvOS" "tvOS Simulator")
PLATFORMS=("iOS" "iOS Simulator" "macOS" "macOS Cataylst" "watchOS" "watchOS Simulator" "tvOS" "tvOS Simulator" "visionOS" "visionOS Simulator")

build_framework_with_configuration_and_name() {
CONFIGURATION=${1}
Expand Down
Loading