Skip to content

Swift3 #502

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 36 commits into from
Oct 11, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
4ff05c6
Run tests on Xcode8-beta
jberkel Jul 21, 2016
4cdfd69
Validate pod on xcode8
jberkel Aug 24, 2016
ed8980c
Run tests on iPhone 6
jberkel Aug 24, 2016
775a26c
Don’t hardcode simulator version
jberkel Aug 24, 2016
1cc0a53
Bump cocoapods
jberkel Sep 13, 2016
0aaf650
Set Swift version to 2.3
jberkel Sep 13, 2016
2588c44
Xcode8 compat changes
jberkel Sep 13, 2016
b62880e
Update CocoaPods, update repo
jberkel Sep 14, 2016
9fa5b90
Use recommended Xcode8 project settings
jberkel Sep 14, 2016
3df6b05
travis: use xcode8 as default image
jberkel Sep 14, 2016
90e662e
Add Swift version to xcconfig
jberkel Sep 16, 2016
494f3c4
use Pod::Validator#add_swift_version
jberkel Sep 16, 2016
8f9b8a8
migrating to swift 3
mariotaku Sep 16, 2016
78c7f6a
all tests passed
mariotaku Sep 16, 2016
aaa07c7
added .swift-version for pods
mariotaku Sep 17, 2016
e9abf03
Remove Xcode 7.3 tests
jberkel Sep 17, 2016
f8209be
Set swift version in podspec
jberkel Sep 17, 2016
33f712d
Set iOS simulator
jberkel Sep 17, 2016
1837266
Swift3 enum casing
jberkel Sep 20, 2016
4ed14ad
Nest Operation inside Connection
jberkel Sep 20, 2016
2c9fd0c
Flag methods executed for side-effects to silence warnings
jberkel Oct 6, 2016
8f8eec7
Add tests for Blob initializer
jberkel Oct 7, 2016
b6941cd
Add more tests for blob handling
jberkel Oct 7, 2016
f7d017d
use @discardableResult
jberkel Oct 8, 2016
6bf844a
Fix warnings
jberkel Oct 8, 2016
1549062
Accidental commit
jberkel Oct 8, 2016
5bc521e
Only available on OS X 10.10 or newer
jberkel Oct 8, 2016
f11f6b8
cleanup
jberkel Oct 9, 2016
6152ee3
Documentation updates
jberkel Oct 9, 2016
bbab401
Remove FIXME
jberkel Oct 9, 2016
96238f5
sqlite3_trace
jberkel Oct 9, 2016
b392eaf
Remove unneeded typealias
jberkel Oct 9, 2016
8ba973e
Remove outdated sample code (#516)
jberkel Oct 10, 2016
681e219
Update bundler
jberkel Oct 10, 2016
db8f39b
Only import module when building with CocoaPods
jberkel Oct 11, 2016
6b4cb81
Mention swift-2.3 branch in documentation
jberkel Oct 11, 2016
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .swift-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.0
10 changes: 9 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
language: objective-c
rvm: 2.2
osx_image: xcode8
env:
global:
- IOS_SIMULATOR="iPhone SE"
matrix:
include:
- env: BUILD_SCHEME="SQLite iOS"
Expand All @@ -7,7 +12,10 @@ matrix:
- env: VALIDATOR_SUBSPEC="standard"
- env: VALIDATOR_SUBSPEC="standalone"
before_install:
- gem update bundler
- gem install xcpretty --no-document
script:
- ./run-tests.sh
osx_image: xcode7.3
after_failure:
- find $HOME/Library/Developer/Xcode/DerivedData/ -name '*.log' -print0 | xargs -0 cat
- cat /var/log/system.log
4 changes: 4 additions & 0 deletions CocoaPods/iphoneos-10.0/module.modulemap
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
module CSQLite [system] {
header "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS10.0.sdk/usr/include/sqlite3.h"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This hard-coding of the Xcode path causes build errors (Carthage, CocoaPods or just building in Xcode) for all users who don't have their copy of Xcode 8.x at that path.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you suggest to do instead?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This hard-coding is required for CocoaPods. If you include SQLite.swift as a sub-project or via Carthage it uses an SDK-relative path instead.

I've raised this issue with CocoaPods in the past: CocoaPods/CocoaPods#3942

We're always open to alternative solutions for CocoaPods users, though, and would happily take contributions that solve the problem more elegantly for them!

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@stephencelis this also affects Carthage builds – without the modulemap, the CSQLite imports cannot be resolved. Even worse, they're still required after the framework has been built (see #492).

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

think this is solved now with db8f39b

export *
}
4 changes: 4 additions & 0 deletions CocoaPods/iphonesimulator-10.0/module.modulemap
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
module CSQLite [system] {
header "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator10.0.sdk/usr/include/sqlite3.h"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As above, this causes build errors for all users who don't have their copy of Xcode 8.x at that path.

export *
}
4 changes: 4 additions & 0 deletions CocoaPods/macosx-10.11/module.modulemap
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
module CSQLite [system] {
header "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/include/sqlite3.h"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As above, this causes build errors for all users who don't have their copy of Xcode 8.x at that path.

export *
}
4 changes: 4 additions & 0 deletions CocoaPods/macosx-10.12/module.modulemap
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
module CSQLite [system] {
header "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/usr/include/sqlite3.h"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As above, this causes build errors for all users who don't have their copy of Xcode 8.x at that path.

export *
}
2 changes: 1 addition & 1 deletion CocoaPods/macosx/module.modulemap
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module CSQLite [system] {
header "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/include/sqlite3.h"
header "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sqlite3.h"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As above, this causes build errors for all users who don't have their copy of Xcode 8.x at that path.

export *
}
2 changes: 1 addition & 1 deletion CocoaPodsTests/Gemfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
source 'https://rubygems.org'

gem 'cocoapods'
gem 'cocoapods', '~> 1.1.0.rc.2'
gem 'minitest'
45 changes: 25 additions & 20 deletions CocoaPodsTests/Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,58 +1,60 @@
GEM
remote: https://rubygems.org/
specs:
activesupport (4.2.6)
activesupport (4.2.7.1)
i18n (~> 0.7)
json (~> 1.7, >= 1.7.7)
minitest (~> 5.1)
thread_safe (~> 0.3, >= 0.3.4)
tzinfo (~> 1.1)
claide (1.0.0)
cocoapods (1.0.0)
activesupport (>= 4.0.2)
cocoapods (1.1.0.rc.2)
activesupport (>= 4.0.2, < 5)
claide (>= 1.0.0, < 2.0)
cocoapods-core (= 1.0.0)
cocoapods-deintegrate (>= 1.0.0, < 2.0)
cocoapods-downloader (>= 1.0.0, < 2.0)
cocoapods-core (= 1.1.0.rc.2)
cocoapods-deintegrate (>= 1.0.1, < 2.0)
cocoapods-downloader (>= 1.1.1, < 2.0)
cocoapods-plugins (>= 1.0.0, < 2.0)
cocoapods-search (>= 1.0.0, < 2.0)
cocoapods-stats (>= 1.0.0, < 2.0)
cocoapods-trunk (>= 1.0.0, < 2.0)
cocoapods-try (>= 1.0.0, < 2.0)
cocoapods-try (>= 1.1.0, < 2.0)
colored (~> 1.2)
escape (~> 0.0.4)
fourflusher (~> 0.3.0)
molinillo (~> 0.4.5)
fourflusher (~> 1.0.1)
gh_inspector (~> 1.0)
molinillo (~> 0.5.1)
nap (~> 1.0)
xcodeproj (>= 1.0.0, < 2.0)
cocoapods-core (1.0.0)
activesupport (>= 4.0.2)
xcodeproj (>= 1.3.1, < 2.0)
cocoapods-core (1.1.0.rc.2)
activesupport (>= 4.0.2, < 5)
fuzzy_match (~> 2.0.4)
nap (~> 1.0)
cocoapods-deintegrate (1.0.0)
cocoapods-downloader (1.0.0)
cocoapods-deintegrate (1.0.1)
cocoapods-downloader (1.1.1)
cocoapods-plugins (1.0.0)
nap
cocoapods-search (1.0.0)
cocoapods-stats (1.0.0)
cocoapods-trunk (1.0.0)
nap (>= 0.8, < 2.0)
netrc (= 0.7.8)
cocoapods-try (1.0.0)
cocoapods-try (1.1.0)
colored (1.2)
escape (0.0.4)
fourflusher (0.3.0)
fourflusher (1.0.1)
fuzzy_match (2.0.4)
gh_inspector (1.0.2)
i18n (0.7.0)
json (1.8.3)
minitest (5.8.4)
molinillo (0.4.5)
minitest (5.9.0)
molinillo (0.5.1)
nap (1.1.0)
netrc (0.7.8)
thread_safe (0.3.5)
tzinfo (1.2.2)
thread_safe (~> 0.1)
xcodeproj (1.0.0)
xcodeproj (1.3.1)
activesupport (>= 3)
claide (>= 1.0.0, < 2.0)
colored (~> 1.2)
Expand All @@ -61,5 +63,8 @@ PLATFORMS
ruby

DEPENDENCIES
cocoapods
cocoapods (~> 1.1.0.rc.2)
minitest

BUNDLED WITH
1.10.6
5 changes: 4 additions & 1 deletion CocoaPodsTests/Makefile
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
test: install
test: install repo_update
@set -e; \
for test in *_test.rb; do \
bundle exec ./$$test; \
done

repo_update:
@bundle exec pod repo update --silent

install:
@bundle install --path gems

Expand Down
7 changes: 5 additions & 2 deletions CocoaPodsTests/integration_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,22 @@ def test_validate_project

def validator
@validator ||= TestRunningValidator.new(podspec, []).tap do |validator|
subspec = ENV["VALIDATOR_SUBSPEC"]
validator.test_files = Dir["#{project_test_dir}/*.swift"]
validator.config.verbose = true
validator.no_clean = true
validator.use_frameworks = true
validator.fail_fast = true
validator.local = true
validator.allow_warnings = true
if subspec == "none"
subspec = ENV['VALIDATOR_SUBSPEC']
if subspec == 'none'
validator.no_subspecs = true
else
validator.only_subspec = subspec
end
if ENV['IOS_SIMULATOR']
validator.ios_simulator = ENV['IOS_SIMULATOR']
end
end
end

Expand Down
52 changes: 36 additions & 16 deletions CocoaPodsTests/test_running_validator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,36 @@ class TestRunningValidator < Pod::Validator
TEST_TARGET = 'Tests'

attr_accessor :test_files
attr_accessor :ios_simulator
attr_accessor :tvos_simulator

def initialize(spec_or_path, source_urls)
super(spec_or_path, source_urls)
self.ios_simulator = :oldest
self.tvos_simulator = :oldest
end

def create_app_project
super.tap do
project = Xcodeproj::Project.open(validation_dir + "#{APP_TARGET}.xcodeproj")
create_test_target(project)
end
super
project = Xcodeproj::Project.open(validation_dir + "#{APP_TARGET}.xcodeproj")
create_test_target(project)
project.save
end

def add_app_project_import
super
project = Xcodeproj::Project.open(validation_dir + 'App.xcodeproj')
group = project.new_group(TEST_TARGET)
test_target = project.targets.last
test_target.add_file_references(test_files.map { |file| group.new_file(file) })
add_swift_version(test_target)
project.save
end

def install_pod
super.tap do
if local?
FileUtils.ln_s file.dirname, validation_dir + "Pods/#{spec.name}"
end
super
if local?
FileUtils.ln_s file.dirname, validation_dir + "Pods/#{spec.name}"
end
end

Expand All @@ -39,11 +56,7 @@ def build_pod
private
def create_test_target(project)
test_target = project.new_target(:unit_test_bundle, TEST_TARGET, consumer.platform_name, deployment_target)
group = project.new_group(TEST_TARGET)
test_target.add_file_references(test_files.map { |file| group.new_file(file) })
project.save
create_test_scheme(project, test_target)
project
end

def create_test_scheme(project, test_target)
Expand All @@ -63,21 +76,27 @@ def add_test_target(pod_file)
end

def run_tests
command = %W(clean test -workspace #{APP_TARGET}.xcworkspace -scheme #{TEST_TARGET} -configuration Debug)
command = [
'clean', 'test',
'-workspace', File.join(validation_dir, "#{APP_TARGET}.xcworkspace"),
'-scheme', TEST_TARGET,
'-configuration', 'Debug'
]
case consumer.platform_name
when :ios
command += %w(CODE_SIGN_IDENTITY=- -sdk iphonesimulator)
command += Fourflusher::SimControl.new.destination('iPhone 4s', deployment_target)
command += Fourflusher::SimControl.new.destination(ios_simulator, 'iOS', deployment_target)
when :osx
command += %w(LD_RUNPATH_SEARCH_PATHS=@loader_path/../Frameworks)
when :tvos
command += %w(CODE_SIGN_IDENTITY=- -sdk appletvsimulator)
command += Fourflusher::SimControl.new.destination('Apple TV 1080p', deployment_target)
command += Fourflusher::SimControl.new.destination(tvos_simulator, 'tvOS', deployment_target)
else
return # skip watchos
end

output, status = Dir.chdir(validation_dir) { _xcodebuild(command) }
output, status = _xcodebuild(command)

unless status.success?
message = 'Returned an unsuccessful exit code.'
if config.verbose?
Expand All @@ -87,5 +106,6 @@ def run_tests
end
error('xcodebuild', message)
end
output
end
end
Loading