-
Notifications
You must be signed in to change notification settings - Fork 31
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
Introduce new framework generation process #104
Conversation
let notDuplicatedSymlinks = symlinks.filter { path in | ||
notSymlinks.allSatisfy { FileManager.default.contentsEqual(atPath: path.pathString, andPath: $0.pathString) } | ||
} | ||
.map { $0.asURL.resolvingSymlinksInPath() } | ||
.map(\.absolutePath) | ||
|
||
return Set(notSymlinks + notDuplicatedSymlinks) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the same logic PIFGenerater
used to do this.
@testable import ScipioKit | ||
import TSCBasic | ||
|
||
final class InfoPlistGeneratorTests: XCTestCase { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a test case of an existing logic.
import Foundation | ||
import TSCBasic | ||
|
||
/// A assembler to generate framework bundle |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/// A assembler to generate framework bundle |
It is already described in name of struct
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is an additional doccomment following line. So it's better to remain this line.
|
||
/// FileLists to assemble a framework bundle | ||
struct FrameworkComponents { | ||
var name: String |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
var name: String | |
var frameworkName: String |
I'm not sure whether the name of "Component" or "Framework"
Sources/ScipioKit/Producer/PIF/FrameworkComponentsCollector.swift
Outdated
Show resolved
Hide resolved
private func findInfoPlist(in frameworkBundlePath: AbsolutePath) throws -> AbsolutePath { | ||
let infoPlistLocationCandidates = [ | ||
// In a regular framework bundle, Info.plist should be on its root | ||
frameworkBundlePath.appending(component: "Info.plist"), | ||
// In a versioned framework bundle (for macOS), Info.plist should be in Resources | ||
frameworkBundlePath.appending(components: "Resources", "Info.plist"), | ||
] | ||
guard let infoPlistPath = infoPlistLocationCandidates.first(where: fileSystem.exists(_:)) else { | ||
throw Error.infoPlistNotFound(frameworkBundlePath: frameworkBundlePath) | ||
} | ||
return infoPlistPath | ||
} | ||
|
||
/// Collects *.swiftmodules* in a generated framework bundle | ||
private func collectSwiftModules(of targetName: String, in frameworkPath: AbsolutePath) throws -> AbsolutePath? { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is difference of collect and find?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, I'll unify them to collect.
Co-authored-by: freddi(Yuki Aki) <[email protected]>
Run for 15.0 Revert "Run for 15.0" This reverts commit 200f4b4. Do not remove Package.resolved Specify DEPLOYMENT_TARGET
In this commit, I bumped up the macOS support version to macOS 12.0 or above. Because current HEAD of swift-driver only supports that.
This PR changes framework generation process.
Before
Scipio tries to consist of frameworks with PIF. Modify PIF to generate framework by injecting header and linker build phases.
But it breaks some packages. It's better to keep PIF as modified as possible.
After
Just build framework components with xcbuild. After that, assemble framework bundles manually.
FrameworkComponentsCollector
collects framework components from the generated framework.FrameworkBundleAssembler
try to relocate them into framework bundle format (Assembled Framework)XCBuildClient
tries to generate XCFramework from the assembled frameworks