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
6e4ee6e7
Commit
6e4ee6e7
authored
Mar 04, 2012
by
Luke Redpath
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixes for the latest version of xcodeproj
parent
ce8650bb
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
74 additions
and
54 deletions
+74
-54
CHANGELOG.md
CHANGELOG.md
+2
-2
Podfile
examples/MacRubySample/Podfile
+2
-2
better_installer.rb
lib/cocoapods/better_installer.rb
+11
-0
target_installer.rb
lib/cocoapods/installer/target_installer.rb
+4
-4
podfile.rb
lib/cocoapods/podfile.rb
+2
-2
project.rb
lib/cocoapods/project.rb
+27
-18
project_integration.rb
lib/cocoapods/project_integration.rb
+2
-2
project_integration_spec.rb
spec/functional/project_integration_spec.rb
+1
-1
integration_spec.rb
spec/integration_spec.rb
+6
-6
project_spec.rb
spec/unit/project_spec.rb
+17
-17
No files found.
CHANGELOG.md
View file @
6e4ee6e7
...
...
@@ -78,8 +78,8 @@ _before_ it’s written to disk. [[docs][3]]
# Enable garbage collection support for MacRuby applications.
post_install do |installer|
installer.project.targets.each do |target|
target.build
C
onfigurations.each do |config|
config.build
S
ettings['GCC_ENABLE_OBJC_GC'] = 'supported'
target.build
_c
onfigurations.each do |config|
config.build
_s
ettings['GCC_ENABLE_OBJC_GC'] = 'supported'
end
end
end
...
...
examples/MacRubySample/Podfile
View file @
6e4ee6e7
...
...
@@ -16,8 +16,8 @@ end
# Enable garbage collection support, which MacRuby requires.
post_install
do
|
installer
|
installer
.
project
.
targets
.
each
do
|
target
|
target
.
build
C
onfigurations
.
each
do
|
config
|
config
.
build
S
ettings
[
'GCC_ENABLE_OBJC_GC'
]
=
'supported'
target
.
build
_c
onfigurations
.
each
do
|
config
|
config
.
build
_s
ettings
[
'GCC_ENABLE_OBJC_GC'
]
=
'supported'
end
end
end
lib/cocoapods/better_installer.rb
0 → 100644
View file @
6e4ee6e7
module
Pod
class
DependencyInstaller
def
initialize
(
sandbox
)
@sandbox
=
sandbox
end
def
install
(
dependency
)
end
end
end
lib/cocoapods/installer/target_installer.rb
View file @
6e4ee6e7
...
...
@@ -83,11 +83,11 @@ module Pod
end
def
configure_build_configurations
(
xcconfig_file
)
@target
.
build
C
onfigurations
.
each
do
|
config
|
@target
.
build
_c
onfigurations
.
each
do
|
config
|
config
.
baseConfiguration
=
xcconfig_file
config
.
build
S
ettings
[
'OTHER_LDFLAGS'
]
=
''
config
.
build
S
ettings
[
'GCC_PREFIX_HEADER'
]
=
prefix_header_filename
config
.
build
S
ettings
[
'PODS_ROOT'
]
=
'$(SRCROOT)'
config
.
build
_s
ettings
[
'OTHER_LDFLAGS'
]
=
''
config
.
build
_s
ettings
[
'GCC_PREFIX_HEADER'
]
=
prefix_header_filename
config
.
build
_s
ettings
[
'PODS_ROOT'
]
=
'$(SRCROOT)'
end
end
...
...
lib/cocoapods/podfile.rb
View file @
6e4ee6e7
...
...
@@ -206,8 +206,8 @@ module Pod
#
# post_install do |installer|
# installer.project.targets.each do |target|
# target.build
C
onfigurations.each do |config|
# config.build
S
ettings['GCC_ENABLE_OBJC_GC'] = 'supported'
# target.build
_c
onfigurations.each do |config|
# config.build
_s
ettings['GCC_ENABLE_OBJC_GC'] = 'supported'
# end
# end
# end
...
...
lib/cocoapods/project.rb
View file @
6e4ee6e7
...
...
@@ -22,9 +22,13 @@ module Pod
pods
.
groups
.
new
(
'name'
=>
name
)
end
def
build_configuration_list
objects
[
root_object
.
attributes
[
'buildConfigurationList'
]]
end
# Shortcut access to build configurations
def
build_configurations
objects
[
root_object
.
attributes
[
'buildConfigurationList'
]].
buildC
onfigurations
build_configuration_list
.
build_c
onfigurations
end
def
build_configuration
(
name
)
...
...
@@ -32,7 +36,7 @@ module Pod
end
def
self
.
for_platform
(
platform
)
project
=
Pod
::
Project
.
new
Pod
::
Project
.
new
.
tap
do
|
project
|
project
.
main_group
<<
project
.
groups
.
new
({
'name'
=>
'Pods'
})
framework
=
project
.
add_system_framework
(
platform
==
:ios
?
'Foundation'
:
'Cocoa'
)
framework
.
group
=
project
.
groups
.
new
({
'name'
=>
'Frameworks'
})
...
...
@@ -41,21 +45,23 @@ module Pod
project
.
main_group
<<
products
project
.
root_object
.
products
=
products
project
.
root_object
.
attributes
[
'buildConfigurationList'
]
=
project
.
objects
.
add
(
Xcodeproj
::
Project
::
Object
::
XCConfigurationList
,
{
configuration_list
=
project
.
objects
.
add
(
Xcodeproj
::
Project
::
Object
::
XCConfigurationList
,
{
'defaultConfigurationIsVisible'
=>
'0'
,
'defaultConfigurationName'
=>
'Release'
,
'buildConfigurations'
=>
[
project
.
objects
.
add
(
Xcodeproj
::
Project
::
Object
::
XCBuildConfiguration
,
{
})
config
=
configuration_list
.
build_configurations
.
new
(
'name'
=>
'Debug'
,
'buildSettings'
=>
build_settings
(
platform
,
:debug
)
}),
project
.
objects
.
add
(
Xcodeproj
::
Project
::
Object
::
XCBuildConfiguration
,
{
)
configuration_list
.
build_configurations
.
new
(
'name'
=>
'Release'
,
'buildSettings'
=>
build_settings
(
platform
,
:release
)
}
)
].
map
(
&
:uuid
)
})
.
uuid
project
)
project
.
root_object
.
attributes
[
'buildConfigurationList'
]
=
configuration_list
.
uuid
end
end
private
...
...
@@ -69,20 +75,20 @@ module Pod
'GCC_WARN_ABOUT_RETURN_TYPE'
=>
'YES'
,
'GCC_WARN_UNUSED_VARIABLE'
=>
'YES'
,
'OTHER_LDFLAGS'
=>
''
},
}
.
freeze
,
:debug
=>
{
'GCC_DYNAMIC_NO_PIC'
=>
'NO'
,
'GCC_PREPROCESSOR_DEFINITIONS'
=>
[
"DEBUG=1"
,
"$(inherited)"
],
'GCC_SYMBOLS_PRIVATE_EXTERN'
=>
'NO'
,
'GCC_OPTIMIZATION_LEVEL'
=>
'0'
},
}
.
freeze
,
:ios
=>
{
'ARCHS'
=>
"$(ARCHS_STANDARD_32_BIT)"
,
'GCC_VERSION'
=>
'com.apple.compilers.llvmgcc42'
,
'IPHONEOS_DEPLOYMENT_TARGET'
=>
'4.3'
,
'PUBLIC_HEADERS_FOLDER_PATH'
=>
"$(TARGET_NAME)"
,
'SDKROOT'
=>
'iphoneos'
},
}
.
freeze
,
:osx
=>
{
'ARCHS'
=>
"$(ARCHS_STANDARD_64_BIT)"
,
'GCC_ENABLE_OBJC_EXCEPTIONS'
=>
'YES'
,
...
...
@@ -90,12 +96,15 @@ module Pod
'GCC_VERSION'
=>
'com.apple.compilers.llvm.clang.1_0'
,
'MACOSX_DEPLOYMENT_TARGET'
=>
'10.7'
,
'SDKROOT'
=>
'macosx'
}
}
}
.
freeze
}
.
freeze
def
self
.
build_settings
(
platform
,
scheme
)
settings
=
COMMON_BUILD_SETTINGS
[
:all
].
merge
(
COMMON_BUILD_SETTINGS
[
platform
.
name
])
COMMON_BUILD_SETTINGS
[
:all
].
dup
.
tap
do
|
settings
|
settings
.
merge!
(
COMMON_BUILD_SETTINGS
[
platform
.
name
])
settings
[
'COPY_PHASE_STRIP'
]
=
scheme
==
:debug
?
'NO'
:
'YES'
if
platform
.
requires_legacy_ios_archs?
settings
[
'ARCHS'
]
=
"armv6 armv7"
end
...
...
@@ -109,7 +118,7 @@ module Pod
settings
[
'VALIDATE_PRODUCT'
]
=
'YES'
if
platform
==
:ios
settings
[
'DEBUG_INFORMATION_FORMAT'
]
=
"dwarf-with-dsym"
if
platform
==
:osx
end
settings
end
end
end
end
lib/cocoapods/project_integration.rb
View file @
6e4ee6e7
...
...
@@ -67,7 +67,7 @@ module Pod
def
base_project_configurations_on_xcconfig
(
project
,
xcconfig_file
)
project
.
targets
.
each
do
|
target
|
target
.
build
C
onfigurations
.
each
do
|
config
|
target
.
build
_c
onfigurations
.
each
do
|
config
|
config
.
baseConfiguration
=
xcconfig_file
end
end
...
...
@@ -82,7 +82,7 @@ module Pod
end
def
add_copy_resources_script_phase_to_each_target_in_project
(
project
,
copy_resources_script_phase
)
project
.
targets
.
each
{
|
target
|
target
.
build
P
hases
<<
copy_resources_script_phase
}
project
.
targets
.
each
{
|
target
|
target
.
build
_p
hases
<<
copy_resources_script_phase
}
end
end
end
...
...
spec/functional/project_integration_spec.rb
View file @
6e4ee6e7
...
...
@@ -31,7 +31,7 @@ describe Pod::ProjectIntegration do
xcconfig_file
=
@sample_project
.
files
.
where
(
:path
=>
"Pods/Pods.xcconfig"
)
@sample_project
.
targets
.
each
do
|
target
|
target
.
build
C
onfigurations
.
each
do
|
config
|
target
.
build
_c
onfigurations
.
each
do
|
config
|
config
.
baseConfiguration
.
should
==
xcconfig_file
end
end
...
...
spec/integration_spec.rb
View file @
6e4ee6e7
...
...
@@ -136,16 +136,16 @@ else
post_install
do
|
installer
|
target
=
installer
.
project
.
targets
.
first
target
.
build
C
onfigurations
.
each
do
|
config
|
config
.
build
S
ettings
[
'GCC_ENABLE_OBJC_GC'
]
=
'supported'
target
.
build
_c
onfigurations
.
each
do
|
config
|
config
.
build
_s
ettings
[
'GCC_ENABLE_OBJC_GC'
]
=
'supported'
end
end
end
SpecHelper
::
Installer
.
new
(
podfile
).
install!
project
=
Pod
::
Project
.
new
(
config
.
project_pods_root
+
'Pods.xcodeproj'
)
project
.
targets
.
first
.
build
C
onfigurations
.
map
do
|
config
|
config
.
build
S
ettings
[
'GCC_ENABLE_OBJC_GC'
]
project
.
targets
.
first
.
build
_c
onfigurations
.
map
do
|
config
|
config
.
build
_s
ettings
[
'GCC_ENABLE_OBJC_GC'
]
end
.
should
==
%w{ supported supported }
end
...
...
@@ -325,7 +325,7 @@ else
project
=
Pod
::
Project
.
new
(
projpath
)
libPods
=
project
.
files
.
find
{
|
f
|
f
.
name
==
'libPods.a'
}
project
.
targets
.
each
do
|
target
|
target
.
build
C
onfigurations
.
each
do
|
config
|
target
.
build
_c
onfigurations
.
each
do
|
config
|
config
.
baseConfiguration
.
path
.
should
==
'Pods/Pods.xcconfig'
end
...
...
@@ -333,7 +333,7 @@ else
phase
.
files
.
map
{
|
buildFile
|
buildFile
.
file
}.
should
.
include
libPods
# should be the last phase
target
.
build
P
hases
.
last
.
shellScript
.
should
==
%{"${SRCROOT}/Pods/Pods-resources.sh"\n}
target
.
build
_p
hases
.
last
.
shellScript
.
should
==
%{"${SRCROOT}/Pods/Pods-resources.sh"\n}
end
end
...
...
spec/unit/project_spec.rb
View file @
6e4ee6e7
...
...
@@ -13,7 +13,7 @@ describe 'Pod::Project' do
it
"adds a group to the `Pods' group"
do
group
=
@project
.
add_pod_group
(
'JSONKit'
)
@project
.
pods
.
child
R
eferences
.
should
.
include
group
.
uuid
@project
.
pods
.
child
_r
eferences
.
should
.
include
group
.
uuid
find_object
({
'isa'
=>
'PBXGroup'
,
'name'
=>
'JSONKit'
,
...
...
@@ -30,7 +30,7 @@ describe 'Pod::Project' do
'dstPath'
=>
'Pods/Path/To/Source'
,
'name'
=>
'Copy SomePod Public Headers'
}).
should
.
not
==
nil
@project
.
targets
.
first
.
build
P
hases
.
should
.
include
phase
@project
.
targets
.
first
.
build
_p
hases
.
should
.
include
phase
end
shared
"for any platform"
do
...
...
@@ -48,43 +48,43 @@ describe 'Pod::Project' do
behaves_like
"for any platform"
it
"sets VALIDATE_PRODUCT to YES for the Release configuration"
do
@project
.
build_configuration
(
"Release"
).
build
S
ettings
[
"VALIDATE_PRODUCT"
].
should
==
"YES"
@project
.
build_configuration
(
"Release"
).
build
_s
ettings
[
"VALIDATE_PRODUCT"
].
should
==
"YES"
end
end
describe
"for the :ios platform with a deployment target"
do
it
"sets ARCHS to 'armv6 armv7' for both configurations if the deployment target is less than 4.3"
do
@project
=
Pod
::
Project
.
for_platform
(
Pod
::
Platform
.
new
(
:ios
,
:deployment_target
=>
"4.0"
))
@project
.
build_configuration
(
"Debug"
).
build
S
ettings
[
"ARCHS"
].
should
==
"armv6 armv7"
@project
.
build_configuration
(
"Release"
).
build
S
ettings
[
"ARCHS"
].
should
==
"armv6 armv7"
@project
.
build_configuration
(
"Debug"
).
build
_s
ettings
[
"ARCHS"
].
should
==
"armv6 armv7"
@project
.
build_configuration
(
"Release"
).
build
_s
ettings
[
"ARCHS"
].
should
==
"armv6 armv7"
@project
=
Pod
::
Project
.
for_platform
(
Pod
::
Platform
.
new
(
:ios
,
:deployment_target
=>
"4.1"
))
@project
.
build_configuration
(
"Debug"
).
build
S
ettings
[
"ARCHS"
].
should
==
"armv6 armv7"
@project
.
build_configuration
(
"Release"
).
build
S
ettings
[
"ARCHS"
].
should
==
"armv6 armv7"
@project
.
build_configuration
(
"Debug"
).
build
_s
ettings
[
"ARCHS"
].
should
==
"armv6 armv7"
@project
.
build_configuration
(
"Release"
).
build
_s
ettings
[
"ARCHS"
].
should
==
"armv6 armv7"
@project
=
Pod
::
Project
.
for_platform
(
Pod
::
Platform
.
new
(
:ios
,
:deployment_target
=>
"4.2"
))
@project
.
build_configuration
(
"Debug"
).
build
S
ettings
[
"ARCHS"
].
should
==
"armv6 armv7"
@project
.
build_configuration
(
"Release"
).
build
S
ettings
[
"ARCHS"
].
should
==
"armv6 armv7"
@project
.
build_configuration
(
"Debug"
).
build
_s
ettings
[
"ARCHS"
].
should
==
"armv6 armv7"
@project
.
build_configuration
(
"Release"
).
build
_s
ettings
[
"ARCHS"
].
should
==
"armv6 armv7"
end
it
"uses standard ARCHs if deployment target is 4.3 or above"
do
@project
=
Pod
::
Project
.
for_platform
(
Pod
::
Platform
.
new
(
:ios
,
:deployment_target
=>
"4.3"
))
@project
.
build_configuration
(
"Debug"
).
build
S
ettings
[
"ARCHS"
].
should
==
"$(ARCHS_STANDARD_32_BIT)"
@project
.
build_configuration
(
"Release"
).
build
S
ettings
[
"ARCHS"
].
should
==
"$(ARCHS_STANDARD_32_BIT)"
@project
.
build_configuration
(
"Debug"
).
build
_s
ettings
[
"ARCHS"
].
should
==
"$(ARCHS_STANDARD_32_BIT)"
@project
.
build_configuration
(
"Release"
).
build
_s
ettings
[
"ARCHS"
].
should
==
"$(ARCHS_STANDARD_32_BIT)"
@project
=
Pod
::
Project
.
for_platform
(
Pod
::
Platform
.
new
(
:ios
,
:deployment_target
=>
"4.4"
))
@project
.
build_configuration
(
"Debug"
).
build
S
ettings
[
"ARCHS"
].
should
==
"$(ARCHS_STANDARD_32_BIT)"
@project
.
build_configuration
(
"Release"
).
build
S
ettings
[
"ARCHS"
].
should
==
"$(ARCHS_STANDARD_32_BIT)"
@project
.
build_configuration
(
"Debug"
).
build
_s
ettings
[
"ARCHS"
].
should
==
"$(ARCHS_STANDARD_32_BIT)"
@project
.
build_configuration
(
"Release"
).
build
_s
ettings
[
"ARCHS"
].
should
==
"$(ARCHS_STANDARD_32_BIT)"
end
it
"sets IPHONEOS_DEPLOYMENT_TARGET for both configurations"
do
@project
=
Pod
::
Project
.
for_platform
(
Pod
::
Platform
.
new
(
:ios
))
@project
.
build_configuration
(
"Debug"
).
build
S
ettings
[
"IPHONEOS_DEPLOYMENT_TARGET"
].
should
==
"4.3"
@project
.
build_configuration
(
"Release"
).
build
S
ettings
[
"IPHONEOS_DEPLOYMENT_TARGET"
].
should
==
"4.3"
@project
.
build_configuration
(
"Debug"
).
build
_s
ettings
[
"IPHONEOS_DEPLOYMENT_TARGET"
].
should
==
"4.3"
@project
.
build_configuration
(
"Release"
).
build
_s
ettings
[
"IPHONEOS_DEPLOYMENT_TARGET"
].
should
==
"4.3"
@project
=
Pod
::
Project
.
for_platform
(
Pod
::
Platform
.
new
(
:ios
,
:deployment_target
=>
"4.0"
))
@project
.
build_configuration
(
"Debug"
).
build
S
ettings
[
"IPHONEOS_DEPLOYMENT_TARGET"
].
should
==
"4.0"
@project
.
build_configuration
(
"Release"
).
build
S
ettings
[
"IPHONEOS_DEPLOYMENT_TARGET"
].
should
==
"4.0"
@project
.
build_configuration
(
"Debug"
).
build
_s
ettings
[
"IPHONEOS_DEPLOYMENT_TARGET"
].
should
==
"4.0"
@project
.
build_configuration
(
"Release"
).
build
_s
ettings
[
"IPHONEOS_DEPLOYMENT_TARGET"
].
should
==
"4.0"
end
end
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