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
ace222ef
Commit
ace222ef
authored
Nov 12, 2011
by
Eloy Duran
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move ProjectTemplate code into Xcode::Project extension.
parent
738cf91b
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
77 additions
and
82 deletions
+77
-82
cocoapods.rb
lib/cocoapods.rb
+1
-1
installer.rb
lib/cocoapods/installer.rb
+1
-1
project_template.rb
lib/cocoapods/project_template.rb
+0
-80
xcode_project.rb
lib/cocoapods/xcode_project.rb
+75
-0
No files found.
lib/cocoapods.rb
View file @
ace222ef
...
@@ -12,7 +12,6 @@ module Pod
...
@@ -12,7 +12,6 @@ module Pod
autoload
:Executable
,
'cocoapods/executable'
autoload
:Executable
,
'cocoapods/executable'
autoload
:Installer
,
'cocoapods/installer'
autoload
:Installer
,
'cocoapods/installer'
autoload
:Podfile
,
'cocoapods/podfile'
autoload
:Podfile
,
'cocoapods/podfile'
autoload
:ProjectTemplate
,
'cocoapods/project_template'
autoload
:Resolver
,
'cocoapods/resolver'
autoload
:Resolver
,
'cocoapods/resolver'
autoload
:Source
,
'cocoapods/source'
autoload
:Source
,
'cocoapods/source'
autoload
:Spec
,
'cocoapods/specification'
autoload
:Spec
,
'cocoapods/specification'
...
@@ -25,6 +24,7 @@ end
...
@@ -25,6 +24,7 @@ end
module
Xcode
module
Xcode
autoload
:Config
,
'cocoapods/xcode_project'
autoload
:Config
,
'cocoapods/xcode_project'
autoload
:Project
,
'cocoapods/xcode_project'
autoload
:Project
,
'cocoapods/xcode_project'
autoload
:Workspace
,
'cocoapods/xcode_project'
end
end
class
Pathname
class
Pathname
...
...
lib/cocoapods/installer.rb
View file @
ace222ef
...
@@ -164,7 +164,7 @@ EOS
...
@@ -164,7 +164,7 @@ EOS
def
project
def
project
return
@project
if
@project
return
@project
if
@project
@project
=
ProjectTemplate
.
for_platform
(
@podfile
.
platform
)
@project
=
Xcode
::
Project
.
for_platform
(
@podfile
.
platform
)
# First we need to resolve dependencies across *all* targets, so that the
# First we need to resolve dependencies across *all* targets, so that the
# same correct versions of pods are being used for all targets. This
# same correct versions of pods are being used for all targets. This
# happens when we call `build_specifications'.
# happens when we call `build_specifications'.
...
...
lib/cocoapods/project_template.rb
deleted
100644 → 0
View file @
738cf91b
require
'fileutils'
module
Pod
module
ProjectTemplate
def
self
.
for_platform
(
platform
)
project
=
Xcode
::
Project
.
new
project
.
main_group
<<
project
.
groups
.
new
({
'name'
=>
'Pods'
})
framework
=
project
.
add_system_framework
(
platform
==
:ios
?
'Foundation'
:
'Cocoa'
)
framework
.
group
=
project
.
groups
.
new
({
'name'
=>
'Frameworks'
})
project
.
main_group
<<
framework
.
group
products
=
project
.
groups
.
new
({
'name'
=>
'Products'
})
project
.
main_group
<<
products
project
.
root_object
.
products
=
products
project
.
root_object
.
attributes
[
'buildConfigurationList'
]
=
project
.
objects
.
add
(
Xcode
::
Project
::
XCConfigurationList
,
{
'defaultConfigurationIsVisible'
=>
'0'
,
'defaultConfigurationName'
=>
'Release'
,
'buildConfigurations'
=>
[
project
.
objects
.
add
(
Xcode
::
Project
::
XCBuildConfiguration
,
{
'name'
=>
'Debug'
,
'buildSettings'
=>
build_settings
(
platform
,
:debug
)
}),
project
.
objects
.
add
(
Xcode
::
Project
::
XCBuildConfiguration
,
{
'name'
=>
'Release'
,
'buildSettings'
=>
build_settings
(
platform
,
:release
)
})
].
map
(
&
:uuid
)
}).
uuid
project
end
private
COMMON_BUILD_SETTINGS
=
{
:all
=>
{
'ALWAYS_SEARCH_USER_PATHS'
=>
'NO'
,
'GCC_C_LANGUAGE_STANDARD'
=>
'gnu99'
,
'INSTALL_PATH'
=>
"$(BUILT_PRODUCTS_DIR)"
,
'GCC_WARN_ABOUT_MISSING_PROTOTYPES'
=>
'YES'
,
'GCC_WARN_ABOUT_RETURN_TYPE'
=>
'YES'
,
'GCC_WARN_UNUSED_VARIABLE'
=>
'YES'
,
'OTHER_LDFLAGS'
=>
''
},
:debug
=>
{
'GCC_DYNAMIC_NO_PIC'
=>
'NO'
,
'GCC_PREPROCESSOR_DEFINITIONS'
=>
[
"DEBUG=1"
,
"$(inherited)"
],
'GCC_SYMBOLS_PRIVATE_EXTERN'
=>
'NO'
,
'GCC_OPTIMIZATION_LEVEL'
=>
'0'
},
: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'
},
: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'
}
}
def
self
.
build_settings
(
platform
,
scheme
)
settings
=
COMMON_BUILD_SETTINGS
[
:all
].
merge
(
COMMON_BUILD_SETTINGS
[
platform
])
settings
[
'COPY_PHASE_STRIP'
]
=
scheme
==
:debug
?
'NO'
:
'YES'
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
settings
end
end
end
lib/cocoapods/xcode_project.rb
View file @
ace222ef
...
@@ -20,5 +20,80 @@ module Xcode
...
@@ -20,5 +20,80 @@ module Xcode
})
})
end
end
end
end
def
self
.
for_platform
(
platform
)
project
=
Xcode
::
Project
.
new
project
.
main_group
<<
project
.
groups
.
new
({
'name'
=>
'Pods'
})
framework
=
project
.
add_system_framework
(
platform
==
:ios
?
'Foundation'
:
'Cocoa'
)
framework
.
group
=
project
.
groups
.
new
({
'name'
=>
'Frameworks'
})
project
.
main_group
<<
framework
.
group
products
=
project
.
groups
.
new
({
'name'
=>
'Products'
})
project
.
main_group
<<
products
project
.
root_object
.
products
=
products
project
.
root_object
.
attributes
[
'buildConfigurationList'
]
=
project
.
objects
.
add
(
Xcode
::
Project
::
XCConfigurationList
,
{
'defaultConfigurationIsVisible'
=>
'0'
,
'defaultConfigurationName'
=>
'Release'
,
'buildConfigurations'
=>
[
project
.
objects
.
add
(
Xcode
::
Project
::
XCBuildConfiguration
,
{
'name'
=>
'Debug'
,
'buildSettings'
=>
build_settings
(
platform
,
:debug
)
}),
project
.
objects
.
add
(
Xcode
::
Project
::
XCBuildConfiguration
,
{
'name'
=>
'Release'
,
'buildSettings'
=>
build_settings
(
platform
,
:release
)
})
].
map
(
&
:uuid
)
}).
uuid
project
end
private
COMMON_BUILD_SETTINGS
=
{
:all
=>
{
'ALWAYS_SEARCH_USER_PATHS'
=>
'NO'
,
'GCC_C_LANGUAGE_STANDARD'
=>
'gnu99'
,
'INSTALL_PATH'
=>
"$(BUILT_PRODUCTS_DIR)"
,
'GCC_WARN_ABOUT_MISSING_PROTOTYPES'
=>
'YES'
,
'GCC_WARN_ABOUT_RETURN_TYPE'
=>
'YES'
,
'GCC_WARN_UNUSED_VARIABLE'
=>
'YES'
,
'OTHER_LDFLAGS'
=>
''
},
:debug
=>
{
'GCC_DYNAMIC_NO_PIC'
=>
'NO'
,
'GCC_PREPROCESSOR_DEFINITIONS'
=>
[
"DEBUG=1"
,
"$(inherited)"
],
'GCC_SYMBOLS_PRIVATE_EXTERN'
=>
'NO'
,
'GCC_OPTIMIZATION_LEVEL'
=>
'0'
},
: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'
},
: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'
}
}
def
self
.
build_settings
(
platform
,
scheme
)
settings
=
COMMON_BUILD_SETTINGS
[
:all
].
merge
(
COMMON_BUILD_SETTINGS
[
platform
])
settings
[
'COPY_PHASE_STRIP'
]
=
scheme
==
:debug
?
'NO'
:
'YES'
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
settings
end
end
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