mirror of
https://github.com/yonaskolb/XcodeGen.git
synced 2024-08-17 00:30:29 +03:00
Merge 3b0c364ebd
into 17acb4dc61
This commit is contained in:
commit
f5465856b2
@ -2,6 +2,10 @@
|
||||
|
||||
## Next Version
|
||||
|
||||
### Added
|
||||
|
||||
- Added support for local Swift packages in Xcode 15 #1465 @kinnarr
|
||||
|
||||
## 2.40.1
|
||||
|
||||
### Fixed
|
||||
|
@ -86,8 +86,8 @@
|
||||
"kind" : "remoteSourceControl",
|
||||
"location" : "https://github.com/tuist/XcodeProj.git",
|
||||
"state" : {
|
||||
"revision" : "6e60fb55271c80f83a186c9b1b4982fd991cfc0a",
|
||||
"version" : "8.13.0"
|
||||
"revision" : "447c159b0c5fb047a024fd8d942d4a76cf47dde0",
|
||||
"version" : "8.16.0"
|
||||
}
|
||||
},
|
||||
{
|
||||
|
@ -16,7 +16,7 @@ let package = Package(
|
||||
.package(url: "https://github.com/yonaskolb/JSONUtilities.git", from: "4.2.0"),
|
||||
.package(url: "https://github.com/kylef/Spectre.git", from: "0.9.2"),
|
||||
.package(url: "https://github.com/onevcat/Rainbow.git", from: "4.0.0"),
|
||||
.package(url: "https://github.com/tuist/XcodeProj.git", exact: "8.13.0"),
|
||||
.package(url: "https://github.com/tuist/XcodeProj.git", exact: "8.16.0"),
|
||||
.package(url: "https://github.com/jakeheis/SwiftCLI.git", from: "6.0.3"),
|
||||
.package(url: "https://github.com/mxcl/Version", from: "2.0.0"),
|
||||
.package(url: "https://github.com/SwiftDocOrg/GraphViz.git", exact: "0.2.0"),
|
||||
|
@ -22,6 +22,7 @@ public class PBXProjGenerator {
|
||||
var targetFileReferences: [String: PBXFileReference] = [:]
|
||||
var sdkFileReferences: [String: PBXFileReference] = [:]
|
||||
var packageReferences: [String: XCRemoteSwiftPackageReference] = [:]
|
||||
var localPackageReferences: [String: XCLocalSwiftPackageReference] = [:]
|
||||
|
||||
var carthageFrameworksByPlatform: [String: Set<PBXFileElement>] = [:]
|
||||
var frameworkFiles: [PBXFileElement] = []
|
||||
@ -30,7 +31,6 @@ public class PBXProjGenerator {
|
||||
var generated = false
|
||||
|
||||
private var projects: [ProjectReference: PBXProj] = [:]
|
||||
lazy private var localPackageReferences: [String] = project.packages.compactMap { $0.value.isLocal ? $0.key : nil }
|
||||
|
||||
public init(project: Project, projectDirectory: Path? = nil) {
|
||||
self.project = project
|
||||
@ -170,6 +170,10 @@ public class PBXProjGenerator {
|
||||
packageReferences[name] = packageReference
|
||||
addObject(packageReference)
|
||||
case let .local(path, group):
|
||||
let packageReference = XCLocalSwiftPackageReference(relativePath: path)
|
||||
localPackageReferences[name] = packageReference
|
||||
addObject(packageReference)
|
||||
|
||||
try sourceGenerator.createLocalPackage(path: Path(path), group: group.map { Path($0) })
|
||||
}
|
||||
}
|
||||
@ -310,7 +314,8 @@ public class PBXProjGenerator {
|
||||
}
|
||||
pbxProject.knownRegions = knownRegions.sorted()
|
||||
|
||||
pbxProject.packages = packageReferences.sorted { $0.key < $1.key }.map { $1 }
|
||||
pbxProject.remotePackages = packageReferences.sorted { $0.key < $1.key }.map { $1 }
|
||||
pbxProject.localPackages = localPackageReferences.sorted { $0.key < $1.key }.map { $1 }
|
||||
|
||||
let allTargets: [PBXTarget] = targetObjects.valueArray + targetAggregateObjects.valueArray
|
||||
pbxProject.targets = allTargets
|
||||
@ -945,7 +950,7 @@ public class PBXProjGenerator {
|
||||
|
||||
// If package's reference is none and there is no specified package in localPackages,
|
||||
// then ignore the package specified as dependency.
|
||||
if packageReference == nil, !localPackageReferences.contains(dependency.reference) {
|
||||
if packageReference == nil, localPackageReferences[dependency.reference] == nil {
|
||||
continue
|
||||
}
|
||||
|
||||
@ -1469,7 +1474,7 @@ public class PBXProjGenerator {
|
||||
func makePackagePluginDependency(for target: ProjectTarget) -> [PBXTargetDependency] {
|
||||
target.buildToolPlugins.compactMap { buildToolPlugin in
|
||||
let packageReference = packageReferences[buildToolPlugin.package]
|
||||
if packageReference == nil, !localPackageReferences.contains(buildToolPlugin.package) {
|
||||
if packageReference == nil, localPackageReferences[buildToolPlugin.package] == nil {
|
||||
return nil
|
||||
}
|
||||
|
||||
|
@ -251,6 +251,8 @@
|
||||
5BA91390AE78D2EE15C60091 /* XCRemoteSwiftPackageReference "Codability" */,
|
||||
348C81C327DB1710B742C370 /* XCRemoteSwiftPackageReference "Prefire" */,
|
||||
E3887F3CB2C069E70D98092F /* XCRemoteSwiftPackageReference "SwiftRoaring" */,
|
||||
630A8CE9F2BE39704ED9D461 /* XCLocalSwiftPackageReference "FooFeature" */,
|
||||
C6539B364583AE96C18CE377 /* XCLocalSwiftPackageReference "../../.." */,
|
||||
);
|
||||
projectDirPath = "";
|
||||
projectRoot = "";
|
||||
@ -662,6 +664,17 @@
|
||||
};
|
||||
/* End XCRemoteSwiftPackageReference section */
|
||||
|
||||
/* Begin XCLocalSwiftPackageReference section */
|
||||
630A8CE9F2BE39704ED9D461 /* XCLocalSwiftPackageReference "FooFeature" */ = {
|
||||
isa = XCLocalSwiftPackageReference;
|
||||
relativePath = FooFeature;
|
||||
};
|
||||
C6539B364583AE96C18CE377 /* XCLocalSwiftPackageReference "../../.." */ = {
|
||||
isa = XCLocalSwiftPackageReference;
|
||||
relativePath = ../../..;
|
||||
};
|
||||
/* End XCLocalSwiftPackageReference section */
|
||||
|
||||
/* Begin XCSwiftPackageProductDependency section */
|
||||
15DB49096E2978F6BCA8D604 /* FooUI */ = {
|
||||
isa = XCSwiftPackageProductDependency;
|
||||
|
Loading…
Reference in New Issue
Block a user