From 12e3c4a14cf3fe93b770fb4aaf0497ac632c8f22 Mon Sep 17 00:00:00 2001 From: Andrey Vyazovoy Date: Mon, 30 Oct 2023 16:54:10 -0400 Subject: [PATCH 1/7] Update `.gitignore` file --- .gitignore | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.gitignore b/.gitignore index 66859dc..66f3991 100644 --- a/.gitignore +++ b/.gitignore @@ -11,6 +11,12 @@ project.xcworkspace/ xcuserdata/ *.xccheckout +#SPM +/.build +/Packages +.swiftpm/ +.netrc + # RubyGems Bundler vendor/bundle/ From b6dd75eb12ba2c1b6927e77b787d35d899139881 Mon Sep 17 00:00:00 2001 From: Andrey Vyazovoy Date: Mon, 30 Oct 2023 17:08:52 -0400 Subject: [PATCH 2/7] Delete orphaned `Info.plist` file --- Sources/Info.plist | 24 ------------------------ 1 file changed, 24 deletions(-) delete mode 100644 Sources/Info.plist diff --git a/Sources/Info.plist b/Sources/Info.plist deleted file mode 100644 index fbe1e6b..0000000 --- a/Sources/Info.plist +++ /dev/null @@ -1,24 +0,0 @@ - - - - - CFBundleDevelopmentRegion - en - CFBundleExecutable - $(EXECUTABLE_NAME) - CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - $(PRODUCT_NAME) - CFBundlePackageType - FMWK - CFBundleShortVersionString - 1.0 - CFBundleVersion - $(CURRENT_PROJECT_VERSION) - NSPrincipalClass - - - From c6b61af7c02e39b614c08abe3145b6ca0e039ef0 Mon Sep 17 00:00:00 2001 From: Andrey Vyazovoy Date: Mon, 30 Oct 2023 17:31:08 -0400 Subject: [PATCH 3/7] Make directory structure SPM-compatible by default --- Examples/Podfile.lock | 2 +- SimpleSource.podspec | 6 +++--- Sources/{ => SimpleSource}/BasicData/BasicDataSource.swift | 0 Sources/{ => SimpleSource}/BasicData/BasicSection.swift | 0 Sources/{ => SimpleSource}/CoreData/CoreDataSource.swift | 0 Sources/{ => SimpleSource}/CoreData/FetchDelegate.swift | 0 Sources/{ => SimpleSource}/DataSource.swift | 0 .../UICollectionView/CollectionViewDataSource.swift | 0 .../UICollectionView/CollectionViewFactory.swift | 0 .../UICollectionView/CollectionViewReorderingDelegate.swift | 0 .../UICollectionView/UICollectionView+Updates.swift | 0 .../UITableView/TableViewDataSource.swift | 0 .../UITableView/TableViewEditingDelegate.swift | 0 .../{ => SimpleSource}/UITableView/TableViewFactory.swift | 0 .../UITableView/TableViewReorderingDelegate.swift | 0 .../UITableView/UITableView+Updates.swift | 0 Sources/{ => SimpleSource}/Updates.swift | 0 Sources/{ => SimpleSource}/Utils/Array+Extensions.swift | 0 Sources/{ => SimpleSource}/Utils/Diff.swift | 0 Tests/{ => SimpleSourceTests}/BasicDataSourceTests.swift | 0 Tests/{ => SimpleSourceTests}/CoreDataSourceTests.swift | 0 .../{ => SimpleSourceTests}/IndexedUpdateHandlerTests.swift | 0 .../TestModel.xcdatamodeld/TestModel.xcdatamodel/contents | 0 Tests/{ => SimpleSourceTests}/UIKitViewUpdateTests.swift | 0 24 files changed, 4 insertions(+), 4 deletions(-) rename Sources/{ => SimpleSource}/BasicData/BasicDataSource.swift (100%) rename Sources/{ => SimpleSource}/BasicData/BasicSection.swift (100%) rename Sources/{ => SimpleSource}/CoreData/CoreDataSource.swift (100%) rename Sources/{ => SimpleSource}/CoreData/FetchDelegate.swift (100%) rename Sources/{ => SimpleSource}/DataSource.swift (100%) rename Sources/{ => SimpleSource}/UICollectionView/CollectionViewDataSource.swift (100%) rename Sources/{ => SimpleSource}/UICollectionView/CollectionViewFactory.swift (100%) rename Sources/{ => SimpleSource}/UICollectionView/CollectionViewReorderingDelegate.swift (100%) rename Sources/{ => SimpleSource}/UICollectionView/UICollectionView+Updates.swift (100%) rename Sources/{ => SimpleSource}/UITableView/TableViewDataSource.swift (100%) rename Sources/{ => SimpleSource}/UITableView/TableViewEditingDelegate.swift (100%) rename Sources/{ => SimpleSource}/UITableView/TableViewFactory.swift (100%) rename Sources/{ => SimpleSource}/UITableView/TableViewReorderingDelegate.swift (100%) rename Sources/{ => SimpleSource}/UITableView/UITableView+Updates.swift (100%) rename Sources/{ => SimpleSource}/Updates.swift (100%) rename Sources/{ => SimpleSource}/Utils/Array+Extensions.swift (100%) rename Sources/{ => SimpleSource}/Utils/Diff.swift (100%) rename Tests/{ => SimpleSourceTests}/BasicDataSourceTests.swift (100%) rename Tests/{ => SimpleSourceTests}/CoreDataSourceTests.swift (100%) rename Tests/{ => SimpleSourceTests}/IndexedUpdateHandlerTests.swift (100%) rename Tests/{Model => SimpleSourceTests/Resources}/TestModel.xcdatamodeld/TestModel.xcdatamodel/contents (100%) rename Tests/{ => SimpleSourceTests}/UIKitViewUpdateTests.swift (100%) diff --git a/Examples/Podfile.lock b/Examples/Podfile.lock index d9a6a49..d32abb9 100644 --- a/Examples/Podfile.lock +++ b/Examples/Podfile.lock @@ -22,7 +22,7 @@ EXTERNAL SOURCES: SPEC CHECKSUMS: Nimble: f8a8219d16f176429b951e8f7e72df5c23ceddc0 Quick: d32871931c05547cb4e0bc9009d66a18b50d8558 - SimpleSource: c096d5fb8c7ec0956c2cf01c8a645828c2efb330 + SimpleSource: e87a36168184399c3bae04ebf87dc52aaf1bfa53 PODFILE CHECKSUM: 5ebdafbbdb9020f19e05fb40cff22a580d64a844 diff --git a/SimpleSource.podspec b/SimpleSource.podspec index 0da44b9..9ea5b27 100644 --- a/SimpleSource.podspec +++ b/SimpleSource.podspec @@ -8,11 +8,11 @@ Pod::Spec.new do |s| s.platform = :ios, '13.0' s.swift_version = '5.7' s.source = { :git => 'https://github.com/Squarespace/simple-source.git', :tag => s.version } - s.source_files = 'Sources/**/*.{h,m,swift}' + s.source_files = 'Sources/' + s.name + '/**/*.{h,m,swift}' s.test_spec 'Tests' do |test_spec| - test_spec.resource = 'Tests/Model/*.xcdatamodeld' - test_spec.source_files = 'Tests/**/*.swift' + test_spec.resource = 'Tests/' + test_spec.name.gsub("/", "") + '/Resources/*.xcdatamodeld' + test_spec.source_files = 'Tests/' + test_spec.name.gsub("/", "") + '/**/*.swift' test_spec.dependency 'Nimble', '~> 12.0' test_spec.dependency 'Quick', '~> 7.0' end diff --git a/Sources/BasicData/BasicDataSource.swift b/Sources/SimpleSource/BasicData/BasicDataSource.swift similarity index 100% rename from Sources/BasicData/BasicDataSource.swift rename to Sources/SimpleSource/BasicData/BasicDataSource.swift diff --git a/Sources/BasicData/BasicSection.swift b/Sources/SimpleSource/BasicData/BasicSection.swift similarity index 100% rename from Sources/BasicData/BasicSection.swift rename to Sources/SimpleSource/BasicData/BasicSection.swift diff --git a/Sources/CoreData/CoreDataSource.swift b/Sources/SimpleSource/CoreData/CoreDataSource.swift similarity index 100% rename from Sources/CoreData/CoreDataSource.swift rename to Sources/SimpleSource/CoreData/CoreDataSource.swift diff --git a/Sources/CoreData/FetchDelegate.swift b/Sources/SimpleSource/CoreData/FetchDelegate.swift similarity index 100% rename from Sources/CoreData/FetchDelegate.swift rename to Sources/SimpleSource/CoreData/FetchDelegate.swift diff --git a/Sources/DataSource.swift b/Sources/SimpleSource/DataSource.swift similarity index 100% rename from Sources/DataSource.swift rename to Sources/SimpleSource/DataSource.swift diff --git a/Sources/UICollectionView/CollectionViewDataSource.swift b/Sources/SimpleSource/UICollectionView/CollectionViewDataSource.swift similarity index 100% rename from Sources/UICollectionView/CollectionViewDataSource.swift rename to Sources/SimpleSource/UICollectionView/CollectionViewDataSource.swift diff --git a/Sources/UICollectionView/CollectionViewFactory.swift b/Sources/SimpleSource/UICollectionView/CollectionViewFactory.swift similarity index 100% rename from Sources/UICollectionView/CollectionViewFactory.swift rename to Sources/SimpleSource/UICollectionView/CollectionViewFactory.swift diff --git a/Sources/UICollectionView/CollectionViewReorderingDelegate.swift b/Sources/SimpleSource/UICollectionView/CollectionViewReorderingDelegate.swift similarity index 100% rename from Sources/UICollectionView/CollectionViewReorderingDelegate.swift rename to Sources/SimpleSource/UICollectionView/CollectionViewReorderingDelegate.swift diff --git a/Sources/UICollectionView/UICollectionView+Updates.swift b/Sources/SimpleSource/UICollectionView/UICollectionView+Updates.swift similarity index 100% rename from Sources/UICollectionView/UICollectionView+Updates.swift rename to Sources/SimpleSource/UICollectionView/UICollectionView+Updates.swift diff --git a/Sources/UITableView/TableViewDataSource.swift b/Sources/SimpleSource/UITableView/TableViewDataSource.swift similarity index 100% rename from Sources/UITableView/TableViewDataSource.swift rename to Sources/SimpleSource/UITableView/TableViewDataSource.swift diff --git a/Sources/UITableView/TableViewEditingDelegate.swift b/Sources/SimpleSource/UITableView/TableViewEditingDelegate.swift similarity index 100% rename from Sources/UITableView/TableViewEditingDelegate.swift rename to Sources/SimpleSource/UITableView/TableViewEditingDelegate.swift diff --git a/Sources/UITableView/TableViewFactory.swift b/Sources/SimpleSource/UITableView/TableViewFactory.swift similarity index 100% rename from Sources/UITableView/TableViewFactory.swift rename to Sources/SimpleSource/UITableView/TableViewFactory.swift diff --git a/Sources/UITableView/TableViewReorderingDelegate.swift b/Sources/SimpleSource/UITableView/TableViewReorderingDelegate.swift similarity index 100% rename from Sources/UITableView/TableViewReorderingDelegate.swift rename to Sources/SimpleSource/UITableView/TableViewReorderingDelegate.swift diff --git a/Sources/UITableView/UITableView+Updates.swift b/Sources/SimpleSource/UITableView/UITableView+Updates.swift similarity index 100% rename from Sources/UITableView/UITableView+Updates.swift rename to Sources/SimpleSource/UITableView/UITableView+Updates.swift diff --git a/Sources/Updates.swift b/Sources/SimpleSource/Updates.swift similarity index 100% rename from Sources/Updates.swift rename to Sources/SimpleSource/Updates.swift diff --git a/Sources/Utils/Array+Extensions.swift b/Sources/SimpleSource/Utils/Array+Extensions.swift similarity index 100% rename from Sources/Utils/Array+Extensions.swift rename to Sources/SimpleSource/Utils/Array+Extensions.swift diff --git a/Sources/Utils/Diff.swift b/Sources/SimpleSource/Utils/Diff.swift similarity index 100% rename from Sources/Utils/Diff.swift rename to Sources/SimpleSource/Utils/Diff.swift diff --git a/Tests/BasicDataSourceTests.swift b/Tests/SimpleSourceTests/BasicDataSourceTests.swift similarity index 100% rename from Tests/BasicDataSourceTests.swift rename to Tests/SimpleSourceTests/BasicDataSourceTests.swift diff --git a/Tests/CoreDataSourceTests.swift b/Tests/SimpleSourceTests/CoreDataSourceTests.swift similarity index 100% rename from Tests/CoreDataSourceTests.swift rename to Tests/SimpleSourceTests/CoreDataSourceTests.swift diff --git a/Tests/IndexedUpdateHandlerTests.swift b/Tests/SimpleSourceTests/IndexedUpdateHandlerTests.swift similarity index 100% rename from Tests/IndexedUpdateHandlerTests.swift rename to Tests/SimpleSourceTests/IndexedUpdateHandlerTests.swift diff --git a/Tests/Model/TestModel.xcdatamodeld/TestModel.xcdatamodel/contents b/Tests/SimpleSourceTests/Resources/TestModel.xcdatamodeld/TestModel.xcdatamodel/contents similarity index 100% rename from Tests/Model/TestModel.xcdatamodeld/TestModel.xcdatamodel/contents rename to Tests/SimpleSourceTests/Resources/TestModel.xcdatamodeld/TestModel.xcdatamodel/contents diff --git a/Tests/UIKitViewUpdateTests.swift b/Tests/SimpleSourceTests/UIKitViewUpdateTests.swift similarity index 100% rename from Tests/UIKitViewUpdateTests.swift rename to Tests/SimpleSourceTests/UIKitViewUpdateTests.swift From d5de0307b82383fa49fdfeed6b429e049e66f079 Mon Sep 17 00:00:00 2001 From: Andrey Vyazovoy Date: Mon, 30 Oct 2023 18:02:05 -0400 Subject: [PATCH 4/7] Add missing imports --- Examples/SimpleSourceExample/Colors.swift | 1 + Tests/SimpleSourceTests/BasicDataSourceTests.swift | 5 +++-- Tests/SimpleSourceTests/CoreDataSourceTests.swift | 7 ++++--- Tests/SimpleSourceTests/IndexedUpdateHandlerTests.swift | 3 ++- Tests/SimpleSourceTests/UIKitViewUpdateTests.swift | 4 ++-- 5 files changed, 12 insertions(+), 8 deletions(-) diff --git a/Examples/SimpleSourceExample/Colors.swift b/Examples/SimpleSourceExample/Colors.swift index 8edb1ee..a0ca5c9 100644 --- a/Examples/SimpleSourceExample/Colors.swift +++ b/Examples/SimpleSourceExample/Colors.swift @@ -1,5 +1,6 @@ import Foundation import SimpleSource +import UIKit // MARK: Sections diff --git a/Tests/SimpleSourceTests/BasicDataSourceTests.swift b/Tests/SimpleSourceTests/BasicDataSourceTests.swift index 019781a..1a84a03 100644 --- a/Tests/SimpleSourceTests/BasicDataSourceTests.swift +++ b/Tests/SimpleSourceTests/BasicDataSourceTests.swift @@ -1,6 +1,7 @@ -import Quick +import Foundation import Nimble -import SimpleSource +import Quick +@testable import SimpleSource class BasicDataSourceTests: QuickSpec { diff --git a/Tests/SimpleSourceTests/CoreDataSourceTests.swift b/Tests/SimpleSourceTests/CoreDataSourceTests.swift index d469bd2..326b727 100644 --- a/Tests/SimpleSourceTests/CoreDataSourceTests.swift +++ b/Tests/SimpleSourceTests/CoreDataSourceTests.swift @@ -1,7 +1,8 @@ -import Quick -import Nimble -import SimpleSource import CoreData +import Foundation +import Nimble +import Quick +@testable import SimpleSource private let StoreFilename = "SimpleSource-UnitTest-Store" diff --git a/Tests/SimpleSourceTests/IndexedUpdateHandlerTests.swift b/Tests/SimpleSourceTests/IndexedUpdateHandlerTests.swift index f13ac6f..760a9fb 100644 --- a/Tests/SimpleSourceTests/IndexedUpdateHandlerTests.swift +++ b/Tests/SimpleSourceTests/IndexedUpdateHandlerTests.swift @@ -1,5 +1,6 @@ -import Quick +import Foundation import Nimble +import Quick @testable import SimpleSource class IndexedUpdateHandlerTests: QuickSpec { diff --git a/Tests/SimpleSourceTests/UIKitViewUpdateTests.swift b/Tests/SimpleSourceTests/UIKitViewUpdateTests.swift index e44f2df..002ba0f 100644 --- a/Tests/SimpleSourceTests/UIKitViewUpdateTests.swift +++ b/Tests/SimpleSourceTests/UIKitViewUpdateTests.swift @@ -1,6 +1,6 @@ -import UIKit -import Quick import Nimble +import Quick +import UIKit @testable import SimpleSource protocol DataSourceUpdateable: UIViewController { From 8363276d8531880f3744c19fcf2271fc8d3e08b3 Mon Sep 17 00:00:00 2001 From: Andrey Vyazovoy Date: Mon, 30 Oct 2023 18:02:46 -0400 Subject: [PATCH 5/7] Add SPM support --- Package.resolved | 41 +++++++++++++++++++ Package.swift | 33 +++++++++++++++ README.md | 23 +++++++++++ .../CoreDataSourceTests.swift | 11 ++++- 4 files changed, 106 insertions(+), 2 deletions(-) create mode 100644 Package.resolved create mode 100644 Package.swift diff --git a/Package.resolved b/Package.resolved new file mode 100644 index 0000000..5b2020a --- /dev/null +++ b/Package.resolved @@ -0,0 +1,41 @@ +{ + "pins" : [ + { + "identity" : "cwlcatchexception", + "kind" : "remoteSourceControl", + "location" : "https://github.com/mattgallagher/CwlCatchException.git", + "state" : { + "revision" : "3b123999de19bf04905bc1dfdb76f817b0f2cc00", + "version" : "2.1.2" + } + }, + { + "identity" : "cwlpreconditiontesting", + "kind" : "remoteSourceControl", + "location" : "https://github.com/mattgallagher/CwlPreconditionTesting.git", + "state" : { + "revision" : "a23ded2c91df9156628a6996ab4f347526f17b6b", + "version" : "2.1.2" + } + }, + { + "identity" : "nimble", + "kind" : "remoteSourceControl", + "location" : "https://github.com/Quick/Nimble", + "state" : { + "revision" : "edaedc1ec86f14ac6e2ca495b94f0ff7150d98d0", + "version" : "12.3.0" + } + }, + { + "identity" : "quick", + "kind" : "remoteSourceControl", + "location" : "https://github.com/Quick/Quick", + "state" : { + "revision" : "ef9aaf3f634b3a1ab6f54f1173fe2400b36e7cb8", + "version" : "7.3.0" + } + } + ], + "version" : 2 +} diff --git a/Package.swift b/Package.swift new file mode 100644 index 0000000..6d5d5b3 --- /dev/null +++ b/Package.swift @@ -0,0 +1,33 @@ +// swift-tools-version: 5.7 + +import PackageDescription + +let package = Package( + name: "swift-simple-source", + platforms: [ + .iOS(.v13) + ], + products: [ + .library( + name: "SimpleSource", + targets: ["SimpleSource"] + ), + ], + dependencies: [ + .package(url: "https://github.com/Quick/Quick", from: "7.3.0"), + .package(url: "https://github.com/Quick/Nimble", from: "12.3.0"), + ], + targets: [ + .target( + name: "SimpleSource" + ), + .testTarget( + name: "SimpleSourceTests", + dependencies: [ + "SimpleSource", + .product(name: "Quick", package: "Quick"), + .product(name: "Nimble", package: "Nimble"), + ] + ), + ] +) diff --git a/README.md b/README.md index 88c8b24..9a3d1cf 100644 --- a/README.md +++ b/README.md @@ -159,6 +159,29 @@ pod 'SimpleSource' Then run the command `pod install` to add SimpleSource to your workspace. +### Swift Package Manager + +The [Swift Package Manager](https://swift.org/package-manager/) is a tool for automating the distribution of Swift code and is integrated into the `swift` compiler. + +You can add SimpleSource to an Xcode project by adding it as a package dependency. + + 1. From the **File** menu, select **Add Packages...** + 1. Enter "https://github.com/Squarespace/simple-source" into the package repository URL text field + 1. Depending on how your project is structured: + - If you have a single application target that needs access to the library, then add + **SimpleSource** directly to your application. + - If you want to use this library from multiple Xcode targets, or mix Xcode targets and SPM + targets, you must create a shared framework that depends on **SimpleSource** and + then depend on that framework in all of your targets. + +If you developing a package, adding SimpleSource as a dependency is as easy as adding it to the `dependencies` value of your `Package.swift`. + +```swift +dependencies: [ + .package(url: "https://github.com/Squarespace/simple-source", from: "3.0.1") +] +``` + ## Getting Started We will build a simple example, showing a table of employees grouped by department. diff --git a/Tests/SimpleSourceTests/CoreDataSourceTests.swift b/Tests/SimpleSourceTests/CoreDataSourceTests.swift index 326b727..6d2b03c 100644 --- a/Tests/SimpleSourceTests/CoreDataSourceTests.swift +++ b/Tests/SimpleSourceTests/CoreDataSourceTests.swift @@ -7,9 +7,16 @@ import Quick private let StoreFilename = "SimpleSource-UnitTest-Store" class CoreDataSourceTests: QuickSpec { - + static let bundle: Bundle = { + #if SWIFT_PACKAGE + .module + #else + .init(for: CoreDataSourceTests.self) + #endif + }() + static var model: NSManagedObjectModel = { - let modelURL = Bundle(for: CoreDataSourceTests.self).url(forResource: "TestModel", withExtension: "momd")! + let modelURL = bundle.url(forResource: "TestModel", withExtension: "momd")! return NSManagedObjectModel(contentsOf: modelURL)! }() From a01a6138aff8b65f9de27e3d50cafcccb3c448cb Mon Sep 17 00:00:00 2001 From: Andrey Vyazovoy Date: Mon, 30 Oct 2023 22:27:20 -0400 Subject: [PATCH 6/7] Switch `SimpleSourceExample` project to SPM --- Examples/Podfile | 22 ----- Examples/Podfile.lock | 29 ------ .../project.pbxproj | 90 +++++-------------- .../xcschemes/SimpleSourceExample.xcscheme | 31 +------ .../contents.xcworkspacedata | 3 - README.md | 4 - 6 files changed, 26 insertions(+), 153 deletions(-) delete mode 100644 Examples/Podfile delete mode 100644 Examples/Podfile.lock diff --git a/Examples/Podfile b/Examples/Podfile deleted file mode 100644 index 8137d56..0000000 --- a/Examples/Podfile +++ /dev/null @@ -1,22 +0,0 @@ -platform :ios, '13.0' - -target 'SimpleSourceExample' do - use_frameworks! - - pod 'SimpleSource', :path => '..', :testspecs => ['Tests'] -end - -def inherit_project_deployment_target(installer) - ios_min_deployment_target = "13.0" - puts "Bumping pods iOS deployment target to the minimal available (#{ios_min_deployment_target})" - installer.pods_project.targets.each do |target| - if target.platform_name == :ios && target.deployment_target.to_f < ios_min_deployment_target.to_f - puts "\t#{target.name} has iOS deployment target set to #{target.deployment_target}. Bumping to #{ios_min_deployment_target}" - target.deployment_target = ios_min_deployment_target - end - end -end - -post_install do |installer| - inherit_project_deployment_target(installer) -end diff --git a/Examples/Podfile.lock b/Examples/Podfile.lock deleted file mode 100644 index d32abb9..0000000 --- a/Examples/Podfile.lock +++ /dev/null @@ -1,29 +0,0 @@ -PODS: - - Nimble (12.3.0) - - Quick (7.3.0) - - SimpleSource (3.0.1) - - SimpleSource/Tests (3.0.1): - - Nimble (~> 12.0) - - Quick (~> 7.0) - -DEPENDENCIES: - - SimpleSource (from `..`) - - SimpleSource/Tests (from `..`) - -SPEC REPOS: - trunk: - - Nimble - - Quick - -EXTERNAL SOURCES: - SimpleSource: - :path: ".." - -SPEC CHECKSUMS: - Nimble: f8a8219d16f176429b951e8f7e72df5c23ceddc0 - Quick: d32871931c05547cb4e0bc9009d66a18b50d8558 - SimpleSource: e87a36168184399c3bae04ebf87dc52aaf1bfa53 - -PODFILE CHECKSUM: 5ebdafbbdb9020f19e05fb40cff22a580d64a844 - -COCOAPODS: 1.13.0 diff --git a/Examples/SimpleSourceExample.xcodeproj/project.pbxproj b/Examples/SimpleSourceExample.xcodeproj/project.pbxproj index f28422b..a153d45 100644 --- a/Examples/SimpleSourceExample.xcodeproj/project.pbxproj +++ b/Examples/SimpleSourceExample.xcodeproj/project.pbxproj @@ -3,11 +3,11 @@ archiveVersion = 1; classes = { }; - objectVersion = 56; + objectVersion = 60; objects = { /* Begin PBXBuildFile section */ - 1125C4B111C313BADE9DEE27 /* Pods_SimpleSourceExample.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E03B72459B7D8A89ED6D1A29 /* Pods_SimpleSourceExample.framework */; }; + 62FF82AA2AF09C9500C7EB61 /* SimpleSource in Frameworks */ = {isa = PBXBuildFile; productRef = 62FF82A92AF09C9500C7EB61 /* SimpleSource */; }; C424C2691E3B4B2900CEE8C0 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = C424C2681E3B4B2900CEE8C0 /* AppDelegate.swift */; }; C424C26B1E3B4B2900CEE8C0 /* ColorTableViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = C424C26A1E3B4B2900CEE8C0 /* ColorTableViewController.swift */; }; C424C26E1E3B4B2900CEE8C0 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = C424C26C1E3B4B2900CEE8C0 /* Main.storyboard */; }; @@ -35,8 +35,6 @@ /* End PBXBuildFile section */ /* Begin PBXFileReference section */ - 65333953768EE8F03228185B /* Pods-SimpleSourceExample.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SimpleSourceExample.debug.xcconfig"; path = "Pods/Target Support Files/Pods-SimpleSourceExample/Pods-SimpleSourceExample.debug.xcconfig"; sourceTree = ""; }; - 8C2328A1D61B2AA900671F49 /* Pods-SimpleSourceExample.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SimpleSourceExample.release.xcconfig"; path = "Pods/Target Support Files/Pods-SimpleSourceExample/Pods-SimpleSourceExample.release.xcconfig"; sourceTree = ""; }; C424C2651E3B4B2900CEE8C0 /* SimpleSourceExample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = SimpleSourceExample.app; sourceTree = BUILT_PRODUCTS_DIR; }; C424C2681E3B4B2900CEE8C0 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; C424C26A1E3B4B2900CEE8C0 /* ColorTableViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ColorTableViewController.swift; sourceTree = ""; }; @@ -63,7 +61,6 @@ C424C2AB1E3D1B1600CEE8C0 /* characters.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = characters.json; sourceTree = ""; }; C4847CC4200388DD00841DBA /* ItemListTableViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ItemListTableViewController.swift; sourceTree = ""; }; C4E8EA791EABC18300D5EE1D /* ReorderingColorGridViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ReorderingColorGridViewController.swift; sourceTree = ""; }; - E03B72459B7D8A89ED6D1A29 /* Pods_SimpleSourceExample.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_SimpleSourceExample.framework; sourceTree = BUILT_PRODUCTS_DIR; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -71,37 +68,18 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 1125C4B111C313BADE9DEE27 /* Pods_SimpleSourceExample.framework in Frameworks */, + 62FF82AA2AF09C9500C7EB61 /* SimpleSource in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ - 5D1976861E89CF5DB8542DB1 /* Pods */ = { - isa = PBXGroup; - children = ( - 65333953768EE8F03228185B /* Pods-SimpleSourceExample.debug.xcconfig */, - 8C2328A1D61B2AA900671F49 /* Pods-SimpleSourceExample.release.xcconfig */, - ); - name = Pods; - sourceTree = ""; - }; - 6C8F20F1EEC12F51A1D3E66B /* Frameworks */ = { - isa = PBXGroup; - children = ( - E03B72459B7D8A89ED6D1A29 /* Pods_SimpleSourceExample.framework */, - ); - name = Frameworks; - sourceTree = ""; - }; C424C25C1E3B4B2900CEE8C0 = { isa = PBXGroup; children = ( C424C2671E3B4B2900CEE8C0 /* SimpleSourceExample */, C424C2661E3B4B2900CEE8C0 /* Products */, - 5D1976861E89CF5DB8542DB1 /* Pods */, - 6C8F20F1EEC12F51A1D3E66B /* Frameworks */, ); sourceTree = ""; }; @@ -264,17 +242,18 @@ isa = PBXNativeTarget; buildConfigurationList = C424C2771E3B4B2900CEE8C0 /* Build configuration list for PBXNativeTarget "SimpleSourceExample" */; buildPhases = ( - C9493BAEA1942A5FAEECDEE7 /* [CP] Check Pods Manifest.lock */, C424C2611E3B4B2900CEE8C0 /* Sources */, C424C2621E3B4B2900CEE8C0 /* Frameworks */, C424C2631E3B4B2900CEE8C0 /* Resources */, - 61726B5B8A96F790C3CA8367 /* [CP] Embed Pods Frameworks */, ); buildRules = ( ); dependencies = ( ); name = SimpleSourceExample; + packageProductDependencies = ( + 62FF82A92AF09C9500C7EB61 /* SimpleSource */, + ); productName = SimpleSourceExample; productReference = C424C2651E3B4B2900CEE8C0 /* SimpleSourceExample.app */; productType = "com.apple.product-type.application"; @@ -306,6 +285,9 @@ Base, ); mainGroup = C424C25C1E3B4B2900CEE8C0; + packageReferences = ( + 62FF82A82AF09C7600C7EB61 /* XCLocalSwiftPackageReference ".." */, + ); productRefGroup = C424C2661E3B4B2900CEE8C0 /* Products */; projectDirPath = ""; projectRoot = ""; @@ -330,44 +312,6 @@ }; /* End PBXResourcesBuildPhase section */ -/* Begin PBXShellScriptBuildPhase section */ - 61726B5B8A96F790C3CA8367 /* [CP] Embed Pods Frameworks */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-SimpleSourceExample/Pods-SimpleSourceExample-frameworks-${CONFIGURATION}-input-files.xcfilelist", - ); - name = "[CP] Embed Pods Frameworks"; - outputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-SimpleSourceExample/Pods-SimpleSourceExample-frameworks-${CONFIGURATION}-output-files.xcfilelist", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-SimpleSourceExample/Pods-SimpleSourceExample-frameworks.sh\"\n"; - showEnvVarsInLog = 0; - }; - C9493BAEA1942A5FAEECDEE7 /* [CP] Check Pods Manifest.lock */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - "${PODS_PODFILE_DIR_PATH}/Podfile.lock", - "${PODS_ROOT}/Manifest.lock", - ); - name = "[CP] Check Pods Manifest.lock"; - outputPaths = ( - "$(DERIVED_FILE_DIR)/Pods-SimpleSourceExample-checkManifestLockResult.txt", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; - showEnvVarsInLog = 0; - }; -/* End PBXShellScriptBuildPhase section */ - /* Begin PBXSourcesBuildPhase section */ C424C2611E3B4B2900CEE8C0 /* Sources */ = { isa = PBXSourcesBuildPhase; @@ -539,7 +483,6 @@ }; C424C2781E3B4B2900CEE8C0 /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 65333953768EE8F03228185B /* Pods-SimpleSourceExample.debug.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; INFOPLIST_FILE = SimpleSourceExample/Info.plist; @@ -554,7 +497,6 @@ }; C424C2791E3B4B2900CEE8C0 /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 8C2328A1D61B2AA900671F49 /* Pods-SimpleSourceExample.release.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; INFOPLIST_FILE = SimpleSourceExample/Info.plist; @@ -590,6 +532,20 @@ }; /* End XCConfigurationList section */ +/* Begin XCLocalSwiftPackageReference section */ + 62FF82A82AF09C7600C7EB61 /* XCLocalSwiftPackageReference ".." */ = { + isa = XCLocalSwiftPackageReference; + relativePath = ..; + }; +/* End XCLocalSwiftPackageReference section */ + +/* Begin XCSwiftPackageProductDependency section */ + 62FF82A92AF09C9500C7EB61 /* SimpleSource */ = { + isa = XCSwiftPackageProductDependency; + productName = SimpleSource; + }; +/* End XCSwiftPackageProductDependency section */ + /* Begin XCVersionGroup section */ C424C29D1E3D030600CEE8C0 /* CharacterModel.xcdatamodeld */ = { isa = XCVersionGroup; diff --git a/Examples/SimpleSourceExample.xcodeproj/xcshareddata/xcschemes/SimpleSourceExample.xcscheme b/Examples/SimpleSourceExample.xcodeproj/xcshareddata/xcschemes/SimpleSourceExample.xcscheme index 2bd5568..f210301 100644 --- a/Examples/SimpleSourceExample.xcodeproj/xcshareddata/xcschemes/SimpleSourceExample.xcscheme +++ b/Examples/SimpleSourceExample.xcodeproj/xcshareddata/xcschemes/SimpleSourceExample.xcscheme @@ -1,7 +1,7 @@ + version = "1.7"> @@ -20,20 +20,6 @@ ReferencedContainer = "container:SimpleSourceExample.xcodeproj"> - - - - + codeCoverageEnabled = "YES" + shouldAutocreateTestPlan = "YES"> - - - - - - - - diff --git a/README.md b/README.md index 9a3d1cf..7932dd3 100644 --- a/README.md +++ b/README.md @@ -18,9 +18,7 @@ Run the example app. Navigate the UI and see how little code is in each view con Then come back here to learn more. ```sh -bundle install cd Examples/ -bundle exec pod install open SimpleSourceExample.xcworkspace ``` @@ -379,9 +377,7 @@ There is a playground and an example project in the `Examples/` directory. To try it out, run the following commands: ```sh -bundle install cd Examples/ -bundle exec pod install open SimpleSourceExamples.xcworkspace ``` From a14c9e799ce56983f0601f3bead933c35736650a Mon Sep 17 00:00:00 2001 From: Andrey Vyazovoy Date: Mon, 30 Oct 2023 22:32:22 -0400 Subject: [PATCH 7/7] Add CI steps for SPM test run --- .github/workflows/ci.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a82ec8c..9ea2bb4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -38,3 +38,13 @@ jobs: with: name: test_artifacts path: ${{ steps.define_validation_dir.outputs.path }} + + - name: Install xcbeautify + run: brew install xcbeautify + + - name: Run SPM unit tests + run: | + xcodebuild test \ + -scheme swift-simple-source \ + -destination 'platform=iOS Simulator,name=iPhone SE (3rd generation),OS=latest' \ + | xcbeautify