Dpendencies update + improved dependencies version management (#721)

* updating dependencies

* minor version pinning

* update completed and also added a tool that checks for outdated swiftpm packages

* changelog

* DTCoreText uses exact version

* minor version for analytics

* pushing OutdatedPackages

* package.swift for the repo also using upToNextMinor

* fixing a typo

* Update Tools/Sources/OutdatedPackages.swift

Co-authored-by: Doug <6060466+pixlwave@users.noreply.github.com>

* Update Tools/Sources/SetupProject.swift

Co-authored-by: Doug <6060466+pixlwave@users.noreply.github.com>

* removing unused comment

* removed trailing comma

---------

Co-authored-by: Doug <6060466+pixlwave@users.noreply.github.com>
This commit is contained in:
Mauro 2023-03-23 11:26:20 +01:00 committed by GitHub
parent e696280e69
commit ca319e0bfe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 74 additions and 49 deletions

View File

@ -30,8 +30,8 @@
"kind" : "remoteSourceControl", "kind" : "remoteSourceControl",
"location" : "https://github.com/devicekit/DeviceKit", "location" : "https://github.com/devicekit/DeviceKit",
"state" : { "state" : {
"revision" : "d37e70cb2646666dcf276d7d3d4a9760a41ff8a6", "revision" : "691fe8112cca20ebf0020a1709d4e0205400311c",
"version" : "4.9.0" "version" : "5.0.0"
} }
}, },
{ {
@ -84,8 +84,8 @@
"kind" : "remoteSourceControl", "kind" : "remoteSourceControl",
"location" : "https://github.com/onevcat/Kingfisher", "location" : "https://github.com/onevcat/Kingfisher",
"state" : { "state" : {
"revision" : "44e891bdb61426a95e31492a67c7c0dfad1f87c5", "revision" : "af4be924ad984cf4d16f4ae4df424e79a443d435",
"version" : "7.4.1" "version" : "7.6.2"
} }
}, },
{ {
@ -102,8 +102,8 @@
"kind" : "remoteSourceControl", "kind" : "remoteSourceControl",
"location" : "https://github.com/matrix-org/matrix-analytics-events", "location" : "https://github.com/matrix-org/matrix-analytics-events",
"state" : { "state" : {
"revision" : "94598bd8ef3aa2a3d3848c656c37d5e95b6b1cff", "revision" : "2f5fa5f1e2f6c6ae1a47c33d953a3ce289167eb0",
"version" : "0.4.0" "version" : "0.5.0"
} }
}, },
{ {
@ -120,8 +120,8 @@
"kind" : "remoteSourceControl", "kind" : "remoteSourceControl",
"location" : "https://github.com/PostHog/posthog-ios", "location" : "https://github.com/PostHog/posthog-ios",
"state" : { "state" : {
"revision" : "d3177a24686ead147f5e4ff4d7e284ca4be33870", "revision" : "5962d97f30dbe85f8591ee5ba64f671c6bf1770a",
"version" : "1.4.4" "version" : "2.0.1"
} }
}, },
{ {
@ -129,8 +129,8 @@
"kind" : "remoteSourceControl", "kind" : "remoteSourceControl",
"location" : "https://github.com/getsentry/sentry-cocoa", "location" : "https://github.com/getsentry/sentry-cocoa",
"state" : { "state" : {
"revision" : "2e7899aff930ed3b8d81be1909492f7684bbd481", "revision" : "3fc79ea6ebcfd726e48bea1d98f89bc3a32d5cf2",
"version" : "8.3.1" "version" : "8.3.2"
} }
}, },
{ {
@ -163,10 +163,10 @@
{ {
"identity" : "swift-snapshot-testing", "identity" : "swift-snapshot-testing",
"kind" : "remoteSourceControl", "kind" : "remoteSourceControl",
"location" : "https://github.com/pointfreeco/swift-snapshot-testing.git", "location" : "https://github.com/pointfreeco/swift-snapshot-testing",
"state" : { "state" : {
"revision" : "f29e2014f6230cf7d5138fc899da51c7f513d467", "revision" : "cef5b3f6f11781dd4591bdd1dd0a3d22bd609334",
"version" : "1.10.0" "version" : "1.11.0"
} }
}, },
{ {
@ -192,8 +192,8 @@
"kind" : "remoteSourceControl", "kind" : "remoteSourceControl",
"location" : "https://github.com/SwiftyBeaver/SwiftyBeaver", "location" : "https://github.com/SwiftyBeaver/SwiftyBeaver",
"state" : { "state" : {
"revision" : "12b5acf96d98f91d50de447369bd18df74600f1a", "revision" : "1080914828ef1c9ca9cd2bad50667b3d847dabff",
"version" : "1.9.6" "version" : "2.0.0"
} }
}, },
{ {

View File

@ -71,7 +71,7 @@ public class MXLog: NSObject {
function: String = #function, function: String = #function,
line: Int = #line, line: Int = #line,
context: Any? = nil) { context: Any? = nil) {
logger.verbose(message(), file, function, line: line, context: context) logger.verbose(message(), file: file, function: function, line: line, context: context)
} }
public static func debug(_ message: @autoclosure () -> Any, public static func debug(_ message: @autoclosure () -> Any,
@ -79,7 +79,7 @@ public class MXLog: NSObject {
function: String = #function, function: String = #function,
line: Int = #line, line: Int = #line,
context: Any? = nil) { context: Any? = nil) {
logger.debug(message(), file, function, line: line, context: context) logger.debug(message(), file: file, function: function, line: line, context: context)
} }
public static func info(_ message: @autoclosure () -> Any, public static func info(_ message: @autoclosure () -> Any,
@ -87,7 +87,7 @@ public class MXLog: NSObject {
function: String = #function, function: String = #function,
line: Int = #line, line: Int = #line,
context: Any? = nil) { context: Any? = nil) {
logger.info(message(), file, function, line: line, context: context) logger.info(message(), file: file, function: function, line: line, context: context)
} }
public static func warning(_ message: @autoclosure () -> Any, public static func warning(_ message: @autoclosure () -> Any,
@ -95,7 +95,7 @@ public class MXLog: NSObject {
function: String = #function, function: String = #function,
line: Int = #line, line: Int = #line,
context: Any? = nil) { context: Any? = nil) {
logger.warning(message(), file, function, line: line, context: context) logger.warning(message(), file: file, function: function, line: line, context: context)
} }
/// Log error with additional details /// Log error with additional details
@ -108,7 +108,7 @@ public class MXLog: NSObject {
function: String = #function, function: String = #function,
line: Int = #line, line: Int = #line,
context: Any? = nil) { context: Any? = nil) {
logger.error(message(), file, function, line: line, context: context) logger.error(message(), file: file, function: function, line: line, context: context)
} }
/// Log failure with additional details /// Log failure with additional details
@ -124,7 +124,7 @@ public class MXLog: NSObject {
function: String = #function, function: String = #function,
line: Int = #line, line: Int = #line,
context: Any? = nil) { context: Any? = nil) {
logger.error(message, file, function, line: line, context: context) logger.error(message, file: file, function: function, line: line, context: context)
#if DEBUG #if DEBUG
assertionFailure("\(message)") assertionFailure("\(message)")
#endif #endif

View File

@ -96,7 +96,7 @@ targets:
if which sourcery >/dev/null; then if which sourcery >/dev/null; then
sourcery --config Tools/Sourcery/sourcery_automockable_config.yml sourcery --config Tools/Sourcery/sourcery_automockable_config.yml
else else
echo "warning: Sourcert not installed, run swift run tools setup-project" echo "warning: Sourcery not installed, run swift run tools setup-project"
fi fi
postBuildScripts: postBuildScripts:

View File

@ -5,17 +5,17 @@
"kind" : "remoteSourceControl", "kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-argument-parser", "location" : "https://github.com/apple/swift-argument-parser",
"state" : { "state" : {
"revision" : "fddd1c00396eed152c45a46bea9f47b98e59301d", "revision" : "fee6933f37fde9a5e12a1e4aeaa93fe60116ff2a",
"version" : "1.2.0" "version" : "1.2.2"
} }
}, },
{ {
"identity" : "yams", "identity" : "yams",
"kind" : "remoteSourceControl", "kind" : "remoteSourceControl",
"location" : "https://github.com/jpsim/Yams.git", "location" : "https://github.com/jpsim/Yams",
"state" : { "state" : {
"revision" : "01835dc202670b5bb90d07f3eae41867e9ed29f6", "revision" : "f47ba4838c30dbd59998a4e4c87ab620ff959e8a",
"version" : "5.0.1" "version" : "5.0.5"
} }
} }
], ],

View File

@ -12,8 +12,8 @@ let package = Package(
.executable(name: "tools", targets: ["Tools"]) .executable(name: "tools", targets: ["Tools"])
], ],
dependencies: [ dependencies: [
.package(url: "https://github.com/apple/swift-argument-parser", from: "1.2.0"), .package(url: "https://github.com/apple/swift-argument-parser", .upToNextMinor(from: "1.2.0")),
.package(url: "https://github.com/jpsim/Yams", from: "5.0.1") .package(url: "https://github.com/jpsim/Yams", .upToNextMinor(from: "5.0.0"))
], ],
targets: [ targets: [
.executableTarget(name: "Tools", .executableTarget(name: "Tools",

View File

@ -0,0 +1,23 @@
import ArgumentParser
import Foundation
struct OutdatedPackages: ParsableCommand {
static var configuration = CommandConfiguration(abstract: "A tool to check outdated package dependencies. Please make sure you have already run setup-project before using this tool.")
private var projectSwiftPMDirectoryURL: URL { Utilities.projectDirectoryURL.appending(path: "ElementX.xcodeproj/project.xcworkspace/xcshareddata/swiftpm") }
func run() throws {
try checkToolsDependencies()
try checkProjectDependencies()
}
func checkToolsDependencies() throws {
guard let output = try Utilities.zsh("swift outdated"), !output.isEmpty else { return }
print("outdated tools Swift packages:\n\(output)")
}
func checkProjectDependencies() throws {
guard let output = try Utilities.zsh("swift outdated", workingDirectoryURL: projectSwiftPMDirectoryURL), !output.isEmpty else { return }
print("outdated project Swift packages:\n\(output)")
}
}

View File

@ -15,7 +15,7 @@ struct SetupProject: ParsableCommand {
} }
func brewBundleInstall() throws { func brewBundleInstall() throws {
try Utilities.zsh("brew install xcodegen swiftgen swiftlint swiftformat git-lfs sourcery") try Utilities.zsh("brew install xcodegen swiftgen swiftlint swiftformat git-lfs sourcery kiliankoe/formulae/swift-outdated")
} }
func xcodegen() throws { func xcodegen() throws {

View File

@ -5,5 +5,6 @@ import Foundation
struct Tools: ParsableCommand { struct Tools: ParsableCommand {
static var configuration = CommandConfiguration(abstract: "A collection of command line tools for ElementX", static var configuration = CommandConfiguration(abstract: "A collection of command line tools for ElementX",
subcommands: [BuildSDK.self, subcommands: [BuildSDK.self,
SetupProject.self]) SetupProject.self,
OutdatedPackages.self])
} }

View File

@ -0,0 +1 @@
Updated dependencies, and added a tool to check for outdated ones.

View File

@ -52,52 +52,52 @@ packages:
# path: ../compound-ios # path: ../compound-ios
Algorithms: Algorithms:
url: https://github.com/apple/swift-algorithms url: https://github.com/apple/swift-algorithms
majorVersion: 1.0.0 minorVersion: 1.0.0
AnalyticsEvents: AnalyticsEvents:
url: https://github.com/matrix-org/matrix-analytics-events url: https://github.com/matrix-org/matrix-analytics-events
exactVersion: 0.4.0 minorVersion: 0.5.0
AppAuth: AppAuth:
url: https://github.com/openid/AppAuth-iOS url: https://github.com/openid/AppAuth-iOS
majorVersion: 1.5.0 minorVersion: 1.6.0
Collections: Collections:
url: https://github.com/apple/swift-collections url: https://github.com/apple/swift-collections
majorVersion: 1.0.4 minorVersion: 1.0.0
DeviceKit: DeviceKit:
url: https://github.com/devicekit/DeviceKit url: https://github.com/devicekit/DeviceKit
majorVersion: 4.7.0 minorVersion: 5.0.0
DTCoreText: DTCoreText:
url: https://github.com/Cocoanetics/DTCoreText url: https://github.com/Cocoanetics/DTCoreText
majorVersion: 1.6.26 exactVersion: 1.6.26
KeychainAccess: KeychainAccess:
url: https://github.com/kishikawakatsumi/KeychainAccess url: https://github.com/kishikawakatsumi/KeychainAccess
majorVersion: 4.2.2 minorVersion: 4.2.0
Kingfisher: Kingfisher:
url: https://github.com/onevcat/Kingfisher url: https://github.com/onevcat/Kingfisher
majorVersion: 7.2.0 minorVersion: 7.6.0
KZFileWatchers: KZFileWatchers:
url: https://github.com/krzysztofzablocki/KZFileWatchers url: https://github.com/krzysztofzablocki/KZFileWatchers
branch: master branch: master
Introspect: Introspect:
url: https://github.com/siteline/SwiftUI-Introspect url: https://github.com/siteline/SwiftUI-Introspect
majorVersion: 0.2.3 minorVersion: 0.2.0
PostHog: PostHog:
url: https://github.com/PostHog/posthog-ios url: https://github.com/PostHog/posthog-ios
majorVersion: 1.4.4 minorVersion: 2.0.0
SwiftyBeaver: SwiftyBeaver:
url: https://github.com/SwiftyBeaver/SwiftyBeaver url: https://github.com/SwiftyBeaver/SwiftyBeaver
majorVersion: 1.9.5 minorVersion: 2.0.0
SwiftState: SwiftState:
url: https://github.com/ReactKit/SwiftState url: https://github.com/ReactKit/SwiftState
majorVersion: 6.0.0 minorVersion: 6.0.0
GZIP: GZIP:
url: https://github.com/nicklockwood/GZIP url: https://github.com/nicklockwood/GZIP
majorVersion: 1.3.0 minorVersion: 1.3.0
Sentry: Sentry:
url: https://github.com/getsentry/sentry-cocoa url: https://github.com/getsentry/sentry-cocoa
majorVersion: 8.3.1 minorVersion: 8.3.0
SnapshotTesting: SnapshotTesting:
url: https://github.com/pointfreeco/swift-snapshot-testing url: https://github.com/pointfreeco/swift-snapshot-testing
majorVersion: 1.10.0 minorVersion: 1.11.0
Version: Version:
url: https://github.com/mxcl/Version url: https://github.com/mxcl/Version
majorVersion: 2.0.1 minorVersion: 2.0.0