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 visionOS support #245

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
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
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ An Xcode replacement-ish *development environment* that aims to be your reliable

## 👁 Overview

[XBase] enables you to build, watch, and run xcode products as well as swift packages from within your favorite editor. It supports running products on iOS, watchOS and tvOS simulators, along with real-time logging, and some lsp features such as auto-completion and code navigation. ([🌟 Features](#-features)).
[XBase] enables you to build, watch, and run xcode products as well as swift packages from within your favorite editor. It supports running products on iOS, watchOS, tvOS, and visionOS simulators, along with real-time logging, and some lsp features such as auto-completion and code navigation. ([🌟 Features](#-features)).

Furthermore, [XBase] has built-in support for a variety of Xcode project generators, which allow you to avoid launching Xcode or manually editing '*.xcodeproj' anytime you add or remove files. We strongly advise you to use one ... at least till [XBase] supports adding/removing files and folders, along with other requirements. ([💆 Generators](#-generators))

Expand Down Expand Up @@ -215,6 +215,7 @@ require("xbase.statusline").feline() -- append to feline setup function
},
watchOS = {}, -- all available devices
tvOS = {}, -- all available devices
visionOS = {} -- all available devices
},
--- Log buffer configurations
log_buffer = {
Expand Down
1 change: 1 addition & 0 deletions lua/xbase/config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ local defaults = {
},
watchOS = {}, -- all available devices
tvOS = {}, -- all available devices
xrOS = {} -- all available devices
},
--- Log buffer configurations
log_buffer = {
Expand Down
4 changes: 3 additions & 1 deletion src/runner/device.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,14 @@ impl From<simctl::Device> for Device {

impl Device {
/// Get special build arguments to run on current device.
// -sdk driverkit -sdk iphoneos -sdk macosx -sdk appletvos -sdk watchos
// -sdk driverkit -sdk iphoneos -sdk macosx -sdk appletvos -sdk watchos -sdk xros
pub fn special_build_args(&self) -> Vec<String> {
match self.platform {
PBXTargetPlatform::IOS => vec!["-sdk".into(), "iphonesimulator".into()],
PBXTargetPlatform::WatchOS => vec!["-sdk".into(), "watchsimulator".into()],
PBXTargetPlatform::TvOS => vec!["-sdk".into(), "appletvsimulator".into()],
PBXTargetPlatform::MacOS => vec!["-sdk".into(), "macosx".into()],
PBXTargetPlatform::XrOS => vec!["-sdk".into(), "xrsimulator".into()],
PBXTargetPlatform::Unknown => vec![],
}
}
Expand All @@ -74,6 +75,7 @@ impl Default for Runners {
PBXTargetPlatform::IOS,
PBXTargetPlatform::WatchOS,
PBXTargetPlatform::TvOS,
PBXTargetPlatform::XrOS,
]
.into_iter()
.map(|p| {
Expand Down
6 changes: 6 additions & 0 deletions vscode/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,12 @@
"default": [],
"type": "list",
"order": 3
},
"xbase.simctl.xrOS": {
"markdownDescription": "visionOS simulators to include. run `xcrun simctl list` to get a full list of available simulators. If the list is empty then all available simulators will be included",
"default": [],
"type": "list",
"order": 3
}
}
}
Expand Down
2 changes: 2 additions & 0 deletions vscode/xbase/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,8 @@ function getPickerItems(
case "watchOS":
platformDevices = devices.watchOS;
break;
case "xrOS":
platformDevices = devices.xrOS;
default:
platformDevices = devices.tvOS;
break;
Expand Down
5 changes: 3 additions & 2 deletions vscode/xbase/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,12 @@ export default {
};
},

get devices(): { iOS: string[], watchOS: string[], tvOS: string[] } {
get devices(): { iOS: string[], watchOS: string[], tvOS: string[], xrOS: string[] } {
return getConfig("simctl", "devices", {
iOS: getConfig("simctl", "iOS", []),
watchOS: getConfig("simctl", "watchOS", []),
tvOS: getConfig("simctl", "tvOS", [])
tvOS: getConfig("simctl", "tvOS", []),
xrOS: getConfig("simctl", "xrOS", [])
});
}
};
Expand Down