Skip to content

Commit

Permalink
Merge pull request #177 from unoplatform/fix-xcode-check
Browse files Browse the repository at this point in the history
fix: Fix Xcode version checks and manifests
  • Loading branch information
nickrandolph authored Oct 9, 2023
2 parents 154f3fa + accf715 commit 873057f
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 11 deletions.
12 changes: 7 additions & 5 deletions UnoCheck/Checkups/XCodeCheckup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ public NuGetVersion ExactVersion
public string ExactVersionName
=> Manifest?.Check?.XCode?.ExactVersionName;

public NuGetVersion Version
=> ExactVersion ?? MinimumVersion;

public string VersionName
=> ExactVersionName ?? MinimumVersionName ?? ExactVersion?.ToString() ?? MinimumVersion?.ToString();

Expand Down Expand Up @@ -67,7 +70,7 @@ public override Task<DiagnosticResult> Examine(SharedState history)
}

// Selected version is good
ReportStatus($"Xcode.app ({VersionName})", Status.Ok);
ReportStatus($"Xcode.app ({selected.VersionString} {selected.BuildVersion})", Status.Ok);
return Task.FromResult(DiagnosticResult.Ok(this));
}

Expand Down Expand Up @@ -101,12 +104,12 @@ public override Task<DiagnosticResult> Examine(SharedState history)
}


ReportStatus($"Xcode.app ({VersionName}) not installed.", Status.Error);
ReportStatus($"Xcode.app ({Version} {VersionName}) not installed.", Status.Error);

return Task.FromResult(new DiagnosticResult(
Status.Error,
this,
new Suggestion($"Download XCode {VersionName}")));
new Suggestion($"Download XCode {Version} {VersionName}")));
}
catch(InvalidDataException)
{
Expand Down Expand Up @@ -177,11 +180,10 @@ XCodeInfo GetXcodeInfo(string path, bool selected)
if (File.Exists(versionPlist))
{
NSDictionary rootDict = (NSDictionary)PropertyListParser.Parse(versionPlist);
string cfBundleVersion = rootDict.ObjectForKey("CFBundleVersion")?.ToString();
string cfBundleShortVersion = rootDict.ObjectForKey("CFBundleShortVersionString")?.ToString();
string productBuildVersion = rootDict.ObjectForKey("ProductBuildVersion")?.ToString();

if (NuGetVersion.TryParse(cfBundleVersion, out var v))
if (NuGetVersion.TryParse(cfBundleShortVersion, out var v))
return new XCodeInfo(v, cfBundleShortVersion, productBuildVersion, path, selected);
}
else
Expand Down
4 changes: 2 additions & 2 deletions manifests/uno.ui-preview-major.manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
}
},
"xcode": {
"exactVersion": "14E300c",
"exactVersionName": "14.3.1"
"exactVersion": "15.0",
"exactVersionName": "15A240d"
},
"vswin": {
"minimumVersion": "17.8.0-pre.1"
Expand Down
4 changes: 2 additions & 2 deletions manifests/uno.ui-preview.manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
}
},
"xcode": {
"exactVersion": "14E300c",
"exactVersionName": "14.3.1"
"exactVersion": "14.3.1",
"exactVersionName": "14E300c"
},
"vswin": {
"minimumVersion": "17.4.4"
Expand Down
4 changes: 2 additions & 2 deletions manifests/uno.ui.manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
}
},
"xcode": {
"exactVersion": "14E300c",
"exactVersionName": "14.3.1"
"exactVersion": "14.3.1",
"exactVersionName": "14E300c"
},
"vswin": {
"minimumVersion": "17.4.4"
Expand Down

0 comments on commit 873057f

Please sign in to comment.