Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
C
cocoapods
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
gengmeiios
cocoapods
Commits
5ae5ef8d
Commit
5ae5ef8d
authored
May 19, 2016
by
Marius Rackwitz
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #5352 from CocoaPods/mr-fix-5313
Symlink header folders by script build phase
parents
5496974a
3dc666eb
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
300 additions
and
2 deletions
+300
-2
CHANGELOG.md
CHANGELOG.md
+6
-0
contents.xcworkspacedata
...Dir Example/Examples.xcworkspace/contents.xcworkspacedata
+10
-0
project.pbxproj
...ample/HeaderMappingsDir Example.xcodeproj/project.pbxproj
+0
-0
HeaderMappingsDir Example.xcscheme
...xcshareddata/xcschemes/HeaderMappingsDir Example.xcscheme
+91
-0
AppDelegate.swift
...gsDir Example/HeaderMappingsDir Example/AppDelegate.swift
+10
-0
Contents.json
... Example/Assets.xcassets/AppIcon.appiconset/Contents.json
+59
-0
Info.plist
...rMappingsDir Example/HeaderMappingsDir Example/Info.plist
+32
-0
Foo.m
...ples/HeaderMappingsDir Example/HeaderMappingsDirPod/Foo.m
+1
-0
HeaderMappingsDirPod.podspec
...Example/HeaderMappingsDirPod/HeaderMappingsDirPod.podspec
+25
-0
Bar.h
...appingsDir Example/HeaderMappingsDirPod/include/Bar/Bar.h
+0
-0
Bar_Private.h
...ir Example/HeaderMappingsDirPod/include/Bar/Bar_Private.h
+0
-0
Foo.h
...derMappingsDir Example/HeaderMappingsDirPod/include/Foo.h
+1
-0
module.modulemap
...MappingsDir Example/HeaderMappingsDirPod/module.modulemap
+10
-0
Podfile
examples/HeaderMappingsDir Example/Podfile
+9
-0
pod_target_installer.rb
...oapods/installer/target_installer/pod_target_installer.rb
+21
-0
pod_target_installer_spec.rb
...t/installer/target_installer/pod_target_installer_spec.rb
+25
-2
No files found.
CHANGELOG.md
View file @
5ae5ef8d
...
...
@@ -12,6 +12,12 @@ To install release candidates run `[sudo] gem install cocoapods --pre`
##### Bug Fixes
*
Symlink the header folders in the framework bundle's root directory
by a new shell script build phase if
`header_mappings_dir`
is used
with frameworks.
[
Marius Rackwitz
](
https://github.com/mrackwitz
)
[
#5313
](
https://github.com/CocoaPods/CocoaPods/issues/5313
)
*
Ensure
`Set`
is defined before using it.
[
Samuel Giddins
](
https://github.com/segiddins
)
[
#5287
](
https://github.com/CocoaPods/CocoaPods/issues/5287
)
...
...
examples/HeaderMappingsDir Example/Examples.xcworkspace/contents.xcworkspacedata
0 → 100644
View file @
5ae5ef8d
<?xml version="1.0" encoding="UTF-8"?>
<Workspace
version =
"1.0"
>
<FileRef
location =
"group:HeaderMappingsDir Example.xcodeproj"
>
</FileRef>
<FileRef
location =
"group:Pods/Pods.xcodeproj"
>
</FileRef>
</Workspace>
examples/HeaderMappingsDir Example/HeaderMappingsDir Example.xcodeproj/project.pbxproj
0 → 100644
View file @
5ae5ef8d
This diff is collapsed.
Click to expand it.
examples/HeaderMappingsDir Example/HeaderMappingsDir Example.xcodeproj/xcshareddata/xcschemes/HeaderMappingsDir Example.xcscheme
0 → 100644
View file @
5ae5ef8d
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion =
"0730"
version =
"1.3"
>
<BuildAction
parallelizeBuildables =
"YES"
buildImplicitDependencies =
"YES"
>
<BuildActionEntries>
<BuildActionEntry
buildForTesting =
"YES"
buildForRunning =
"YES"
buildForProfiling =
"YES"
buildForArchiving =
"YES"
buildForAnalyzing =
"YES"
>
<BuildableReference
BuildableIdentifier =
"primary"
BlueprintIdentifier =
"295BB55D1CEA95DE00E79F82"
BuildableName =
"App.app"
BlueprintName =
"App"
ReferencedContainer =
"container:HeaderMappingsDir Example.xcodeproj"
>
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration =
"Debug"
selectedDebuggerIdentifier =
"Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier =
"Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv =
"YES"
>
<Testables>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier =
"primary"
BlueprintIdentifier =
"295BB55D1CEA95DE00E79F82"
BuildableName =
"App.app"
BlueprintName =
"App"
ReferencedContainer =
"container:HeaderMappingsDir Example.xcodeproj"
>
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration =
"Debug"
selectedDebuggerIdentifier =
"Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier =
"Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle =
"0"
useCustomWorkingDirectory =
"NO"
ignoresPersistentStateOnLaunch =
"NO"
debugDocumentVersioning =
"YES"
debugServiceExtension =
"internal"
allowLocationSimulation =
"YES"
>
<BuildableProductRunnable
runnableDebuggingMode =
"0"
>
<BuildableReference
BuildableIdentifier =
"primary"
BlueprintIdentifier =
"295BB55D1CEA95DE00E79F82"
BuildableName =
"App.app"
BlueprintName =
"App"
ReferencedContainer =
"container:HeaderMappingsDir Example.xcodeproj"
>
</BuildableReference>
</BuildableProductRunnable>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration =
"Release"
shouldUseLaunchSchemeArgsEnv =
"YES"
savedToolIdentifier =
""
useCustomWorkingDirectory =
"NO"
debugDocumentVersioning =
"YES"
>
<BuildableProductRunnable
runnableDebuggingMode =
"0"
>
<BuildableReference
BuildableIdentifier =
"primary"
BlueprintIdentifier =
"295BB55D1CEA95DE00E79F82"
BuildableName =
"App.app"
BlueprintName =
"App"
ReferencedContainer =
"container:HeaderMappingsDir Example.xcodeproj"
>
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration =
"Debug"
>
</AnalyzeAction>
<ArchiveAction
buildConfiguration =
"Release"
revealArchiveInOrganizer =
"YES"
>
</ArchiveAction>
</Scheme>
examples/HeaderMappingsDir Example/HeaderMappingsDir Example/AppDelegate.swift
0 → 100644
View file @
5ae5ef8d
import
Cocoa
import
HeaderMappingsDirPod
import
HeaderMappingsDirPod
.
Private
@NSApplicationMain
class
AppDelegate
:
NSObject
,
NSApplicationDelegate
{
@IBOutlet
weak
var
window
:
NSWindow
!
}
examples/HeaderMappingsDir Example/HeaderMappingsDir Example/Assets.xcassets/AppIcon.appiconset/Contents.json
0 → 100644
View file @
5ae5ef8d
{
"images"
:
[
{
"idiom"
:
"mac"
,
"size"
:
"16x16"
,
"scale"
:
"1x"
},
{
"idiom"
:
"mac"
,
"size"
:
"16x16"
,
"scale"
:
"2x"
},
{
"idiom"
:
"mac"
,
"size"
:
"32x32"
,
"scale"
:
"1x"
},
{
"idiom"
:
"mac"
,
"size"
:
"32x32"
,
"scale"
:
"2x"
},
{
"idiom"
:
"mac"
,
"size"
:
"128x128"
,
"scale"
:
"1x"
},
{
"idiom"
:
"mac"
,
"size"
:
"128x128"
,
"scale"
:
"2x"
},
{
"idiom"
:
"mac"
,
"size"
:
"256x256"
,
"scale"
:
"1x"
},
{
"idiom"
:
"mac"
,
"size"
:
"256x256"
,
"scale"
:
"2x"
},
{
"idiom"
:
"mac"
,
"size"
:
"512x512"
,
"scale"
:
"1x"
},
{
"idiom"
:
"mac"
,
"size"
:
"512x512"
,
"scale"
:
"2x"
}
],
"info"
:
{
"version"
:
1
,
"author"
:
"xcode"
}
}
\ No newline at end of file
examples/HeaderMappingsDir Example/HeaderMappingsDir Example/Info.plist
0 → 100644
View file @
5ae5ef8d
<
?xml
v
e
rsion="
1
.
0
"
e
n
c
o
d
ing="UT
F
-
8
"?
>
<
!
D
O
C
TYP
E
plist
PU
B
LI
C
"-//
A
ppl
e
//
D
T
D
PLIST
1
.
0
//
E
N"
"http://www.
a
ppl
e
.
c
om/
D
T
D
s/Prop
e
rtyList-
1
.
0
.
d
t
d
"
>
<
plist
v
e
rsion="
1
.
0
"
>
<
d
i
c
t
>
<
k
e
y
>
CFBundleDevelopmentRegion
<
/k
e
y
>
<
string
>
en
<
/string
>
<
k
e
y
>
CFBundleExecutable
<
/k
e
y
>
<
string
>
$
(
EXECUTABLE_NAME
)<
/string
>
<
k
e
y
>
CFBundleIconFile
<
/k
e
y
>
<
string
><
/string
>
<
k
e
y
>
CFBundleIdentifier
<
/k
e
y
>
<
string
>
$
(
PRODUCT_BUNDLE_IDENTIFIER
)<
/string
>
<
k
e
y
>
CFBundleInfoDictionaryVersion
<
/k
e
y
>
<
string
>
6.0
<
/string
>
<
k
e
y
>
CFBundleName
<
/k
e
y
>
<
string
>
$
(
PRODUCT_NAME
)<
/string
>
<
k
e
y
>
CFBundlePackageType
<
/k
e
y
>
<
string
>
APPL
<
/string
>
<
k
e
y
>
CFBundleShortVersionString
<
/k
e
y
>
<
string
>
1.0
<
/string
>
<
k
e
y
>
CFBundleSignature
<
/k
e
y
>
<
string
>
????
<
/string
>
<
k
e
y
>
CFBundleVersion
<
/k
e
y
>
<
string
>
1
<
/string
>
<
k
e
y
>
LSMinimumSystemVersion
<
/k
e
y
>
<
string
>
$
(
MACOSX_DEPLOYMENT_TARGET
)<
/string
>
<
k
e
y
>
NSHumanReadableCopyright
<
/k
e
y
>
<
string
>
Copyright
©
2016
CocoaPods.
All
rights
reserved.
<
/string
>
<
k
e
y
>
NSPrincipalClass
<
/k
e
y
>
<
string
>
NSApplication
<
/string
>
<
/
d
i
c
t
>
<
/plist
>
examples/HeaderMappingsDir Example/HeaderMappingsDirPod/Foo.m
0 → 100644
View file @
5ae5ef8d
#
import
"
Bar_Private
.
h
"
examples/HeaderMappingsDir Example/HeaderMappingsDirPod/HeaderMappingsDirPod.podspec
0 → 100644
View file @
5ae5ef8d
Pod
::
Spec
.
new
do
|
s
|
s
.
name
=
'HeaderMappingsDirPod'
s
.
version
=
'0.1.0'
s
.
summary
=
'Demonstrates using a set of advanced options all together.'
s
.
description
=
<<-
DESC
* has private headers
* has a `header_mappings_dir`
* has a `module_map`
* explictly declare at least one of the private
headers in the module map
DESC
s
.
source
=
{
:git
=>
'https://github.com/CocoaPods/CocoaPods.git'
,
:tag
=>
"v
#{
s
.
version
}
"
}
s
.
homepage
=
"https://github.com/CocoaPods/CocoaPods"
s
.
author
=
{
'Example'
=>
'help@example.org'
}
s
.
license
=
{
:type
=>
'MIT'
,
:file
=>
'../../../LICENSE'
}
s
.
public_header_files
=
'include/Foo.h'
,
'include/Bar/Bar.h'
s
.
private_header_files
=
'include/Bar/Bar_Private.h'
s
.
source_files
=
'*.m'
,
'include/*.h'
,
'include/Bar/*.h'
s
.
module_map
=
'module.modulemap'
s
.
header_mappings_dir
=
'include'
s
.
preserve_paths
=
%w(include)
s
.
osx
.
deployment_target
=
'10.9'
end
examples/HeaderMappingsDir Example/HeaderMappingsDirPod/include/Bar/Bar.h
0 → 100644
View file @
5ae5ef8d
examples/HeaderMappingsDir Example/HeaderMappingsDirPod/include/Bar/Bar_Private.h
0 → 100644
View file @
5ae5ef8d
examples/HeaderMappingsDir Example/HeaderMappingsDirPod/include/Foo.h
0 → 100644
View file @
5ae5ef8d
#import "Bar/Bar.h"
examples/HeaderMappingsDir Example/HeaderMappingsDirPod/module.modulemap
0 → 100644
View file @
5ae5ef8d
framework module HeaderMappingsDirPod {
umbrella header "Foo.h"
export *
module * { export * }
explicit module Private {
header "Bar/Bar_Private.h"
}
}
examples/HeaderMappingsDir Example/Podfile
0 → 100644
View file @
5ae5ef8d
platform
:osx
,
'10.9'
use_frameworks!
workspace
'Examples.xcworkspace'
project
'HeaderMappingsDir Example.xcodeproj'
target
'App'
do
pod
'HeaderMappingsDirPod'
,
:path
=>
'HeaderMappingsDirPod'
end
lib/cocoapods/installer/target_installer/pod_target_installer.rb
View file @
5ae5ef8d
...
...
@@ -32,6 +32,7 @@ module Pod
target
.
file_accessors
.
flat_map
(
&
:public_headers
).
map
(
&
:basename
)
end
end
create_build_phase_to_symlink_header_folders
end
create_prefix_header
create_dummy_source
...
...
@@ -216,6 +217,26 @@ module Pod
end
end
# Creates a build phase which links the versioned header folders
# of the OS X into the framework bundle's root root directory.
# This is only necessary because the way how headers are copied
# via custom copy file build phases in combination with
# header_mappings_dir interferes with xcodebuild's expectations
# about the existence of private or public headers.
#
# @return [void]
#
def
create_build_phase_to_symlink_header_folders
return
unless
target
.
platform
.
name
==
:osx
&&
header_mappings_dir
build_phase
=
native_target
.
new_shell_script_build_phase
(
'Create Symlinks to Header Folders'
)
build_phase
.
shell_script
=
<<-
eos
.
strip_heredoc
cd "$CONFIGURATION_BUILD_DIR/$WRAPPER_NAME"
ln -fs ${PUBLIC_HEADERS_FOLDER_PATH
\#
$WRAPPER_NAME/} ${PUBLIC_HEADERS_FOLDER_PATH
\#\$
CONTENTS_FOLDER_PATH/}
ln -fs ${PRIVATE_HEADERS_FOLDER_PATH
\#\$
WRAPPER_NAME/} ${PRIVATE_HEADERS_FOLDER_PATH
\#\$
CONTENTS_FOLDER_PATH/}
eos
end
# Creates a prefix header file which imports `UIKit` or `Cocoa` according
# to the platform of the target. This file also include any prefix header
# content reported by the specification of the pods.
...
...
spec/unit/installer/target_installer/pod_target_installer_spec.rb
View file @
5ae5ef8d
...
...
@@ -300,10 +300,11 @@ module Pod
@project
.
add_file_reference
(
file
,
group
)
end
@installer
.
stubs
(
:target
).
returns
(
@pod_target
)
@installer
.
install!
end
it
'creates custom copy files phases for framework pods'
do
@installer
.
install!
target
=
@project
.
native_targets
.
first
target
.
name
.
should
==
'snake'
...
...
@@ -340,12 +341,34 @@ module Pod
end
it
'uses relative file paths to generate umbrella header'
do
content
=
@pod_target
.
umbrella_header_path
.
read
@installer
.
install!
content
=
@pod_target
.
umbrella_header_path
.
read
content
.
should
=~
%r{"A/Boa.h"}
content
.
should
=~
%r{"A/Garden.h"}
content
.
should
=~
%r{"A/Rattle.h"}
end
it
'creates a build phase to symlink header folders on OS X'
do
@pod_target
.
stubs
(
:platform
).
returns
(
Platform
.
osx
)
@installer
.
install!
target
=
@project
.
native_targets
.
first
build_phase
=
target
.
shell_script_build_phases
.
find
do
|
bp
|
bp
.
name
==
'Create Symlinks to Header Folders'
end
build_phase
.
should
.
not
.
be
.
nil
end
end
it
"doesn't create a build phase to symlink header folders by default on OS X"
do
@pod_target
.
stubs
(
:platform
).
returns
(
Platform
.
osx
)
@installer
.
install!
target
=
@project
.
native_targets
.
first
target
.
shell_script_build_phases
.
should
==
[]
end
#--------------------------------------------------------------------------------#
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment