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
4e4fc7fb
Commit
4e4fc7fb
authored
Mar 31, 2012
by
Eloy Duran
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update for latest Xcodeproj.
parent
e1a6ccf0
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
25 additions
and
86 deletions
+25
-86
Gemfile.lock
Gemfile.lock
+1
-1
Rakefile
Rakefile
+7
-0
target_installer.rb
lib/cocoapods/installer/target_installer.rb
+2
-2
project.rb
lib/cocoapods/project.rb
+12
-80
project_spec.rb
spec/unit/project_spec.rb
+3
-3
No files found.
Gemfile.lock
View file @
4e4fc7fb
GIT
GIT
remote: git://github.com/CocoaPods/Xcodeproj.git
remote: git://github.com/CocoaPods/Xcodeproj.git
revision:
455192a27d22990363d3719662a6eb1ee683cd87
revision:
b3db4601c47bf78cb5e6fa8ada5bcb4cda18e05f
specs:
specs:
xcodeproj (0.1.0)
xcodeproj (0.1.0)
...
...
Rakefile
View file @
4e4fc7fb
...
@@ -143,6 +143,13 @@ namespace :spec do
...
@@ -143,6 +143,13 @@ namespace :spec do
end
end
end
end
end
end
desc
"Removes the stored VCR fixture"
task
:clean_vcr
do
sh
"rm -f spec/fixtures/vcr/tarballs.yml"
end
task
:clean_env
=>
[
:clean_vcr
,
:unpack_fixture_tarballs
,
"ext:cleanbuild"
]
end
end
namespace
:examples
do
namespace
:examples
do
...
...
lib/cocoapods/installer/target_installer.rb
View file @
4e4fc7fb
...
@@ -52,11 +52,11 @@ module Pod
...
@@ -52,11 +52,11 @@ module Pod
self
.
requires_arc
=
pods
.
any?
{
|
pod
|
pod
.
requires_arc?
}
self
.
requires_arc
=
pods
.
any?
{
|
pod
|
pod
.
requires_arc?
}
# First add the target to the project
# First add the target to the project
@target
=
@project
.
targets
.
new_static_library
(
@target_definition
.
label
)
@target
=
@project
.
targets
.
new_static_library
(
@target_definition
.
platform
.
name
,
@target_definition
.
label
)
pods
.
each
do
|
pod
|
pods
.
each
do
|
pod
|
# TODO add methods like xcconfig to LocalPod as well? (which returns the correct platform)
# TODO add methods like xcconfig to LocalPod as well? (which returns the correct platform)
xcconfig
.
merge!
(
pod
.
specification
.
xcconfig
[
@target_definition
.
platform
.
to_sym
])
xcconfig
.
merge!
(
pod
.
specification
.
xcconfig
[
@target_definition
.
platform
.
name
])
pod
.
add_to_target
(
@target
)
pod
.
add_to_target
(
@target
)
# TODO: this doesn't need to be done here, it has nothing to do with the target
# TODO: this doesn't need to be done here, it has nothing to do with the target
...
...
lib/cocoapods/project.rb
View file @
4e4fc7fb
...
@@ -23,15 +23,7 @@ module Pod
...
@@ -23,15 +23,7 @@ module Pod
pods
.
groups
.
new
(
'name'
=>
name
)
pods
.
groups
.
new
(
'name'
=>
name
)
end
end
def
build_configuration_list
# TODO do we need this?
objects
[
root_object
.
attributes
[
'buildConfigurationList'
]]
end
# Shortcut access to build configurations
def
build_configurations
build_configuration_list
.
build_configurations
end
def
build_configuration
(
name
)
def
build_configuration
(
name
)
build_configurations
.
find
{
|
c
|
c
.
name
==
name
}
build_configurations
.
find
{
|
c
|
c
.
name
==
name
}
end
end
...
@@ -39,83 +31,23 @@ module Pod
...
@@ -39,83 +31,23 @@ module Pod
def
self
.
for_platform
(
platform
)
def
self
.
for_platform
(
platform
)
Pod
::
Project
.
new
.
tap
do
|
project
|
Pod
::
Project
.
new
.
tap
do
|
project
|
project
.
main_group
<<
project
.
groups
.
new
(
'name'
=>
'Pods'
)
project
.
main_group
<<
project
.
groups
.
new
(
'name'
=>
'Pods'
)
project
.
add_system_framework
(
platform
==
:ios
?
'Foundation'
:
'Cocoa'
)
project
.
build_settings
(
'Debug'
).
merge!
(
build_settings
(
platform
))
project
.
build_settings
(
'Release'
).
merge!
(
build_settings
(
platform
))
# TODO this should al move to Xcodeproj as the default behavior of a new project
configuration_list
=
project
.
objects
.
add
(
Xcodeproj
::
Project
::
Object
::
XCConfigurationList
,
{
'defaultConfigurationIsVisible'
=>
'0'
,
'defaultConfigurationName'
=>
'Release'
,
})
configuration_list
.
build_configurations
.
new
(
'name'
=>
'Debug'
,
'buildSettings'
=>
build_settings
(
platform
,
:debug
)
)
configuration_list
.
build_configurations
.
new
(
'name'
=>
'Release'
,
'buildSettings'
=>
build_settings
(
platform
,
:release
)
)
project
.
root_object
.
attributes
[
'buildConfigurationList'
]
=
configuration_list
.
uuid
end
end
end
end
private
private
COMMON_BUILD_SETTINGS
=
{
# TODO this needs to be added to each individual target
:all
=>
{
def
self
.
build_settings
(
platform
)
'ALWAYS_SEARCH_USER_PATHS'
=>
'NO'
,
settings
=
{}
'GCC_C_LANGUAGE_STANDARD'
=>
'gnu99'
,
if
platform
.
requires_legacy_ios_archs?
'INSTALL_PATH'
=>
"$(BUILT_PRODUCTS_DIR)"
,
settings
[
'ARCHS'
]
=
"armv6 armv7"
'GCC_WARN_ABOUT_MISSING_PROTOTYPES'
=>
'YES'
,
end
'GCC_WARN_ABOUT_RETURN_TYPE'
=>
'YES'
,
if
platform
==
:ios
&&
platform
.
deployment_target
'GCC_WARN_UNUSED_VARIABLE'
=>
'YES'
,
settings
[
'IPHONEOS_DEPLOYMENT_TARGET'
]
=
platform
.
deployment_target
.
to_s
'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'
,
'GCC_WARN_64_TO_32_BIT_CONVERSION'
=>
'YES'
,
'GCC_VERSION'
=>
'com.apple.compilers.llvm.clang.1_0'
,
'MACOSX_DEPLOYMENT_TARGET'
=>
'10.7'
,
'SDKROOT'
=>
'macosx'
}.
freeze
}.
freeze
def
self
.
build_settings
(
platform
,
scheme
)
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
if
platform
==
:ios
&&
platform
.
deployment_target
settings
[
'IPHONEOS_DEPLOYMENT_TARGET'
]
=
platform
.
deployment_target
.
to_s
end
if
scheme
==
:debug
settings
.
merge!
(
COMMON_BUILD_SETTINGS
[
:debug
])
settings
[
'ONLY_ACTIVE_ARCH'
]
=
'YES'
if
platform
==
:osx
else
settings
[
'VALIDATE_PRODUCT'
]
=
'YES'
if
platform
==
:ios
settings
[
'DEBUG_INFORMATION_FORMAT'
]
=
"dwarf-with-dsym"
if
platform
==
:osx
end
end
end
settings
end
end
end
end
end
end
spec/unit/project_spec.rb
View file @
4e4fc7fb
...
@@ -47,7 +47,7 @@ describe 'Pod::Project' do
...
@@ -47,7 +47,7 @@ describe 'Pod::Project' do
behaves_like
"for any platform"
behaves_like
"for any platform"
it
"sets VALIDATE_PRODUCT to YES for the Release configuration"
do
x
it
"sets VALIDATE_PRODUCT to YES for the Release configuration"
do
@project
.
build_configuration
(
"Release"
).
build_settings
[
"VALIDATE_PRODUCT"
].
should
==
"YES"
@project
.
build_configuration
(
"Release"
).
build_settings
[
"VALIDATE_PRODUCT"
].
should
==
"YES"
end
end
end
end
...
@@ -67,7 +67,7 @@ describe 'Pod::Project' do
...
@@ -67,7 +67,7 @@ describe 'Pod::Project' do
@project
.
build_configuration
(
"Release"
).
build_settings
[
"ARCHS"
].
should
==
"armv6 armv7"
@project
.
build_configuration
(
"Release"
).
build_settings
[
"ARCHS"
].
should
==
"armv6 armv7"
end
end
it
"uses standard ARCHs if deployment target is 4.3 or above"
do
x
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
=
Pod
::
Project
.
for_platform
(
Pod
::
Platform
.
new
(
:ios
,
:deployment_target
=>
"4.3"
))
@project
.
build_configuration
(
"Debug"
).
build_settings
[
"ARCHS"
].
should
==
"$(ARCHS_STANDARD_32_BIT)"
@project
.
build_configuration
(
"Debug"
).
build_settings
[
"ARCHS"
].
should
==
"$(ARCHS_STANDARD_32_BIT)"
@project
.
build_configuration
(
"Release"
).
build_settings
[
"ARCHS"
].
should
==
"$(ARCHS_STANDARD_32_BIT)"
@project
.
build_configuration
(
"Release"
).
build_settings
[
"ARCHS"
].
should
==
"$(ARCHS_STANDARD_32_BIT)"
...
@@ -77,7 +77,7 @@ describe 'Pod::Project' do
...
@@ -77,7 +77,7 @@ describe 'Pod::Project' do
@project
.
build_configuration
(
"Release"
).
build_settings
[
"ARCHS"
].
should
==
"$(ARCHS_STANDARD_32_BIT)"
@project
.
build_configuration
(
"Release"
).
build_settings
[
"ARCHS"
].
should
==
"$(ARCHS_STANDARD_32_BIT)"
end
end
it
"sets IPHONEOS_DEPLOYMENT_TARGET for both configurations"
do
x
it
"sets IPHONEOS_DEPLOYMENT_TARGET for both configurations"
do
@project
=
Pod
::
Project
.
for_platform
(
Pod
::
Platform
.
new
(
:ios
))
@project
=
Pod
::
Project
.
for_platform
(
Pod
::
Platform
.
new
(
:ios
))
@project
.
build_configuration
(
"Debug"
).
build_settings
[
"IPHONEOS_DEPLOYMENT_TARGET"
].
should
==
"4.3"
@project
.
build_configuration
(
"Debug"
).
build_settings
[
"IPHONEOS_DEPLOYMENT_TARGET"
].
should
==
"4.3"
@project
.
build_configuration
(
"Release"
).
build_settings
[
"IPHONEOS_DEPLOYMENT_TARGET"
].
should
==
"4.3"
@project
.
build_configuration
(
"Release"
).
build_settings
[
"IPHONEOS_DEPLOYMENT_TARGET"
].
should
==
"4.3"
...
...
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