-
Notifications
You must be signed in to change notification settings - Fork 4
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
Only generates Swift interface for mixed source #5
Comments
It was designed for Swift interfaces, as I didn't thought of the objc use case. I'd need to capture which request does SourceKit launch in order to create the Objc interface object, as I don't use the *.swiftinterface file to generate the module. |
The generated module follows the import SourceKittenFramework
if sourceUrl.absoluteString.hasSuffix("h") {
let args = [String]()
let generated = try Request.interface(file: sourceUrl.absoluteString, uuid: NSUUID().uuidString, arguments: args).send()
if let match = generated.first(where: { key, _ in
return key == "key.sourcetext"
}) {
let sourceCode = match.value as! String
// do whatever with the swiftinterface code
} Since this is not a use case for ModuleInterface, I'll close this issue. |
With this snippet I could add support for both kind of sources as an enhancement. |
I think it would be a worthy enhancement. In our case, we process Swift source file-by-file and generate a final artifact. Using SourceKitten we can process Our finalized, combined representation looks like (for our demo package) |
I think this would be a nice improvement to this library 👍 |
I agree :) |
PRs are welcome if you want to help with this!🤩 |
We have internal tooling that publishes Swift interfaces for comment and review. For Swift-only frameworks our tooling works fine simply getting the abstract syntax tree of the Swift source code. However, this approach doesn't work when the source contains, or is primarily, Objective-C.
We have an alternate process that will process
*.swiftinterface
files, but we have yet to find a process that works for generating these files from Objective-C or mixed source except for using the internal Xcode Generated interface. We are searching for a programmatic solution.Based on comments here (jpsim/SourceKitten#405) I was hoping that this tool might solve our issue. However, when I run it on a simple dummy framework, which contains a
SwiftClass
object and anObjCClass
object, the generated interface only includes theSwiftClass
interface even though the bridgedObjCClass
is exposed.Is ModuleInterface intended to work with mixed source, or is it strictly for Swift-only frameworks (or the Swift-only portion of mixed frameworks)?
The text was updated successfully, but these errors were encountered: