From 23020b10a78610539ce3714b8e6c46da4bf9fc83 Mon Sep 17 00:00:00 2001 From: Javier Cicchelli Date: Fri, 28 Apr 2023 19:06:48 +0200 Subject: [PATCH] Turned off the CoreData entity generation from the TestModel core data model and moved the core data model under the Resources folder. --- Tests/Persistence/Helpers/TestEntity.swift | 29 +++++++++++++++++++ .../Helpers/TestPersistenceService.swift | 1 + .../Model.xcdatamodel/contents | 2 +- 3 files changed, 31 insertions(+), 1 deletion(-) create mode 100644 Tests/Persistence/Helpers/TestEntity.swift rename Tests/Persistence/{Helpers => Resources}/TestModel.xcdatamodeld/Model.xcdatamodel/contents (88%) diff --git a/Tests/Persistence/Helpers/TestEntity.swift b/Tests/Persistence/Helpers/TestEntity.swift new file mode 100644 index 0000000..691f3de --- /dev/null +++ b/Tests/Persistence/Helpers/TestEntity.swift @@ -0,0 +1,29 @@ +//===----------------------------------------------------------------------===// +// +// This source file is part of the SwiftLibs open source project +// +// Copyright (c) 2023 Röck+Cöde VoF. and the SwiftLibs project authors +// Licensed under the EUPL 1.2 or later. +// +// See LICENSE.txt for license information +// See CONTRIBUTORS.txt for the list of SwiftLibs project authors +// +//===----------------------------------------------------------------------===// + +import Foundation +import CoreData + +@objc(TestEntity) +public class TestEntity: NSManagedObject {} + +// MARK: - Fetch requests + +extension TestEntity { + + // MARK: Functions + + @nonobjc public class func fetchRequest() -> NSFetchRequest { + return NSFetchRequest(entityName: "TestEntity") + } + +} diff --git a/Tests/Persistence/Helpers/TestPersistenceService.swift b/Tests/Persistence/Helpers/TestPersistenceService.swift index 2ebb19d..bac652b 100644 --- a/Tests/Persistence/Helpers/TestPersistenceService.swift +++ b/Tests/Persistence/Helpers/TestPersistenceService.swift @@ -11,6 +11,7 @@ //===----------------------------------------------------------------------===// import CoreData +import Foundation import Persistence struct TestPersistenceService { diff --git a/Tests/Persistence/Helpers/TestModel.xcdatamodeld/Model.xcdatamodel/contents b/Tests/Persistence/Resources/TestModel.xcdatamodeld/Model.xcdatamodel/contents similarity index 88% rename from Tests/Persistence/Helpers/TestModel.xcdatamodeld/Model.xcdatamodel/contents rename to Tests/Persistence/Resources/TestModel.xcdatamodeld/Model.xcdatamodel/contents index 4c66cba..e1702d8 100644 --- a/Tests/Persistence/Helpers/TestModel.xcdatamodeld/Model.xcdatamodel/contents +++ b/Tests/Persistence/Resources/TestModel.xcdatamodeld/Model.xcdatamodel/contents @@ -1,4 +1,4 @@ - + \ No newline at end of file