Skip to content

Prep for public release to CocoaPods #314

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 5 commits into from
Jan 10, 2016
Merged
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
25 changes: 19 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,10 +1,23 @@
# OS X
.DS_Store
Copy link
Owner

Choose a reason for hiding this comment

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

Good change. Prepares us for swiftpm compatibility 👍

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Thx :) I can't take full credit. This just seemed to be the norm in similar projects I viewed for comparison when I did "new project", so I copy pasted. Plus I've removed more than a few .DS_Store files over time.


# Xcode
build/
timeline.xctimeline
xcuserdata/

# System
.DS_Store
*.pbxuser
!default.pbxuser
*.mode1v3
!default.mode1v3
*.mode2v3
!default.mode2v3
*.perspectivev3
!default.perspectivev3
xcuserdata
*.xccheckout
*.moved-aside
DerivedData
*.hmap
*.ipa
*.xcuserstate

# Carthage
Carthage/
Carthage
3 changes: 0 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +0,0 @@
[submodule "sqlcipher"]
path = Vendor/sqlcipher
url = https://github.com/sqlcipher/sqlcipher.git
21 changes: 0 additions & 21 deletions Documentation/Index.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
- [Carthage](#carthage)
- [CocoaPods](#cocoapods)
- [Manual](#manual)
- [SQLCipher](#sqlcipher)
- [Frameworkless Targets](#frameworkless-targets)
- [Getting Started](#getting-started)
- [Connecting to a Database](#connecting-to-a-database)
Expand Down Expand Up @@ -103,10 +102,6 @@ install SQLite.swift with Carthage:

pod 'SQLite.swift',
git: 'https://github.com/stephencelis/SQLite.swift.git'

# instead, for SQLCipher support
pod 'SQLiteCipher.swift',
git: 'https://github.com/stephencelis/SQLite.swift.git'
```

3. Run `pod install`.
Expand All @@ -132,22 +127,6 @@ 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

> _Note_: To install with CocoaPods, [see above](#cocoapods).

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](#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):
>
> - `-DSQLITE_ENABLE_FTS4`
> - `-DSQLITE_ENABLE_FTS3_PARENTHESIS`


### Frameworkless Targets

It’s possible to use SQLite.swift in a target that doesn’t support frameworks, including iOS 7 apps and OS X command line tools, though it takes a little extra work.
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,6 @@ repl:
swift -F '$(TMPDIR)/SQLite.swift/Build/Products/Debug'

sloc:
@zsh -c "grep -vE '^ *//|^$$' SQLite/*.{swift,h,c} | wc -l"
@zsh -c "grep -vE '^ *//|^$$' SQLite/*/*.{swift,h,m} | wc -l"
Copy link
Owner

Choose a reason for hiding this comment

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

Good catch! I don't think the depth is deeper than one directory here at the moment, but maybe **/* for future safety?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I tried "make sloc" and only got errors, and this made it work. (I almost deleted everything from the Makefile to "start fresh", but didn't want to deal with the potential repercussions as I'd already changed so much! (i.e. I was trying to resist (further?) bike shedding! )


.PHONY: test coverage clean repl sloc
33 changes: 1 addition & 32 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ syntax _and_ intent.
- A lightweight, uncomplicated query and parameter binding interface
- Developer-friendly error handling and debugging
- [Full-text search][] support
- [SQLCipher](#sqlcipher) support
- [Well-documented][See Documentation]
- Extensively tested
- SQLCipher support will be available again soon (see #311)

[Full-text search]: Documentation/Index.md#full-text-search
[See Documentation]: Documentation/Index.md#sqliteswift-documentation
Expand Down Expand Up @@ -150,10 +150,6 @@ SQLite.swift with CocoaPods:

pod 'SQLite.swift',
git: 'https://github.com/stephencelis/SQLite.swift.git'

# instead, for SQLCipher support
pod 'SQLiteCipher.swift',
git: 'https://github.com/stephencelis/SQLite.swift.git'
```

3. Run `pod install`.
Expand Down Expand Up @@ -184,33 +180,6 @@ To install SQLite.swift as an Xcode sub-project:
[download]: https://github.com/stephencelis/SQLite.swift/archive/master.zip


#### SQLCipher

> _Note_: To install with CocoaPods, [see above](#cocoapods).

To install SQLite.swift with [SQLCipher][] 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](#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
> following to **Other C Flags** in the **Build Settings** of the
> **sqlcipher** target (in the **sqlcipher.xcodeproj** project):
>
> - `-DSQLITE_ENABLE_FTS4`
> - `-DSQLITE_ENABLE_FTS3_PARENTHESIS`

[SQLCipher]: http://sqlcipher.net
[without support for full-text search]: https://github.com/sqlcipher/sqlcipher/issues/102
[FTS4]: http://www.sqlite.org/fts3.html


## Communication

[See the planning document] for a roadmap and existing feature requests.
Expand Down
36 changes: 26 additions & 10 deletions SQLite.swift.podspec
Original file line number Diff line number Diff line change
@@ -1,17 +1,33 @@
$LOAD_PATH << '.'
require 'Supporting Files/podspec.rb'
#
# `pod lib lint SQLite.swift.podspec' fails - see
Copy link
Owner

Choose a reason for hiding this comment

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

Hm, I'm getting this:

 -> SQLite.swift (0.9.0)
    - ERROR | xcodebuild: Returned an unsuccessful exit code.
    - ERROR | [iOS] swift: Swift support uses dynamic frameworks and is therefore only supported on iOS > 8.
    - ERROR | xcodebuild:  /Users/stephencelis/Developer/SQLite.swift/SQLite/Core/Blob.swift:25:8: error: no such module 'SQLite3'

[!] SQLite.swift did not pass validation, due to 3 errors.

I can eliminate the middle one by adding this line to the pod spec:

  s.ios.deployment_target = "8.0"

The other two, when running --verbose, are failing on the import SQLite3, assuming because there's no 0.9.0 tag with the SQLite3 directory/sub-pod available?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Are you doing pod lib lint ... perhaps? You need to use pod spec lint ..., per svdo/swift-netutils#4 which leads to CocoaPods/CocoaPods#4607. See comment on line 2. That same error cost me several hours until I found the pre-existing issue :(

I agree that the deployment target is a good idea regardless though. (Though to be honest, I'm not sure it's possible to have Swift on < 8.0 anyway, so I think this comes out in the wash).

# https://github.com/CocoaPods/CocoaPods/issues/4607
#

Pod::Spec.new do |spec|
spec.name = 'SQLite.swift'
spec.summary = 'A type-safe, Swift-language layer over SQLite3.'
Pod::Spec.new do |s|
s.name = "SQLite.swift"
s.version = "0.9.0"
s.summary = "A type-safe, Swift-language layer over SQLite3 for iOS and OS X."

spec.description = <<-DESC
s.description = <<-DESC
SQLite.swift provides compile-time confidence in SQL statement syntax and
intent.
DESC
DESC

apply_shared_config spec, 'SQLite'
s.homepage = "https://github.com/stephencelis/SQLite.swift"
s.license = 'MIT'
s.author = { "Stephen Celis" => "stephen@stephencelis.com" }
s.source = { :git => "https://github.com/stephencelis/SQLite.swift.git", :tag => s.version.to_s }
s.social_media_url = 'https://twitter.com/stephencelis'

s.module_name = 'SQLite'
s.module_map = 'module.modulemap'
s.ios.deployment_target = "8.0"

s.source_files = 'SQLite/**/*'

# make the sqlite3 C library behave like a module
s.libraries = 'sqlite3'
s.xcconfig = { 'SWIFT_INCLUDE_PATHS' => '${PODS_ROOT}/SQLite.swift/SQLite3' }
s.preserve_path = 'SQLite3/*'

spec.exclude_files = 'Source/Cipher/Cipher.swift'
spec.library = 'sqlite3'
end
Loading