Skip to content

Commit 80a76f6

Browse files
abueideclaude
andauthored
fix(init): correct plugin compatibility for Xcode 26 (#81)
* fix(init): correct plugin compatibility for Xcode 26 - Rename survicate package/import from SegmentSurvicate to SurvicateDestination (matches the 3.x package product name) - Use `any Plugin` instead of `any DestinationPlugin` in generated ContentView since AmplitudeSession conforms to EventPlugin - Disable CLANG_ENABLE_EXPLICIT_MODULES in project.yml and xcodebuild flags to work around Firebase/GoogleUtilities build failure on Xcode 26 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * feat(init): accept commas and all/none in plugin wizard The plugin selection prompt now splits on commas or spaces, so "1,3,5" and "1 3 5" both work. Typing "all" selects every plugin and "none" deselects all. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 127048e commit 80a76f6

1 file changed

Lines changed: 23 additions & 12 deletions

File tree

segkit/src/init_cmd.rs

Lines changed: 23 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -82,10 +82,10 @@ pub const PLUGIN_REGISTRY: &[Plugin] = &[
8282
Plugin {
8383
key: "survicate",
8484
display_name: "Survicate",
85-
package_name: "SegmentSurvicate",
85+
package_name: "SurvicateDestination",
8686
repo_url: "https://github.com/Survicate/analytics-swift-survicate",
8787
min_version: "3.0.2",
88-
import_name: "SegmentSurvicate",
88+
import_name: "SurvicateDestination",
8989
swift_init: "SurvicateDestination()",
9090
},
9191
];
@@ -220,6 +220,7 @@ packages:
220220
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad: "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"
221221
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone: "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"
222222
SWIFT_EMIT_LOC_STRINGS: YES
223+
CLANG_ENABLE_EXPLICIT_MODULES: NO
223224
{name}Tests:
224225
type: bundle.unit-test
225226
platform: iOS
@@ -271,7 +272,7 @@ fn generate_content_view(name: &str) -> String {
271272
let mut plugin_entries = String::new();
272273
for p in PLUGIN_REGISTRY {
273274
plugin_entries.push_str(&format!(
274-
" (\"{key}\", \"{display}\", {{ {init} as (any DestinationPlugin) }}),\n",
275+
" (\"{key}\", \"{display}\", {{ {init} as (any Plugin) }}),\n",
275276
key = p.key,
276277
display = p.display_name,
277278
init = p.swift_init,
@@ -328,7 +329,7 @@ struct ContentView: View {{
328329
analytics.add(plugin: IDFAPlugin())
329330
330331
// Dynamically register enabled destination plugins
331-
let availablePlugins: [(key: String, name: String, make: () -> any DestinationPlugin)] = [
332+
let availablePlugins: [(key: String, name: String, make: () -> any Plugin)] = [
332333
{plugin_entries} ]
333334
for p in availablePlugins where Config.enabledPluginKeys.contains(p.key) {{
334335
analytics.add(plugin: p.make())
@@ -534,7 +535,7 @@ fn prompt_plugins(already_selected: &[String]) -> Vec<String> {
534535

535536
loop {
536537
eprintln!();
537-
eprintln!("Select destination plugins (enter numbers to toggle, Enter to confirm):");
538+
eprintln!("Select destination plugins (numbers to toggle, all/none, Enter to confirm):");
538539
for (i, plugin) in PLUGIN_REGISTRY.iter().enumerate() {
539540
let marker = if selected[i] { "[x]" } else { "[ ]" };
540541
eprintln!(" {}) {} {}", i + 1, marker, plugin.key);
@@ -550,10 +551,20 @@ fn prompt_plugins(already_selected: &[String]) -> Vec<String> {
550551
if trimmed.is_empty() {
551552
break;
552553
}
553-
for token in trimmed.split_whitespace() {
554-
if let Ok(n) = token.parse::<usize>() {
555-
if n >= 1 && n <= PLUGIN_REGISTRY.len() {
556-
selected[n - 1] = !selected[n - 1];
554+
for token in trimmed.split(|c: char| c == ',' || c.is_whitespace()) {
555+
let token = token.trim();
556+
if token.is_empty() {
557+
continue;
558+
}
559+
match token.to_lowercase().as_str() {
560+
"all" => selected.iter_mut().for_each(|s| *s = true),
561+
"none" => selected.iter_mut().for_each(|s| *s = false),
562+
_ => {
563+
if let Ok(n) = token.parse::<usize>() {
564+
if n >= 1 && n <= PLUGIN_REGISTRY.len() {
565+
selected[n - 1] = !selected[n - 1];
566+
}
567+
}
557568
}
558569
}
559570
}
@@ -738,10 +749,10 @@ const DEVBOX_JSON: &str = r#"{
738749
"shell": {
739750
"scripts": {
740751
"build": [
741-
"ios.sh xcodebuild -project __NAME__.xcodeproj -scheme __NAME__ -configuration Debug -destination 'generic/platform=iOS Simulator' -derivedDataPath DerivedData build"
752+
"ios.sh xcodebuild -project __NAME__.xcodeproj -scheme __NAME__ -configuration Debug -destination 'generic/platform=iOS Simulator' -derivedDataPath DerivedData CLANG_ENABLE_EXPLICIT_MODULES=NO build"
742753
],
743754
"build:release": [
744-
"ios.sh xcodebuild -project __NAME__.xcodeproj -scheme __NAME__ -configuration Release -derivedDataPath DerivedData build"
755+
"ios.sh xcodebuild -project __NAME__.xcodeproj -scheme __NAME__ -configuration Release -derivedDataPath DerivedData CLANG_ENABLE_EXPLICIT_MODULES=NO build"
745756
],
746757
"build:clean": [
747758
"rm -rf DerivedData"
@@ -750,7 +761,7 @@ const DEVBOX_JSON: &str = r#"{
750761
"ios.sh run ${1:-}"
751762
],
752763
"test": [
753-
"ios.sh xcodebuild -project __NAME__.xcodeproj -scheme __NAME__ -destination 'platform=iOS Simulator,name=iPhone 17' test"
764+
"ios.sh xcodebuild -project __NAME__.xcodeproj -scheme __NAME__ -destination 'platform=iOS Simulator,name=iPhone 17' CLANG_ENABLE_EXPLICIT_MODULES=NO test"
754765
]
755766
}
756767
}

0 commit comments

Comments
 (0)