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
193572d8
Commit
193572d8
authored
Nov 04, 2011
by
Eloy Duran
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Generate a prefix header for each target and remove the files from disk and the project template.
parent
018cb7f4
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
29 additions
and
34 deletions
+29
-34
installer.rb
lib/cocoapods/installer.rb
+21
-2
specification.rb
lib/cocoapods/specification.rb
+5
-4
project.rb
lib/cocoapods/xcode/project.rb
+0
-1
integration_spec.rb
spec/integration_spec.rb
+1
-0
project_spec.rb
spec/unit/xcode/project_spec.rb
+2
-3
Pods-Prefix.pch
xcode-project-templates/cocoa-static-library/Pods-Prefix.pch
+0
-7
Pods.xcconfig
xcode-project-templates/cocoa-static-library/Pods.xcconfig
+0
-1
project.pbxproj
...lates/cocoa-static-library/Pods.xcodeproj/project.pbxproj
+0
-4
Pods-Prefix.pch
...ject-templates/cocoa-touch-static-library/Pods-Prefix.pch
+0
-7
Pods.xcconfig
...roject-templates/cocoa-touch-static-library/Pods.xcconfig
+0
-1
project.pbxproj
...cocoa-touch-static-library/Pods.xcodeproj/project.pbxproj
+0
-4
No files found.
lib/cocoapods/installer.rb
View file @
193572d8
...
...
@@ -61,6 +61,19 @@ module Pod
"
#{
@definition
.
lib_name
}
.bridgesupport"
end
# TODO move out
def
save_prefix_header_as
(
pathname
)
pathname
.
open
(
'w'
)
do
|
header
|
header
.
puts
"#ifdef __OBJC__"
header
.
puts
"#import
#{
@podfile
.
platform
==
:ios
?
'<UIKit/UIKit.h>'
:
'<Cocoa/Cocoa.h>'
}
"
header
.
puts
"#endif"
end
end
def
prefix_header_filename
"
#{
@definition
.
lib_name
}
-prefix.pch"
end
# TODO move xcconfig related code into the xcconfig method, like copy_resources_script and generate_bridge_support.
def
install!
# First add the target to the project
...
...
@@ -86,10 +99,12 @@ module Pod
end
xcconfig
.
merge!
(
'USER_HEADER_SEARCH_PATHS'
=>
user_header_search_paths
.
sort
.
uniq
.
join
(
" "
))
# Add the xcconfig file to the project and make it the base of the target's configurations.
# Add the prefix header and xcconfig files to the project
@xcodeproj
.
files
.
new
(
'path'
=>
prefix_header_filename
)
xcconfig_file
=
@xcodeproj
.
files
.
new
(
"path"
=>
xcconfig_filename
)
@target
.
buildConfigurations
.
each
do
|
config
|
config
.
baseConfiguration
=
xcconfig_file
config
.
buildSettings
[
'GCC_PREFIX_HEADER'
]
=
prefix_header_filename
end
end
...
...
@@ -99,6 +114,7 @@ module Pod
bridge_support_generator
.
save_as
(
root
+
bridge_support_filename
)
copy_resources_script
.
resources
<<
bridge_support_filename
end
save_prefix_header_as
(
root
+
prefix_header_filename
)
copy_resources_script
.
save_as
(
root
+
copy_resources_filename
)
end
end
...
...
@@ -154,7 +170,10 @@ module Pod
puts
" * Writing Xcode project file to `
#{
pbxproj
}
'"
if
config
.
verbose?
xcodeproj
.
save_as
(
pbxproj
)
build_specifications
.
each
(
&
:post_install
)
# Post install hooks run last!
targets
.
each
do
|
target
|
target
.
build_specifications
.
each
{
|
spec
|
spec
.
post_install
(
target
)
}
end
end
def
configure_project
(
projpath
)
...
...
lib/cocoapods/specification.rb
View file @
193572d8
...
...
@@ -325,17 +325,18 @@ module Pod
# This is a convenience method which gets called after all pods have been
# downloaded, installed, and the Xcode project and related files have been
# generated. Override this to, for instance, add to the prefix header:
# generated. (It receives the Pod::Installer::Target instance for the current
# target.) Override this to, for instance, add to the prefix header:
#
# Pod::Spec.new do |s|
# def s.post_install
# prefix_header = config.project_pods_root +
'Pods-Prefix.pch'
# def s.post_install
(target)
# prefix_header = config.project_pods_root +
target.prefix_header_filename
# prefix_header.open('a') do |file|
# file.puts(%{#ifdef __OBJC__\n#import "SSToolkitDefines.h"\n#endif})
# end
# end
# end
def
post_install
def
post_install
(
target
)
end
end
...
...
lib/cocoapods/xcode/project.rb
View file @
193572d8
...
...
@@ -331,7 +331,6 @@ module Pod
self
.
buildSettings
=
{
'DSTROOT'
=>
'/tmp/Pods.dst'
,
'GCC_PRECOMPILE_PREFIX_HEADER'
=>
'YES'
,
'GCC_PREFIX_HEADER'
=>
'Pods-Prefix.pch'
,
'GCC_VERSION'
=>
'com.apple.compilers.llvm.clang.1_0'
,
# The OTHER_LDFLAGS option *has* to be overriden so that it does not
# use those from the xcconfig (for CocoaPods specifically).
...
...
spec/integration_spec.rb
View file @
193572d8
...
...
@@ -174,6 +174,7 @@ else
Dir
.
chdir
(
config
.
project_pods_root
)
do
puts
"
\n
[!] Compiling static library `Pods'..."
#system("xcodebuild -target Pods").should == true
system
(
"xcodebuild -target Pods > /dev/null 2>&1"
).
should
==
true
puts
"
\n
[!] Compiling static library `Pods-debug'..."
system
(
"xcodebuild -target Pods-debug > /dev/null 2>&1"
).
should
==
true
...
...
spec/unit/xcode/project_spec.rb
View file @
193572d8
...
...
@@ -183,7 +183,8 @@ describe "Pod::Xcode::Project" do
configuration
.
buildSettings
.
should
==
{
'DSTROOT'
=>
'/tmp/Pods.dst'
,
'GCC_PRECOMPILE_PREFIX_HEADER'
=>
'YES'
,
'GCC_PREFIX_HEADER'
=>
'Pods-Prefix.pch'
,
# TODO do we need a default?
#'GCC_PREFIX_HEADER' => 'Pods-Prefix.pch',
'OTHER_LDFLAGS'
=>
''
,
'GCC_VERSION'
=>
'com.apple.compilers.llvm.clang.1_0'
,
'PRODUCT_NAME'
=>
'$(TARGET_NAME)'
,
...
...
@@ -322,8 +323,6 @@ describe "Pod::Xcode::Project" do
it
"saves the template with the adjusted project"
do
@template
.
copy_to
(
temporary_directory
)
@project
.
save_as
(
temporary_directory
+
'Pods.xcodeproj'
)
(
temporary_directory
+
'Pods-Prefix.pch'
).
should
.
exist
(
temporary_directory
+
'Pods.xcconfig'
).
should
.
exist
project_file
=
(
temporary_directory
+
'Pods.xcodeproj/project.pbxproj'
)
NSDictionary
.
dictionaryWithContentsOfFile
(
project_file
.
to_s
).
should
==
@project
.
to_hash
end
...
...
xcode-project-templates/cocoa-static-library/Pods-Prefix.pch
deleted
100644 → 0
View file @
018cb7f4
//
// Prefix header for all source files of the 'Pods' target in the 'Pods' project
//
#ifdef __OBJC__
#import <Cocoa/Cocoa.h>
#endif
xcode-project-templates/cocoa-static-library/Pods.xcconfig
deleted
100644 → 0
View file @
018cb7f4
xcode-project-templates/cocoa-static-library/Pods.xcodeproj/project.pbxproj
View file @
193572d8
...
...
@@ -8,15 +8,12 @@
/* Begin PBXFileReference section */
518ACD3E1446050200F6BE80
/* Cocoa.framework */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
wrapper.framework
;
name
=
Cocoa.framework
;
path
=
System/Library/Frameworks/Cocoa.framework
;
sourceTree
=
SDKROOT
;
};
518ACD461446050200F6BE80
/* Pods-Prefix.pch */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.c.h
;
path
=
"Pods-Prefix.pch"
;
sourceTree
=
"<group>"
;
};
518ACD53144605B400F6BE80
/* Pods.xcconfig */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
text.xcconfig
;
path
=
Pods.xcconfig
;
sourceTree
=
"<group>"
;
};
/* End PBXFileReference section */
/* Begin PBXGroup section */
518ACD301446050100F6BE80
=
{
isa
=
PBXGroup
;
children
=
(
518ACD53144605B400F6BE80
/* Pods.xcconfig */
,
518ACD5B1446449B00F6BE80
/* Pods */
,
518ACD3D1446050200F6BE80
/* Frameworks */
,
518ACD3C1446050200F6BE80
/* Products */
,
...
...
@@ -41,7 +38,6 @@
518ACD451446050200F6BE80
/* Supporting Files */
=
{
isa
=
PBXGroup
;
children
=
(
518ACD461446050200F6BE80
/* Pods-Prefix.pch */
,
);
name
=
"Supporting Files"
;
path
=
Pods
;
...
...
xcode-project-templates/cocoa-touch-static-library/Pods-Prefix.pch
deleted
100644 → 0
View file @
018cb7f4
//
// Prefix header for all source files of the 'Pods' target in the 'Pods' project
//
#ifdef __OBJC__
#import <UIKit/UIKit.h>
#endif
xcode-project-templates/cocoa-touch-static-library/Pods.xcconfig
deleted
100644 → 0
View file @
018cb7f4
xcode-project-templates/cocoa-touch-static-library/Pods.xcodeproj/project.pbxproj
View file @
193572d8
...
...
@@ -7,16 +7,13 @@
objects
=
{
/* Begin PBXFileReference section */
515160D0141EC5D100EBB823
/* Pods.xcconfig */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
text.xcconfig
;
path
=
Pods.xcconfig
;
sourceTree
=
"<group>"
;
};
515B0FB8141D52E0001DC3E6
/* Foundation.framework */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
wrapper.framework
;
name
=
Foundation.framework
;
path
=
System/Library/Frameworks/Foundation.framework
;
sourceTree
=
SDKROOT
;
};
515B0FBC141D52E0001DC3E6
/* Pods-Prefix.pch */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.c.h
;
path
=
"Pods-Prefix.pch"
;
sourceTree
=
SOURCE_ROOT
;
};
/* End PBXFileReference section */
/* Begin PBXGroup section */
515B0FAA141D52E0001DC3E6
=
{
isa
=
PBXGroup
;
children
=
(
515160D0141EC5D100EBB823
/* Pods.xcconfig */
,
515B0FC9141D5FBE001DC3E6
/* Pods */
,
515B0FB7141D52E0001DC3E6
/* Frameworks */
,
515B0FB6141D52E0001DC3E6
/* Products */
,
...
...
@@ -41,7 +38,6 @@
515B0FBB141D52E0001DC3E6
/* Supporting Files */
=
{
isa
=
PBXGroup
;
children
=
(
515B0FBC141D52E0001DC3E6
/* Pods-Prefix.pch */
,
);
name
=
"Supporting Files"
;
path
=
Pods
;
...
...
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