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

Support mixed Objective-C and Swift projects #447

Closed
FelixSFD opened this issue Jan 3, 2016 · 12 comments
Closed

Support mixed Objective-C and Swift projects #447

FelixSFD opened this issue Jan 3, 2016 · 12 comments

Comments

@FelixSFD
Copy link

FelixSFD commented Jan 3, 2016

Im running jazzy (0.5.0) with the following command, but only my Swift-files are parsed. All Objective-C headers are ignored.

jazzy --clean --objc --umbrella-header MyApp/MyApp-Bridging-Header.h --framework-root /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.1.sdk --author "The Author" --sdk iphoneos --swift-version 2.1 --min-acl private --xcodebuild-arguments -scheme,MyAppScheme --module MyApp

What am I doing wrong?

@khoogheem
Copy link

try it with

--framework-root . (assuming you are running jazzy in the root of your project)

Also, you shouldn't need --min-acl as that is for swift only I believe

@FelixSFD
Copy link
Author

FelixSFD commented Jan 3, 2016

If the root ist the folder, where all my source-files are ( [folder where the .xcodeproj is located]/MyApp/ ), I'm in root. Sorry. I was in the folder where my .xcodeproj is located. Both folders have just the same name ;-) [folder where the .xcodeproj is located]/MyApp/ returns another error.

But it didn't work. Still parsing my Swift files only.

I have Swift and Objective-C in my project, so I need it.

@jpsim jpsim changed the title Objective-C headers are ignored Support mixed Objective-C and Swift projects Apr 6, 2016
@jpsim
Copy link
Collaborator

jpsim commented Apr 6, 2016

Sorry @FelixSFD, right now jazzy just documents either Objective-C or Swift projects. Generating documentation for Objective-C and Swift in the same project hasn't been added yet.

To my surprise, we didn't already have a ticket tracking that, so we're now using this one to track adding mixed documentation support.

@eflath
Copy link

eflath commented Apr 6, 2016

As a workaround, is it possible to run two different commands and create separate documentation for iOS and swift? the command I'm running now documents the Swift code only even though i'm passing the --objc flag and I can't get it to parse the objc files

@jpsim
Copy link
Collaborator

jpsim commented Apr 6, 2016

Yes, you could combine the SourceKitten doc output JSON for both Objective-C and Swift versions of your documentation using the jazzy --sourcekitten-sourcefile command, but you're in very undocumented territory here so my ability to help you along will be limited.

@ronak2121
Copy link

Any update on this? It's been almost 8 - 9 months on it now.

@jpsim
Copy link
Collaborator

jpsim commented Mar 6, 2018

Nothing new to share, I don't think anyone's actively working on this. Would you like to contribute to this @ronak2121?

@erhnby
Copy link

erhnby commented Jun 25, 2018

Any update on this @jpsim, @FelixSFD ?

@jpsim
Copy link
Collaborator

jpsim commented Jun 25, 2018

still no

@wilmarvh
Copy link

wilmarvh commented Jan 9, 2019

Gonna take a guess here that there's no update yet @jpsim ?

If I were interested in contributing, where is the best place to start with this?

@johnfairh
Copy link
Collaborator

There are quite a few things to do to support mixing ObjC and Swift docs in the same website.
Broadly:

  1. Add CLI flags etc. sufficient for jazzy to get two lots of sourcekitten output, one for objc and the other for Swift.
  2. Work through all of jazzy's processing of sourcekitten output and figure out what needs doing, slowly getting rid of refs to the global 'objc' flag. Figure out 'extensions of ObjC classes' and 'objc categories of swift classes'.
  3. Figure out what the web pages ought to look like, what changes are needed there.

I would start with part 2, generating the sourcekitten output manually and passing it in with -s. This comes in to SourceKitten.parse in sourcekitten.rb - would probably start off by setting an "objc or swift" flag in all the decls based off the filenames, then just follow all the code through and work through cases as they come up.

@johnfairh
Copy link
Collaborator

Fixed in master via #1113.

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

No branches or pull requests

9 participants