Skip to content

Xcode8 #475

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

Closed
wants to merge 13 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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 @@
2.3
37 changes: 32 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,40 @@
language: objective-c
rvm: 2.2
osx_image: xcode8
matrix:
include:
- env: BUILD_SCHEME="SQLite iOS"
- env:
- BUILD_SCHEME="SQLite iOS"
- IOS_SIMULATOR="iPhone SE"
- env: BUILD_SCHEME="SQLite Mac"
- env: VALIDATOR_SUBSPEC="none"
- env: VALIDATOR_SUBSPEC="standard"
- env: VALIDATOR_SUBSPEC="standalone"
- env:
- VALIDATOR_SUBSPEC="none"
- IOS_SIMULATOR="iPhone SE"
- env:
- VALIDATOR_SUBSPEC="standard"
- IOS_SIMULATOR="iPhone SE"
- env:
- VALIDATOR_SUBSPEC="standalone"
- IOS_SIMULATOR="iPhone SE"
- os: osx
osx_image: xcode7.3
env: BUILD_SCHEME="SQLite iOS"
- os: osx
osx_image: xcode7.3
env: BUILD_SCHEME="SQLite Mac"
- os: osx
osx_image: xcode7.3
env: VALIDATOR_SUBSPEC="none"
- os: osx
osx_image: xcode7.3
env: VALIDATOR_SUBSPEC="standard"
- os: osx
osx_image: xcode7.3
env: VALIDATOR_SUBSPEC="standalone"
before_install:
- 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"
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"
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"
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"
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"
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
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
BUILD_TOOL = xcodebuild
BUILD_SCHEME = SQLite Mac
IOS_SIMULATOR = iPhone 6
ifeq ($(BUILD_SCHEME),SQLite iOS)
BUILD_ARGUMENTS = -scheme "$(BUILD_SCHEME)" -sdk iphonesimulator
BUILD_ARGUMENTS = -scheme "$(BUILD_SCHEME)" -destination "platform=iOS Simulator,name=$(IOS_SIMULATOR)"
else
BUILD_ARGUMENTS = -scheme "$(BUILD_SCHEME)"
endif
Expand Down
21 changes: 14 additions & 7 deletions SQLite.swift.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ Pod::Spec.new do |s|
s.osx.deployment_target = "10.9"
s.watchos.deployment_target = "2.0"
s.default_subspec = 'standard'
s.pod_target_xcconfig = {
'SWIFT_VERSION' => '2.3',
}

s.subspec 'standard' do |ss|
ss.source_files = 'SQLite/**/*.{c,h,m,swift}'
Expand All @@ -33,13 +36,17 @@ Pod::Spec.new do |s|
ss.library = 'sqlite3'
ss.preserve_paths = 'CocoaPods/**/*'
ss.pod_target_xcconfig = {
'SWIFT_INCLUDE_PATHS[sdk=macosx*]' => '$(SRCROOT)/SQLite.swift/CocoaPods/macosx',
'SWIFT_INCLUDE_PATHS[sdk=iphoneos*]' => '$(SRCROOT)/SQLite.swift/CocoaPods/iphoneos',
'SWIFT_INCLUDE_PATHS[sdk=iphonesimulator*]' => '$(SRCROOT)/SQLite.swift/CocoaPods/iphonesimulator',
'SWIFT_INCLUDE_PATHS[sdk=appletvos*]' => '$(SRCROOT)/SQLite.swift/CocoaPods/appletvos',
'SWIFT_INCLUDE_PATHS[sdk=appletvsimulator*]' => '$(SRCROOT)/SQLite.swift/CocoaPods/appletvsimulator',
'SWIFT_INCLUDE_PATHS[sdk=watchos*]' => '$(SRCROOT)/SQLite.swift/CocoaPods/watchos',
'SWIFT_INCLUDE_PATHS[sdk=watchsimulator*]' => '$(SRCROOT)/SQLite.swift/CocoaPods/watchsimulator'
'SWIFT_INCLUDE_PATHS[sdk=macosx*]' => '$(SRCROOT)/SQLite.swift/CocoaPods/macosx',
'SWIFT_INCLUDE_PATHS[sdk=macosx10.11]' => '$(SRCROOT)/SQLite.swift/CocoaPods/macosx-10.11',
'SWIFT_INCLUDE_PATHS[sdk=macosx10.12]' => '$(SRCROOT)/SQLite.swift/CocoaPods/macosx-10.12',
'SWIFT_INCLUDE_PATHS[sdk=iphoneos*]' => '$(SRCROOT)/SQLite.swift/CocoaPods/iphoneos',
'SWIFT_INCLUDE_PATHS[sdk=iphoneos10.0]' => '$(SRCROOT)/SQLite.swift/CocoaPods/iphoneos-10.0',
'SWIFT_INCLUDE_PATHS[sdk=iphonesimulator*]' => '$(SRCROOT)/SQLite.swift/CocoaPods/iphonesimulator',
'SWIFT_INCLUDE_PATHS[sdk=iphonesimulator10.0]' => '$(SRCROOT)/SQLite.swift/CocoaPods/iphonesimulator-10.0',
'SWIFT_INCLUDE_PATHS[sdk=appletvos*]' => '$(SRCROOT)/SQLite.swift/CocoaPods/appletvos',
'SWIFT_INCLUDE_PATHS[sdk=appletvsimulator*]' => '$(SRCROOT)/SQLite.swift/CocoaPods/appletvsimulator',
'SWIFT_INCLUDE_PATHS[sdk=watchos*]' => '$(SRCROOT)/SQLite.swift/CocoaPods/watchos',
'SWIFT_INCLUDE_PATHS[sdk=watchsimulator*]' => '$(SRCROOT)/SQLite.swift/CocoaPods/watchsimulator'
}
end

Expand Down
Loading