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
7c334329
Commit
7c334329
authored
Jun 09, 2013
by
Ian Ynda-Hummel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add an integration test for basic Podfile construction.
parent
376f2412
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
42 additions
and
7 deletions
+42
-7
init.rb
lib/cocoapods/command/init.rb
+9
-7
integration.rb
spec/integration.rb
+14
-0
Podfile
spec/integration/init_multiple_platforms/after/Podfile
+10
-0
project.pbxproj
...tiple_platforms/after/SampleApp.xcodeproj/project.pbxproj
+0
-0
project.pbxproj
...iple_platforms/before/SampleApp.xcodeproj/project.pbxproj
+0
-0
Podfile
spec/integration/init_single_platform/after/Podfile
+9
-0
project.pbxproj
...single_platform/after/SampleApp.xcodeproj/project.pbxproj
+0
-0
project.pbxproj
...ingle_platform/before/SampleApp.xcodeproj/project.pbxproj
+0
-0
No files found.
lib/cocoapods/command/init.rb
View file @
7c334329
...
@@ -38,26 +38,28 @@ module Pod
...
@@ -38,26 +38,28 @@ module Pod
def
podfile_template
(
project
)
def
podfile_template
(
project
)
platforms
=
project
.
targets
.
map
{
|
t
|
t
.
platform_name
}.
uniq
platforms
=
project
.
targets
.
map
{
|
t
|
t
.
platform_name
}.
uniq
if
platforms
.
length
==
1
has_global_platform
=
platforms
.
length
==
1
if
has_global_platform
podfile
=
<<-
PLATFORM
podfile
=
<<-
PLATFORM
platform
#{
platforms
.
first
}
platform
:
#{
platforms
.
first
}
PLATFORM
PLATFORM
else
else
podfile
=
<<-
PLATFORM
podfile
=
<<-
PLATFORM
# Uncomment this line to define
the
platform for your project
# Uncomment this line to define
a global
platform for your project
platform :ios, "6.0"
#
platform :ios, "6.0"
PLATFORM
PLATFORM
end
end
for
target
in
project
.
targets
for
target
in
project
.
targets
podfile
<<
target_module
(
target
)
podfile
<<
target_module
(
target
,
!
has_global_platform
)
end
end
podfile
podfile
end
end
def
target_module
(
target
,
define_platform
=
true
)
def
target_module
(
target
,
define_platform
=
true
)
platform
=
"platform
#{
target
.
platform_name
}
"
if
define_platform
platform
=
"platform
:
#{
target
.
platform_name
}
"
if
define_platform
return
<<-
TARGET
return
<<-
TARGET
target :
#{
target
.
name
}
do
target "
#{
target
.
name
}
" do
#{
platform
}
#{
platform
}
end
end
TARGET
TARGET
...
...
spec/integration.rb
View file @
7c334329
...
@@ -378,6 +378,20 @@ describe "Integration" do
...
@@ -378,6 +378,20 @@ describe "Integration" do
#--------------------------------------#
#--------------------------------------#
describe
"Pod init"
do
describe
"Initializes a Podfile with a single platform"
do
check
"init"
,
"init_single_platform"
end
describe
"Initializes a Podfile with no uniform platform"
do
check
"init"
,
"init_multiple_platforms"
end
end
#--------------------------------------#
end
end
...
...
spec/integration/init_multiple_platforms/after/Podfile
0 → 100644
View file @
7c334329
# Uncomment this line to define a global platform for your project
# platform :ios, "6.0"
target
"SampleApp"
do
platform
:osx
end
target
"SampleiOSApp"
do
platform
:ios
end
spec/integration/init_multiple_platforms/after/SampleApp.xcodeproj/project.pbxproj
0 → 100644
View file @
7c334329
This diff is collapsed.
Click to expand it.
spec/integration/init_multiple_platforms/before/SampleApp.xcodeproj/project.pbxproj
0 → 100644
View file @
7c334329
This diff is collapsed.
Click to expand it.
spec/integration/init_single_platform/after/Podfile
0 → 100644
View file @
7c334329
platform
:osx
target
"SampleApp"
do
end
target
"SampleApp copy"
do
end
spec/integration/init_single_platform/after/SampleApp.xcodeproj/project.pbxproj
0 → 100644
View file @
7c334329
This diff is collapsed.
Click to expand it.
spec/integration/init_single_platform/before/SampleApp.xcodeproj/project.pbxproj
0 → 100644
View file @
7c334329
This diff is collapsed.
Click to expand it.
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