-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
fix(darwin): update minimum macOS version from 10.15 to 12.0 #5253
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -22,7 +22,7 @@ | |||||
| <string>{{.CFBundleIconName}}</string> | ||||||
| {{- end}} | ||||||
| <key>LSMinimumSystemVersion</key> | ||||||
| <string>10.15.0</string> | ||||||
| <string>12.0</string> | ||||||
|
||||||
| <string>12.0</string> | |
| <string>12.0.0</string> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,79 @@ | ||
| package test | ||
|
|
||
| import ( | ||
| "os" | ||
| "path/filepath" | ||
| "strings" | ||
| "testing" | ||
|
|
||
| "howett.net/plist" | ||
| ) | ||
|
|
||
| func TestDarwinInfoPlistMinVersion(t *testing.T) { | ||
| templates := []string{ | ||
| "../../internal/commands/updatable_build_assets/darwin/Info.plist.tmpl", | ||
| "../../internal/commands/updatable_build_assets/darwin/Info.dev.plist.tmpl", | ||
| } | ||
|
|
||
| expectedVersion := "12.0" | ||
|
|
||
| for _, tmpl := range templates { | ||
| t.Run(filepath.Base(tmpl), func(t *testing.T) { | ||
| data, err := os.ReadFile(tmpl) | ||
| if err != nil { | ||
| t.Fatalf("Failed to read template: %v", err) | ||
| } | ||
|
|
||
| content := string(data) | ||
|
|
||
| if !strings.Contains(content, expectedVersion) { | ||
| t.Errorf("Template %s does not contain expected minimum version %s", tmpl, expectedVersion) | ||
| } | ||
|
|
||
| if strings.Contains(content, "10.15") { | ||
| t.Errorf("Template %s still contains outdated 10.15 version", tmpl) | ||
| } | ||
|
|
||
| var plistDict map[string]any | ||
| _, err = plist.Unmarshal(data, &plistDict) | ||
| if err != nil { | ||
| t.Fatalf("Failed to unmarshal plist template %s: %v", tmpl, err) | ||
| } | ||
|
|
||
| minVer, ok := plistDict["LSMinimumSystemVersion"] | ||
| if !ok { | ||
| t.Fatalf("Template %s is missing LSMinimumSystemVersion", tmpl) | ||
| } | ||
| if minVer != expectedVersion { | ||
| t.Errorf("LSMinimumSystemVersion = %v, want %s", minVer, expectedVersion) | ||
| } | ||
| }) | ||
| } | ||
| } | ||
|
|
||
| func TestDarwinTaskfileMinVersion(t *testing.T) { | ||
| taskfile := "../../internal/commands/build_assets/darwin/Taskfile.yml" | ||
|
|
||
| data, err := os.ReadFile(taskfile) | ||
| if err != nil { | ||
| t.Fatalf("Failed to read Taskfile: %v", err) | ||
| } | ||
|
|
||
| content := string(data) | ||
|
|
||
| if strings.Contains(content, "10.15") { | ||
| t.Errorf("Taskfile still contains outdated 10.15 version") | ||
| } | ||
|
|
||
| if !strings.Contains(content, "12.0") { | ||
| t.Errorf("Taskfile does not contain expected minimum version 12.0") | ||
| } | ||
|
|
||
| if !strings.Contains(content, "-mmacosx-version-min=12.0") { | ||
| t.Errorf("Taskfile CGO flags not updated to 12.0") | ||
| } | ||
|
|
||
| if !strings.Contains(content, `MACOSX_DEPLOYMENT_TARGET: "12.0"`) { | ||
| t.Errorf("Taskfile MACOSX_DEPLOYMENT_TARGET not updated to 12.0") | ||
| } | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LSMinimumSystemVersionwas previously expressed as a 3-segment version (e.g.10.15.0), but is now12.0. Elsewhere in the repo (egv3/examples/dev/build/Info.plist) the value uses amajor.minor.patchformat; consider using12.0.0for consistency and to avoid any potential parsing differences across macOS versions.