Open dylandrones opened 2 years ago
Hey @dylandrones, yeah you guessed it. SourceKit needs to know every file necessary to compile your Swift code. If a declaration that you use is in another package (like a pod repo), SourceKit doesn't have enough type information and Gryphon can't go on with the compilation.
There are a few things you can try here:
MyPoint
declaration to be used only with Gryphon translations, but that's ignored in your actual app. Since SourceKit only needs the code to compile correctly, the new declaration doesn't have to work - it just has to contain the type, methods, etc that you're using. Add the file to Gryphon's xcfilelist
but don't add it to Xcode, and everything should be OK.That said, this error message could be a lot better than it is. Can you give me more information about it? Did it show up as an error on the line that references MyPoint
?
Hello,
I would like to perform option 2, but not sure how to add the "pod repo's files when calling Gryphon".
Since there will be more the one file from the framework, can I add a reference to the framework folder?
Is there a tutorial somewhere on how to do that?
Call Gryphon
under the Gryphon target, with no success. I am unsure of other ways to add Input files to the Gryphon call.
After building the "gryphon target" I see this error:
In the Issue Navigator, I can select "show in log"
And in the log, I can see this:
MyPoint
is a class defined in a private pod repo called "MyFramework". The app builds in swift successfully.
How can I convert swift files that have references to classes defined in a private pod repo, using Gryphon?
What happens: I get the following error message when trying to build the Gryphon project from my Xcode workspace.
SourceKit failed to get an expression's type. Try running gryphon init again.
What I expected to see: I expected the file to be able to converted. Gryphon succeeds in converting the entire file when it references
CGPoint
just fine.Why I think the error is related to a private Cocoapod repo: After some investigation, it appears this error happens when I try to build the Gryphon project with a variable declaration that is defined in a private pod. When I remove the declaration, the file is able to be converted.
In my private cocoapod
Framework_A
, I have the following defined:In my Xcode workspace (that has Gryphon initialized in it, and that has
Framework_A
installed via thePodFile
), I callMyPoint
and the error occurs.The
--verbose
output points to the variable declaration as the error:Conclusion Do I need to add my private pod repo as an input source somehow? Any information would be greatly appreciated.
Environment Gryphon version 0.18.1, using the Swift 5.5 parser Xcode: 13.2.1 MacOS: Monterey 12.1