Skip to content
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

Use Xcode-provided metadata for license accept #71

Open
timsutton opened this issue Oct 28, 2015 · 1 comment
Open

Use Xcode-provided metadata for license accept #71

timsutton opened this issue Oct 28, 2015 · 1 comment

Comments

@timsutton
Copy link
Collaborator

Scanning the License.rtf file for text matching the agreement as is done here seemed a bit fragile - and I found that there's an actual plist containing two pieces of info at /Applications/Xcode.app/Contents/Resources/LicenseInfo. For example, from the Xcode 7.2 beta:

<plist version="1.0">
<dict>
    <key>licenseID</key>
    <string>EA1327</string>
    <key>licenseType</key>
    <string>Beta</string>
</dict>
</plist>

This allows us to more easily grab the agreement number, and know whether it's general release or beta. (licenseType will be either Beta or GM).

Knowing whether it's general release or Beta is important because there are actually two other keys that can be set in com.apple.dt.Xcode:

~  defaults read /Library/Preferences/com.apple.dt.Xcode
{
    IDELastBetaLicenseAgreedTo = EA1327;
    IDEXcodeVersionForAgreedToBetaLicense = "7.2";
}

Also, if com.apple.dt.Xcode is actually a standard Mac preference, it's better to use defaults to set the prefs rather than writing directly to the plist storage to avoid caching issues with cfprefsd.

Filing this to point out the issue, but I can work on a PR for this.

@timsutton
Copy link
Collaborator Author

Just to note that when I last checked what the DVT framework was doing for handling this, it looked like they're just reading the /L/P/com.apple.dt.Xcode.plist directly, not using Preferences/defaults.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant