|
@@ -45,7 +45,7 @@ command:
|
|
|
clean: clean up/remove all generated files
|
|
|
download-core: downloads core library (binary version)
|
|
|
download-sync: downloads sync library (binary version, core+sync)
|
|
|
- build: builds all iOS and macOS frameworks
|
|
|
+ build: builds all iOS and macOS frameworks
|
|
|
ios-static: builds fat iOS static framework
|
|
|
ios-dynamic: builds iOS dynamic frameworks
|
|
|
ios-swift: builds RealmSwift frameworks for iOS
|
|
@@ -55,6 +55,7 @@ command:
|
|
|
tvos-swift: builds RealmSwift framework for tvOS
|
|
|
osx: builds macOS framework
|
|
|
osx-swift: builds RealmSwift framework for macOS
|
|
|
+ xcframework [plats]: builds xcframeworks for Realm and RealmSwift for given platforms
|
|
|
analyze-osx: analyzes macOS framework
|
|
|
test: tests all iOS and macOS frameworks
|
|
|
test-all: tests all iOS and macOS frameworks in both Debug and Release configurations
|
|
@@ -151,11 +152,7 @@ build_combined() {
|
|
|
destination="iPhone 8"
|
|
|
elif [[ "$os" == "watchos" ]]; then
|
|
|
os_name="$os"
|
|
|
- if (( $(xcode_version_major) >= 10 )); then
|
|
|
- destination="Apple Watch Series 3 - 42mm"
|
|
|
- else
|
|
|
- destination="Apple Watch - 42mm"
|
|
|
- fi
|
|
|
+ destination="Apple Watch Series 3 - 42mm"
|
|
|
elif [[ "$os" == "appletvos" ]]; then
|
|
|
os_name="tvos"
|
|
|
destination="Apple TV"
|
|
@@ -174,58 +171,46 @@ build_combined() {
|
|
|
xc "-scheme '$scheme' -configuration $config -sdk $os"
|
|
|
xc "-scheme '$scheme' -configuration $config -sdk $simulator -destination 'name=$destination' ONLY_ACTIVE_ARCH=NO"
|
|
|
|
|
|
- if (( $(xcode_version_major) < 11 )); then
|
|
|
- # Combine .swiftmodule
|
|
|
- if [ -d $simulator_path/Modules/$module_name.swiftmodule ]; then
|
|
|
- cp $simulator_path/Modules/$module_name.swiftmodule/* $os_path/Modules/$module_name.swiftmodule/
|
|
|
- fi
|
|
|
+ # Combine .swiftmodule
|
|
|
+ if [ -d $simulator_path/Modules/$module_name.swiftmodule ]; then
|
|
|
+ cp $simulator_path/Modules/$module_name.swiftmodule/* $os_path/Modules/$module_name.swiftmodule/
|
|
|
+ fi
|
|
|
|
|
|
- # Xcode 10.2 merges the generated headers together with ifdef guards for
|
|
|
- # each of the target platforms. This doesn't handle merging
|
|
|
- # device/simulator builds, so we need to take care of that ourselves.
|
|
|
- # Currently all platforms have identical headers, so we just pick one and
|
|
|
- # use that rather than merging, but this may change in the future.
|
|
|
- if [ -f $os_path/Headers/$module_name-Swift.h ]; then
|
|
|
- unique_headers=$(find $build_intermediates_path -name $module_name-Swift.h -exec shasum {} \; | cut -d' ' -f 1 | uniq | grep -c '^')
|
|
|
- if [ $unique_headers != "1" ]; then
|
|
|
- echo "Platform-specific Swift generated headers are not identical. Merging them is required and is not yet implemented."
|
|
|
- exit 1
|
|
|
- fi
|
|
|
- find $build_intermediates_path -name $module_name-Swift.h -exec cp {} $os_path/Headers \; -quit
|
|
|
- fi
|
|
|
+ # Xcode 10.2 merges the generated headers together with ifdef guards for
|
|
|
+ # each of the target platforms. This doesn't handle merging
|
|
|
+ # device/simulator builds, so we need to take care of that ourselves.
|
|
|
+ # Currently all platforms have identical headers, so we just pick one and
|
|
|
+ # use that rather than merging, but this may change in the future.
|
|
|
+ if [ -f $os_path/Headers/$module_name-Swift.h ]; then
|
|
|
+ unique_headers=$(find $build_intermediates_path -name $module_name-Swift.h -exec shasum {} \; | cut -d' ' -f 1 | uniq | grep -c '^')
|
|
|
+ if [ $unique_headers != "1" ]; then
|
|
|
+ echo "Platform-specific Swift generated headers are not identical. Merging them is required and is not yet implemented."
|
|
|
+ exit 1
|
|
|
+ fi
|
|
|
+ find $build_intermediates_path -name $module_name-Swift.h -exec cp {} $os_path/Headers \; -quit
|
|
|
+ fi
|
|
|
|
|
|
- # Copy *.bcsymbolmap to .framework for submitting app with bitcode
|
|
|
- copy_bcsymbolmap "$build_products_path/$config-$os$scope_suffix" "$os_path"
|
|
|
+ # Copy *.bcsymbolmap to .framework for submitting app with bitcode
|
|
|
+ copy_bcsymbolmap "$build_products_path/$config-$os$scope_suffix" "$os_path"
|
|
|
|
|
|
- # Retrieve build products
|
|
|
- clean_retrieve $os_path $out_path $product_name
|
|
|
+ # Retrieve build products
|
|
|
+ clean_retrieve $os_path $out_path $product_name
|
|
|
|
|
|
- # Combine ar archives
|
|
|
- LIPO_OUTPUT="$out_path/$product_name/$module_name"
|
|
|
- xcrun lipo -create "$simulator_path/$binary_path" "$os_path/$binary_path" -output "$LIPO_OUTPUT"
|
|
|
+ # Combine ar archives
|
|
|
+ LIPO_OUTPUT="$out_path/$product_name/$module_name"
|
|
|
+ xcrun lipo -create "$simulator_path/$binary_path" "$os_path/$binary_path" -output "$LIPO_OUTPUT"
|
|
|
|
|
|
- # Verify that the combined library has bitcode and we didn't accidentally
|
|
|
- # remove it somewhere along the line
|
|
|
- if [[ "$destination" != "" && "$config" == "Release" ]]; then
|
|
|
- sh build.sh binary-has-bitcode "$LIPO_OUTPUT"
|
|
|
- fi
|
|
|
- else
|
|
|
- rm -rf "$out_path/$module_name.xcframework"
|
|
|
- xcodebuild -create-xcframework \
|
|
|
- -framework $simulator_path \
|
|
|
- -framework $os_path \
|
|
|
- -output "$out_path/$module_name.xcframework"
|
|
|
+ # Verify that the combined library has bitcode and we didn't accidentally
|
|
|
+ # remove it somewhere along the line
|
|
|
+ if [[ "$destination" != "" && "$config" == "Release" ]]; then
|
|
|
+ sh build.sh binary-has-bitcode "$LIPO_OUTPUT"
|
|
|
fi
|
|
|
}
|
|
|
|
|
|
copy_realm_framework() {
|
|
|
local platform="$1"
|
|
|
- local extension="xcframework"
|
|
|
- if (( $(xcode_version_major) < 11 )); then
|
|
|
- extension="framework"
|
|
|
- fi
|
|
|
- rm -rf build/$platform/swift-$REALM_XCODE_VERSION/Realm.$extension
|
|
|
- cp -R build/$platform/Realm.$extension build/$platform/swift-$REALM_XCODE_VERSION
|
|
|
+ rm -rf build/$platform/swift-$REALM_XCODE_VERSION/Realm.framework
|
|
|
+ cp -R build/$platform/Realm.framework build/$platform/swift-$REALM_XCODE_VERSION
|
|
|
}
|
|
|
|
|
|
clean_retrieve() {
|
|
@@ -246,6 +231,10 @@ test_ios_static() {
|
|
|
xc "-scheme 'Realm iOS static' -configuration $CONFIGURATION -sdk iphonesimulator -destination '$destination' test"
|
|
|
}
|
|
|
|
|
|
+plist_get() {
|
|
|
+ /usr/libexec/PlistBuddy -c "Print :$2" $1 2> /dev/null
|
|
|
+}
|
|
|
+
|
|
|
######################################
|
|
|
# Device Test Helper
|
|
|
######################################
|
|
@@ -400,18 +389,13 @@ download_sync() {
|
|
|
COMMAND="$1"
|
|
|
|
|
|
# Use Debug config if command ends with -debug, otherwise default to Release
|
|
|
-# Set IS_RUNNING_PACKAGING when running packaging steps to avoid running iOS static tests with Xcode 8.3.3
|
|
|
case "$COMMAND" in
|
|
|
*-debug)
|
|
|
COMMAND="${COMMAND%-debug}"
|
|
|
CONFIGURATION="Debug"
|
|
|
;;
|
|
|
- package-*)
|
|
|
- IS_RUNNING_PACKAGING=1
|
|
|
- ;;
|
|
|
esac
|
|
|
export CONFIGURATION=${CONFIGURATION:-Release}
|
|
|
-export IS_RUNNING_PACKAGING=${IS_RUNNING_PACKAGING:-0}
|
|
|
|
|
|
# Pre-choose Xcode and Swift versions for those operations that do not set them
|
|
|
REALM_XCODE_VERSION=${xcode_version:-$REALM_XCODE_VERSION}
|
|
@@ -519,17 +503,6 @@ case "$COMMAND" in
|
|
|
sh build.sh tvos-swift
|
|
|
sh build.sh osx
|
|
|
sh build.sh osx-swift
|
|
|
-
|
|
|
- if (( $(xcode_version_major) >= 11 )); then
|
|
|
- rm -rf "build/*.xcframework"
|
|
|
- find build/DerivedData -name 'Realm.framework' \
|
|
|
- | grep -v '\-static' \
|
|
|
- | sed 's/.*/-framework &/' \
|
|
|
- | xargs xcodebuild -create-xcframework -output build/Realm.xcframework
|
|
|
- find build/DerivedData -name 'RealmSwift.framework' \
|
|
|
- | sed 's/.*/-framework &/' \
|
|
|
- | xargs xcodebuild -create-xcframework -output build/RealmSwift.xcframework
|
|
|
- fi
|
|
|
exit 0
|
|
|
;;
|
|
|
|
|
@@ -590,6 +563,176 @@ case "$COMMAND" in
|
|
|
exit 0
|
|
|
;;
|
|
|
|
|
|
+ "catalyst")
|
|
|
+ if (( $(xcode_version_major) < 11 )); then
|
|
|
+ echo 'Building for Catalyst requires Xcode 11'
|
|
|
+ exit 1
|
|
|
+ fi
|
|
|
+
|
|
|
+ xc "-scheme Realm -configuration $CONFIGURATION REALM_CATALYST_FLAGS='-target x86_64-apple-ios13.0-macabi' REALM_PLATFORM_SUFFIX='maccatalyst'"
|
|
|
+ clean_retrieve "build/DerivedData/Realm/Build/Products/$CONFIGURATION/Realm.framework" "build/catalyst" "Realm.framework"
|
|
|
+ ;;
|
|
|
+
|
|
|
+ "catalyst-swift")
|
|
|
+ if (( $(xcode_version_major) < 11 )); then
|
|
|
+ echo 'Building for Catalyst requires Xcode 11'
|
|
|
+ exit 1
|
|
|
+ fi
|
|
|
+
|
|
|
+ sh build.sh catalyst
|
|
|
+ # FIXME: change this to just "-destination variant='Mac Catalyst'" once the CI machines are running 10.15
|
|
|
+ xc "-scheme 'RealmSwift' -configuration $CONFIGURATION build \
|
|
|
+ REALM_CATALYST_FLAGS='-target x86_64-apple-ios13.0-macabi' \
|
|
|
+ REALM_PLATFORM_SUFFIX='maccatalyst' \
|
|
|
+ SWIFT_DEPLOYMENT_TARGET='13.0-macabi' \
|
|
|
+ SWIFT_PLATFORM_TARGET_PREFIX='ios'"
|
|
|
+ destination="build/catalyst/swift-$REALM_XCODE_VERSION"
|
|
|
+ clean_retrieve "build/DerivedData/Realm/Build/Products/$CONFIGURATION/RealmSwift.framework" "$destination" "RealmSwift.framework"
|
|
|
+ rm -rf "$destination/Realm.framework"
|
|
|
+ cp -R build/catalyst/Realm.framework "$destination"
|
|
|
+ ;;
|
|
|
+
|
|
|
+ "xcframework")
|
|
|
+ if (( $(xcode_version_major) < 11 )); then
|
|
|
+ echo 'Building a xcframework requires Xcode 11'
|
|
|
+ exit 1
|
|
|
+ fi
|
|
|
+
|
|
|
+ export REALM_EXTRA_BUILD_ARGUMENTS="$REALM_EXTRA_BUILD_ARGUMENTS BUILD_LIBRARY_FOR_DISTRIBUTION=YES REALM_OBJC_MACH_O_TYPE=staticlib"
|
|
|
+
|
|
|
+ # Build all of the requested frameworks
|
|
|
+ shift
|
|
|
+ PLATFORMS="${*:-osx ios watchos tvos catalyst}"
|
|
|
+ for platform in $PLATFORMS; do
|
|
|
+ sh build.sh $platform-swift
|
|
|
+ done
|
|
|
+
|
|
|
+ # Assemble them into xcframeworks
|
|
|
+ rm -rf build/*.xcframework
|
|
|
+ find build/DerivedData/Realm/Build/Products -name 'Realm.framework' \
|
|
|
+ | grep -v '\-static' \
|
|
|
+ | sed 's/.*/-framework &/' \
|
|
|
+ | xargs xcodebuild -create-xcframework -output build/Realm.xcframework
|
|
|
+ find build/DerivedData/Realm/Build/Products -name 'RealmSwift.framework' \
|
|
|
+ | sed 's/.*/-framework &/' \
|
|
|
+ | xargs xcodebuild -create-xcframework -output build/RealmSwift.xcframework
|
|
|
+
|
|
|
+ # strip-frameworks.sh isn't needed with xcframeworks since we don't
|
|
|
+ # lipo together device/simulator libs
|
|
|
+ find build/Realm.xcframework -name 'strip-frameworks.sh' -delete
|
|
|
+ find build/RealmSwift.xcframework -name 'strip-frameworks.sh' -delete
|
|
|
+
|
|
|
+ # swiftinterface files currently have incorrect name resolution which
|
|
|
+ # results in the RealmSwift.Realm class name clashing with the Realm
|
|
|
+ # module name. Work around this by renaming the Realm module to
|
|
|
+ # RealmObjc. This is safe to do with a pre-built library because the
|
|
|
+ # module name is unrelated to what symbols are exported by an obj-c
|
|
|
+ # library, and we're statically linking the obj-c library into the
|
|
|
+ # swift library so it doesn't need to be loaded at runtime.
|
|
|
+ cd build
|
|
|
+ cp -R Realm.xcframework RealmObjc.xcframework
|
|
|
+ find RealmObjc.xcframework -name 'Realm.framework' \
|
|
|
+ -execdir mv {} RealmObjc.framework \; || true 2> /dev/null
|
|
|
+ find RealmObjc.xcframework -name '*.h' \
|
|
|
+ -exec sed -i '' 's/Realm\//RealmObjc\//' {} \;
|
|
|
+ find RealmObjc.xcframework -name 'module.modulemap' \
|
|
|
+ -exec sed -i '' 's/module Realm/module RealmObjc/' {} \;
|
|
|
+ sed -i '' 's/Realm.framework/RealmObjc.framework/' RealmObjc.xcframework/Info.plist
|
|
|
+
|
|
|
+ find RealmSwift.xcframework -name '*.swiftinterface' \
|
|
|
+ -exec sed -i '' 's/import Realm/import RealmObjc/' {} \;
|
|
|
+ find RealmSwift.xcframework -name '*.swiftinterface' \
|
|
|
+ -exec sed -i '' 's/Realm.RLM/RealmObjc.RLM/g' {} \;
|
|
|
+
|
|
|
+ # Realm is statically linked into RealmSwift so we no longer actually
|
|
|
+ # need the obj-c static library, and just need the framework shell.
|
|
|
+ # Remove everything but placeholder.o so that there's still a library
|
|
|
+ # to link against that just doesn't define any symbols.
|
|
|
+ find RealmObjc.xcframework -name 'Realm' | while read file; do
|
|
|
+ (
|
|
|
+ cd $(dirname $file)
|
|
|
+ if readlink Realm > /dev/null; then
|
|
|
+ ln -sf Versions/Current/RealmObjc Realm
|
|
|
+ elif lipo -info Realm | grep -q 'Non-fat'; then
|
|
|
+ ar -t Realm | grep -v placeholder | tr '\n' '\0' | xargs -0 ar -d Realm >/dev/null 2>&1
|
|
|
+ ranlib Realm >/dev/null 2>&1
|
|
|
+ else
|
|
|
+ for arch in $(lipo -info Realm | cut -f3 -d':'); do
|
|
|
+ lipo Realm -thin $arch -output tmp.a
|
|
|
+ ar -t tmp.a | grep -v placeholder | tr '\n' '\0' | xargs -0 ar -d tmp.a >/dev/null 2>&1
|
|
|
+ ranlib tmp.a >/dev/null 2>&1
|
|
|
+ lipo Realm -replace $arch tmp.a -output Realm
|
|
|
+ rm tmp.a
|
|
|
+ done
|
|
|
+ fi
|
|
|
+ mv Realm RealmObjc
|
|
|
+ )
|
|
|
+ done
|
|
|
+
|
|
|
+ # We built Realm.framework as a static framework so that we could link
|
|
|
+ # it into RealmSwift.framework and not have to deal with the runtime
|
|
|
+ # implications of renaming the shared library, but we want the end
|
|
|
+ # result to be that Realm.xcframework is a dynamic framework. Our build
|
|
|
+ # system isn't really set up to build both static and dynamic versions
|
|
|
+ # of it, so instead just turn each of the static libraries in
|
|
|
+ # Realm.xcframework into a shared library.
|
|
|
+ cd Realm.xcframework
|
|
|
+ i=0
|
|
|
+ while plist_get Info.plist "AvailableLibraries:$i" > /dev/null; do
|
|
|
+ arch_dir_name="$(plist_get Info.plist "AvailableLibraries:$i:LibraryIdentifier")"
|
|
|
+ platform="$(plist_get Info.plist "AvailableLibraries:$i:SupportedPlatform")"
|
|
|
+ variant="$(plist_get Info.plist "AvailableLibraries:$i:SupportedPlatformVariant" 2> /dev/null || echo 'os')"
|
|
|
+ deployment_target_name="$platform"
|
|
|
+ install_name='@rpath/Realm.framework/Realm'
|
|
|
+ bitcode_flag='-fembed-bitcode'
|
|
|
+ if [ "$variant" = 'simulator' ]; then
|
|
|
+ bitcode_flag=''
|
|
|
+ fi
|
|
|
+ case "$platform" in
|
|
|
+ "macos") sdk='macosx'; install_name='@rpath/Realm.framework/Versions/A/Realm'; bitcode_flag='';;
|
|
|
+ "ios") sdk="iphone$variant"; deployment_target_name='iphoneos';;
|
|
|
+ "watchos") sdk="watch$variant";;
|
|
|
+ "tvos") sdk="appletv$variant";;
|
|
|
+ esac
|
|
|
+ deployment_target=$(grep -i "$deployment_target_name.*_DEPLOYMENT_TARGET" ../../Configuration/Base.xcconfig \
|
|
|
+ | sed 's/.*= \(.*\);/\1/')
|
|
|
+ architectures=""
|
|
|
+ j=0
|
|
|
+ while plist_get Info.plist "AvailableLibraries:$i:SupportedArchitectures:$j" > /dev/null; do
|
|
|
+ architectures="${architectures} -arch $(plist_get Info.plist "AvailableLibraries:$i:SupportedArchitectures:$j")"
|
|
|
+ j=$(($j + 1))
|
|
|
+ done
|
|
|
+
|
|
|
+ (
|
|
|
+ cd $arch_dir_name/Realm.framework
|
|
|
+ realm_lib=$(readlink Realm || echo 'Realm')
|
|
|
+ # feature_token.cpp.o depends on PKey, which isn't actually
|
|
|
+ # present in the macOS build of the sync library. This normally
|
|
|
+ # works fine because we never reference any symbols from
|
|
|
+ # feature_token.cpp.o so it doesn't get pulled in at all, but
|
|
|
+ # -all_load makes every object file in the input get linked
|
|
|
+ # into the shared library.
|
|
|
+ ar -d $realm_lib feature_token.cpp.o 2> /dev/null || true
|
|
|
+ clang++ -shared $architectures \
|
|
|
+ -target ${platform}${deployment_target} \
|
|
|
+ -isysroot $(xcrun --sdk ${sdk} --show-sdk-path) \
|
|
|
+ -install_name "$install_name" \
|
|
|
+ -compatibility_version 1 -current_version 1 \
|
|
|
+ -fapplication-extension \
|
|
|
+ $bitcode_flag \
|
|
|
+ -Wl,-all_load \
|
|
|
+ -Wl,-unexported_symbol,'__Z*' \
|
|
|
+ -o realm.dylib \
|
|
|
+ Realm -lz
|
|
|
+ mv realm.dylib $realm_lib
|
|
|
+ )
|
|
|
+
|
|
|
+ i=$(($i + 1))
|
|
|
+ done
|
|
|
+
|
|
|
+ exit 0
|
|
|
+ ;;
|
|
|
+
|
|
|
######################################
|
|
|
# Analysis
|
|
|
######################################
|
|
@@ -833,8 +976,12 @@ case "$COMMAND" in
|
|
|
|
|
|
"verify-tvos")
|
|
|
sh build.sh test-tvos
|
|
|
- sh build.sh test-tvos-swift
|
|
|
sh build.sh examples-tvos
|
|
|
+ exit 0
|
|
|
+ ;;
|
|
|
+
|
|
|
+ "verify-tvos-swift")
|
|
|
+ sh build.sh test-tvos-swift
|
|
|
sh build.sh examples-tvos-swift
|
|
|
exit 0
|
|
|
;;
|
|
@@ -850,9 +997,7 @@ case "$COMMAND" in
|
|
|
;;
|
|
|
|
|
|
"verify-swiftpm")
|
|
|
- if (( $(xcode_version_major) >= 10 )); then
|
|
|
- sh build.sh test-swiftpm
|
|
|
- fi
|
|
|
+ sh build.sh test-swiftpm
|
|
|
exit 0
|
|
|
;;
|
|
|
|
|
@@ -948,8 +1093,7 @@ case "$COMMAND" in
|
|
|
# Versioning
|
|
|
######################################
|
|
|
"get-version")
|
|
|
- version_file="Realm/Realm-Info.plist"
|
|
|
- echo "$(PlistBuddy -c "Print :CFBundleShortVersionString" "$version_file")"
|
|
|
+ echo "$(plist_get 'Realm/Realm-Info.plist' 'CFBundleShortVersionString')"
|
|
|
exit 0
|
|
|
;;
|
|
|
|
|
@@ -1150,12 +1294,11 @@ EOM
|
|
|
zip --symlinks -r realm-examples.zip examples -x "examples/installation/*"
|
|
|
;;
|
|
|
|
|
|
- "package-test-examples")
|
|
|
+ "package-test-examples-objc")
|
|
|
if ! VERSION=$(echo realm-objc-*.zip | egrep -o '\d*\.\d*\.\d*-[a-z]*(\.\d*)?'); then
|
|
|
VERSION=$(echo realm-objc-*.zip | egrep -o '\d*\.\d*\.\d*')
|
|
|
fi
|
|
|
OBJC="realm-objc-${VERSION}"
|
|
|
- SWIFT="realm-swift-${VERSION}"
|
|
|
unzip ${OBJC}.zip
|
|
|
|
|
|
cp $0 ${OBJC}
|
|
@@ -1166,7 +1309,13 @@ EOM
|
|
|
sh build.sh examples-osx
|
|
|
cd ..
|
|
|
rm -rf ${OBJC}
|
|
|
+ ;;
|
|
|
|
|
|
+ "package-test-examples-swift")
|
|
|
+ if ! VERSION=$(echo realm-swift-*.zip | egrep -o '\d*\.\d*\.\d*-[a-z]*(\.\d*)?'); then
|
|
|
+ VERSION=$(echo realm-swift-*.zip | egrep -o '\d*\.\d*\.\d*')
|
|
|
+ fi
|
|
|
+ SWIFT="realm-swift-${VERSION}"
|
|
|
unzip ${SWIFT}.zip
|
|
|
|
|
|
cp $0 ${SWIFT}
|
|
@@ -1186,79 +1335,21 @@ EOM
|
|
|
zip --symlinks -r realm-framework-ios-static.zip Realm.framework
|
|
|
;;
|
|
|
|
|
|
- "package-ios")
|
|
|
- sh build.sh prelaunch-simulator
|
|
|
- sh build.sh ios-dynamic
|
|
|
- cd build/ios
|
|
|
- zip --symlinks -r realm-framework-ios.zip Realm.framework
|
|
|
- ;;
|
|
|
-
|
|
|
- "package-osx")
|
|
|
- sh build.sh osx
|
|
|
-
|
|
|
- cd build/DerivedData/Realm/Build/Products/Release
|
|
|
- zip --symlinks -r realm-framework-osx.zip Realm.framework
|
|
|
- ;;
|
|
|
-
|
|
|
- "package-watchos")
|
|
|
- sh build.sh prelaunch-simulator
|
|
|
- sh build.sh watchos
|
|
|
-
|
|
|
- # If we're building the obj-c library with an Xcode version older than
|
|
|
- # 10, we need to also build the arm64_32 slice with Xcode 10 and lipo
|
|
|
- # it in
|
|
|
- if (( $(xcode_version_major) < 10 )); then
|
|
|
- (
|
|
|
- REALM_XCODE_VERSION=10.0
|
|
|
- REALM_SWIFT_VERSION=
|
|
|
- set_xcode_and_swift_versions
|
|
|
- sh build.sh prelaunch-simulator
|
|
|
- xc "-scheme Realm -configuration $CONFIGURATION -sdk watchos ARCHS='arm64_32'"
|
|
|
- cp build/DerivedData/Realm/Build/Products/Release-watchos/Realm.framework/*.bcsymbolmap build/watchos/Realm.framework
|
|
|
- xcrun lipo \
|
|
|
- -create build/watchos/Realm.framework/Realm build/DerivedData/Realm/Build/Products/Release-watchos/Realm.framework/Realm \
|
|
|
- -output build/watchos-tmp
|
|
|
- mv build/watchos-tmp build/watchos/Realm.framework/Realm
|
|
|
- )
|
|
|
- fi
|
|
|
-
|
|
|
- cd build/watchos
|
|
|
- zip --symlinks -r realm-framework-watchos.zip Realm.framework
|
|
|
- ;;
|
|
|
-
|
|
|
- "package-tvos")
|
|
|
- sh build.sh prelaunch-simulator
|
|
|
- sh build.sh tvos
|
|
|
+ "package")
|
|
|
+ PLATFORM="$2"
|
|
|
+ REALM_SWIFT_VERSION=
|
|
|
|
|
|
- cd build/tvos
|
|
|
- zip --symlinks -r realm-framework-tvos.zip Realm.framework
|
|
|
- ;;
|
|
|
+ set_xcode_and_swift_versions
|
|
|
|
|
|
- package-*-swift)
|
|
|
- PLATFORM=$(echo $COMMAND | cut -d - -f 2)
|
|
|
- for version in 9.2 9.3 9.4 10.0 10.1 10.2.1; do
|
|
|
- REALM_XCODE_VERSION=$version
|
|
|
- REALM_SWIFT_VERSION=
|
|
|
- set_xcode_and_swift_versions
|
|
|
+ if [[ "$PLATFORM" = "catalyst" ]] && (( $(xcode_version_major) < 11 )); then
|
|
|
+ mkdir -p build/catalyst/swift-$REALM_XCODE_VERSION
|
|
|
+ else
|
|
|
sh build.sh prelaunch-simulator
|
|
|
sh build.sh $PLATFORM-swift
|
|
|
- done
|
|
|
-
|
|
|
- cd build/$PLATFORM
|
|
|
- zip --symlinks -r realm-swift-framework-$PLATFORM.zip swift-9.2 swift-9.2 swift-9.4 swift-10.0 swift-10.1 swift-10.2.1
|
|
|
- ;;
|
|
|
-
|
|
|
- package-*-swift-*)
|
|
|
- PLATFORM=$(echo $COMMAND | cut -d - -f 2)
|
|
|
- REALM_XCODE_VERSION=$(echo $COMMAND | cut -d - -f 4)
|
|
|
- REALM_SWIFT_VERSION=
|
|
|
-
|
|
|
- set_xcode_and_swift_versions
|
|
|
- sh build.sh prelaunch-simulator
|
|
|
- sh build.sh $PLATFORM-swift
|
|
|
+ fi
|
|
|
|
|
|
cd build/$PLATFORM
|
|
|
- zip --symlinks -r realm-swift-framework-$PLATFORM-swift-$REALM_XCODE_VERSION.zip swift-$REALM_XCODE_VERSION
|
|
|
+ zip --symlinks -r realm-framework-$PLATFORM-$REALM_XCODE_VERSION.zip swift-$REALM_XCODE_VERSION
|
|
|
;;
|
|
|
|
|
|
"package-release")
|
|
@@ -1276,58 +1367,20 @@ EOM
|
|
|
mkdir -p ${FOLDER}/ios/dynamic
|
|
|
mkdir -p ${FOLDER}/Swift
|
|
|
|
|
|
- (
|
|
|
- cd ${FOLDER}/osx
|
|
|
- unzip ${WORKSPACE}/realm-framework-osx.zip
|
|
|
- )
|
|
|
-
|
|
|
- (
|
|
|
- cd ${FOLDER}/ios/static
|
|
|
- unzip ${WORKSPACE}/realm-framework-ios-static.zip
|
|
|
- )
|
|
|
-
|
|
|
- (
|
|
|
- cd ${FOLDER}/ios/dynamic
|
|
|
- unzip ${WORKSPACE}/realm-framework-ios.zip
|
|
|
- )
|
|
|
-
|
|
|
- (
|
|
|
- cd ${FOLDER}/watchos
|
|
|
- unzip ${WORKSPACE}/realm-framework-watchos.zip
|
|
|
- )
|
|
|
+ unzip ${WORKSPACE}/realm-framework-ios-static.zip -d ${FOLDER}/ios/static
|
|
|
+ for platform in osx ios watchos tvos catalyst; do
|
|
|
+ unzip ${WORKSPACE}/realm-framework-${platform}-${REALM_XCODE_VERSION}.zip -d ${FOLDER}/${platform}
|
|
|
+ mv ${FOLDER}/${platform}/swift-*/Realm.framework ${FOLDER}/${platform}
|
|
|
+ rm -r ${FOLDER}/${platform}/swift-*
|
|
|
+ done
|
|
|
|
|
|
- (
|
|
|
- cd ${FOLDER}/tvos
|
|
|
- unzip ${WORKSPACE}/realm-framework-tvos.zip
|
|
|
- )
|
|
|
+ mv ${FOLDER}/ios/Realm.framework ${FOLDER}/ios/dynamic
|
|
|
else
|
|
|
- (
|
|
|
- cd ${FOLDER}/osx
|
|
|
- for f in ${WORKSPACE}/realm-swift-framework-osx-swift-*.zip; do
|
|
|
- unzip "$f"
|
|
|
- done
|
|
|
- )
|
|
|
-
|
|
|
- (
|
|
|
- cd ${FOLDER}/ios
|
|
|
- for f in ${WORKSPACE}/realm-swift-framework-ios-swift-*.zip; do
|
|
|
- unzip "$f"
|
|
|
- done
|
|
|
- )
|
|
|
-
|
|
|
- (
|
|
|
- cd ${FOLDER}/watchos
|
|
|
- for f in ${WORKSPACE}/realm-swift-framework-watchos-swift-*.zip; do
|
|
|
- unzip "$f"
|
|
|
- done
|
|
|
- )
|
|
|
-
|
|
|
- (
|
|
|
- cd ${FOLDER}/tvos
|
|
|
- for f in ${WORKSPACE}/realm-swift-framework-tvos-swift-*.zip; do
|
|
|
- unzip "$f"
|
|
|
- done
|
|
|
- )
|
|
|
+ for platform in osx ios watchos tvos catalyst; do
|
|
|
+ find ${WORKSPACE} -name "realm-framework-$platform-*.zip" \
|
|
|
+ -maxdepth 1 \
|
|
|
+ -exec unzip {} -d ${FOLDER}/${platform} \;
|
|
|
+ done
|
|
|
fi
|
|
|
|
|
|
(
|
|
@@ -1390,40 +1443,37 @@ EOF
|
|
|
|
|
|
echo 'Packaging iOS'
|
|
|
sh build.sh package-ios-static
|
|
|
- cp build/ios-static/realm-framework-ios-static.zip ..
|
|
|
- sh build.sh package-ios
|
|
|
- cp build/ios/realm-framework-ios.zip ..
|
|
|
- sh build.sh package-ios-swift
|
|
|
- cp build/ios/realm-swift-framework-ios.zip ..
|
|
|
+ cp build/ios-static/realm-framework-ios-static.zip .
|
|
|
+ sh build.sh package ios
|
|
|
+ cp build/ios/realm-framework-ios-$REALM_XCODE_VERSION.zip .
|
|
|
|
|
|
echo 'Packaging macOS'
|
|
|
- sh build.sh package-osx
|
|
|
- cp build/DerivedData/Realm/Build/Products/Release/realm-framework-osx.zip ..
|
|
|
- sh build.sh package-osx-swift
|
|
|
- cp build/osx/realm-swift-framework-osx.zip ..
|
|
|
+ sh build.sh package osx
|
|
|
+ cp build/osx/realm-framework-osx-$REALM_XCODE_VERSION.zip .
|
|
|
|
|
|
echo 'Packaging watchOS'
|
|
|
- sh build.sh package-watchos
|
|
|
- cp build/watchos/realm-framework-watchos.zip ..
|
|
|
- sh build.sh package-watchos-swift
|
|
|
- cp build/watchos/realm-swift-framework-watchos.zip ..
|
|
|
+ sh build.sh package watchos
|
|
|
+ cp build/watchos/realm-framework-watchos-$REALM_XCODE_VERSION.zip .
|
|
|
|
|
|
echo 'Packaging tvOS'
|
|
|
- sh build.sh package-tvos
|
|
|
- cp build/tvos/realm-framework-tvos.zip ..
|
|
|
- sh build.sh package-tvos-swift
|
|
|
- cp build/tvos/realm-swift-framework-tvos.zip ..
|
|
|
+ sh build.sh package tvos
|
|
|
+ cp build/tvos/realm-framework-tvos-$REALM_XCODE_VERSION.zip .
|
|
|
+
|
|
|
+ echo 'Packaging Catalyst'
|
|
|
+ sh build.sh package catalyst
|
|
|
+ cp build/catalyst/realm-framework-catalyst-$REALM_XCODE_VERSION.zip .
|
|
|
|
|
|
echo 'Packaging examples'
|
|
|
sh build.sh package-examples
|
|
|
- cp realm-examples.zip ..
|
|
|
|
|
|
echo 'Building final release packages'
|
|
|
+ export WORKSPACE="${WORKSPACE}/realm-cocoa"
|
|
|
sh build.sh package-release objc
|
|
|
sh build.sh package-release swift
|
|
|
|
|
|
echo 'Testing packaged examples'
|
|
|
- sh build.sh package-test-examples
|
|
|
+ sh build.sh package-test-examples-objc
|
|
|
+ sh build.sh package-test-examples-swift
|
|
|
;;
|
|
|
|
|
|
"github-release")
|
|
@@ -1451,7 +1501,7 @@ x.y.z Release notes (yyyy-MM-dd)
|
|
|
* File format: Generates Realms with format v9 (Reads and upgrades all previous formats)
|
|
|
* Realm Object Server: 3.21.0 or later.
|
|
|
* APIs are backwards compatible with all previous releases in the 3.x.y series.
|
|
|
-* Carthage release for Swift is built with Xcode 10.2.1.
|
|
|
+* Carthage release for Swift is built with Xcode 11.0.
|
|
|
EOS)
|
|
|
changelog=$(cat CHANGELOG.md)
|
|
|
echo "$empty_section" > CHANGELOG.md
|