Skip to content

Commit

Permalink
Add a script to generate the release zip files
Browse files Browse the repository at this point in the history
* Added Scripts/generate_release_zip.sh
* Added Scripts/Support/License/LICENSE_*.txt for release.
* Added CBL_VERSION_STRING in Xcode project file so that the version string can be set from the generate_release_zip.sh script.
* Adjusted platform output folder name and modified podspec accordingly

#1650
  • Loading branch information
pasin committed Mar 4, 2017
1 parent 2315953 commit 700e48a
Show file tree
Hide file tree
Showing 10 changed files with 209 additions and 22 deletions.
14 changes: 7 additions & 7 deletions CouchbaseLite.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = 'CouchbaseLite'
s.version = '2.0DB2'
s.version = '2.0DB002'
s.license = 'Apache License, Version 2.0'
s.homepage = 'http://mobile.couchbase.com'
s.summary = 'An embedded syncable NoSQL database for iOS, tvOS, and MacOS apps.'
Expand All @@ -11,14 +11,14 @@ Pod::Spec.new do |s|
sh Scripts/prepare_cocoapods.sh "CBL ObjC"
CMD

s.ios.preserve_paths = 'frameworks/CBL ObjC/ios/CouchbaseLite.framework'
s.ios.vendored_frameworks = 'frameworks/CBL ObjC/ios/CouchbaseLite.framework'
s.ios.preserve_paths = 'frameworks/CBL ObjC/iOS/CouchbaseLite.framework'
s.ios.vendored_frameworks = 'frameworks/CBL ObjC/iOS/CouchbaseLite.framework'

s.tvos.preserve_paths = 'frameworks/CBL ObjC/tvos/CouchbaseLite.framework'
s.tvos.vendored_frameworks = 'frameworks/CBL ObjC/tvos/CouchbaseLite.framework'
s.tvos.preserve_paths = 'frameworks/CBL ObjC/tvOS/CouchbaseLite.framework'
s.tvos.vendored_frameworks = 'frameworks/CBL ObjC/tvOS/CouchbaseLite.framework'

s.osx.preserve_paths = 'frameworks/CBL ObjC/macos/CouchbaseLite.framework'
s.osx.vendored_frameworks = 'frameworks/CBL ObjC/macos/CouchbaseLite.framework'
s.osx.preserve_paths = 'frameworks/CBL ObjC/macOS/CouchbaseLite.framework'
s.osx.vendored_frameworks = 'frameworks/CBL ObjC/macOS/CouchbaseLite.framework'

s.ios.deployment_target = '8.0'
s.tvos.deployment_target = '9.0'
Expand Down
14 changes: 7 additions & 7 deletions CouchbaseLiteSwift.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = 'CouchbaseLiteSwift'
s.version = '2.0DB2'
s.version = '2.0DB002'
s.license = 'Apache License, Version 2.0'
s.homepage = 'http://mobile.couchbase.com'
s.summary = 'An embedded syncable NoSQL database for iOS, tvOS, and MacOS apps.'
Expand All @@ -11,14 +11,14 @@ Pod::Spec.new do |s|
sh Scripts/prepare_cocoapods.sh "CBL Swift"
CMD

s.ios.preserve_paths = 'frameworks/CBL Swift/ios/CouchbaseLiteSwift.framework'
s.ios.vendored_frameworks = 'frameworks/CBL Swift/ios/CouchbaseLiteSwift.framework'
s.ios.preserve_paths = 'frameworks/CBL Swift/iOS/CouchbaseLiteSwift.framework'
s.ios.vendored_frameworks = 'frameworks/CBL Swift/iOS/CouchbaseLiteSwift.framework'

s.tvos.preserve_paths = 'frameworks/CBL Swift/tvos/CouchbaseLiteSwift.framework'
s.tvos.vendored_frameworks = 'frameworks/CBL Swift/tvos/CouchbaseLiteSwift.framework'
s.tvos.preserve_paths = 'frameworks/CBL Swift/tvOS/CouchbaseLiteSwift.framework'
s.tvos.vendored_frameworks = 'frameworks/CBL Swift/tvOS/CouchbaseLiteSwift.framework'

s.osx.preserve_paths = 'frameworks/CBL Swift/macos/CouchbaseLiteSwift.framework'
s.osx.vendored_frameworks = 'frameworks/CBL Swift/macos/CouchbaseLiteSwift.framework'
s.osx.preserve_paths = 'frameworks/CBL Swift/macOS/CouchbaseLiteSwift.framework'
s.osx.vendored_frameworks = 'frameworks/CBL Swift/macOS/CouchbaseLiteSwift.framework'

s.ios.deployment_target = '8.0'
s.tvos.deployment_target = '9.0'
Expand Down
2 changes: 1 addition & 1 deletion Objective-C/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>2.0DB2</string>
<string>$(CBL_VERSION_STRING)</string>
<key>CFBundleVersion</key>
<string>$(CURRENT_PROJECT_VERSION)</string>
<key>NSHumanReadableCopyright</key>
Expand Down
17 changes: 17 additions & 0 deletions Scripts/Support/License/LICENSE_community.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
Couchbase, Inc. Community Edition License Agreement

IMPORTANT-READ CAREFULLY: BY CLICKING THE “I ACCEPT” BOX OR INSTALLING, DOWNLOADING OR OTHERWISE USING THIS SOFTWARE AND ANY ASSOCIATED DOCUMENTATION, YOU, ON BEHALF OF YOURSELF OR AS AN AUTHORIZED REPRESENTATIVE ON BEHALF OF AN ENTITY (“LICENSEE”) AGREE TO ALL THE TERMS OF THIS COMMUNITY EDITION LICENSE AGREEMENT (THE “AGREEMENT”) REGARDING YOUR USE OF THE SOFTWARE. YOU REPRESENT AND WARRANT THAT YOU HAVE FULL LEGAL AUTHORITY TO BIND THE LICENSEE TO THIS AGREEMENT. IF YOU DO NOT AGREE WITH ALL OF THESE TERMS, DO NOT SELECT THE “I ACCEPT” BOX AND DO NOT INSTALL, DOWNLOAD OR OTHERWISE USE THE SOFTWARE. THE EFFECTIVE DATE OF THIS AGREEMENT IS THE DATE ON WHICH YOU CLICK “I ACCEPT” OR OTHERWISE INSTALL, DOWNLOAD OR USE THE SOFTWARE.

1. License Grant. Couchbase Inc. hereby grants Licensee, free of charge, the non-exclusive right to use, copy, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to Licensee including the following copyright notice in all copies or substantial portions of the Software:

Couchbase ®
http://www.couchbase.com
Copyright 2011 Couchbase, Inc.

As used in this Agreement, “Software” means the object code version of the applicable elastic data management server software provided by Couchbase, Inc.

2. Restrictions. Licensee will not: (a) reverse engineer, disassemble, or decompile the Software (except to the extent such restrictions are prohibited by law);

3. Support. Couchbase, Inc. will provide Licensee with access to, and use of, the Couchbase, Inc. support forum available at the following URL: http://forums.Couchbase.org. Couchbase, Inc. may, at its discretion, modify, suspend or terminate support at any time.

4. Warranty Disclaimer and Limitation of Liability. THE SOFTWARE IS PROVIDED “AS IS,” WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL COUCHBASE INC. OR THE AUTHORS OR COPYRIGHT HOLDERS IN THE SOFTWARE BE LIABLE FOR ANY CLAIM, DAMAGES (INCLUDING, WITHOUT LIMITATION, DIRECT, INDIRECT OR CONSEQUENTIAL DAMAGES) OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
47 changes: 47 additions & 0 deletions Scripts/Support/License/LICENSE_enterprise.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
COUCHBASE INC. ENTERPRISE LICENSE AGREEMENT - FREE EDITION

IMPORTANT-READ CAREFULLY: BY CLICKING THE "I ACCEPT" BOX OR INSTALLING,
DOWNLOADING OR OTHERWISE USING THIS SOFTWARE AND ANY ASSOCIATED
DOCUMENTATION, YOU, ON BEHALF OF YOURSELF OR AS AN AUTHORIZED
REPRESENTATIVE ON BEHALF OF AN ENTITY ("LICENSEE") AGREE TO ALL THE
TERMS OF THIS ENTERPRISE LICENSE AGREEMENT - FREE EDITION (THE
"AGREEMENT") REGARDING YOUR USE OF THE SOFTWARE. YOU REPRESENT AND
WARRANT THAT YOU HAVE FULL LEGAL AUTHORITY TO BIND THE LICENSEE TO THIS
AGREEMENT. IF YOU DO NOT AGREE WITH ALL OF THESE TERMS, DO NOT SELECT
THE "I ACCEPT" BOX AND DO NOT INSTALL, DOWNLOAD OR OTHERWISE USE THE
SOFTWARE. THE EFFECTIVE DATE OF THIS AGREEMENT IS THE DATE ON WHICH YOU
CLICK "I ACCEPT" OR OTHERWISE INSTALL, DOWNLOAD OR USE THE SOFTWARE.

1. License Grant. Subject to Licensee's compliance with the terms and
conditions of this Agreement, Couchbase Inc. hereby grants to Licensee a
perpetual, non-exclusive, non-transferable, non-sublicensable,
royalty-free, limited license to install and use the Software only for
Licensee's own internal non-production use for the purpose of
evaluation and/or development.

2. Restrictions. Licensee will not reverse engineer, disassemble, or
decompile the Software (except to the extent such restrictions are
prohibited by law).

3. Support. Couchbase Inc. will provide Licensee with: (a) periodic
Software updates to correct known bugs and errors to the extent
Couchbase Inc. incorporates such corrections into the free edition
version of the Software; and (b) access to, and use of, the Couchbase
Inc. support forum available at the following URL:
http://www.couchbase.org/forums/. Couchbase, Inc. may, at its
discretion, modify, suspend or terminate support at any time upon notice
to Licensee.

4. Warranty Disclaimer and Limitation of Liability. THE SOFTWARE IS
PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
COUCHBASE INC. OR THE AUTHORS OR COPYRIGHT HOLDERS IN THE SOFTWARE BE
LIABLE FOR ANY INDIRECT OR CONSEQUENTIAL DAMAGES, WHETHER IN AN
ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE OR FOR AN AMOUNT IN THE AGGREGATE EXCEEDING ONE HUNDRED DOLLARS.

5. General. This Agreement is the entire agreement and is governed by California law.


19 changes: 16 additions & 3 deletions Scripts/build_framework.sh
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ set -e

function usage
{
echo "\nUsage: ${0} -s <Scheme Name: \"CBL ObjC\" or \"CBL Swift\"> -p <Platform Name: iOS, tvOS, or macOS> -o <Output Directory>\n\n"
echo "\nUsage: ${0} -s <Scheme Name: \"CBL ObjC\" or \"CBL Swift\"> -p <Platform Name: iOS, tvOS, or macOS> -o <Output Directory> [-v <Version String>]\n"
}

while [[ $# -gt 1 ]]
Expand All @@ -23,6 +23,10 @@ do
OUTPUT_DIR=${2}
shift
;;
-v)
VERSION=${2}
shift
;;
*)
usage
exit 3
Expand All @@ -46,12 +50,15 @@ PLATFORM_NAME=`echo $PLATFORM_NAME | tr '[:upper:]' '[:lower:]'`
if [ ${PLATFORM_NAME} = "ios" ]
then
SDKS=("iphoneos" "iphonesimulator")
PLATFORM_NAME="iOS"
elif [ ${PLATFORM_NAME} = "tvos" ]
then
SDKS=("appletvos" "appletvsimulator")
PLATFORM_NAME="tvOS"
elif [ ${PLATFORM_NAME} = "macos" ]
then
SDKS=("macosx")
PLATFORM_NAME="macOS"
fi

OUTPUT_BASE_DIR=${OUTPUT_DIR}/${SCHEME}/${PLATFORM_NAME}
Expand All @@ -74,11 +81,17 @@ for SDK in "${SDKS[@]}"
CLEAN_CMD=""
if [[ ${ROUND} == 0 ]]
then
CLEAN_CMD="clean "
CLEAN_CMD="clean"
fi

#Run xcodebuild:
xcodebuild -scheme "${SCHEME}" -configuration Release -sdk ${SDK} OHTER_CFLAGS="-fembed-bitcode" ${CLEAN_CMD}build
BUILD_VERSION=""
if [ ! -z "$VERSION" ]
then
BUILD_VERSION="CBL_VERSION_STRING=${VERSION}"
fi

xcodebuild -scheme "${SCHEME}" -configuration Release -sdk ${SDK} ${BUILD_VERSION} OHTER_CFLAGS="-fembed-bitcode" ${CLEAN_CMD} build

# Get the XCode built framework and dsym file path:
PRODUCTS_DIR=`xcodebuild -scheme "${SCHEME}" -configuration Release -sdk "${SDK}" -showBuildSettings|grep -w BUILT_PRODUCTS_DIR|head -n 1|awk '{ print $3 }'`
Expand Down
106 changes: 106 additions & 0 deletions Scripts/generate_release_zip.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
#!/bin/bash

set -e

function usage
{
echo "\nUsage: ${0} -o <Output Directory> [-v <Version String>]\n"
}

while [[ $# -gt 1 ]]
do
key=${1}
case $key in
-v)
VERSION=${2}
shift
;;
-o)
OUTPUT_DIR=${2}
shift
;;
*)
usage
exit 3
;;
esac
shift
done

if [ -z "$OUTPUT_DIR" ]
then
usage
exit 4
fi

VERSION_SUFFIX=""
if [ ! -z "$VERSION" ]
then
VERSION_SUFFIX="_$VERSION"
fi

BUILD_DIR=$OUTPUT_DIR/build

OUTPUT_OBJC_COMMUNITY_DIR=$OUTPUT_DIR/objc_community
OUTPUT_OBJC_ENTERPRISE_DIR=$OUTPUT_DIR/objc_enterprise
OUTPUT_OBJC_COMMUNITY_ZIP=`pwd`/$OUTPUT_DIR/couchbase-lite-objc_community$VERSION_SUFFIX.zip
OUTPUT_OBJC_ENTERPRISE_ZIP=`pwd`/$OUTPUT_DIR/couchbase-lite-objc_enterprise$VERSION_SUFFIX.zip

OUTPUT_SWIFT_COMMUNITY_DIR=$OUTPUT_DIR/swift_community
OUTPUT_SWIFT_ENTERPRISE_DIR=$OUTPUT_DIR/swift_enterprise
OUTPUT_SWIFT_COMMUNITY_ZIP=`pwd`/$OUTPUT_DIR/couchbase-lite-swift_community$VERSION_SUFFIX.zip
OUTPUT_SWIFT_ENTERPRISE_ZIP=`pwd`/$OUTPUT_DIR/couchbase-lite-swift_enterprise$VERSION_SUFFIX.zip

rm -rf "$OUTPUT_DIR"

sh Scripts/build_framework.sh -s "CBL ObjC" -p iOS -o "$BUILD_DIR" -v "$VERSION"
sh Scripts/build_framework.sh -s "CBL ObjC" -p tvOS -o "$BUILD_DIR" -v "$VERSION"
sh Scripts/build_framework.sh -s "CBL ObjC" -p macOS -o "$BUILD_DIR" -v "$VERSION"

sh Scripts/build_framework.sh -s "CBL Swift" -p iOS -o "$BUILD_DIR" -v "$VERSION"
sh Scripts/build_framework.sh -s "CBL Swift" -p tvOS -o "$BUILD_DIR" -v "$VERSION"
sh Scripts/build_framework.sh -s "CBL Swift" -p macOS -o "$BUILD_DIR" -v "$VERSION"

# Objective-C Community
mkdir -p "$OUTPUT_OBJC_COMMUNITY_DIR"
cp -R "$BUILD_DIR/CBL ObjC"/* "$OUTPUT_OBJC_COMMUNITY_DIR"
cp Scripts/Support/License/LICENSE_community.txt "$OUTPUT_OBJC_COMMUNITY_DIR"/LICENSE.txt
pushd "$OUTPUT_OBJC_COMMUNITY_DIR"
zip -ry "$OUTPUT_OBJC_COMMUNITY_ZIP" *
popd

# Objective-C Enterprise
mkdir -p "$OUTPUT_OBJC_ENTERPRISE_DIR"
cp -R "$BUILD_DIR/CBL ObjC"/* "$OUTPUT_OBJC_ENTERPRISE_DIR"
cp Scripts/Support/License/LICENSE_enterprise.txt "$OUTPUT_OBJC_ENTERPRISE_DIR/LICENSE.txt"
pushd "$OUTPUT_OBJC_ENTERPRISE_DIR"
zip -ry "$OUTPUT_OBJC_ENTERPRISE_ZIP" *
popd

# Swift Community
mkdir -p "$OUTPUT_SWIFT_COMMUNITY_DIR"
cp -R "$BUILD_DIR/CBL Swift"/* "$OUTPUT_SWIFT_COMMUNITY_DIR"
cp Scripts/Support/License/LICENSE_community.txt "$OUTPUT_SWIFT_COMMUNITY_DIR"/LICENSE.txt
pushd "$OUTPUT_SWIFT_COMMUNITY_DIR"
zip -ry "$OUTPUT_SWIFT_COMMUNITY_ZIP" *
popd

# Swift Enterprise
mkdir -p "$OUTPUT_SWIFT_ENTERPRISE_DIR"
cp -R "$BUILD_DIR/CBL Swift"/* "$OUTPUT_SWIFT_ENTERPRISE_DIR"
cp Scripts/Support/License/LICENSE_enterprise.txt "$OUTPUT_SWIFT_ENTERPRISE_DIR/LICENSE.txt"
pushd "$OUTPUT_SWIFT_ENTERPRISE_DIR"
zip -ry "$OUTPUT_SWIFT_ENTERPRISE_ZIP" *
popd

# Generate MD5 file:
pushd "$OUTPUT_DIR"
md5 *.zip > MD5.txt
popd

# Cleanup
rm -rf "$BUILD_DIR"
rm -rf "$OUTPUT_OBJC_COMMUNITY_DIR"
rm -rf "$OUTPUT_OBJC_ENTERPRISE_DIR"
rm -rf "$OUTPUT_SWIFT_COMMUNITY_DIR"
rm -rf "$OUTPUT_SWIFT_ENTERPRISE_DIR"
6 changes: 3 additions & 3 deletions Scripts/prepare_cocoapods.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ fi
echo "Preparing CouchbaseLite framework ..."

rm -rf frameworks
sh Scripts/build_framework.sh -s "$SCHEME" -p ios -o frameworks > ios-build.log
sh Scripts/build_framework.sh -s "$SCHEME" -p tvos -o frameworks > tvos-build.log
sh Scripts/build_framework.sh -s "$SCHEME" -p macos -o frameworks > macos-build.log
sh Scripts/build_framework.sh -s "$SCHEME" -p iOS -o frameworks > ios-build.log
sh Scripts/build_framework.sh -s "$SCHEME" -p tvOS -o frameworks > tvos-build.log
sh Scripts/build_framework.sh -s "$SCHEME" -p macOS -o frameworks > macos-build.log
2 changes: 1 addition & 1 deletion Swift/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>2.0DB2</string>
<string>$(CBL_VERSION_STRING)</string>
<key>CFBundleVersion</key>
<string>$(CURRENT_PROJECT_VERSION)</string>
<key>NSHumanReadableCopyright</key>
Expand Down
4 changes: 4 additions & 0 deletions xcconfigs/Project.xcconfig
Original file line number Diff line number Diff line change
Expand Up @@ -105,3 +105,7 @@ CLANG_ANALYZER_SECURITY_INSECUREAPI_MKSTEMP = YES
CLANG_ANALYZER_SECURITY_INSECUREAPI_RAND = YES
CLANG_ANALYZER_SECURITY_INSECUREAPI_STRCPY = YES
CLANG_ANALYZER_SECURITY_INSECUREAPI_VFORK = YES

// Versioning
CBL_VERSION_STRING = 2.0DB002

0 comments on commit 700e48a

Please sign in to comment.