Skip to content

Add quick pick to set Xcode DEVELOPER_DIR #384

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

Merged
merged 4 commits into from
Aug 15, 2022

Conversation

adam-fowler
Copy link
Contributor

No description provided.

@adam-fowler adam-fowler linked an issue Aug 9, 2022 that may be closed by this pull request
@adam-fowler
Copy link
Contributor Author

@aelam does this work for you?

@aelam
Copy link
Contributor

aelam commented Aug 10, 2022

@adam-fowler will try it out this week. Thanks for mentioning me !

@adam-fowler
Copy link
Contributor Author

Do you want your real email address in the CONTRIBUTORS.txt?

@aelam
Copy link
Contributor

aelam commented Aug 10, 2022

Yes! It would be my honor!

@adam-fowler
Copy link
Contributor Author

Yes! It would be my honor!

You need to tell me what it is though

configuration.swiftEnvironmentVariables = swiftEnv;
// if SDK is inside previous DEVELOPER_DIR then move to new DEVELOPER_DIR
if (
configuration.sdk.length > 0 &&
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here is convenient enough

but I'm wondering if it's possible for the setting of swift.SDK could be like either way

  1. swift.SDK: "SDKs/MacOSX.sdk" (DEVELOPER_DIR is the automatic prefix for it)
  2. swift.SDK: "$DEVELOPER_DIR/SDKs/MacOSX.sdk". (environment variable can be used in arguments too)

a bit out of scope here. you may find some ideas here

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

DEVELOPER_DIR doesn't exist on Linux or Windows. Also the SDK can exist outside the DEVELOPER_DIR if you are cross compiling for another platform.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your answer

@aelam
Copy link
Contributor

aelam commented Aug 11, 2022

[email protected]

* Get list of Xcode versions intalled on mac
* @returns Folders for each Xcode install
*/
public static async getXcodeInstalls(): Promise<string[]> {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nits] getInstalledXcodes may be easier to understand?

await withQuickPick(
selectedXcode ?? defaultXcode,
xcodes.map(xcode => {
const developerDir = `${xcode}/Contents/Developer`;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nits] the UI and the actual value is a bit different
the list in UI is Xcode paths
but the actual values are the developer paths
it's a little bit different, not sure if engineers would get confused

@aelam
Copy link
Contributor

aelam commented Aug 11, 2022

I don't see any problems, it's convenient.

when I check this PR, I found an issue #387 (not related to this one). Please check

@adam-fowler adam-fowler force-pushed the feature/xcode-select branch from 95e1b59 to 100dc8d Compare August 14, 2022 16:07
@adam-fowler adam-fowler requested a review from 0xTim August 15, 2022 10:02
Copy link
Member

@0xTim 0xTim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@adam-fowler adam-fowler merged commit 9ba47c6 into swiftlang:main Aug 15, 2022
@adam-fowler adam-fowler deleted the feature/xcode-select branch August 15, 2022 15:31
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

Successfully merging this pull request may close these issues.

Add command to set Xcode tools
3 participants