Skip to content

Commit

Permalink
Merge branch 'develop' into prototype/concurrency
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnEstropia committed Jul 18, 2023
2 parents b88ade9 + 7e37219 commit 320c614
Show file tree
Hide file tree
Showing 442 changed files with 217,164 additions and 122,853 deletions.
3 changes: 1 addition & 2 deletions CoreStore.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = "CoreStore"
s.version = "9.0.0"
s.version = "9.1.0"
s.swift_version = "5.7"
s.license = "MIT"
s.homepage = "https://github.com/JohnEstropia/CoreStore"
Expand Down Expand Up @@ -30,6 +30,5 @@ Pod::Spec.new do |s|
ts.ios.deployment_target = "13.0"
ts.osx.deployment_target = "10.15"
ts.tvos.deployment_target = "13.0"
ts.watchos.deployment_target = "7.4"
end
end
26 changes: 18 additions & 8 deletions CoreStore.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@
18166889232B9ED80097C275 /* String+KeyPaths.swift in Sources */ = {isa = PBXBuildFile; fileRef = B51B5C2A22D43931009FA3BA /* String+KeyPaths.swift */; };
2F03A53619C5C6DA005002A5 /* CoreStore.h in Headers */ = {isa = PBXBuildFile; fileRef = 2F03A53519C5C6DA005002A5 /* CoreStore.h */; settings = {ATTRIBUTES = (Public, ); }; };
2F03A54D19C5C872005002A5 /* CoreData.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2F03A54C19C5C872005002A5 /* CoreData.framework */; };
53EB03E62A3AD5D400179430 /* Operators.swift in Sources */ = {isa = PBXBuildFile; fileRef = 53EB03E52A3AD5D400179430 /* Operators.swift */; };
53EB03E72A3AD5D400179430 /* Operators.swift in Sources */ = {isa = PBXBuildFile; fileRef = 53EB03E52A3AD5D400179430 /* Operators.swift */; };
53EB03E82A3AD5D400179430 /* Operators.swift in Sources */ = {isa = PBXBuildFile; fileRef = 53EB03E52A3AD5D400179430 /* Operators.swift */; };
53EB03E92A3AD5D400179430 /* Operators.swift in Sources */ = {isa = PBXBuildFile; fileRef = 53EB03E52A3AD5D400179430 /* Operators.swift */; };
82BA18931C4BBCBA00A0916E /* CoreStore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 82BA18891C4BBCBA00A0916E /* CoreStore.framework */; };
82BA18A01C4BBD1400A0916E /* CoreStore.h in Headers */ = {isa = PBXBuildFile; fileRef = 2F03A53519C5C6DA005002A5 /* CoreStore.h */; settings = {ATTRIBUTES = (Public, ); }; };
82BA18A21C4BBD1D00A0916E /* CoreStoreError.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5D1E22B19FA9FBC003B2874 /* CoreStoreError.swift */; };
Expand Down Expand Up @@ -878,6 +882,7 @@
2F03A53B19C5C6DA005002A5 /* CoreStoreTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = CoreStoreTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
2F03A53E19C5C6DA005002A5 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
2F03A54C19C5C872005002A5 /* CoreData.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreData.framework; path = System/Library/Frameworks/CoreData.framework; sourceTree = SDKROOT; };
53EB03E52A3AD5D400179430 /* Operators.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Operators.swift; sourceTree = "<group>"; };
82BA18891C4BBCBA00A0916E /* CoreStore.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = CoreStore.framework; sourceTree = BUILT_PRODUCTS_DIR; };
82BA18921C4BBCBA00A0916E /* CoreStoreTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = CoreStoreTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
82BA18DE1C4BBE2600A0916E /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS9.1.sdk/System/Library/Frameworks/Foundation.framework; sourceTree = DEVELOPER_DIR; };
Expand Down Expand Up @@ -1451,6 +1456,7 @@
B52F742E1E9B50D0005F3DAC /* SchemaHistory.swift */,
B5D339E61E9493A500C880DE /* Entity.swift */,
B5A991EB1E9DC2CE0091A2E3 /* VersionLock.swift */,
53EB03E52A3AD5D400179430 /* Operators.swift */,
);
name = "Dynamic Models";
sourceTree = "<group>";
Expand Down Expand Up @@ -2171,6 +2177,7 @@
B5F9C093287849E0007AAD2E /* DataStack+Concurrency.swift in Sources */,
B5BF7FC6234D7E460070E741 /* ObjectSnapshot.swift in Sources */,
B5E84EF71AFF846E0064E85B /* UnsafeDataTransaction.swift in Sources */,
53EB03E62A3AD5D400179430 /* Operators.swift in Sources */,
B56964D41B22FFAD0075EE4A /* DataStack+Migration.swift in Sources */,
B5D339DD1E9489C700C880DE /* DynamicObject.swift in Sources */,
B50C3EE523D153EA00B29880 /* Field.Coded.swift in Sources */,
Expand Down Expand Up @@ -2387,6 +2394,7 @@
B5F9C094287849E0007AAD2E /* DataStack+Concurrency.swift in Sources */,
82BA18AC1C4BBD3100A0916E /* SynchronousDataTransaction.swift in Sources */,
B50C3EE623D153EA00B29880 /* Field.Coded.swift in Sources */,
53EB03E72A3AD5D400179430 /* Operators.swift in Sources */,
82BA18C41C4BBD5300A0916E /* ListMonitor.swift in Sources */,
B5215CAA1FA4810300139E3A /* QueryChainBuilder.swift in Sources */,
B50E175823517DE4004F033C /* Differentiable.swift in Sources */,
Expand Down Expand Up @@ -2638,6 +2646,7 @@
B5F9C096287849E0007AAD2E /* DataStack+Concurrency.swift in Sources */,
B5D339EF1E9495E500C880DE /* CoreStoreObject+Querying.swift in Sources */,
B52DD19F1BE1F92C00949AFE /* SynchronousDataTransaction.swift in Sources */,
53EB03E92A3AD5D400179430 /* Operators.swift in Sources */,
B52DD1CB1BE1F94600949AFE /* Internals.WeakObject.swift in Sources */,
B5220E1A1D130791009BC71E /* Internals.CoreStoreFetchedResultsController.swift in Sources */,
B5215CAC1FA4810300139E3A /* QueryChainBuilder.swift in Sources */,
Expand Down Expand Up @@ -2854,6 +2863,7 @@
B5F9C095287849E0007AAD2E /* DataStack+Concurrency.swift in Sources */,
B56321991BD65216006C9394 /* OrderBy.swift in Sources */,
B50C3EE723D153EA00B29880 /* Field.Coded.swift in Sources */,
53EB03E82A3AD5D400179430 /* Operators.swift in Sources */,
B5D339EE1E9495E500C880DE /* CoreStoreObject+Querying.swift in Sources */,
B56321A51BD65216006C9394 /* MigrationChain.swift in Sources */,
B56321A21BD65216006C9394 /* ListObserver.swift in Sources */,
Expand Down Expand Up @@ -3102,7 +3112,7 @@
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
MARKETING_VERSION = 9.0.0;
MARKETING_VERSION = 9.1.0;
OTHER_LDFLAGS = (
"-weak_framework",
Combine,
Expand All @@ -3126,7 +3136,7 @@
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
MARKETING_VERSION = 9.0.0;
MARKETING_VERSION = 9.1.0;
OTHER_LDFLAGS = (
"-weak_framework",
Combine,
Expand Down Expand Up @@ -3184,7 +3194,7 @@
GCC_NO_COMMON_BLOCKS = YES;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
MARKETING_VERSION = 9.0.0;
MARKETING_VERSION = 9.1.0;
OTHER_LDFLAGS = (
"-weak_framework",
Combine,
Expand All @@ -3211,7 +3221,7 @@
GCC_NO_COMMON_BLOCKS = YES;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
MARKETING_VERSION = 9.0.0;
MARKETING_VERSION = 9.1.0;
OTHER_LDFLAGS = (
"-weak_framework",
Combine,
Expand Down Expand Up @@ -3317,7 +3327,7 @@
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks";
MACOSX_DEPLOYMENT_TARGET = 10.15;
MARKETING_VERSION = 9.0.0;
MARKETING_VERSION = 9.1.0;
OTHER_LDFLAGS = (
"-weak_framework",
Combine,
Expand Down Expand Up @@ -3348,7 +3358,7 @@
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks";
MACOSX_DEPLOYMENT_TARGET = 10.15;
MARKETING_VERSION = 9.0.0;
MARKETING_VERSION = 9.1.0;
OTHER_LDFLAGS = (
"-weak_framework",
Combine,
Expand Down Expand Up @@ -3414,7 +3424,7 @@
GCC_NO_COMMON_BLOCKS = YES;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
MARKETING_VERSION = 9.0.0;
MARKETING_VERSION = 9.1.0;
OTHER_LDFLAGS = (
"-weak_framework",
Combine,
Expand Down Expand Up @@ -3443,7 +3453,7 @@
GCC_NO_COMMON_BLOCKS = YES;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
MARKETING_VERSION = 9.0.0;
MARKETING_VERSION = 9.1.0;
OTHER_LDFLAGS = (
"-weak_framework",
Combine,
Expand Down
2 changes: 1 addition & 1 deletion CoreStoreTests/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>BNDL</string>
<key>CFBundleShortVersionString</key>
<string>9.0.0</string>
<string>9.1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ extension Modern.ColorsDemo.SwiftUI {
}
}
}
.animation(.default)
// .animation(.default) // breaks layout
.listStyle(PlainListStyle())
.edgesIgnoringSafeArea([])
}
Expand Down
3 changes: 1 addition & 2 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,7 @@ let package = Package(
.target(
name: "CoreStore",
dependencies: [],
path: "Sources",
exclude: ["CoreStoreBridge.h", "CoreStoreBridge.m"]
path: "Sources"
),
.testTarget(
name: "CoreStoreTests",
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2449,7 +2449,7 @@ var body: some View {
### Install with CocoaPods
In your `Podfile`, add
```
pod 'CoreStore', '~> 9.0'
pod 'CoreStore', '~> 9.1'
```
and run
```
Expand All @@ -2460,7 +2460,7 @@ This installs CoreStore as a framework. Declare `import CoreStore` in your swift
### Install with Carthage
In your `Cartfile`, add
```
github "JohnEstropia/CoreStore" >= 9.0.0
github "JohnEstropia/CoreStore" >= 9.1.0
```
and run
```
Expand All @@ -2471,7 +2471,7 @@ This installs CoreStore as a framework. Declare `import CoreStore` in your swift
#### Install with Swift Package Manager:
```swift
dependencies: [
.package(url: "https://github.com/JohnEstropia/CoreStore.git", from: "9.0.0"))
.package(url: "https://github.com/JohnEstropia/CoreStore.git", from: "9.1.0"))
]
```
Declare `import CoreStore` in your swift file to use the library.
Expand Down
8 changes: 7 additions & 1 deletion Sources/CoreStore+CustomDebugStringConvertible.swift
Original file line number Diff line number Diff line change
Expand Up @@ -1215,8 +1215,14 @@ extension NSAttributeType: CoreStoreDebugStringConvertible {
case .objectIDAttributeType: return ".objectIDAttributeType"
case .UUIDAttributeType: return ".UUIDAttributeType"
case .URIAttributeType: return ".URIAttributeType"

#if swift(>=5.9) // Xcode 15 (iOS 17.0, macOS 14.0, tvOS 17.0, watchOS 10.0)
case .compositeAttributeType: return ".compositeAttributeType"

#endif

@unknown default:
fatalError()
fatalError()
}
}
}
Expand Down
8 changes: 7 additions & 1 deletion Sources/DynamicObject.swift
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,15 @@ extension NSManagedObject: DynamicObject {
}

public class func cs_fromRaw(object: NSManagedObject) -> Self {


#if swift(>=5.9)
return unsafeDowncast(object, to: self)

#else
// unsafeDowncast fails debug assertion starting Swift 5.2
return _unsafeUncheckedDowncast(object, to: self)

#endif
}

public static func cs_matches(object: NSManagedObject) -> Bool {
Expand Down
2 changes: 1 addition & 1 deletion Sources/Internals.DiffableDataUIDispatcher.Changeset.swift
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ extension Internals.DiffableDataUIDispatcher {
var elementUpdated: [ElementPath]
var elementMoved: [(source: ElementPath, target: ElementPath)]

@inlinable
@usableFromInline
init(
data: C,
sectionDeleted: [Int] = [],
Expand Down
16 changes: 8 additions & 8 deletions Sources/Internals.DiffableDataUIDispatcher.DiffResult.swift
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ extension Internals.DiffableDataUIDispatcher {

// MARK: Private

@inlinable
@usableFromInline
internal init(
deleted: [Index] = [],
inserted: [Index] = [],
Expand All @@ -213,18 +213,18 @@ extension Internals.DiffableDataUIDispatcher {

// Implementation based on https://github.com/ra1028/DifferenceKit
@usableFromInline
internal struct Trace<Index> {
internal struct Trace<I> {

@usableFromInline
internal var reference: Index?
internal var reference: I?

@usableFromInline
internal var deleteOffset = 0

@usableFromInline
internal var isTracked = false

@inlinable
@usableFromInline
init() {}
}

Expand Down Expand Up @@ -252,7 +252,7 @@ extension Internals.DiffableDataUIDispatcher {
@usableFromInline
internal var position = 0

@inlinable
@usableFromInline
internal init(_ indices: ContiguousArray<Int>) {

self.indices = indices
Expand Down Expand Up @@ -292,7 +292,7 @@ extension Internals.DiffableDataUIDispatcher {
@usableFromInline
internal let pointer: UnsafePointer<T>

@inlinable
@usableFromInline
internal init(pointer: UnsafePointer<T>) {

self.pointeeHashValue = pointer.pointee.hashValue
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ extension Internals.DiffableDataUIDispatcher {
@usableFromInline
var changesets: ContiguousArray<Changeset<C>>

@inlinable
@usableFromInline
init<S: Sequence>(_ changesets: S) where S.Element == Changeset<C> {

self.changesets = ContiguousArray(changesets)
Expand Down
2 changes: 1 addition & 1 deletion Sources/Internals.DiffableDataUIDispatcher.swift
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ extension Internals {
@usableFromInline
var section: Int

@inlinable
@usableFromInline
init(element: Int, section: Int) {

self.element = element
Expand Down
2 changes: 1 addition & 1 deletion Sources/Internals.EntityIdentifier.swift
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ extension Internals {
default:
Internals.abort("\(Internals.typeName(DynamicObject.self)) is not meant to be implemented by external types.")
}
}
}

internal init(_ entityDescription: NSEntityDescription) {

Expand Down
47 changes: 47 additions & 0 deletions Sources/Operators.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
//
// Operators.swift
// CoreStore
//
// Copyright © 2023 John Rommel Estropia
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, 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 the following conditions:
//
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.
//
// 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 THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 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.
//


infix operator .= : AssignmentPrecedence
infix operator .== : ComparisonPrecedence


infix operator &&? : LogicalConjunctionPrecedence
infix operator ||? : LogicalConjunctionPrecedence


// MARK: - ~

/**
Connects multiple `KeyPathStringConvertible`s to create a type-safe chain usable in query/fetch expressions
```
let owner = dataStack.fetchOne(
From<Pet>().where(
(\.master ~ \.name) == "John"
)
)
```
*/
infix operator ~ : AdditionPrecedence
3 changes: 0 additions & 3 deletions Sources/Relationship.ToManyOrdered.swift
Original file line number Diff line number Diff line change
Expand Up @@ -371,9 +371,6 @@ extension RelationshipContainer.ToManyOrdered: RandomAccessCollection {

// MARK: - Operations

infix operator .= : AssignmentPrecedence
infix operator .== : ComparisonPrecedence

extension RelationshipContainer.ToManyOrdered {

/**
Expand Down
3 changes: 0 additions & 3 deletions Sources/Relationship.ToManyUnordered.swift
Original file line number Diff line number Diff line change
Expand Up @@ -364,9 +364,6 @@ extension RelationshipContainer.ToManyUnordered: Sequence {

// MARK: - Operations

infix operator .= : AssignmentPrecedence
infix operator .== : ComparisonPrecedence

extension RelationshipContainer.ToManyUnordered {

/**
Expand Down
4 changes: 0 additions & 4 deletions Sources/Relationship.ToOne.swift
Original file line number Diff line number Diff line change
Expand Up @@ -304,10 +304,6 @@ extension RelationshipContainer {


// MARK: - Operations

infix operator .= : AssignmentPrecedence
infix operator .== : ComparisonPrecedence

extension RelationshipContainer.ToOne {

/**
Expand Down
Loading

0 comments on commit 320c614

Please sign in to comment.