SourceKitten icon indicating copy to clipboard operation
SourceKitten copied to clipboard

automatically determine compiler arguments for Objective-C projects

Open jpsim opened this issue 10 years ago β€’ 10 comments

I decided to punt that in #57.

jpsim avatar Nov 07 '15 01:11 jpsim

@jpsim I haven't looked at this in detail yet but maybe specifying an .xcconfig file might streamline this? I'm looking at using Jazzy with some Objective-C projects and was thinking of having a nicer way to invoke it.

seanlabastille avatar Nov 11 '15 12:11 seanlabastille

The way we do this for Swift is to run xcodebuild and parse the result for compiler arguments. Since SourceKit requires all the files to have been indexed, and the best way I know of to do that is to build the whole module, this works out (although it's loooong).

For Objective-C, we don't need to index the files first, so we can just run xcodebuild -dry-run and parse the compiler arguments from the output.

jpsim avatar Nov 11 '15 15:11 jpsim

When I used appledoc, I maintained an xml file (plist) with all the settings and pointed to it on the command line. Perhaps that would be an easy way to resolve this -- consult a plist which the user maintains for providing parameters to source kitten, etc. appledocsettings

Mozahler avatar Jan 08 '16 18:01 Mozahler

jazzy can be configured via a YAML file, and I would prefer if SourceKitten automatically detected Objective-C compiler arguments like we do for Swift, rendering that kind of error-prone & tedious configuration unnecessary.

jpsim avatar Jan 08 '16 18:01 jpsim

Automagic is always best. Wish swift wasn't such a moving target.

Sent from my iPhone

On Jan 8, 2016, at 1:33 PM, JP Simard [email protected] wrote:

jazzy can be configured via a YAML file, and I would prefer if SourceKitten automatically detected Objective-C compiler arguments like we do for Swift, rendering that kind of error-prone & tedious configuration unnecessary.

β€” Reply to this email directly or view it on GitHub.

Mozahler avatar Jan 08 '16 18:01 Mozahler

Automagic is always best. Wish swift wasn't such a moving target.

This is actually for Objective-C. We already do this for Swift and it's been quite stable!

jpsim avatar Jan 08 '16 18:01 jpsim

Excellent. Would you mind pointing me to a yaml file which is valid for a project (so I can understand how to populate one..)?

Sent from my iPhone

On Jan 8, 2016, at 1:53 PM, JP Simard [email protected] wrote:

Automagic is always best. Wish swift wasn't such a moving target.

This is actually for Objective-C. We already do this for Swift and it's been quite stable!

β€” Reply to this email directly or view it on GitHub.

Mozahler avatar Jan 08 '16 19:01 Mozahler

See https://github.com/realm/jazzy#usage, https://github.com/bustoutsolutions/siesta/blob/master/.jazzy.yaml, https://github.com/danthorpe/Money/blob/development/.jazzy.yaml, https://github.com/natestedman/Shirley/blob/master/.jazzy.yaml, https://github.com/kaishin/gifu/blob/master/.jazzy.yaml, https://github.com/natestedman/Attributed/blob/master/.jazzy.yaml, https://github.com/DerLobi/Depressed/blob/develop/.jazzy.yaml

jpsim avatar Jan 08 '16 19:01 jpsim

Awesome! πŸ’ƒπŸΎπŸ‘―πŸŽ‰πŸ’πŸ’¨πŸŽ‰πŸ‘―πŸŽ‰πŸ’ƒ Thanks

Sent from my iPhone

On Jan 8, 2016, at 2:19 PM, JP Simard [email protected] wrote:

See https://github.com/realm/jazzy#usage, https://github.com/bustoutsolutions/siesta/blob/master/.jazzy.yaml, https://github.com/danthorpe/Money/blob/development/.jazzy.yaml, https://github.com/natestedman/Shirley/blob/master/.jazzy.yaml, https://github.com/kaishin/gifu/blob/master/.jazzy.yaml, https://github.com/natestedman/Attributed/blob/master/.jazzy.yaml, https://github.com/DerLobi/Depressed/blob/develop/.jazzy.yaml

β€” Reply to this email directly or view it on GitHub.

Mozahler avatar Jan 08 '16 19:01 Mozahler

This interesting article might help you find a way to automate this (maybe?) πŸ€ https://roman.dev/xcodebuild/

rogerluan avatar May 21 '20 01:05 rogerluan