Skip to content
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

Revert Static Lib to Dynamic Framework #1960

Merged
merged 2 commits into from
Apr 30, 2019
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
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,18 @@ github "ReactiveX/RxSwift" ~> 5.0
$ carthage update
```

#### Carthage as a Static Library

Carthage defaults to building RxSwift as a Dynamic Library.

If you wish to build RxSwift as a Static Library using Carthage you may use the script below to manually modify the framework type before building with Carthage:

```bash
carthage update RxSwift --platform iOS --no-build
sed -i -e 's/MACH_O_TYPE = mh_dylib/MACH_O_TYPE = staticlib/g' Carthage/Checkouts/RxSwift/Rx.xcodeproj/project.pbxproj
carthage build RxAlamofire --platform iOS
```

### [Swift Package Manager](https://github.com/apple/swift-package-manager)

Create a `Package.swift` file.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
/*:
> # IMPORTANT: To use **Rx.playground**:
1. Open **Rx.xcworkspace**.
1. Build the **RxPlaygrounds** scheme for **Mac** (**Product** → **Build**).
1. Build the **RxExample-macOS** scheme (**Product** → **Build**).
1. Open **Rx** playground in the **Project navigator** (under RxExample project).
1. Show the Debug Area (**View** → **Debug Area** → **Show Debug Area**).
----
[Previous](@previous) - [Table of Contents](Table_of_Contents)
*/
import RxPlaygrounds
import RxSwift
/*:
# Combination Operators
Operators that combine multiple source `Observable`s into a single `Observable`.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
/*:
> # IMPORTANT: To use **Rx.playground**:
1. Open **Rx.xcworkspace**.
1. Build the **RxPlaygrounds** scheme for **Mac** (**Product** → **Build**).
1. Build the **RxExample-macOS** scheme (**Product** → **Build**).
1. Open **Rx** playground in the **Project navigator** (under RxExample project).
1. Show the Debug Area (**View** → **Debug Area** → **Show Debug Area**).
----
[Previous](@previous) - [Table of Contents](Table_of_Contents)
*/
import RxPlaygrounds
import RxSwift

playgroundShouldContinueIndefinitely()
/*:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
/*:
> # IMPORTANT: To use **Rx.playground**:
1. Open **Rx.xcworkspace**.
1. Build the **RxPlaygrounds** scheme for **Mac** (**Product** → **Build**).
1. Build the **RxExample-macOS** scheme (**Product** → **Build**).
1. Open **Rx** playground in the **Project navigator** (under RxExample project).
1. Show the Debug Area (**View** → **Debug Area** → **Show Debug Area**).
----
[Previous](@previous) - [Table of Contents](Table_of_Contents)
*/
import RxPlaygrounds
import RxSwift
/*:
# Creating and Subscribing to `Observable`s
There are several ways to create and subscribe to `Observable` sequences.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
/*:
> # IMPORTANT: To use **Rx.playground**:
1. Open **Rx.xcworkspace**.
1. Build the **RxPlaygrounds** scheme for **Mac** (**Product** → **Build**).
1. Build the **RxExample-macOS** scheme (**Product** → **Build**).
1. Open **Rx** playground in the **Project navigator** (under RxExample project).
1. Show the Debug Area (**View** → **Debug Area** → **Show Debug Area**).
----
[Previous](@previous) - [Table of Contents](Table_of_Contents)
*/
import RxPlaygrounds
import RxSwift
/*:
# Debugging Operators
Operators to help debug Rx code.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
/*:
> # IMPORTANT: To use **Rx.playground**:
1. Open **Rx.xcworkspace**.
1. Build the **RxPlaygrounds** scheme for **Mac** (**Product** → **Build**).
1. Build the **RxExample-macOS** scheme (**Product** → **Build**).
1. Open **Rx** playground in the **Project navigator** (under RxExample project).
1. Show the Debug Area (**View** → **Debug Area** → **Show Debug Area**).
----
[Previous](@previous) - [Table of Contents](Table_of_Contents)
*/
import RxPlaygrounds
import RxSwift
/*:
# Error Handling Operators
Operators that help to recover from error notifications from an Observable.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
/*:
> # IMPORTANT: To use **Rx.playground**:
1. Open **Rx.xcworkspace**.
1. Build the **RxPlaygrounds** scheme for **Mac** (**Product** → **Build**).
1. Build the **RxExample-macOS** scheme (**Product** → **Build**).
1. Open **Rx** playground in the **Project navigator** (under RxExample project).
1. Show the Debug Area (**View** → **Debug Area** → **Show Debug Area**).
----
[Previous](@previous) - [Table of Contents](Table_of_Contents)
*/
import RxPlaygrounds
import RxSwift
/*:
# Filtering and Conditional Operators
Operators that selectively emit elements from a source `Observable` sequence.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
/*:
> # IMPORTANT: To use **Rx.playground**:
1. Open **Rx.xcworkspace**.
1. Build the **RxPlaygrounds** scheme for **Mac** (**Product** → **Build**).
1. Build the **RxExample-macOS** scheme (**Product** → **Build**).
1. Open **Rx** playground in the **Project navigator** (under RxExample project).
1. Show the Debug Area (**View** → **Debug Area** → **Show Debug Area**).
----
[Previous](@previous)
*/

import RxPlaygrounds
import RxSwift

/*:
# Introduction
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
/*:
> # IMPORTANT: To use **Rx.playground**:
1. Open **Rx.xcworkspace**.
1. Build the **RxPlaygrounds** scheme for **Mac** (**Product** → **Build**).
1. Build the **RxExample-macOS** scheme (**Product** → **Build**).
1. Open **Rx** playground in the **Project navigator** (under RxExample project).
1. Show the Debug Area (**View** → **Debug Area** → **Show Debug Area**).
----
[Previous](@previous) - [Table of Contents](Table_of_Contents)
*/
import RxPlaygrounds
import RxSwift
/*:
# Mathematical and Aggregate Operators
Operators that operate on the entire sequence of items emitted by an `Observable`.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*:
> # IMPORTANT: To use **Rx.playground**:
1. Open **Rx.xcworkspace**.
1. Build the **RxPlaygrounds** scheme for **Mac** (**Product** → **Build**).
1. Build the **RxExample-macOS** scheme (**Product** → **Build**).
1. Open **Rx** playground in the **Project navigator** (under RxExample project).
1. Show the Debug Area (**View** → **Debug Area** → **Show Debug Area**).
----
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
/*:
> # IMPORTANT: To use **Rx.playground**:
1. Open **Rx.xcworkspace**.
1. Build the **RxPlaygrounds** scheme for **Mac** (**Product** → **Build**).
1. Build the **RxExample-macOS** scheme (**Product** → **Build**).
1. Open **Rx** playground in the **Project navigator** (under RxExample project).
1. Show the Debug Area (**View** → **Debug Area** → **Show Debug Area**).
----
[Previous](@previous) - [Table of Contents](Table_of_Contents)
*/
import RxPlaygrounds
import RxSwift
/*:
# Transforming Operators
Operators that transform Next event elements emitted by an `Observable` sequence.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/*:
> # IMPORTANT: To use **Rx.playground**:
1. Open **Rx.xcworkspace**.
1. Build the **RxPlaygrounds** scheme for **Mac** (**Product** → **Build**).
1. Build the **RxExample-macOS** scheme (**Product** → **Build**).
1. Open **Rx** playground in the **Project navigator** (under RxExample project).
1. Show the Debug Area (**View** → **Debug Area** → **Show Debug Area**).
*/
import RxPlaygrounds
import RxSwift
/*:
# Try Yourself

Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
/*:
> # IMPORTANT: To use **Rx.playground**:
1. Open **Rx.xcworkspace**.
1. Build the **RxPlaygrounds** scheme for **Mac** (**Product** → **Build**).
1. Build the **RxExample-macOS** scheme (**Product** → **Build**).
1. Open **Rx** playground in the **Project navigator** (under RxExample project).
1. Show the Debug Area (**View** → **Debug Area** → **Show Debug Area**).
----
[Previous](@previous) - [Table of Contents](Table_of_Contents)
*/
import RxPlaygrounds
import RxSwift
/*:
# Working with Subjects
A Subject is a sort of bridge or proxy that is available in some implementations of Rx that acts as both an observer and `Observable`. Because it is an observer, it can subscribe to one or more `Observable`s, and because it is an `Observable`, it can pass through the items it observes by reemitting them, and it can also emit new items. [More info](http://reactivex.io/documentation/subject.html)
Expand Down
33 changes: 18 additions & 15 deletions Rx.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -3896,7 +3896,7 @@
INFOPLIST_FILE = "$(SRCROOT)/RxRelay/Info.plist";
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
MACH_O_TYPE = staticlib;
MACH_O_TYPE = mh_dylib;
Copy link
Contributor

Choose a reason for hiding this comment

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

I believe you can safely delete the MACH_O_TYPE entries entirely. They'll default to Xcode's recommendation, which is mh_dylib.

Copy link
Member Author

@freak4pc freak4pc Apr 30, 2019

Choose a reason for hiding this comment

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

True, but in a way I always prefer explicitness (not that the default will change or anything but still I don't see harm in that). The second thing this helps with is the above sed script works. Even though it could replace MACH_O_TYPE = as well. Don't have a huge preference to this :)

Copy link
Member Author

Choose a reason for hiding this comment

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

Actually removing it will leave no trace of it in the project.pbxproj so in a way I think leaving it explicit allows for better communication and also will allow this manual customization in the form of a bash script like the above

PRODUCT_BUNDLE_IDENTIFIER = "io.rx.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
Expand All @@ -3913,7 +3913,7 @@
INFOPLIST_FILE = "$(SRCROOT)/RxRelay/Info.plist";
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
MACH_O_TYPE = staticlib;
MACH_O_TYPE = mh_dylib;
PRODUCT_BUNDLE_IDENTIFIER = "io.rx.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
Expand All @@ -3930,7 +3930,7 @@
INFOPLIST_FILE = "$(SRCROOT)/RxRelay/Info.plist";
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
MACH_O_TYPE = staticlib;
MACH_O_TYPE = mh_dylib;
PRODUCT_BUNDLE_IDENTIFIER = "io.rx.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
Expand All @@ -3947,7 +3947,7 @@
INFOPLIST_FILE = "$(SRCROOT)/RxCocoa/Info.plist";
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
MACH_O_TYPE = staticlib;
MACH_O_TYPE = mh_dylib;
PRODUCT_BUNDLE_IDENTIFIER = "io.rx.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = RxCocoa;
SKIP_INSTALL = YES;
Expand All @@ -3964,7 +3964,7 @@
INFOPLIST_FILE = "$(SRCROOT)/RxCocoa/Info.plist";
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
MACH_O_TYPE = staticlib;
MACH_O_TYPE = mh_dylib;
PRODUCT_BUNDLE_IDENTIFIER = "io.rx.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = RxCocoa;
SKIP_INSTALL = YES;
Expand All @@ -3981,7 +3981,7 @@
INFOPLIST_FILE = "$(SRCROOT)/RxCocoa/Info.plist";
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
MACH_O_TYPE = staticlib;
MACH_O_TYPE = mh_dylib;
PRODUCT_BUNDLE_IDENTIFIER = "io.rx.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = RxCocoa;
SKIP_INSTALL = YES;
Expand All @@ -3998,7 +3998,7 @@
INFOPLIST_FILE = "$(SRCROOT)/RxBlocking/Info.plist";
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
MACH_O_TYPE = staticlib;
MACH_O_TYPE = mh_dylib;
PRODUCT_BUNDLE_IDENTIFIER = "io.rx.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = RxBlocking;
SKIP_INSTALL = YES;
Expand All @@ -4015,7 +4015,7 @@
INFOPLIST_FILE = "$(SRCROOT)/RxBlocking/Info.plist";
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
MACH_O_TYPE = staticlib;
MACH_O_TYPE = mh_dylib;
PRODUCT_BUNDLE_IDENTIFIER = "io.rx.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = RxBlocking;
SKIP_INSTALL = YES;
Expand All @@ -4032,7 +4032,7 @@
INFOPLIST_FILE = "$(SRCROOT)/RxBlocking/Info.plist";
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
MACH_O_TYPE = staticlib;
MACH_O_TYPE = mh_dylib;
PRODUCT_BUNDLE_IDENTIFIER = "io.rx.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = RxBlocking;
SKIP_INSTALL = YES;
Expand Down Expand Up @@ -4313,6 +4313,7 @@
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
MACH_O_TYPE = mh_dylib;
MACOSX_DEPLOYMENT_TARGET = 10.9;
MTL_ENABLE_DEBUG_INFO = NO;
OTHER_SWIFT_FLAGS = "-D TRACE_RESOURCES -Xfrontend -debug-time-function-bodies -Xfrontend -warn-long-expression-type-checking=100 -Xfrontend -warn-long-function-bodies=100";
Expand All @@ -4338,7 +4339,7 @@
INFOPLIST_FILE = "$(SRCROOT)/RxSwift/Info.plist";
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
MACH_O_TYPE = staticlib;
MACH_O_TYPE = mh_dylib;
PRODUCT_BUNDLE_IDENTIFIER = "io.rx.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = RxSwift;
SKIP_INSTALL = YES;
Expand All @@ -4358,7 +4359,7 @@
INFOPLIST_FILE = RxTest/Info.plist;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
MACH_O_TYPE = staticlib;
MACH_O_TYPE = mh_dylib;
OTHER_LDFLAGS = "-weak-lswiftXCTest";
PRODUCT_BUNDLE_IDENTIFIER = io.rx.RxTest;
PRODUCT_NAME = RxTest;
Expand All @@ -4381,7 +4382,7 @@
INFOPLIST_FILE = RxTest/Info.plist;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
MACH_O_TYPE = staticlib;
MACH_O_TYPE = mh_dylib;
OTHER_LDFLAGS = "-weak-lswiftXCTest";
PRODUCT_BUNDLE_IDENTIFIER = io.rx.RxTest;
PRODUCT_NAME = RxTest;
Expand All @@ -4404,7 +4405,7 @@
INFOPLIST_FILE = RxTest/Info.plist;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
MACH_O_TYPE = staticlib;
MACH_O_TYPE = mh_dylib;
OTHER_LDFLAGS = "-weak-lswiftXCTest";
PRODUCT_BUNDLE_IDENTIFIER = io.rx.RxTest;
PRODUCT_NAME = RxTest;
Expand Down Expand Up @@ -4468,6 +4469,7 @@
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
MACH_O_TYPE = mh_dylib;
MACOSX_DEPLOYMENT_TARGET = 10.9;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
Expand Down Expand Up @@ -4532,6 +4534,7 @@
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
MACH_O_TYPE = mh_dylib;
MACOSX_DEPLOYMENT_TARGET = 10.9;
MTL_ENABLE_DEBUG_INFO = NO;
OTHER_SWIFT_FLAGS = "-D RELEASE";
Expand All @@ -4557,7 +4560,7 @@
INFOPLIST_FILE = "$(SRCROOT)/RxSwift/Info.plist";
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
MACH_O_TYPE = staticlib;
MACH_O_TYPE = mh_dylib;
PRODUCT_BUNDLE_IDENTIFIER = "io.rx.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = RxSwift;
SKIP_INSTALL = YES;
Expand All @@ -4574,7 +4577,7 @@
INFOPLIST_FILE = "$(SRCROOT)/RxSwift/Info.plist";
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
MACH_O_TYPE = staticlib;
MACH_O_TYPE = mh_dylib;
PRODUCT_BUNDLE_IDENTIFIER = "io.rx.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = RxSwift;
SKIP_INSTALL = YES;
Expand Down
Loading