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
9ea008e3
Commit
9ea008e3
authored
Nov 06, 2011
by
Eloy Duran
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Clean template related code a bit by using the API.
parent
9ee4b9b5
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
30 deletions
+22
-30
installer.rb
lib/cocoapods/installer.rb
+1
-10
project_template.rb
lib/cocoapods/project_template.rb
+4
-13
project.rb
lib/cocoapods/xcode/project.rb
+17
-7
No files found.
lib/cocoapods/installer.rb
View file @
9ea008e3
...
...
@@ -212,26 +212,17 @@ module Pod
config
.
baseConfiguration
=
configfile
end
end
app_project
.
main_group
<<
configfile
libfile
=
app_project
.
files
.
new
({
'path'
=>
'libPods.a'
,
'lastKnownFileType'
=>
'archive.ar'
,
'includeInIndex'
=>
'0'
,
'sourceTree'
=>
'BUILT_PRODUCTS_DIR'
})
libfile
=
app_project
.
files
.
new_static_library
(
'Pods'
)
app_project
.
objects
.
select_by_class
(
Xcode
::
Project
::
PBXFrameworksBuildPhase
).
each
do
|
build_phase
|
build_phase
.
files
<<
libfile
.
buildFiles
.
new
end
app_project
.
main_group
<<
libfile
copy_resources
=
app_project
.
objects
.
add
(
Xcode
::
Project
::
PBXShellScriptBuildPhase
,
{
'name'
=>
'Copy Pods Resources'
,
'buildActionMask'
=>
'2147483647'
,
'files'
=>
[],
'inputPaths'
=>
[],
'outputPaths'
=>
[],
'runOnlyForDeploymentPostprocessing'
=>
'0'
,
'shellPath'
=>
'/bin/sh'
,
'shellScript'
=>
"${SRCROOT}/Pods/Pods-resources.sh
\n
"
})
...
...
lib/cocoapods/project_template.rb
View file @
9ea008e3
...
...
@@ -10,31 +10,22 @@ module Pod
'developmentRegion'
=>
'English'
,
'hasScannedForEncodings'
=>
'0'
,
'knownRegions'
=>
[
'en'
],
'mainGroup'
=>
project
.
groups
.
new
({
'sourceTree'
=>
'<group>'
})
.
uuid
,
'mainGroup'
=>
project
.
groups
.
new
.
uuid
,
'projectDirPath'
=>
''
,
'projectRoot'
=>
''
,
'targets'
=>
[]
})
project
.
root_object
=
root
project
.
main_group
<<
project
.
groups
.
new
({
'name'
=>
'Pods'
,
'sourceTree'
=>
'<group>'
})
project
.
main_group
<<
project
.
groups
.
new
(
'name'
=>
'Pods'
)
framework
=
project
.
files
.
new
({
'lastKnownFileType'
=>
'wrapper.framework'
,
'name'
=>
platform
==
:ios
?
'Foundation.framework'
:
'Cocoa.framework'
,
'path'
=>
"System/Library/Frameworks/
#{
platform
==
:ios
?
'Framework'
:
'Cocoa'
}
.framework"
,
'sourceTree'
=>
'SDKROOT'
})
framework
.
group
=
project
.
groups
.
new
({
'name'
=>
'Frameworks'
,
'sourceTree'
=>
'<group>'
})
framework
.
group
=
project
.
groups
.
new
(
'name'
=>
'Frameworks'
)
project
.
main_group
<<
framework
.
group
products
=
project
.
groups
.
new
({
'name'
=>
'Products'
,
'sourceTree'
=>
'<group>'
})
products
=
project
.
groups
.
new
(
'name'
=>
'Products'
)
project
.
main_group
<<
products
project
.
root_object
.
products
=
products
...
...
lib/cocoapods/xcode/project.rb
View file @
9ea008e3
...
...
@@ -238,6 +238,15 @@ module Pod
has_many
:buildFiles
,
:inverse_of
=>
:file
has_one
:group
,
:inverse_of
=>
:children
def
self
.
new_static_library
(
project
,
productName
)
new
(
project
,
nil
,
{
"path"
=>
"lib
#{
productName
}
.a"
,
"includeInIndex"
=>
"0"
,
# no idea what this is
"explicitFileType"
=>
"archive.ar"
,
"sourceTree"
=>
"BUILT_PRODUCTS_DIR"
,
})
end
def
initialize
(
project
,
uuid
,
attributes
)
is_new
=
uuid
.
nil?
super
...
...
@@ -359,9 +368,7 @@ module Pod
def
self
.
new_static_library
(
project
,
productName
)
# TODO should probably switch the uuid and attributes argument
target
=
new
(
project
,
nil
,
'productType'
=>
STATIC_LIBRARY
,
'productName'
=>
productName
)
target
.
product
.
path
=
"lib
#{
productName
}
.a"
target
.
product
.
includeInIndex
=
"0"
# no idea what this is
target
.
product
.
explicitFileType
=
"archive.ar"
target
.
product
=
project
.
files
.
new_static_library
(
productName
)
target
.
buildPhases
.
add
(
PBXSourcesBuildPhase
)
buildPhase
=
target
.
buildPhases
.
add
(
PBXFrameworksBuildPhase
)
...
...
@@ -373,6 +380,8 @@ module Pod
target
end
# You need to specify a product. For a static library you can use
# PBXFileReference.new_static_library.
def
initialize
(
project
,
*
)
super
self
.
name
||=
productName
...
...
@@ -386,11 +395,12 @@ module Pod
buildConfigurationList
.
buildConfigurations
.
new
(
'name'
=>
'Debug'
)
buildConfigurationList
.
buildConfigurations
.
new
(
'name'
=>
'Release'
)
end
end
unless
product
self
.
product
=
project
.
files
.
new
(
'sourceTree'
=>
'BUILT_PRODUCTS_DIR'
)
product
.
group
=
project
.
products
end
alias_method
:_product
=
,
:product
=
def
product
=
(
product
)
self
.
_product
=
product
product
.
group
=
@project
.
products
end
def
buildConfigurations
...
...
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