mirror of
https://github.com/yonaskolb/XcodeGen.git
synced 2026-03-18 20:02:25 +00:00
Allow specifying phase order for copy files phases
Copy Files phases don't stop dependent targets from starting to compile. If some of the files being copied are needed for the dependent target to compile then they need to happen before the Compile Sources phase. This change allows specifying that.
This commit is contained in:
@@ -646,7 +646,13 @@ public class PBXProjGenerator {
|
||||
return sourceFilesByCopyFiles.mapValues { getBuildFilesForSourceFiles($0) }
|
||||
}
|
||||
|
||||
copyFilesBuildPhasesFiles.merge(getBuildFilesForCopyFilesPhases()) { $0 + $1 }
|
||||
|
||||
buildPhases += try target.prebuildScripts.map { try generateBuildScript(targetName: target.name, buildScript: $0) }
|
||||
|
||||
buildPhases += copyFilesBuildPhasesFiles
|
||||
.filter { $0.key.phaseOrder == .preCompile }
|
||||
.map { generateCopyFiles(targetName: target.name, copyFiles: $0, buildPhaseFiles: $1) }
|
||||
|
||||
let headersBuildPhaseFiles = getBuildFilesForPhase(.headers)
|
||||
if !headersBuildPhaseFiles.isEmpty && (target.type == .framework || target.type == .dynamicLibrary) {
|
||||
@@ -689,8 +695,9 @@ public class PBXProjGenerator {
|
||||
buildPhases.append(script.reference)
|
||||
}
|
||||
|
||||
copyFilesBuildPhasesFiles.merge(getBuildFilesForCopyFilesPhases()) { $0 + $1 }
|
||||
buildPhases += copyFilesBuildPhasesFiles.map { generateCopyFiles(targetName: target.name, copyFiles: $0, buildPhaseFiles: $1) }
|
||||
buildPhases += copyFilesBuildPhasesFiles
|
||||
.filter { $0.key.phaseOrder == .postCompile }
|
||||
.map { generateCopyFiles(targetName: target.name, copyFiles: $0, buildPhaseFiles: $1) }
|
||||
|
||||
if !targetFrameworkBuildFiles.isEmpty {
|
||||
|
||||
|
||||
@@ -73,7 +73,8 @@ class SourceGenerator {
|
||||
if headerVisibility == .public {
|
||||
chosenBuildPhase = .copyFiles(TargetSource.BuildPhase.CopyFilesSettings(
|
||||
destination: .productsDirectory,
|
||||
subpath: "include/$(PRODUCT_NAME)"
|
||||
subpath: "include/$(PRODUCT_NAME)",
|
||||
phaseOrder: .preCompile
|
||||
))
|
||||
} else {
|
||||
chosenBuildPhase = nil
|
||||
@@ -194,7 +195,8 @@ class SourceGenerator {
|
||||
guard targetType == .staticLibrary else { return nil }
|
||||
return .copyFiles(TargetSource.BuildPhase.CopyFilesSettings(
|
||||
destination: .productsDirectory,
|
||||
subpath: "include/$(PRODUCT_NAME)"
|
||||
subpath: "include/$(PRODUCT_NAME)",
|
||||
phaseOrder: .preCompile
|
||||
))
|
||||
case "framework": return .frameworks
|
||||
case "xpc": return .copyFiles(.xpcServices)
|
||||
|
||||
Reference in New Issue
Block a user