Skip to content

Commit

Permalink
Strip PrivateHeaders directory from copied frameworks
Browse files Browse the repository at this point in the history
Carthage#1377 stoped copying the `Headers` directory, but didn't include the `PrivateHeaders` directory, which is still being copied.

Ref Carthage#1377 Carthage#1337
  • Loading branch information
erichoracek committed Jul 2, 2016
1 parent 6b97280 commit 309f47c
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion Source/CarthageKit/Xcode.swift
Original file line number Diff line number Diff line change
Expand Up @@ -1249,14 +1249,17 @@ public func buildInDirectory(directoryURL: NSURL, withConfiguration configuratio
public func stripFramework(frameworkURL: NSURL, keepingArchitectures: [String], codesigningIdentity: String? = nil) -> SignalProducer<(), CarthageError> {
let stripArchitectures = stripBinary(frameworkURL, keepingArchitectures: keepingArchitectures)

// Xcode doesn't copy `Headers` and `Modules` directory at all.
// Xcode doesn't copy `Headers`, `PrivateHeaders` and `Modules` directory at
// all.
let stripHeaders = stripHeadersDirectory(frameworkURL)
let stripPrivateHeaders = stripPrivateHeadersDirectory(frameworkURL)
let stripModules = stripModulesDirectory(frameworkURL)

let sign = codesigningIdentity.map { codesign(frameworkURL, $0) } ?? .empty

return stripArchitectures
.concat(stripHeaders)
.concat(stripPrivateHeaders)
.concat(stripModules)
.concat(sign)
}
Expand Down Expand Up @@ -1425,6 +1428,11 @@ public func stripHeadersDirectory(frameworkURL: NSURL) -> SignalProducer<(), Car
return stripDirectory(named: "Headers", of: frameworkURL)
}

/// Strips `PrivateHeaders` directory from the given framework.
public func stripPrivateHeadersDirectory(frameworkURL: NSURL) -> SignalProducer<(), CarthageError> {
return stripDirectory(named: "PrivateHeaders", of: frameworkURL)
}

/// Strips `Modules` directory from the given framework.
public func stripModulesDirectory(frameworkURL: NSURL) -> SignalProducer<(), CarthageError> {
return stripDirectory(named: "Modules", of: frameworkURL)
Expand Down

0 comments on commit 309f47c

Please sign in to comment.