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

View File

@ -71,7 +71,7 @@ public class MXLog: NSObject {
function: String = #function,
line: Int = #line,
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,
@ -79,7 +79,7 @@ public class MXLog: NSObject {
function: String = #function,
line: Int = #line,
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,
@ -87,7 +87,7 @@ public class MXLog: NSObject {
function: String = #function,
line: Int = #line,
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,
@ -95,7 +95,7 @@ public class MXLog: NSObject {
function: String = #function,
line: Int = #line,
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
@ -108,7 +108,7 @@ public class MXLog: NSObject {
function: String = #function,
line: Int = #line,
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
@ -124,7 +124,7 @@ public class MXLog: NSObject {
function: String = #function,
line: Int = #line,
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
assertionFailure("\(message)")
#endif

View File

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

View File

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

View File

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

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 {
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 {

View File

@ -5,5 +5,6 @@ import Foundation
struct Tools: ParsableCommand {
static var configuration = CommandConfiguration(abstract: "A collection of command line tools for ElementX",
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
Algorithms:
url: https://github.com/apple/swift-algorithms
majorVersion: 1.0.0
minorVersion: 1.0.0
AnalyticsEvents:
url: https://github.com/matrix-org/matrix-analytics-events
exactVersion: 0.4.0
minorVersion: 0.5.0
AppAuth:
url: https://github.com/openid/AppAuth-iOS
majorVersion: 1.5.0
minorVersion: 1.6.0
Collections:
url: https://github.com/apple/swift-collections
majorVersion: 1.0.4
minorVersion: 1.0.0
DeviceKit:
url: https://github.com/devicekit/DeviceKit
majorVersion: 4.7.0
minorVersion: 5.0.0
DTCoreText:
url: https://github.com/Cocoanetics/DTCoreText
majorVersion: 1.6.26
exactVersion: 1.6.26
KeychainAccess:
url: https://github.com/kishikawakatsumi/KeychainAccess
majorVersion: 4.2.2
minorVersion: 4.2.0
Kingfisher:
url: https://github.com/onevcat/Kingfisher
majorVersion: 7.2.0
minorVersion: 7.6.0
KZFileWatchers:
url: https://github.com/krzysztofzablocki/KZFileWatchers
branch: master
Introspect:
url: https://github.com/siteline/SwiftUI-Introspect
majorVersion: 0.2.3
minorVersion: 0.2.0
PostHog:
url: https://github.com/PostHog/posthog-ios
majorVersion: 1.4.4
minorVersion: 2.0.0
SwiftyBeaver:
url: https://github.com/SwiftyBeaver/SwiftyBeaver
majorVersion: 1.9.5
minorVersion: 2.0.0
SwiftState:
url: https://github.com/ReactKit/SwiftState
majorVersion: 6.0.0
minorVersion: 6.0.0
GZIP:
url: https://github.com/nicklockwood/GZIP
majorVersion: 1.3.0
minorVersion: 1.3.0
Sentry:
url: https://github.com/getsentry/sentry-cocoa
majorVersion: 8.3.1
minorVersion: 8.3.0
SnapshotTesting:
url: https://github.com/pointfreeco/swift-snapshot-testing
majorVersion: 1.10.0
minorVersion: 1.11.0
Version:
url: https://github.com/mxcl/Version
majorVersion: 2.0.1
minorVersion: 2.0.0