xgem-cli 2.0.0-alpha.4 → 2.0.0-alpha.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/doctor.sh CHANGED
@@ -26,7 +26,10 @@ flutter_supports_flag() {
26
26
  flutter_config_spm_enabled() {
27
27
  has_cmd flutter || { echo "unknown (flutter not found)"; return; }
28
28
  local line
29
- line=$(flutter config 2>/dev/null | grep -i "swift-package-manager")
29
+ # Anchored to "enable-swift-package-manager:" (the current-value line)
30
+ # so this doesn't instead match the "--[no-]enable-swift-package-manager"
31
+ # flag-syntax help line that `flutter config` also prints.
32
+ line=$(flutter config 2>/dev/null | grep -im1 -E '^[[:space:]]*enable-swift-package-manager:')
30
33
  if [ -z "$line" ]; then
31
34
  echo "unknown (not reported by this Flutter version)"
32
35
  else
package/lib/ios.sh CHANGED
@@ -60,8 +60,13 @@ ios_deployment_target_for_config() {
60
60
 
61
61
  if has_cmd xcodebuild; then
62
62
  local value
63
+ # Anchored: newer Xcode also emits DEPLOYMENT_TARGET_SETTING_NAME =
64
+ # IPHONEOS_DEPLOYMENT_TARGET (a meta-setting whose *value* is that
65
+ # string), which an unanchored grep matches before the real
66
+ # "IPHONEOS_DEPLOYMENT_TARGET = 15.6" line — anchoring to the key
67
+ # position avoids grabbing that decoy.
63
68
  value=$(xcodebuild -showBuildSettings "${xcb_args[@]}" -configuration "$config" 2>/dev/null \
64
- | grep -m1 'IPHONEOS_DEPLOYMENT_TARGET' | awk '{print $NF}')
69
+ | grep -m1 -E '^[[:space:]]*IPHONEOS_DEPLOYMENT_TARGET[[:space:]]*=' | awk '{print $NF}')
65
70
  [ -n "$value" ] && { echo "$value"; return 0; }
66
71
  fi
67
72
 
@@ -80,15 +85,34 @@ ios_pbxproj_current_max_target() {
80
85
  }
81
86
 
82
87
  # ios_required_spm_deployment_target [project_dir]
83
- # Reads .dart_tool/package_config.json (written by `flutter pub get`) to
84
- # find every resolved package's own ios/Package.swift, and returns the
85
- # highest .iOS(.vNN) platform floor declared across them. This replaces
86
- # hardcoding a guessed value (e.g. "15.0") with an actual measurement of
87
- # what the resolved dependency graph requires.
88
+ # Returns the highest .iOS(.vNN) platform floor declared across every
89
+ # resolved SwiftPM plugin, instead of hardcoding a guessed value.
90
+ #
91
+ # Primary source: ios/Flutter/ephemeral/Packages/.packages/<name>-<version>/,
92
+ # which `flutter pub get` itself populates with each SPM-enabled plugin as
93
+ # part of dependency resolution — this is the actual, already-resolved
94
+ # location Xcode/SPM uses, not a path we have to reconstruct. Scanning it
95
+ # directly sidesteps having to guess each plugin's on-disk manifest layout
96
+ # (which varies — not every plugin puts Package.swift at <root>/ios/).
97
+ #
98
+ # Falls back to parsing .dart_tool/package_config.json's rootUri entries
99
+ # (assuming the common <root>/ios/Package.swift convention) only if that
100
+ # ephemeral directory doesn't exist yet — e.g. before any pub get has run.
88
101
  ios_required_spm_deployment_target() {
89
102
  local project_dir=${1:-.}
90
- local pkg_config="$project_dir/.dart_tool/package_config.json"
103
+ local packages_dir="$project_dir/ios/Flutter/ephemeral/Packages/.packages"
104
+
105
+ if [ -d "$packages_dir" ]; then
106
+ find "$packages_dir" -maxdepth 4 -name "Package.swift" -print0 2>/dev/null \
107
+ | xargs -0 grep -ohE '\.iOS\(\.v[0-9_]+\)' 2>/dev/null \
108
+ | grep -oE '[0-9]+(_[0-9]+)?' | tr '_' '.' \
109
+ | sort -g | tail -1
110
+ return 0
111
+ fi
91
112
 
113
+ log_debug "No resolved SwiftPM packages directory at $packages_dir yet; falling back to package_config.json."
114
+
115
+ local pkg_config="$project_dir/.dart_tool/package_config.json"
92
116
  [ -f "$pkg_config" ] || { log_debug "No .dart_tool/package_config.json — run flutter pub get first."; return 1; }
93
117
  has_cmd python3 || { log_debug "python3 not found; cannot parse package_config.json."; return 1; }
94
118
 
package/lib/version.sh CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/bin/bash
2
2
  # xgem version info.
3
3
 
4
- XGEM_VERSION="2.0.0-alpha.4"
4
+ XGEM_VERSION="2.0.0-alpha.5"
5
5
 
6
6
  print_version() {
7
7
  echo "xgem $XGEM_VERSION"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "xgem-cli",
3
- "version": "2.0.0-alpha.4",
3
+ "version": "2.0.0-alpha.5",
4
4
  "description": "Framework-aware automation CLI: scaffolds and runs clean/build/dev scripts per project type, an environment doctor, a SwiftPM-aware iOS build engine, and a git workflow helper. Runs natively on macOS, Linux, and Windows.",
5
5
  "bin": {
6
6
  "xgem": "bin/xgem.js"