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

Add support for Vision Pro Simulator #7

Merged
merged 4 commits into from
Dec 19, 2023
Merged
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
10 changes: 6 additions & 4 deletions Example/SwiftHotReloadExample.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -322,10 +322,11 @@
PRODUCT_BUNDLE_IDENTIFIER = jp.banjun.SwiftHotReloadExample;
PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = auto;
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator macosx";
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator macosx xros xrsimulator";
SUPPORTS_MACCATALYST = NO;
SWIFT_EMIT_LOC_STRINGS = YES;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
TARGETED_DEVICE_FAMILY = "1,2,7";
};
name = Debug;
};
Expand Down Expand Up @@ -362,10 +363,11 @@
PRODUCT_BUNDLE_IDENTIFIER = jp.banjun.SwiftHotReloadExample;
PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = auto;
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator macosx";
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator macosx xros xrsimulator";
SUPPORTS_MACCATALYST = NO;
SWIFT_EMIT_LOC_STRINGS = YES;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
TARGETED_DEVICE_FAMILY = "1,2,7";
};
name = Release;
};
Expand Down
10 changes: 6 additions & 4 deletions FrameworkTarget/SwiftHotReload.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -371,11 +371,12 @@
PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
SDKROOT = auto;
SKIP_INSTALL = YES;
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator macosx";
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator macosx xros xrsimulator";
SUPPORTS_MACCATALYST = NO;
SWIFT_EMIT_LOC_STRINGS = YES;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
TARGETED_DEVICE_FAMILY = "1,2,7";
};
name = Debug;
};
Expand Down Expand Up @@ -410,10 +411,11 @@
PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
SDKROOT = auto;
SKIP_INSTALL = YES;
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator macosx";
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator macosx xros xrsimulator";
SUPPORTS_MACCATALYST = NO;
SWIFT_EMIT_LOC_STRINGS = YES;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
TARGETED_DEVICE_FAMILY = "1,2,7";
};
name = Release;
};
Expand Down
2 changes: 1 addition & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import PackageDescription

let package = Package(
name: "SwiftHotReload",
platforms: [.iOS(.v14), .macOS(.v13)],
platforms: [.iOS(.v14), .macOS(.v13), .visionOS(.v1)],
products: [
.library(name: "SwiftHotReload", targets: ["SwiftHotReload"]),
],
Expand Down
10 changes: 7 additions & 3 deletions Sources/Core/Env.swift
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,13 @@ public struct Env: Codable, Equatable {
/// arm64-apple-ios14.0-simulator
/// arm64-apple-macos13.0
public var estimatedTargetTriple: String? {
guard let os = (DTPlatformName?.contains("iphone") == true ? "ios"
: DTPlatformName?.contains("macosx") == true ? "macos"
: nil) else { return nil }
#if os(iOS)
let os = "ios"
#elseif os(macOS)
let os = "macos"
#elseif os(visionOS)
let os = "xros"
#endif
let isSimulator = DTPlatformName?.contains("simulator") == true
return [estimatedArch, "apple", os + estimatedDeploymentOSVersion!, isSimulator ? "simulator" : nil]
.compactMap { $0 }.joined(separator: "-")
Expand Down
2 changes: 1 addition & 1 deletion SwiftHotReload.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Pod::Spec.new do |spec|
spec.osx.deployment_target = "11.0"
# spec.watchos.deployment_target = "2.0"
# spec.tvos.deployment_target = "9.0"
# spec.visionos.deployment_target = "1.0"
spec.visionos.deployment_target = "1.0"
spec.source = { :git => "https://github.com/banjun/SwiftHotReload.git", :tag => "#{spec.version}" }
spec.source_files = "Sources/**/*.swift"
spec.swift_version = "5.1"
Expand Down