Skip to content

Commit

Permalink
Merge pull request #6964 from realm/tg/xcframework-release-package
Browse files Browse the repository at this point in the history
Switch to packaging releases as XCFrameworks
  • Loading branch information
tgoyne committed Dec 2, 2020
2 parents 389df56 + dff2b58 commit 32b2060
Show file tree
Hide file tree
Showing 30 changed files with 157 additions and 715 deletions.
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
x.y.z Release notes (yyyy-MM-dd)
=============================================================
### Enhancements
* None.
* The prebuilt binaries are now packaged as XCFrameworks. This adds support for
Catalyst and arm64 simulators when using them to install Realm, removes the
need for the strip-frameworks build step, and should simplify installation.

### Fixed
* The user identifier was added to the file path for synchronized Realms twice
Expand Down
4 changes: 2 additions & 2 deletions Jenkinsfile.releasability
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ def installationTest(platform, test, language) {
sh """
hostname
export REALM_XCODE_VERSION=${carthageXcodeVersion}
cd examples/installation

archive=\$(echo \$PWD/realm-${language}-*.zip)

cd examples/installation
if [[ -f \$archive ]]; then
mv \$archive .
unzip realm-${language}-*.zip
Expand Down
4 changes: 0 additions & 4 deletions Realm.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,6 @@
5D432B8E1CC0713F00A610A9 /* LinkingObjectsTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5D432B8C1CC0713F00A610A9 /* LinkingObjectsTests.mm */; };
5D6156EE1BE0689200A4BD3F /* Realm.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5D659ED91BE04556006515A0 /* Realm.framework */; };
5D6156FB1BE08E7E00A4BD3F /* PerformanceTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 3F04EA2D1992BEE400C2CE2E /* PerformanceTests.m */; };
5D6157051BE13CBB00A4BD3F /* strip-frameworks.sh in Resources */ = {isa = PBXBuildFile; fileRef = E81C393E1AE5CE6A00F03B56 /* strip-frameworks.sh */; };
5D659E811BE04556006515A0 /* external_commit_helper.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3F2118A81B97CBE1005A4CFE /* external_commit_helper.cpp */; };
5D659E821BE04556006515A0 /* index_set.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3FBD05FA1B94E1C3004559CF /* index_set.cpp */; };
5D659E831BE04556006515A0 /* object_schema.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3FAE25561B8CEBBE00D01405 /* object_schema.cpp */; };
Expand Down Expand Up @@ -1133,7 +1132,6 @@
E81A1FC31955FE0100FDED82 /* RealmTests.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = RealmTests.mm; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.objc; };
E81A1FD01955FE0100FDED82 /* SwiftRealmTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SwiftRealmTests.swift; sourceTree = "<group>"; };
E81A1FD11955FE0100FDED82 /* TransactionTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TransactionTests.m; sourceTree = "<group>"; };
E81C393E1AE5CE6A00F03B56 /* strip-frameworks.sh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; name = "strip-frameworks.sh"; path = "scripts/strip-frameworks.sh"; sourceTree = SOURCE_ROOT; };
E8267FED1D90B79000E001C7 /* ObjectServerTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = ObjectServerTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
E8267FF01D90B8E700E001C7 /* RLMObjectServerTests.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; lineEnding = 0; name = RLMObjectServerTests.mm; path = Realm/ObjectServerTests/RLMObjectServerTests.mm; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.objc; };
E82FA60A195632F20043A3C3 /* SwiftArrayPropertyTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; lineEnding = 0; path = SwiftArrayPropertyTests.swift; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.swift; };
Expand Down Expand Up @@ -1916,7 +1914,6 @@
023B19F71A423BD20067FB81 /* libc++.dylib */,
E81A1F621955FC9300FDED82 /* Realm-Info.plist */,
02E334C21A5F3C45009F8810 /* Realm.modulemap */,
E81C393E1AE5CE6A00F03B56 /* strip-frameworks.sh */,
);
name = "Supporting Files";
sourceTree = "<group>";
Expand Down Expand Up @@ -2475,7 +2472,6 @@
files = (
5D659ED21BE04556006515A0 /* CHANGELOG.md in Resources */,
5D659ED51BE04556006515A0 /* LICENSE in Resources */,
5D6157051BE13CBB00A4BD3F /* strip-frameworks.sh in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down
268 changes: 60 additions & 208 deletions build.sh

Large diffs are not rendered by default.

13 changes: 0 additions & 13 deletions examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,19 +106,6 @@ For more information on complete App Clip flow see: [Responding to invocations](



## iOS (RubyMotion)

***RubyMotion support is experimental. We make no claims towards stability and/or performance when using Realm in RubyMotion.***

In the `ios/rubymotion` directory, you will find a Simple example demonstrating how to use Realm in a [RubyMotion](http://www.rubymotion.com) iOS app. Make sure to have run `sh build.sh ios-static` from the root of this repo before building and running this example. You can build and run this example by running `rake` from the `rubymotion/Simple` directory.

To use Realm in your own RubyMotion iOS or OSX app, you must define your models in Objective-C and place them in the `models/` directory. Then in your `Rakefile`, define the following `vendor_project`s:

```ruby
app.vendor_project 'path/to/Realm/Realm.framework', :static, :products => ['Realm'], :force_load => false
app.vendor_project 'models', :static, :cflags => '-F /path/to/Realm/'
```

## OSX (Objective-C)

In the `osx/objc/RealmExamples.xcodeproj` project, you will find the following examples:
Expand Down
2 changes: 1 addition & 1 deletion examples/installation/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ xctest() {
local scheme=(-scheme "$NAME")

# Ensure that dynamic framework tests try to use the correct version of the prebuilt libraries.
sed -i '' 's@/swift-[0-9.]*@/swift-'"${REALM_XCODE_VERSION}"'@' "$DIRECTORY/$NAME.xcodeproj/project.pbxproj"
sed -i '' 's@/realm-swift-latest@/realm-swift-latest/'"${REALM_XCODE_VERSION}"'@' "$DIRECTORY/$NAME.xcodeproj/project.pbxproj"

xcodebuild "${project[@]}" "${scheme[@]}" clean build "${destination[@]}" "${code_signing_flags[@]}"
if [[ $PLATFORM != watchos ]]; then
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
E8561ACE1AFB1518006E087E /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = E8561ACD1AFB1518006E087E /* Images.xcassets */; };
E8561AD11AFB1518006E087E /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = E8561ACF1AFB1518006E087E /* LaunchScreen.xib */; };
E8561ADD1AFB1518006E087E /* DynamicExampleTests.m in Sources */ = {isa = PBXBuildFile; fileRef = E8561ADC1AFB1518006E087E /* DynamicExampleTests.m */; };
E8561AE71AFB1534006E087E /* Realm.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E8561AE61AFB1534006E087E /* Realm.framework */; };
E8561AE81AFB1534006E087E /* Realm.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = E8561AE61AFB1534006E087E /* Realm.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
E8561AE71AFB1534006E087E /* Realm.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = E8561AE61AFB1534006E087E /* Realm.xcframework */; };
E8561AE81AFB1534006E087E /* Realm.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = E8561AE61AFB1534006E087E /* Realm.xcframework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
/* End PBXBuildFile section */

/* Begin PBXContainerItemProxy section */
Expand All @@ -35,7 +35,7 @@
dstPath = "";
dstSubfolderSpec = 10;
files = (
E8561AE81AFB1534006E087E /* Realm.framework in Embed Frameworks */,
E8561AE81AFB1534006E087E /* Realm.xcframework in Embed Frameworks */,
);
name = "Embed Frameworks";
runOnlyForDeploymentPostprocessing = 0;
Expand All @@ -56,15 +56,15 @@
E8561AD61AFB1518006E087E /* DynamicExampleTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = DynamicExampleTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
E8561ADB1AFB1518006E087E /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
E8561ADC1AFB1518006E087E /* DynamicExampleTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = DynamicExampleTests.m; sourceTree = "<group>"; };
E8561AE61AFB1534006E087E /* Realm.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Realm.framework; path = "../../../realm-objc-latest/ios/dynamic/Realm.framework"; sourceTree = "<group>"; };
E8561AE61AFB1534006E087E /* Realm.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = Realm.xcframework; path = "../../../realm-objc-latest/Realm.xcframework"; sourceTree = "<group>"; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
E8561ABA1AFB1518006E087E /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
E8561AE71AFB1534006E087E /* Realm.framework in Frameworks */,
E8561AE71AFB1534006E087E /* Realm.xcframework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand All @@ -84,7 +84,7 @@
E8561ABF1AFB1518006E087E /* DynamicExample */,
E8561AD91AFB1518006E087E /* DynamicExampleTests */,
E8561ABE1AFB1518006E087E /* Products */,
E8561AE61AFB1534006E087E /* Realm.framework */,
E8561AE61AFB1534006E087E /* Realm.xcframework */,
);
sourceTree = "<group>";
};
Expand Down Expand Up @@ -149,7 +149,6 @@
E8561ABA1AFB1518006E087E /* Frameworks */,
E8561ABB1AFB1518006E087E /* Resources */,
E8561AE91AFB1534006E087E /* Embed Frameworks */,
C07E5D8B1B15100E00ED625C /* Strip Framework Architectures */,
);
buildRules = (
);
Expand Down Expand Up @@ -201,6 +200,7 @@
developmentRegion = English;
hasScannedForEncodings = 0;
knownRegions = (
English,
en,
Base,
);
Expand Down Expand Up @@ -235,24 +235,6 @@
};
/* End PBXResourcesBuildPhase section */

/* Begin PBXShellScriptBuildPhase section */
C07E5D8B1B15100E00ED625C /* Strip Framework Architectures */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
name = "Strip Framework Architectures";
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "bash \"${BUILT_PRODUCTS_DIR}/${FRAMEWORKS_FOLDER_PATH}/Realm.framework/strip-frameworks.sh\"";
showEnvVarsInLog = 0;
};
/* End PBXShellScriptBuildPhase section */

/* Begin PBXSourcesBuildPhase section */
E8561AB91AFB1518006E087E /* Sources */ = {
isa = PBXSourcesBuildPhase;
Expand Down Expand Up @@ -324,7 +306,7 @@
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
Expand Down Expand Up @@ -380,7 +362,7 @@
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
objects = {

/* Begin PBXBuildFile section */
E85A7EEC1AFAAFBF005C839C /* Realm.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E88ABBDA1AFAA5D600FA1E1D /* Realm.framework */; };
E85A7EEC1AFAAFBF005C839C /* Realm.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = E88ABBDA1AFAA5D600FA1E1D /* Realm.xcframework */; };
E85A7EED1AFAAFC2005C839C /* libc++.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = E88ABBDC1AFAA5E000FA1E1D /* libc++.dylib */; };
E88ABBB51AFA9DE300FA1E1D /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = E88ABBB41AFA9DE300FA1E1D /* main.m */; };
E88ABBB81AFA9DE300FA1E1D /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = E88ABBB71AFA9DE300FA1E1D /* AppDelegate.m */; };
Expand All @@ -16,7 +16,7 @@
E88ABBC01AFA9DE300FA1E1D /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = E88ABBBF1AFA9DE300FA1E1D /* Images.xcassets */; };
E88ABBC31AFA9DE300FA1E1D /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = E88ABBC11AFA9DE300FA1E1D /* LaunchScreen.xib */; };
E88ABBCF1AFA9DE400FA1E1D /* StaticExampleTests.m in Sources */ = {isa = PBXBuildFile; fileRef = E88ABBCE1AFA9DE400FA1E1D /* StaticExampleTests.m */; };
E88ABBDB1AFAA5D600FA1E1D /* Realm.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E88ABBDA1AFAA5D600FA1E1D /* Realm.framework */; };
E88ABBDB1AFAA5D600FA1E1D /* Realm.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = E88ABBDA1AFAA5D600FA1E1D /* Realm.xcframework */; };
E88ABBDD1AFAA5E000FA1E1D /* libc++.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = E88ABBDC1AFAA5E000FA1E1D /* libc++.dylib */; };
/* End PBXBuildFile section */

Expand Down Expand Up @@ -44,7 +44,7 @@
E88ABBC81AFA9DE400FA1E1D /* StaticExampleTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = StaticExampleTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
E88ABBCD1AFA9DE400FA1E1D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
E88ABBCE1AFA9DE400FA1E1D /* StaticExampleTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = StaticExampleTests.m; sourceTree = "<group>"; };
E88ABBDA1AFAA5D600FA1E1D /* Realm.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Realm.framework; path = "../../../realm-objc-latest/ios/static/Realm.framework"; sourceTree = "<group>"; };
E88ABBDA1AFAA5D600FA1E1D /* Realm.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = Realm.xcframework; path = "../../../realm-objc-latest/ios-static/Realm.xcframework"; sourceTree = "<group>"; };
E88ABBDC1AFAA5E000FA1E1D /* libc++.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = "libc++.dylib"; path = "usr/lib/libc++.dylib"; sourceTree = SDKROOT; };
/* End PBXFileReference section */

Expand All @@ -54,7 +54,7 @@
buildActionMask = 2147483647;
files = (
E88ABBDD1AFAA5E000FA1E1D /* libc++.dylib in Frameworks */,
E88ABBDB1AFAA5D600FA1E1D /* Realm.framework in Frameworks */,
E88ABBDB1AFAA5D600FA1E1D /* Realm.xcframework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand All @@ -63,7 +63,7 @@
buildActionMask = 2147483647;
files = (
E85A7EED1AFAAFC2005C839C /* libc++.dylib in Frameworks */,
E85A7EEC1AFAAFBF005C839C /* Realm.framework in Frameworks */,
E85A7EEC1AFAAFBF005C839C /* Realm.xcframework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand All @@ -77,7 +77,7 @@
E88ABBB11AFA9DE300FA1E1D /* StaticExample */,
E88ABBCB1AFA9DE400FA1E1D /* StaticExampleTests */,
E88ABBDC1AFAA5E000FA1E1D /* libc++.dylib */,
E88ABBDA1AFAA5D600FA1E1D /* Realm.framework */,
E88ABBDA1AFAA5D600FA1E1D /* Realm.xcframework */,
);
sourceTree = "<group>";
};
Expand Down

0 comments on commit 32b2060

Please sign in to comment.