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
08bd4c95
Commit
08bd4c95
authored
Dec 02, 2015
by
Samuel E. Giddins
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #4620 from dnkoutso/master
Add @import UIKit; or @import Cocoa; for generated main.m
parents
ae13ab00
4b8898ca
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
1 deletion
+9
-1
validator.rb
lib/cocoapods/validator.rb
+6
-1
validator_spec.rb
spec/unit/validator_spec.rb
+3
-0
No files found.
lib/cocoapods/validator.rb
View file @
08bd4c95
...
@@ -421,7 +421,12 @@ module Pod
...
@@ -421,7 +421,12 @@ module Pod
''
''
end
end
end
end
source_file
.
open
(
'w'
)
{
|
f
|
f
<<
"@import Foundation;
\n
#{
import_statement
}
int main() {}
\n
"
}
source_file
.
open
(
'w'
)
do
|
f
|
f
<<
"@import Foundation;
\n
"
f
<<
"@import UIKit;
\n
"
if
consumer
.
platform_name
==
:ios
||
consumer
.
platform_name
==
:tvos
f
<<
"@import Cocoa;
\n
"
if
consumer
.
platform_name
==
:osx
f
<<
"
#{
import_statement
}
int main() {}
\n
"
end
end
end
source_file
source_file
end
end
...
...
spec/unit/validator_spec.rb
View file @
08bd4c95
...
@@ -524,6 +524,7 @@ module Pod
...
@@ -524,6 +524,7 @@ module Pod
file
.
basename
.
to_s
.
should
==
'main.m'
file
.
basename
.
to_s
.
should
==
'main.m'
file
.
read
.
should
==
<<-
OBJC
.
strip_heredoc
file
.
read
.
should
==
<<-
OBJC
.
strip_heredoc
@import Foundation;
@import Foundation;
@import UIKit;
@import ModuleName;
@import ModuleName;
int main() {}
int main() {}
OBJC
OBJC
...
@@ -547,6 +548,7 @@ module Pod
...
@@ -547,6 +548,7 @@ module Pod
file
.
basename
.
to_s
.
should
==
'main.m'
file
.
basename
.
to_s
.
should
==
'main.m'
file
.
read
.
should
==
<<-
OBJC
.
strip_heredoc
file
.
read
.
should
==
<<-
OBJC
.
strip_heredoc
@import Foundation;
@import Foundation;
@import UIKit;
#import <ModuleName/ModuleName.h>
#import <ModuleName/ModuleName.h>
int main() {}
int main() {}
OBJC
OBJC
...
@@ -559,6 +561,7 @@ module Pod
...
@@ -559,6 +561,7 @@ module Pod
file
.
basename
.
to_s
.
should
==
'main.m'
file
.
basename
.
to_s
.
should
==
'main.m'
file
.
read
.
should
==
<<-
OBJC
.
strip_heredoc
file
.
read
.
should
==
<<-
OBJC
.
strip_heredoc
@import Foundation;
@import Foundation;
@import UIKit;
int main() {}
int main() {}
OBJC
OBJC
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