Fix to prevent duplicate addition of carthage static frameworks (#829)

* Check carthageLinkType is static

* Update changelog
This commit is contained in:
Fumito Nakazawa 2020-04-13 20:44:14 +09:00 committed by GitHub
parent a96b1c06f9
commit 18fae50c86
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 10 additions and 1 deletions

View File

@ -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

View File

@ -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))
)

View File

@ -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")
}