Fixes SQLite.swift compiler errors in Xcode 9

Adds post install action to Podfile to modify SQLite.swift source files.
This commit is contained in:
Riley Testut 2017-06-27 11:32:30 -05:00
parent a8176cb276
commit 7695a800c6
10 changed files with 25 additions and 8 deletions

View File

@ -766,7 +766,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n";
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n";
showEnvVarsInLog = 0;
};
/* End PBXShellScriptBuildPhase section */

12
Podfile
View File

@ -10,3 +10,15 @@ target 'Delta' do
pod 'Fabric', '~> 1.6.0'
pod 'Crashlytics', '~> 3.8.0'
end
post_install do |installer|
Dir.glob('Pods/SQLite.swift/Sources/SQLite/**/*.swift').each { |path|
begin
text = File.read(path)
text = text.gsub(/import CSQLite/, 'import SQLite3')
File.open(path, 'w') { |file| file.puts text }
rescue Exception
puts "Unable to patch #{path}: #{$!}"
end
}
end

View File

@ -24,6 +24,6 @@ SPEC CHECKSUMS:
SDWebImage: '098e97e6176540799c27e804c96653ee0833d13c'
SQLite.swift: 99b36c22084427f0abbeb957556ce1528cf10bb3
PODFILE CHECKSUM: 479289198dc1b6bdae32696a6946bca9352751db
PODFILE CHECKSUM: de6e2bf57dcf8e9fe6b622b181fd87d3855641e6
COCOAPODS: 1.2.0
COCOAPODS: 1.2.1

4
Pods/Manifest.lock generated
View File

@ -24,6 +24,6 @@ SPEC CHECKSUMS:
SDWebImage: '098e97e6176540799c27e804c96653ee0833d13c'
SQLite.swift: 99b36c22084427f0abbeb957556ce1528cf10bb3
PODFILE CHECKSUM: 479289198dc1b6bdae32696a6946bca9352751db
PODFILE CHECKSUM: de6e2bf57dcf8e9fe6b622b181fd87d3855641e6
COCOAPODS: 1.2.0
COCOAPODS: 1.2.1

View File

@ -29,7 +29,7 @@ import sqlite3
#elseif SQLITE_SWIFT_SQLCIPHER
import SQLCipher
#elseif SWIFT_PACKAGE || COCOAPODS
import CSQLite
import SQLite3
#endif
/// A connection to SQLite.

View File

@ -27,7 +27,7 @@ import sqlite3
#elseif SQLITE_SWIFT_SQLCIPHER
import SQLCipher
#elseif SWIFT_PACKAGE || COCOAPODS
import CSQLite
import SQLite3
#endif
/// A single SQL statement.

View File

@ -27,7 +27,7 @@ import sqlite3
#elseif SQLITE_SWIFT_SQLCIPHER
import SQLCipher
#elseif SWIFT_PACKAGE || COCOAPODS
import CSQLite
import SQLite3
#endif
public typealias Star = (Expression<Binding>?, Expression<Binding>?) -> Expression<Void>

View File

@ -21,6 +21,9 @@ case "${TARGETED_DEVICE_FAMILY}" in
3)
TARGET_DEVICE_ARGS="--target-device tv"
;;
4)
TARGET_DEVICE_ARGS="--target-device watch"
;;
*)
TARGET_DEVICE_ARGS="--target-device mac"
;;

View File

@ -8,4 +8,5 @@ OTHER_LDFLAGS = $(inherited) -ObjC -l"c++" -l"z" -framework "Crashlytics" -frame
OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS"
PODS_BUILD_DIR = $BUILD_DIR
PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
PODS_PODFILE_DIR_PATH = ${SRCROOT}/.
PODS_ROOT = ${SRCROOT}/Pods

View File

@ -8,4 +8,5 @@ OTHER_LDFLAGS = $(inherited) -ObjC -l"c++" -l"z" -framework "Crashlytics" -frame
OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS"
PODS_BUILD_DIR = $BUILD_DIR
PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
PODS_PODFILE_DIR_PATH = ${SRCROOT}/.
PODS_ROOT = ${SRCROOT}/Pods