Skip to content

Commit 38d9b85

Browse files
authored
Merge pull request #502 from stephencelis/swift3-mariotaku
Swift3
2 parents 492bd66 + 6b4cb81 commit 38d9b85

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+1069
-917
lines changed

.swift-version

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
3.0

.travis.yml

+9-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11
language: objective-c
2+
rvm: 2.2
3+
osx_image: xcode8
4+
env:
5+
global:
6+
- IOS_SIMULATOR="iPhone SE"
27
matrix:
38
include:
49
- env: BUILD_SCHEME="SQLite iOS"
@@ -7,7 +12,10 @@ matrix:
712
- env: VALIDATOR_SUBSPEC="standard"
813
- env: VALIDATOR_SUBSPEC="standalone"
914
before_install:
15+
- gem update bundler
1016
- gem install xcpretty --no-document
1117
script:
1218
- ./run-tests.sh
13-
osx_image: xcode7.3
19+
after_failure:
20+
- find $HOME/Library/Developer/Xcode/DerivedData/ -name '*.log' -print0 | xargs -0 cat
21+
- cat /var/log/system.log
+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
module CSQLite [system] {
2+
header "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS10.0.sdk/usr/include/sqlite3.h"
3+
export *
4+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
module CSQLite [system] {
2+
header "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator10.0.sdk/usr/include/sqlite3.h"
3+
export *
4+
}
+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
module CSQLite [system] {
2+
header "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/include/sqlite3.h"
3+
export *
4+
}
+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
module CSQLite [system] {
2+
header "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/usr/include/sqlite3.h"
3+
export *
4+
}

CocoaPods/macosx/module.modulemap

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
module CSQLite [system] {
2-
header "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/include/sqlite3.h"
2+
header "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sqlite3.h"
33
export *
44
}

CocoaPodsTests/Gemfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
source 'https://rubygems.org'
22

3-
gem 'cocoapods'
3+
gem 'cocoapods', '~> 1.1.0.rc.2'
44
gem 'minitest'

CocoaPodsTests/Gemfile.lock

+25-20
Original file line numberDiff line numberDiff line change
@@ -1,58 +1,60 @@
11
GEM
22
remote: https://rubygems.org/
33
specs:
4-
activesupport (4.2.6)
4+
activesupport (4.2.7.1)
55
i18n (~> 0.7)
66
json (~> 1.7, >= 1.7.7)
77
minitest (~> 5.1)
88
thread_safe (~> 0.3, >= 0.3.4)
99
tzinfo (~> 1.1)
1010
claide (1.0.0)
11-
cocoapods (1.0.0)
12-
activesupport (>= 4.0.2)
11+
cocoapods (1.1.0.rc.2)
12+
activesupport (>= 4.0.2, < 5)
1313
claide (>= 1.0.0, < 2.0)
14-
cocoapods-core (= 1.0.0)
15-
cocoapods-deintegrate (>= 1.0.0, < 2.0)
16-
cocoapods-downloader (>= 1.0.0, < 2.0)
14+
cocoapods-core (= 1.1.0.rc.2)
15+
cocoapods-deintegrate (>= 1.0.1, < 2.0)
16+
cocoapods-downloader (>= 1.1.1, < 2.0)
1717
cocoapods-plugins (>= 1.0.0, < 2.0)
1818
cocoapods-search (>= 1.0.0, < 2.0)
1919
cocoapods-stats (>= 1.0.0, < 2.0)
2020
cocoapods-trunk (>= 1.0.0, < 2.0)
21-
cocoapods-try (>= 1.0.0, < 2.0)
21+
cocoapods-try (>= 1.1.0, < 2.0)
2222
colored (~> 1.2)
2323
escape (~> 0.0.4)
24-
fourflusher (~> 0.3.0)
25-
molinillo (~> 0.4.5)
24+
fourflusher (~> 1.0.1)
25+
gh_inspector (~> 1.0)
26+
molinillo (~> 0.5.1)
2627
nap (~> 1.0)
27-
xcodeproj (>= 1.0.0, < 2.0)
28-
cocoapods-core (1.0.0)
29-
activesupport (>= 4.0.2)
28+
xcodeproj (>= 1.3.1, < 2.0)
29+
cocoapods-core (1.1.0.rc.2)
30+
activesupport (>= 4.0.2, < 5)
3031
fuzzy_match (~> 2.0.4)
3132
nap (~> 1.0)
32-
cocoapods-deintegrate (1.0.0)
33-
cocoapods-downloader (1.0.0)
33+
cocoapods-deintegrate (1.0.1)
34+
cocoapods-downloader (1.1.1)
3435
cocoapods-plugins (1.0.0)
3536
nap
3637
cocoapods-search (1.0.0)
3738
cocoapods-stats (1.0.0)
3839
cocoapods-trunk (1.0.0)
3940
nap (>= 0.8, < 2.0)
4041
netrc (= 0.7.8)
41-
cocoapods-try (1.0.0)
42+
cocoapods-try (1.1.0)
4243
colored (1.2)
4344
escape (0.0.4)
44-
fourflusher (0.3.0)
45+
fourflusher (1.0.1)
4546
fuzzy_match (2.0.4)
47+
gh_inspector (1.0.2)
4648
i18n (0.7.0)
4749
json (1.8.3)
48-
minitest (5.8.4)
49-
molinillo (0.4.5)
50+
minitest (5.9.0)
51+
molinillo (0.5.1)
5052
nap (1.1.0)
5153
netrc (0.7.8)
5254
thread_safe (0.3.5)
5355
tzinfo (1.2.2)
5456
thread_safe (~> 0.1)
55-
xcodeproj (1.0.0)
57+
xcodeproj (1.3.1)
5658
activesupport (>= 3)
5759
claide (>= 1.0.0, < 2.0)
5860
colored (~> 1.2)
@@ -61,5 +63,8 @@ PLATFORMS
6163
ruby
6264

6365
DEPENDENCIES
64-
cocoapods
66+
cocoapods (~> 1.1.0.rc.2)
6567
minitest
68+
69+
BUNDLED WITH
70+
1.10.6

CocoaPodsTests/Makefile

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
1-
test: install
1+
test: install repo_update
22
@set -e; \
33
for test in *_test.rb; do \
44
bundle exec ./$$test; \
55
done
66

7+
repo_update:
8+
@bundle exec pod repo update --silent
9+
710
install:
811
@bundle install --path gems
912

CocoaPodsTests/integration_test.rb

+5-2
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,22 @@ def test_validate_project
1313

1414
def validator
1515
@validator ||= TestRunningValidator.new(podspec, []).tap do |validator|
16-
subspec = ENV["VALIDATOR_SUBSPEC"]
1716
validator.test_files = Dir["#{project_test_dir}/*.swift"]
1817
validator.config.verbose = true
1918
validator.no_clean = true
2019
validator.use_frameworks = true
2120
validator.fail_fast = true
2221
validator.local = true
2322
validator.allow_warnings = true
24-
if subspec == "none"
23+
subspec = ENV['VALIDATOR_SUBSPEC']
24+
if subspec == 'none'
2525
validator.no_subspecs = true
2626
else
2727
validator.only_subspec = subspec
2828
end
29+
if ENV['IOS_SIMULATOR']
30+
validator.ios_simulator = ENV['IOS_SIMULATOR']
31+
end
2932
end
3033
end
3134

CocoaPodsTests/test_running_validator.rb

+36-16
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,36 @@ class TestRunningValidator < Pod::Validator
77
TEST_TARGET = 'Tests'
88

99
attr_accessor :test_files
10+
attr_accessor :ios_simulator
11+
attr_accessor :tvos_simulator
12+
13+
def initialize(spec_or_path, source_urls)
14+
super(spec_or_path, source_urls)
15+
self.ios_simulator = :oldest
16+
self.tvos_simulator = :oldest
17+
end
1018

1119
def create_app_project
12-
super.tap do
13-
project = Xcodeproj::Project.open(validation_dir + "#{APP_TARGET}.xcodeproj")
14-
create_test_target(project)
15-
end
20+
super
21+
project = Xcodeproj::Project.open(validation_dir + "#{APP_TARGET}.xcodeproj")
22+
create_test_target(project)
23+
project.save
24+
end
25+
26+
def add_app_project_import
27+
super
28+
project = Xcodeproj::Project.open(validation_dir + 'App.xcodeproj')
29+
group = project.new_group(TEST_TARGET)
30+
test_target = project.targets.last
31+
test_target.add_file_references(test_files.map { |file| group.new_file(file) })
32+
add_swift_version(test_target)
33+
project.save
1634
end
1735

1836
def install_pod
19-
super.tap do
20-
if local?
21-
FileUtils.ln_s file.dirname, validation_dir + "Pods/#{spec.name}"
22-
end
37+
super
38+
if local?
39+
FileUtils.ln_s file.dirname, validation_dir + "Pods/#{spec.name}"
2340
end
2441
end
2542

@@ -39,11 +56,7 @@ def build_pod
3956
private
4057
def create_test_target(project)
4158
test_target = project.new_target(:unit_test_bundle, TEST_TARGET, consumer.platform_name, deployment_target)
42-
group = project.new_group(TEST_TARGET)
43-
test_target.add_file_references(test_files.map { |file| group.new_file(file) })
44-
project.save
4559
create_test_scheme(project, test_target)
46-
project
4760
end
4861

4962
def create_test_scheme(project, test_target)
@@ -63,21 +76,27 @@ def add_test_target(pod_file)
6376
end
6477

6578
def run_tests
66-
command = %W(clean test -workspace #{APP_TARGET}.xcworkspace -scheme #{TEST_TARGET} -configuration Debug)
79+
command = [
80+
'clean', 'test',
81+
'-workspace', File.join(validation_dir, "#{APP_TARGET}.xcworkspace"),
82+
'-scheme', TEST_TARGET,
83+
'-configuration', 'Debug'
84+
]
6785
case consumer.platform_name
6886
when :ios
6987
command += %w(CODE_SIGN_IDENTITY=- -sdk iphonesimulator)
70-
command += Fourflusher::SimControl.new.destination('iPhone 4s', deployment_target)
88+
command += Fourflusher::SimControl.new.destination(ios_simulator, 'iOS', deployment_target)
7189
when :osx
7290
command += %w(LD_RUNPATH_SEARCH_PATHS=@loader_path/../Frameworks)
7391
when :tvos
7492
command += %w(CODE_SIGN_IDENTITY=- -sdk appletvsimulator)
75-
command += Fourflusher::SimControl.new.destination('Apple TV 1080p', deployment_target)
93+
command += Fourflusher::SimControl.new.destination(tvos_simulator, 'tvOS', deployment_target)
7694
else
7795
return # skip watchos
7896
end
7997

80-
output, status = Dir.chdir(validation_dir) { _xcodebuild(command) }
98+
output, status = _xcodebuild(command)
99+
81100
unless status.success?
82101
message = 'Returned an unsuccessful exit code.'
83102
if config.verbose?
@@ -87,5 +106,6 @@ def run_tests
87106
end
88107
error('xcodebuild', message)
89108
end
109+
output
90110
end
91111
end

0 commit comments

Comments
 (0)