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

Fix cocoapods installation #118

Merged
merged 2 commits into from
May 31, 2021
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
3 changes: 0 additions & 3 deletions CombineX.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,10 @@ Pod::Spec.new do |s|
ss.dependency "CombineX/CXLibc"
ss.dependency "CombineX/CXUtility"
ss.dependency "CombineX/CXNamespace"
# ss.dependency "Runtime"
end

s.subspec "CXFoundation" do |ss|
ss.source_files = "Sources/CXFoundation/**/*.swift"
ss.dependency "CombineX/CXUtility"
ss.dependency "CombineX/CXNamespace"
ss.dependency "CombineX/Main"
end

Expand Down
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ package.dependencies += [

```ruby
pod 'CombineX', "~> 0.3.1"

# or, if you want to use `Foundation` extensions:
pod 'CombineX/CXFoundation', "~> 0.3.1"
Copy link
Member

Choose a reason for hiding this comment

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

I have very little knowledge of CocoaPods. So we don't need to state CXFoundation explicitly before, but now we do? With duplicate version number?

Copy link
Member Author

Choose a reason for hiding this comment

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

It's an either-or

pod 'CombineX' means you only want CombineX.
pod 'CombineX/CXFoundation means you want CombineX, and CXFoundation.

Copy link
Member

Choose a reason for hiding this comment

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

Did users need pod 'CombineX/CXFoundation' before?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, if they want to use CXFoundation

```

#### Carthage
Expand Down
4 changes: 2 additions & 2 deletions Sources/CXFoundation/DispatchQueue.swift
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import CombineX
import Dispatch

#if !COCOAPODS
import CXNamespace
import CXUtility
import CXNamespace
import CombineX
#endif

extension CXWrappers {
Expand Down
3 changes: 2 additions & 1 deletion Sources/CXFoundation/JSONDecoder.swift
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import CombineX
import Foundation

#if !COCOAPODS
import CXUtility
import CXNamespace
import CombineX
#endif

extension CXWrappers {
Expand Down
3 changes: 2 additions & 1 deletion Sources/CXFoundation/JSONEncoder.swift
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import CombineX
import Foundation

#if !COCOAPODS
import CXUtility
import CXNamespace
import CombineX
#endif

extension CXWrappers {
Expand Down
3 changes: 2 additions & 1 deletion Sources/CXFoundation/NSObject.swift
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import CombineX
import Foundation

#if !COCOAPODS
import CXUtility
import CXNamespace
import CombineX
#endif

extension CXWrappers {
Expand Down
27 changes: 24 additions & 3 deletions Sources/CXFoundation/NotificationCenter.swift
Original file line number Diff line number Diff line change
@@ -1,14 +1,35 @@
import CombineX
import CXUtility
import Foundation

#if !COCOAPODS
import CXUtility
import CXNamespace
import CombineX
#endif

extension CXWrappers {

public final class NotificationCenter: NSObject<Foundation.NotificationCenter> {}
public final class NotificationCenter: NSObject<Foundation.NotificationCenter> {

#if COCOAPODS
/// For some reason, when installed via CocoaPods, the compilation will fail with the following error:
///
/// Value of type 'CXWrappers.NotificationCenter' has no member 'base'.
///
/// This is a compiler bug, so, as you can see, there is a crazy workaround here, yes, override without `override` keyword.
public var base: Foundation.NotificationCenter {
return super.base
}

/// For some reason, when installed via CocoaPods, the compilation will fail with the following error:
///
/// 'CXWrappers.NotificationCenter' cannot be constructed because it has no accessible initializers.
///
/// This is a compiler bug, so, as you can see, there is a crazy workaround here, yes, override without `override` keyword.
public init(wrapping base: Foundation.NotificationCenter) {
super.init(wrapping: base)
}
#endif
}
}

extension NotificationCenter {
Expand Down
3 changes: 2 additions & 1 deletion Sources/CXFoundation/OperationQueue.swift
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import CombineX
import Foundation

#if !COCOAPODS
import CXUtility
import CXNamespace
import CombineX
#endif

extension CXWrappers {
Expand Down
3 changes: 2 additions & 1 deletion Sources/CXFoundation/PropertyListDecoder.swift
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
#if os(macOS) || os(iOS) || os(tvOS) || os(watchOS)

import CombineX
import Foundation

#if !COCOAPODS
import CXUtility
import CXNamespace
import CombineX
#endif

extension CXWrappers {
Expand Down
3 changes: 2 additions & 1 deletion Sources/CXFoundation/PropertyListEncoder.swift
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
#if os(macOS) || os(iOS) || os(tvOS) || os(watchOS)

import CombineX
import Foundation

#if !COCOAPODS
import CXUtility
import CXNamespace
import CombineX
#endif

extension CXWrappers {
Expand Down
6 changes: 5 additions & 1 deletion Sources/CXFoundation/Publishers+KeyValueObserving.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,12 @@
#if canImport(ObjectiveC)

import Foundation
import CombineX

#if !COCOAPODS
import CXUtility
import CXNamespace
import CombineX
#endif

// The following protocol is so that we can reference `Self` in the Publisher
// below. This is based on a trick used in the the standard library's
Expand Down
4 changes: 2 additions & 2 deletions Sources/CXFoundation/RunLoop.swift
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import CombineX
import Foundation

#if !COCOAPODS
import CXNamespace
import CXUtility
import CXNamespace
import CombineX
#endif

extension CXWrappers {
Expand Down
4 changes: 2 additions & 2 deletions Sources/CXFoundation/Timer.swift
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import CombineX
import CXUtility
import Foundation

#if !COCOAPODS
import CXUtility
import CXNamespace
import CombineX
#endif

extension CXWrappers {
Expand Down
4 changes: 2 additions & 2 deletions Sources/CXFoundation/URLSession.swift
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import CombineX
import CXUtility
import Foundation

#if canImport(FoundationNetworking)
import FoundationNetworking
#endif

#if !COCOAPODS
import CXUtility
import CXNamespace
import CombineX
#endif

extension CXWrappers {
Expand Down