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
384ac16a
Commit
384ac16a
authored
Oct 22, 2011
by
Nolan Waite
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Can make Xcode workspaces
parent
5f1bb7de
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
45 additions
and
0 deletions
+45
-0
cocoapods.rb
lib/cocoapods.rb
+1
-0
workspace.rb
lib/cocoapods/xcode/workspace.rb
+26
-0
workspace_spec.rb
spec/unit/xcode/workspace_spec.rb
+18
-0
No files found.
lib/cocoapods.rb
View file @
384ac16a
...
@@ -22,6 +22,7 @@ module Pod
...
@@ -22,6 +22,7 @@ module Pod
autoload
:Config
,
'cocoapods/xcode/config'
autoload
:Config
,
'cocoapods/xcode/config'
autoload
:CopyResourcesScript
,
'cocoapods/xcode/copy_resources_script'
autoload
:CopyResourcesScript
,
'cocoapods/xcode/copy_resources_script'
autoload
:Project
,
'cocoapods/xcode/project'
autoload
:Project
,
'cocoapods/xcode/project'
autoload
:Workspace
,
'cocoapods/xcode/workspace'
end
end
autoload
:Pathname
,
'pathname'
autoload
:Pathname
,
'pathname'
...
...
lib/cocoapods/xcode/workspace.rb
0 → 100644
View file @
384ac16a
framework
'Foundation'
module
Pod
module
Xcode
class
Workspace
def
initialize
(
*
projpaths
)
@projpaths
=
projpaths
end
def
<<
(
projpath
)
@projpaths
<<
projpath
end
TEMPLATE
=
%q[<?xml version="1.0" encoding="UTF-8"?><Workspace version="1.0"></Workspace>]
def
to_s
doc
=
NSXMLDocument
.
alloc
.
initWithXMLString
(
TEMPLATE
,
options
:
0
,
error
:nil
)
@projpaths
.
each
do
|
projpath
|
el
=
NSXMLNode
.
elementWithName
(
"FileRef"
)
el
.
addAttribute
(
NSXMLNode
.
attributeWithName
(
"location"
,
stringValue
:"group:
#{
projpath
}
"
))
doc
.
rootElement
.
addChild
(
el
)
end
NSString
.
alloc
.
initWithData
(
doc
.
XMLData
,
encoding
:NSUTF8StringEncoding
)
end
end
end
end
spec/unit/xcode/workspace_spec.rb
0 → 100644
View file @
384ac16a
require
File
.
expand_path
(
'../../../spec_helper'
,
__FILE__
)
describe
"Pod::Xcode::Workspace"
do
before
do
@workspace
=
Pod
::
Xcode
::
Workspace
.
new
(
'Pods/Pods.xcodeproj'
,
'App.xcodeproj'
)
@doc
=
NSXMLDocument
.
alloc
.
initWithXMLString
(
@workspace
.
to_s
,
options
:
0
,
error
:nil
)
end
it
"is the right workspace version"
do
@doc
.
rootElement
.
attributeForName
(
"version"
).
stringValue
.
should
==
"1.0"
end
it
"contains the projects"
do
@doc
.
nodesForXPath
(
"/Workspace/FileRef"
,
error
:nil
).
map
do
|
node
|
node
.
attributeForName
(
"location"
).
stringValue
.
sub
(
/^group:/
,
''
)
end
.
sort
.
should
==
[
'App.xcodeproj'
,
'Pods/Pods.xcodeproj'
]
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