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
7d64004e
Commit
7d64004e
authored
Nov 07, 2011
by
Nolan Waite
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
PBXFileReference sets some file types
parent
17275eb8
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
32 additions
and
7 deletions
+32
-7
installer.rb
lib/cocoapods/installer.rb
+1
-4
project.rb
lib/cocoapods/xcode/project.rb
+14
-3
project_spec.rb
spec/unit/xcode/project_spec.rb
+17
-0
No files found.
lib/cocoapods/installer.rb
View file @
7d64004e
...
...
@@ -203,10 +203,7 @@ module Pod
app_project
=
Xcode
::
Project
.
new
(
projpath
)
return
if
app_project
.
files
.
find
{
|
file
|
file
.
path
=~
/libPods\.a$/
}
configfile
=
app_project
.
files
.
new
({
'path'
=>
'Pods/Pods.xcconfig'
,
'lastKnownFileType'
=>
'text.xcconfig'
})
configfile
=
app_project
.
files
.
new
(
'path'
=>
'Pods/Pods.xcconfig'
)
app_project
.
targets
.
each
do
|
target
|
target
.
buildConfigurations
.
each
do
|
config
|
config
.
baseConfiguration
=
configfile
...
...
lib/cocoapods/xcode/project.rb
View file @
7d64004e
...
...
@@ -234,7 +234,7 @@ module Pod
end
class
PBXFileReference
<
PBXObject
attributes
:path
,
:sourceTree
,
:explicitFileType
,
:includeInIndex
attributes
:path
,
:sourceTree
,
:explicitFileType
,
:
lastKnownFileType
,
:
includeInIndex
has_many
:buildFiles
,
:inverse_of
=>
:file
has_one
:group
,
:inverse_of
=>
:children
...
...
@@ -242,7 +242,6 @@ module Pod
new
(
project
,
nil
,
{
"path"
=>
"lib
#{
productName
}
.a"
,
"includeInIndex"
=>
"0"
,
# no idea what this is
"explicitFileType"
=>
"archive.ar"
,
"sourceTree"
=>
"BUILT_PRODUCTS_DIR"
,
})
end
...
...
@@ -255,6 +254,7 @@ module Pod
if
is_new
@project
.
main_group
.
children
<<
self
end
set_default_file_type!
end
alias_method
:_path
=
,
:path
=
...
...
@@ -267,6 +267,18 @@ module Pod
def
pathname
Pathname
.
new
(
path
)
end
def
set_default_file_type!
return
if
explicitFileType
||
lastKnownFileType
case
path
when
/\.a$/
self
.
explicitFileType
=
'archive.ar'
when
/\.framework$/
self
.
lastKnownFileType
=
'wrapper.framework'
when
/\.xcconfig$/
self
.
lastKnownFileType
=
'text.xcconfig'
end
end
end
class
PBXGroup
<
PBXObject
...
...
@@ -620,7 +632,6 @@ module Pod
def
add_system_framework
(
name
)
files
.
new
({
'lastKnownFileType'
=>
'wrapper.framework'
,
'name'
=>
"
#{
name
}
.framework"
,
'path'
=>
"System/Library/Frameworks/
#{
name
}
.framework"
,
'sourceTree'
=>
'SDKROOT'
...
...
spec/unit/xcode/project_spec.rb
View file @
7d64004e
...
...
@@ -53,6 +53,23 @@ describe "Pod::Xcode::Project" do
end
describe
"a PBXFileReference"
do
it
"sets a default file type"
do
framework
,
library
,
xcconfig
=
%w[framework a xcconfig]
.
map
{
|
n
|
@project
.
files
.
new
(
'path'
=>
"Rockin.
#{
n
}
"
)
}
framework
.
lastKnownFileType
.
should
==
'wrapper.framework'
framework
.
explicitFileType
.
should
==
nil
library
.
lastKnownFileType
.
should
==
nil
library
.
explicitFileType
.
should
==
'archive.ar'
xcconfig
.
lastKnownFileType
.
should
==
'text.xcconfig'
xcconfig
.
explicitFileType
.
should
==
nil
end
it
"doesn't set a file type when overridden"
do
fakework
=
@project
.
files
.
new
(
'path'
=>
'Sup.framework'
,
'lastKnownFileType'
=>
'fish'
)
fakework
.
lastKnownFileType
.
should
==
'fish'
makework
=
@project
.
files
.
new
(
'path'
=>
'n2m.framework'
,
'explicitFileType'
=>
'tree'
)
makework
.
lastKnownFileType
.
should
==
nil
end
before
do
@file
=
@project
.
files
.
new
(
'path'
=>
'some/file.m'
)
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