mirror of
https://github.com/yonaskolb/XcodeGen.git
synced 2024-11-09 22:01:32 +03:00
Fix to prevent duplicate addition of carthage static frameworks (#829)
* Check carthageLinkType is static * Update changelog
This commit is contained in:
parent
a96b1c06f9
commit
18fae50c86
@ -9,6 +9,7 @@
|
||||
#### Fixed
|
||||
- Fixed issue when linking and embeding static frameworks: they should be linked and NOT embed. [#820](https://github.com/yonaskolb/XcodeGen/pull/820) @acecilia
|
||||
- Fixed issue when generating projects for paths with a dot in the folder for swift sources. [#826](https://github.com/yonaskolb/XcodeGen/pull/826) @asifmohd
|
||||
- Fixed duplicate addition of carthage static frameworks. [#829](https://github.com/yonaskolb/XcodeGen/pull/829) @funzin
|
||||
|
||||
## 2.15.1
|
||||
|
||||
|
@ -787,7 +787,9 @@ public class PBXProjGenerator {
|
||||
|
||||
self.carthageFrameworksByPlatform[target.platform.carthageName, default: []].insert(fileReference)
|
||||
|
||||
if dependency.link ?? (target.type != .staticLibrary) {
|
||||
let isStaticLibrary = target.type == .staticLibrary
|
||||
let isCarthageStaticLink = dependency.carthageLinkType == .static
|
||||
if dependency.link ?? (!isStaticLibrary && !isCarthageStaticLink) {
|
||||
let buildFile = self.addObject(
|
||||
PBXBuildFile(file: fileReference, settings: getDependencyFrameworkSettings(dependency: dependency))
|
||||
)
|
||||
|
@ -1124,6 +1124,7 @@ class ProjectGeneratorTests: XCTestCase {
|
||||
guard let files = frameworkBuildPhase?.files, let file = files.first else {
|
||||
return XCTFail("frameworkBuildPhase should have files")
|
||||
}
|
||||
try expect(files.count) == 1
|
||||
try expect(file.file?.nameOrPath) == "MyStaticFramework.framework"
|
||||
|
||||
try expect(target.carthageCopyFrameworkBuildPhase).beNil()
|
||||
@ -1151,6 +1152,8 @@ class ProjectGeneratorTests: XCTestCase {
|
||||
guard let files = frameworkBuildPhase?.files else {
|
||||
return XCTFail("frameworkBuildPhase should have files")
|
||||
}
|
||||
try expect(files.count) == 2
|
||||
|
||||
guard let dynamicFramework = files.first(where: { $0.file?.nameOrPath == "MyDynamicFramework.framework" }) else {
|
||||
return XCTFail("Framework Build Phase should have Dynamic Framework")
|
||||
}
|
||||
@ -1262,6 +1265,7 @@ class ProjectGeneratorTests: XCTestCase {
|
||||
guard let files = frameworkBuildPhase?.files, let file = files.first else {
|
||||
return XCTFail("frameworkBuildPhase should have files")
|
||||
}
|
||||
try expect(files.count) == 1
|
||||
try expect(file.file?.nameOrPath) == "MyStaticFramework.framework"
|
||||
|
||||
try expect(target.carthageCopyFrameworkBuildPhase).beNil()
|
||||
@ -1289,6 +1293,8 @@ class ProjectGeneratorTests: XCTestCase {
|
||||
guard let files = frameworkBuildPhase?.files else {
|
||||
return XCTFail("frameworkBuildPhase should have files")
|
||||
}
|
||||
try expect(files.count) == 2
|
||||
|
||||
guard let dynamicFramework = files.first(where: { $0.file?.nameOrPath == "MyDynamicFramework.framework" }) else {
|
||||
return XCTFail("Framework Build Phase should have Dynamic Framework")
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user