From f67609f97eb8c63b397096e07732f92dc58430b9 Mon Sep 17 00:00:00 2001 From: ryohey Date: Wed, 1 Nov 2017 00:55:04 +0900 Subject: [PATCH] Don't add unnecessary headers build phase --- .../TestProject/Project.xcodeproj/project.pbxproj | 14 -------------- Sources/XcodeGenKit/PBXProjGenerator.swift | 8 +++++--- 2 files changed, 5 insertions(+), 17 deletions(-) diff --git a/Fixtures/TestProject/Project.xcodeproj/project.pbxproj b/Fixtures/TestProject/Project.xcodeproj/project.pbxproj index 08d74392..17276455 100644 --- a/Fixtures/TestProject/Project.xcodeproj/project.pbxproj +++ b/Fixtures/TestProject/Project.xcodeproj/project.pbxproj @@ -295,18 +295,6 @@ BF3515549503 /* MyFramework.h in Headers */, ); }; - HBP783122801 /* Frameworks */ = { - isa = PBXHeadersBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - }; - HBP825232101 /* Frameworks */ = { - isa = PBXHeadersBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - }; /* End PBXHeadersBuildPhase section */ /* Begin PBXNativeTarget section */ @@ -388,7 +376,6 @@ buildPhases = ( SBP783122801 /* Sources */, RBP783122801 /* Resources */, - HBP783122801 /* Headers */, ); buildRules = ( ); @@ -405,7 +392,6 @@ buildPhases = ( SBP825232101 /* Sources */, RBP825232101 /* Resources */, - HBP825232101 /* Headers */, FBP825232101 /* Frameworks */, CFBP64939301 /* CopyFiles */, SSBP81062201 /* Carthage */, diff --git a/Sources/XcodeGenKit/PBXProjGenerator.swift b/Sources/XcodeGenKit/PBXProjGenerator.swift index 0d4b72ac..e3582a0f 100644 --- a/Sources/XcodeGenKit/PBXProjGenerator.swift +++ b/Sources/XcodeGenKit/PBXProjGenerator.swift @@ -354,9 +354,11 @@ public class PBXProjGenerator { addObject(resourcesBuildPhase) buildPhases.append(resourcesBuildPhase.reference) - let headersBuildPhase = PBXHeadersBuildPhase(reference: generateUUID(PBXHeadersBuildPhase.self, target.name), files: getBuildFilesForPhase(.headers)) - addObject(headersBuildPhase) - buildPhases.append(headersBuildPhase.reference) + if target.type == .framework || target.type == .dynamicLibrary { + let headersBuildPhase = PBXHeadersBuildPhase(reference: generateUUID(PBXHeadersBuildPhase.self, target.name), files: getBuildFilesForPhase(.headers)) + addObject(headersBuildPhase) + buildPhases.append(headersBuildPhase.reference) + } if !targetFrameworkBuildFiles.isEmpty {