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

ObjC Import file not found when using SPM directory structure #667

Closed
rnystrom opened this issue Sep 30, 2016 · 7 comments
Closed

ObjC Import file not found when using SPM directory structure #667

rnystrom opened this issue Sep 30, 2016 · 7 comments

Comments

@rnystrom
Copy link

rnystrom commented Sep 30, 2016

We're putting the finishing touches on an Objective-C framework and are trying to prepare for the eventual (maybe?) launch of the Swift Package Manager using the following dir structure:

  • IGListKit.xcodeproj
  • /Source
    • IGListKit.h
    • PublicFile.h
    • PublicFile.m
    • /Internal
      • PrivateFile.h
      • PrivateFile.m
  • /Tests
  • /Example
  • /docs

Our script setup looks like

jazzy \
    --objc \
    --clean \
    --author 'Instagram' \
    --author_url 'https://twitter.com/fbOpenSource' \
    --github_url 'https://github.com/Instagram/IGListKit' \
    --sdk iphonesimulator \
    --module 'IGListKit' \
    --framework-root . \
    --umbrella-header Source/IGListKit.h \
    --readme README.md \
    --output docs/ \

Our umbrella header (and almost all the framework's #imports) look like:

#import <IGListKit/PublicFile.h>
#import <IGListKit/AnotherPublicFile.h>
#import <IGListKit/OneMorePublicFile.h>

When I run the script I get a "file not found" error like:

Source/IGListKit.h:1:9: fatal error: 'IGListKit/PublicFile.h' file not found

If I mv the Source dir to IGListKit all of the docs gen just fine. It seems like there should be a way to s/Source/IGListKit when searching for file paths, right? I hope I'm missing something obvious?

cc @jessesquires who's running into this w/ me

@rnystrom rnystrom changed the title Import file not found when using SPM directory structure ObjC Import file not found when using SPM directory structure Sep 30, 2016
@rnystrom
Copy link
Author

ping @jpsim on this. We have to hack around this bug to gen docs for IGListKit.

facebook-github-bot pushed a commit to Instagram/IGListKit that referenced this issue Oct 20, 2016
Summary:
Temporary fix for the doc generation bug. Works now by simply running `$ ./build_docs.sh`.

cc jessesquires that this fix is good for now

Fixes #55

Jazzy bug at realm/jazzy#667
Closes #93

Differential Revision: D4051337

Pulled By: jessesquires

fbshipit-source-id: 2ad1c45df55ca61ef9a243d0ad33af20b8349f96
@mhuusko5
Copy link

I'm also running into this issue with a project with multiple/nested directories containing relevant headers, vs. just ProjectName/ProjectName. Temporarily creating ProjectName/ProjectName, and copying all headers in there resolves this issue, but then run_sourceKitten ends up failing (guessing because mismatch between file location and .xcodeproj?).

@pigeon-archive
Copy link
Contributor

Hi @rnystrom and @mhuusko5. Thanks for reaching out. My apologies that no one responded to your support request until now. Did you ever find a functional workaround? Is the problem present in the latest version? Please let me know. I'll do my own digging in the meantime.

@rnystrom
Copy link
Author

@istx25 yup we added a workaround for the time being https://github.com/Instagram/IGListKit/pull/93/files

But it's not a very robust solution

@pigeon-archive
Copy link
Contributor

I'll look into this further. Thanks @rnystrom!

@jessesquires
Copy link
Contributor

Is this the same issue as #518 ?

@johnfairh
Copy link
Collaborator

Added explanation and workaround options to docs.

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

5 participants