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
bfe37a1d
Commit
bfe37a1d
authored
Aug 22, 2013
by
Fabio Pelosin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Command::Init] Add dependencies of the normal targets inside the target block
This patch also improves indentation. /c @ianyh
parent
dd8a958f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
9 deletions
+14
-9
init.rb
lib/cocoapods/command/init.rb
+14
-9
No files found.
lib/cocoapods/command/init.rb
View file @
bfe37a1d
...
...
@@ -55,9 +55,6 @@ module Pod
# Uncomment this line to define a global platform for your project
# platform :ios, "6.0"
PLATFORM
if
config
.
default_podfile_path
.
exist?
open
(
config
.
default_podfile_path
,
'r'
)
{
|
f
|
podfile
<<
f
.
read
}
end
for
target
in
project
.
targets
podfile
<<
target_module
(
target
)
end
...
...
@@ -70,15 +67,23 @@ module Pod
# @return [String] the text for the target module
#
def
target_module
(
target
)
target_module
=
<<-
TARGET
.
strip_heredoc
target_module
=
"
\n
target
\"
#{
target
.
name
}
\"
do
\n
"
if
target
.
name
=~
/tests?/i
target_module
<<
template_contents
(
config
.
default_test_podfile_path
)
else
target_module
<<
template_contents
(
config
.
default_podfile_path
)
end
target_module
<<
"
\n
end
\n
"
end
target "
#{
target
.
name
}
" do
TARGET
if
config
.
default_test_podfile_path
.
exist?
and
target
.
name
=~
/tests?/i
open
(
config
.
default_test_podfile_path
,
'r'
)
{
|
f
|
target_module
<<
f
.
read
}
def
template_contents
(
path
)
if
path
.
exist?
path
.
read
.
chomp
.
lines
.
map
{
|
line
|
"
#{
line
}
"
}.
join
(
"
\n
"
)
else
String
.
new
end
target_module
<<
"
\n
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