SQLCipher CocoaPods support
Using a sub-spec, it's easy to use SQLCipher, as well: pod 'SQLite.swift/Cipher', git: # ... Signed-off-by: Stephen Celis <stephen@stephencelis.com>
This commit is contained in:
Родитель
9bfae5c0b5
Коммит
e125805642
|
@ -79,6 +79,7 @@
|
|||
``` ruby
|
||||
use_frameworks!
|
||||
pod 'SQLite.swift', git: 'https://github.com/stephencelis/SQLite.swift.git'
|
||||
# pod 'SQLite.swift/Cipher', git: ... # instead, for SQLCipher support
|
||||
```
|
||||
|
||||
3. Run `pod install`.
|
||||
|
@ -104,13 +105,13 @@ To install SQLite.swift as an Xcode sub-project:
|
|||
You should now be able to `import SQLite` from any of your target’s source files and begin using SQLite.swift.
|
||||
|
||||
|
||||
### SQLCipher
|
||||
#### SQLCipher
|
||||
|
||||
To install SQLite.swift with [SQLCipher](http://sqlcipher.net) support:
|
||||
|
||||
1. Make sure the **sqlcipher** working copy is checked out in Xcode. If **sqlcipher.xcodeproj** is unavailable (_i.e._, it appears red), go to the **Source Control** menu and select **Check Out sqlcipher…** from the **sqlcipher** menu item.
|
||||
|
||||
2. Follow [the instructions above](#installation) with the **SQLiteCipher** target, instead.
|
||||
2. Follow [the instructions above](#manual) with the **SQLiteCipher** target, instead.
|
||||
|
||||
> _Note:_ By default, SQLCipher compiles [without support for full-text search](https://github.com/sqlcipher/sqlcipher/issues/102). If you intend to use [FTS4](#full-text-search), make sure you add the following to **Other C Flags** in the **Build Settings** of the **sqlcipher** target (in the **sqlcipher.xcodeproj** project):
|
||||
>
|
||||
|
|
21
README.md
21
README.md
|
@ -119,17 +119,18 @@ interactively, from the Xcode project’s playground.
|
|||
[CocoaPods][] is a dependency manager for Cocoa projects. To install
|
||||
SQLite.swift with CocoaPods:
|
||||
|
||||
1. Make sure CocoaPods is [installed][CocoaPods Installation] (SQLite.swift
|
||||
requires version 0.37 or greater).
|
||||
1. Make sure CocoaPods is [installed][CocoaPods Installation] (SQLite.swift
|
||||
requires version 0.37 or greater).
|
||||
|
||||
2. Update your Podfile to include the following:
|
||||
2. Update your Podfile to include the following:
|
||||
|
||||
``` ruby
|
||||
use_frameworks!
|
||||
pod 'SQLite.swift', git: 'https://github.com/stephencelis/SQLite.swift.git'
|
||||
```
|
||||
``` ruby
|
||||
use_frameworks!
|
||||
pod 'SQLite.swift', git: 'https://github.com/stephencelis/SQLite.swift.git'
|
||||
# pod 'SQLite.swift/Cipher', git: ... # instead, for SQLCipher support
|
||||
```
|
||||
|
||||
3. Run `pod install`.
|
||||
3. Run `pod install`.
|
||||
|
||||
[CocoaPods]: https://cocoapods.org
|
||||
[CocoaPods Installation]: https://guides.cocoapods.org/using/getting-started.html#getting-started
|
||||
|
@ -168,8 +169,8 @@ To install SQLite.swift with [SQLCipher][] support:
|
|||
**Source Control** menu and select **Check Out sqlcipher…** from the
|
||||
**sqlcipher** menu item.
|
||||
|
||||
2. Follow [the instructions above](#installation) with the
|
||||
**SQLiteCipher** target, instead.
|
||||
2. Follow [the instructions above](#manual) with the **SQLiteCipher** target,
|
||||
instead.
|
||||
|
||||
> _Note:_ By default, SQLCipher compiles [without support for full-text
|
||||
> search][]. If you intend to use [FTS4][], make sure you add the
|
||||
|
|
|
@ -15,15 +15,34 @@ Pod::Spec.new do |s|
|
|||
s.author = { 'Stephen Celis' => 'stephen@stephencelis.com' }
|
||||
s.social_media_url = 'https://twitter.com/stephencelis'
|
||||
|
||||
s.library = 'sqlite3'
|
||||
|
||||
s.source = {
|
||||
git: 'https://github.com/stephencelis/SQLite.swift.git',
|
||||
tag: s.version
|
||||
}
|
||||
|
||||
s.source_files = 'SQLite/**/*.{swift,c,h,m}'
|
||||
s.private_header_files = 'SQLite/fts3_tokenizer.h'
|
||||
|
||||
s.module_map = 'SQLite/module.modulemap'
|
||||
|
||||
s.default_subspec = 'Library'
|
||||
|
||||
s.subspec 'Core' do |ss|
|
||||
ss.source_files = 'SQLite/**/*.{swift,c,h,m}'
|
||||
ss.private_header_files = 'SQLite/fts3_tokenizer.h'
|
||||
end
|
||||
|
||||
s.subspec 'Library' do |ss|
|
||||
ss.dependency 'SQLite.swift/Core'
|
||||
|
||||
ss.library = 'sqlite3'
|
||||
end
|
||||
|
||||
s.subspec 'Cipher' do |ss|
|
||||
ss.dependency 'SQLCipher'
|
||||
ss.dependency 'SQLite.swift/Core'
|
||||
|
||||
ss.source_files = 'SQLiteCipher/**/*.{swift,c,h,m}'
|
||||
|
||||
ss.xcconfig = {
|
||||
'GCC_PREPROCESSOR_DEFINITIONS' => '$(inherited) SQLITE_HAS_CODEC=1'
|
||||
}
|
||||
end
|
||||
end
|
||||
|
|
Загрузка…
Ссылка в новой задаче