cappuccino / cappuccino

Web Application Framework in JavaScript and Objective-J
https://cappuccino.dev/
GNU Lesser General Public License v2.1
2.2k stars 333 forks source link

nib2cib fails to convert xibs with target set later than macOS 10.12 #3043

Open enquora opened 1 year ago

enquora commented 1 year ago

nib2cib fails to convert any xibs for which the "Builds for" property (in the xib Identity inspector) is set more recent than macOS 10.12.

A diff of the XML for otherwise identical xib files indicates the only difference is the line:

We need to handle the absence of the widthSizable and heightSizable properties.

cappbot commented 1 year ago

Milestone: Someday. Label: #new. What's next? A reviewer should examine this issue.

enquora commented 1 year ago

Needs a proper reduction with specific xib examples

michaelbach commented 1 year ago

Dear David:

nib2cib fails to convert any xibs for which the "Builds for" property (in the xib Identity inspector) is set later more recent than macOS 10.12.

yes, this was discussed before and I was recently bitten by it again. So I issued a strong note to self to set to “10.12 and later” as the setting is called.

A diff of the XML for otherwise identical xib files indicates the only difference is the line:

• macOS 10.12 (succeeds): • macOS 10.12.2 (fails): We need to handle the absence of the widthSizable and heightSizable properties.

wow, a great finding! Should be fairly easy to tackle. If / when I find the time…

Best, Michael -- https://michaelbach.de

enquora commented 1 year ago

It simultaneously simpler and more complex. Here is the diff between two xibs with identical content — a single, empty window:

VersionTest 10.12.xib | VersionTest. 12.0xib – 1 Deletion.pdf

It appears the problem is with ibtool refusing to convert if the <deployment version> tag is not present. Will need to see what the actual output from ibtool is.

Test Xibs.zip

enquora commented 1 year ago

It appears that plutil --compile is where the problem occurs

Property List error: Unexpected character N at line 1 / JSON error: JSON text did not start with array or object and option to allow fragments not set. around line 1, column 0. Immediate thoughts are that we should check the target version of the xib and report incompatible versions.

Likely simple for nib2cib itself, much less so for XcodeCapp when it runs nib2cib. Starting to wonder, again, if writing our own xib transformer would be simpler. Xibs are just XML, after all — I wonder if XSLT wouldn't do what we need.

cappbot commented 4 months ago

Assignee: enquora. Milestone: Someday. Label: #new. What's next? A reviewer should examine this issue.