Specify Xcode command line tools when building Swift?


(Brian Gesiak) #1

Hello all,

I have two copies of Xcode on my development machine:
/Applications/Xcode-7.3.1.app and /Applications/Xcode.app (which is Xcode
8.0).

I have `Xcode > Preferences... > Locations > Command Line Tools` set to
/Applications/Xcode-7.3.1.app, since I need Xcode 7.3.1 to build a
different project that I'm working on.

However, apple/swift only builds using Xcode 8. I could change my
`Locations > Command Line Tools` whenever I build apple/swift, but that's
inconvenient -- I build both apple/swift and my other project several times
per day, so I would have to switch very often.

Is it possible to specify an Xcode command line tools location when
building Swift? So far I'm doing this, and it appears to be working:

    DEVELOPER_DIR=/Applications/Xcode.app utils/build-script -R

Is this a good way to build using a specific version of Xcode? Or is there
a better way? Should we support this via an additional option to
utils/build-script, such as `utils/build-script
--xcode=/Applications/Xcode.app`?

Thoughts and feedback appreciated!

- Brian Gesiak


(Daniel Dunbar) #2

Hello all,

I have two copies of Xcode on my development machine: /Applications/Xcode-7.3.1.app and /Applications/Xcode.app (which is Xcode 8.0).

I have `Xcode > Preferences... > Locations > Command Line Tools` set to /Applications/Xcode-7.3.1.app, since I need Xcode 7.3.1 to build a different project that I'm working on.

However, apple/swift only builds using Xcode 8. I could change my `Locations > Command Line Tools` whenever I build apple/swift, but that's inconvenient -- I build both apple/swift and my other project several times per day, so I would have to switch very often.

Is it possible to specify an Xcode command line tools location when building Swift? So far I'm doing this, and it appears to be working:

    DEVELOPER_DIR=/Applications/Xcode.app utils/build-script -R

Is this a good way to build using a specific version of Xcode? Or is there a better way? Should we support this via an additional option to utils/build-script, such as `utils/build-script --xcode=/Applications/Xcode.app`?

Yes, this is a fine way, and the intended use of DEVELOPER_DIR. I'm not sure it deserves an argument on its own, but if that would help discoverability then it might be worth it.

- Daniel

···

On Sep 19, 2016, at 8:24 AM, Brian Gesiak via swift-dev <swift-dev@swift.org> wrote:

Thoughts and feedback appreciated!

- Brian Gesiak
_______________________________________________
swift-dev mailing list
swift-dev@swift.org
https://lists.swift.org/mailman/listinfo/swift-dev