Skip to content

Commit 0f6b07c

Browse files
committed
Added Couchbase Lite build script and README
1 parent c101969 commit 0f6b07c

3 files changed

Lines changed: 38 additions & 0 deletions

File tree

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,3 +38,5 @@ xcuserdata/*
3838
/sqlite3ext.h
3939
/libsqlcipher.la
4040
/.DS_Store
41+
/build
42+
/CouchbaseLite/SQLCipher/
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
This is a build of [SQLCipher][SQLCIPHER] -- a variant of SQLite with encryption support added -- for use with [Couchbase Lite][CBL]. Binaries are provided for Mac OS and iOS; the latter one is 'fat' so it supports both the simulator and real devices.
2+
3+
To enable database encryption in Couchbase Lite, do the following:
4+
5+
1. Add the appropriate libsqlcipher library from this folder to your Xcode project.
6+
2. In your application target's Build Phases tab, open 'Link Binary With Libraries' and:
7+
1. Remove libsqlite.dylib (if present.)
8+
2. Press the "+" button and add the libsqlcipher library that you added to the project in step 1.
9+
3. Encryption is _not_ automatic. Modify your source code to call `-[CBLManager registerEncryptionKey:forDatabaseNamed:]` before opening or creating any database that should be encrypted. See this method's API documentation in CBLManager.h for more details.
10+
Alternatively, you can use the utility class CBLEncryptionController, which includes the UI support for prompting the user for passwords, and for using Touch ID authentication on compatible devices. You'll find it in the 'Extras' folder of the Couchbase Lite distribution. Just add the .m and .h files to your target.
11+
12+
[SQLCIPHER]: http://sqlcipher.net
13+
[CBL]: https://github.com/couchbase/couchbase-lite-ios

CouchbaseLite/build.sh

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#!/bin/bash
2+
set -e
3+
4+
BUILD=../build
5+
DST=SQLCipher
6+
7+
#rm -rf $BUILD
8+
rm -rf $DST
9+
10+
pushd ..
11+
xcodebuild -sdk macosx10.10
12+
xcodebuild -sdk iphoneos8.1
13+
xcodebuild -sdk iphonesimulator8.1
14+
popd
15+
16+
echo "Copying built libraries to '$DST' ..."
17+
mkdir $DST
18+
cp $BUILD/Release/libsqlcipher.a $DST/libsqlcipher-macos.a
19+
lipo -create $BUILD/Release-iphoneos/libsqlcipher.a $BUILD/Release-iphonesimulator/libsqlcipher.a \
20+
-output $DST/libsqlcipher-ios.a
21+
cp README-CouchbaseLite.md $DST/README.md
22+
23+
echo "Done!"

0 commit comments

Comments
 (0)