Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support xcode 15.3 (swift 5.10 changes) #373

Merged
merged 21 commits into from
Mar 17, 2024
Merged
2 changes: 1 addition & 1 deletion App/MutaroDev/MutaroDev.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "# Type a script or drag a script file from your workspace to insert its path.\nif [ $CI ]; then\n export PATH=\"$PATH:/usr/local/bin\"\nelse\n export PATH=\"$PATH:/opt/homebrew/bin\" \nfi\n\nif which needle; then\n echo \"Mins: Create Needle\"\n if [ $CI ]; then\n NEEDLE_SWIFT_FILE_PATH=${CI_PRIMARY_REPOSITORY_PATH}/MutaroModule/Sources/App/Development/DI/NeedleGenerated.swift\n COMPONENT_PATH=${CI_PRIMARY_REPOSITORY_PATH}/MutaroModule/Sources/\n else\n NEEDLE_SWIFT_FILE_PATH=../../MutaroModule/Sources/App/Development/DI/NeedleGenerated.swift\n COMPONENT_PATH=../../MutaroModule/Sources/\n fi\n \n needle generate $NEEDLE_SWIFT_FILE_PATH $COMPONENT_PATH --exclude-paths /Production\nelse\n echo \"warning: Needle not installed\"\nfi\n";
shellScript = "# Type a script or drag a script file from your workspace to insert its path.\nif [ $CI ]; then\n export PATH=\"$PATH:/usr/local/bin\"\nelse\n export PATH=\"$PATH:/opt/homebrew/bin\" \nfi\n\nif which needle; then\n echo \"Mins: Create Needle\"\n if [ $CI ]; then\n NEEDLE_SWIFT_FILE_PATH=${CI_PRIMARY_REPOSITORY_PATH}/MutaroModule/Sources/App/Development/DI/NeedleGenerated.swift\n COMPONENT_PATH=${CI_PRIMARY_REPOSITORY_PATH}/MutaroModule/Sources/\n else\n NEEDLE_SWIFT_FILE_PATH=../../MutaroModule/Sources/App/Development/DI/NeedleGenerated.swift\n COMPONENT_PATH=../../MutaroModule/Sources/\n fi\n rm -rf $NEEDLE_SWIFT_FILE_PATH\n needle generate $NEEDLE_SWIFT_FILE_PATH $COMPONENT_PATH --exclude-paths /Production\nelse\n echo \"warning: Needle not installed\"\nfi\n";
};
71D24CCC2A318EC300092101 /* [NEED FIRST RUN] register env */ = {
isa = PBXShellScriptBuildPhase;
Expand Down
6 changes: 3 additions & 3 deletions BuildTools/Package.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// swift-tools-version: 5.7
// swift-tools-version: 5.10
// The swift-tools-version declares the minimum version of Swift required to build this package.

import PackageDescription
Expand All @@ -21,8 +21,8 @@ let package = Package(
),
.binaryTarget(
name: "LicensePlistBinary",
url: "https://github.com/mono0926/LicensePlist/releases/download/3.24.9/LicensePlistBinary-macos.artifactbundle.zip",
checksum: "57bc9aad97510ee73af979bb3a8dc63653e522dce71a505c13059ab54d6fc990"
url: "https://github.com/mono0926/LicensePlist/releases/download/3.25.1/LicensePlistBinary-macos.artifactbundle.zip",
checksum: "a80181eeed49396dae5d3ce6fc339f33a510299b068fd6b4f507483db78f7f30"
)
]
)
8 changes: 5 additions & 3 deletions MutaroModule/Package.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// swift-tools-version: 5.8
// swift-tools-version: 5.10
// The swift-tools-version declares the minimum version of Swift required to build this package.

import PackageDescription
Expand Down Expand Up @@ -36,7 +36,7 @@ let firebaseAnalyticsDependencies: [Target.Dependency] = [

let debugSwiftSettings: [PackageDescription.SwiftSetting] = [
.define("DEV", .when(configuration: .debug)),
.unsafeFlags(["-strict-concurrency=complete"]),
.unsafeFlags(["-strict-concurrency=complete", "-warn-concurrency", "-enable-actor-data-race-checks"]),
.forwardTrailingClosures,
.existentialAny,
.bareSlashRegexLiterals,
Expand Down Expand Up @@ -244,7 +244,9 @@ let package = Package(
),
.target(
name: "KeychainStore",
dependencies: [],
dependencies: [
.core
],
path: "./Sources/Modules/KeychainStore"
),
.target(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import Client
import Core
import ImageLoader
import KeychainStore
import NeedleFoundation

import AppIntroductionFeature
Expand Down Expand Up @@ -71,4 +72,10 @@ public final class DevRootComponent: BootstrapComponent {
ImageDownloadServiceImp()
}
}

public var keychainDataStore: any KeychainDataStoreProtocol {
shared {
KeychainDataStore()
}
}
}
28 changes: 20 additions & 8 deletions MutaroModule/Sources/App/Development/DI/NeedleGenerated.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import Core
import Foundation
import HomeFeature
import ImageLoader
import KeychainStore
import MyAppToolsFeature
import MyAppsFeature
import NeedleFoundation
Expand Down Expand Up @@ -41,6 +42,9 @@ private class MyAppToolsFeatureDependency8819cdcb20ff8ed502dcProvider: MyAppTool
var client: any Providable {
return devRootComponent.client
}
var keychainDataStore: any KeychainDataStoreProtocol {
return devRootComponent.keychainDataStore
}
private let devRootComponent: DevRootComponent
init(devRootComponent: DevRootComponent) {
self.devRootComponent = devRootComponent
Expand All @@ -51,15 +55,17 @@ private func factory1cd9013174eed344cbd4295202051d8ff8d8a13a(_ component: Needle
return MyAppToolsFeatureDependency8819cdcb20ff8ed502dcProvider(devRootComponent: parent1(component) as! DevRootComponent)
}
private class RegisterJWTFeatureDependencyb8fd3e5e6507e3cea0d9Provider: RegisterJWTFeatureDependency {


init() {

var keychainDataStore: any KeychainDataStoreProtocol {
return devRootComponent.keychainDataStore
}
private let devRootComponent: DevRootComponent
init(devRootComponent: DevRootComponent) {
self.devRootComponent = devRootComponent
}
}
/// ^->DevRootComponent->RegisterJWTFeatureBuilderComponent
private func factory3027719ba7197de4dae7e3b0c44298fc1c149afb(_ component: NeedleFoundation.Scope) -> AnyObject {
return RegisterJWTFeatureDependencyb8fd3e5e6507e3cea0d9Provider()
private func factory3027719ba7197de4dae7295202051d8ff8d8a13a(_ component: NeedleFoundation.Scope) -> AnyObject {
return RegisterJWTFeatureDependencyb8fd3e5e6507e3cea0d9Provider(devRootComponent: parent1(component) as! DevRootComponent)
}
private class MyAppsFeatureDependency6e3d99de62d490ee639fProvider: MyAppsFeatureDependency {
var client: any Providable {
Expand All @@ -68,6 +74,9 @@ private class MyAppsFeatureDependency6e3d99de62d490ee639fProvider: MyAppsFeature
var imageDownloadService: any ImageDownloadService {
return devRootComponent.imageDownloadService
}
var keychainDataStore: any KeychainDataStoreProtocol {
return devRootComponent.keychainDataStore
}
var registerJWTFeatureBuilder: any RegisterJWTFeatureBuildable {
return devRootComponent.registerJWTFeatureBuilder
}
Expand Down Expand Up @@ -128,6 +137,7 @@ extension DevRootComponent: Registration {
localTable["myAppToolsFeatureBuilder-any MyAppToolsFeatureBuildable"] = { [unowned self] in self.myAppToolsFeatureBuilder as Any }
localTable["client-any Providable"] = { [unowned self] in self.client as Any }
localTable["imageDownloadService-any ImageDownloadService"] = { [unowned self] in self.imageDownloadService as Any }
localTable["keychainDataStore-any KeychainDataStoreProtocol"] = { [unowned self] in self.keychainDataStore as Any }
}
}
extension HomeFeatureBuilderComponent: Registration {
Expand All @@ -138,17 +148,19 @@ extension HomeFeatureBuilderComponent: Registration {
extension MyAppToolsFeatureComponent: Registration {
public func registerItems() {
keyPathToName[\MyAppToolsFeatureDependency.client] = "client-any Providable"
keyPathToName[\MyAppToolsFeatureDependency.keychainDataStore] = "keychainDataStore-any KeychainDataStoreProtocol"
}
}
extension RegisterJWTFeatureBuilderComponent: Registration {
public func registerItems() {

keyPathToName[\RegisterJWTFeatureDependency.keychainDataStore] = "keychainDataStore-any KeychainDataStoreProtocol"
}
}
extension MyAppsFeatureBuilderComponent: Registration {
public func registerItems() {
keyPathToName[\MyAppsFeatureDependency.client] = "client-any Providable"
keyPathToName[\MyAppsFeatureDependency.imageDownloadService] = "imageDownloadService-any ImageDownloadService"
keyPathToName[\MyAppsFeatureDependency.keychainDataStore] = "keychainDataStore-any KeychainDataStoreProtocol"
keyPathToName[\MyAppsFeatureDependency.registerJWTFeatureBuilder] = "registerJWTFeatureBuilder-any RegisterJWTFeatureBuildable"
keyPathToName[\MyAppsFeatureDependency.myAppToolsFeatureBuilder] = "myAppToolsFeatureBuilder-any MyAppToolsFeatureBuildable"
}
Expand Down Expand Up @@ -184,7 +196,7 @@ private func registerProviderFactory(_ componentPath: String, _ factory: @escapi
registerProviderFactory("^->DevRootComponent", factoryEmptyDependencyProvider)
registerProviderFactory("^->DevRootComponent->HomeFeatureBuilderComponent", factory61c9a65d91c54126627be3b0c44298fc1c149afb)
registerProviderFactory("^->DevRootComponent->MyAppToolsFeatureComponent", factory1cd9013174eed344cbd4295202051d8ff8d8a13a)
registerProviderFactory("^->DevRootComponent->RegisterJWTFeatureBuilderComponent", factory3027719ba7197de4dae7e3b0c44298fc1c149afb)
registerProviderFactory("^->DevRootComponent->RegisterJWTFeatureBuilderComponent", factory3027719ba7197de4dae7295202051d8ff8d8a13a)
registerProviderFactory("^->DevRootComponent->MyAppsFeatureBuilderComponent", factory7c6a8079ee013eb6ac6c295202051d8ff8d8a13a)
registerProviderFactory("^->DevRootComponent->SettingFeatureBuilderComponent", factory5d4e408a43798995182c295202051d8ff8d8a13a)
registerProviderFactory("^->DevRootComponent->AppIntroductionFeatureBuilderComponent", factorya635079052b624173c15295202051d8ff8d8a13a)
Expand Down
23 changes: 15 additions & 8 deletions MutaroModule/Sources/App/Production/DI/RootComponent.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import Client
import Core
import ImageLoader
import KeychainStore
import NeedleFoundation

import AppIntroductionFeature
Expand All @@ -18,57 +19,63 @@ import RegisterJWTFeature
import SettingFeature

final class RootComponent: BootstrapComponent {
var appIntroductionFeatureBuilder: AppIntroductionFeatureBuildable {
public var appIntroductionFeatureBuilder: any AppIntroductionFeatureBuildable {
shared {
AppIntroductionFeatureBuilderComponent(parent: self)
.appIntroductionBuilder()
}
}

var settingFeatureBuilder: SettingFeatureBuildable {
public var settingFeatureBuilder: any SettingFeatureBuildable {
shared {
SettingFeatureBuilderComponent(parent: self)
.settingFeatureBuilder()
}
}

var homeFeatureBuilder: HomeFeatureBuildable {
public var homeFeatureBuilder: any HomeFeatureBuildable {
shared {
HomeFeatureBuilderComponent(parent: self)
.homeFeatureBuilder()
}
}

var myAppsFeatureBuilder: MyAppsFeatureBuildable {
public var myAppsFeatureBuilder: any MyAppsFeatureBuildable {
shared {
MyAppsFeatureBuilderComponent(parent: self)
.myAppsFeatureBuilder()
}
}

var registerJWTFeatureBuilder: RegisterJWTFeatureBuildable {
public var registerJWTFeatureBuilder: any RegisterJWTFeatureBuildable {
shared {
RegisterJWTFeatureBuilderComponent(parent: self)
.registerJWTFeatureBuilder()
}
}

var myAppToolsFeatureBuilder: MyAppToolsFeatureBuildable {
public var myAppToolsFeatureBuilder: any MyAppToolsFeatureBuildable {
shared {
MyAppToolsFeatureComponent(parent: self)
.myAppToolsFeatureBuilder()
}
}

var client: Providable {
public var client: any Providable {
shared {
Provider()
}
}

var imageDownloadService: ImageDownloadService {
public var imageDownloadService: any ImageDownloadService {
shared {
ImageDownloadServiceImp()
}
}

public var keychainDataStore: any KeychainDataStoreProtocol {
shared {
KeychainDataStore()
}
}
}
6 changes: 3 additions & 3 deletions MutaroModule/Sources/Core/Client/Common/JSONNull.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@

import Foundation

public class JSONNull: Codable, Hashable {
public final class JSONNull: Codable, Hashable, Sendable {
public static func == (_: JSONNull, _: JSONNull) -> Bool {
true
}

public var hashValue: Int {
0
public func hash(into hasher: inout Hasher) {
hasher.combine(0)
}

public init() {}
Expand Down
26 changes: 13 additions & 13 deletions MutaroModule/Sources/Core/Client/Entity/BuildsEntity.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import Foundation

// MARK: - BuildsEntity

public struct BuildsEntity {
public struct BuildsEntity: Sendable {
public let links: BuildsLinks?
public let data: [BuildsDatum]?
public let meta: BuildsMeta?
Expand All @@ -22,7 +22,7 @@ public struct BuildsEntity {

// MARK: - BuildsDatum

public struct BuildsDatum {
public struct BuildsDatum: Sendable {
public let id: String?
public let relationships: BuildsRelationships?
public let links: BuildsLinks?
Expand All @@ -40,7 +40,7 @@ public struct BuildsEntity {

// MARK: - BuildsAttributes

public struct BuildsAttributes {
public struct BuildsAttributes: Sendable {
public let expirationDate: Date?
public let expired: Bool?
public let processingState, buildAudienceType, minOSVersion: String?
Expand Down Expand Up @@ -68,7 +68,7 @@ public struct BuildsEntity {

// MARK: - BuildsIconAssetToken

public struct BuildsIconAssetToken {
public struct BuildsIconAssetToken: Sendable {
public let width: Int?
public let templateURL: String?
public let height: Int?
Expand All @@ -82,7 +82,7 @@ public struct BuildsEntity {

// MARK: - BuildsLinks

public struct BuildsLinks {
public struct BuildsLinks: Sendable {
public let linksSelf: String?

public init(linksSelf: String?) {
Expand All @@ -92,7 +92,7 @@ public struct BuildsEntity {

// MARK: - BuildsRelationships

public struct BuildsRelationships {
public struct BuildsRelationships: Sendable {
public let betaAppReviewSubmission, appStoreVersion, appEncryptionDeclaration, individualTesters: BuildsLinksElement?
public let perfPowerMetrics: BuildsPerfPowerMetrics?
public let betaBuildLocalizations: BuildsLinksElement?
Expand All @@ -118,7 +118,7 @@ public struct BuildsEntity {

// MARK: - BuildsLinksElement

public struct BuildsLinksElement {
public struct BuildsLinksElement: Sendable {
public let links: BuildsLinksDetails?

public init(links: BuildsLinksDetails?) {
Expand All @@ -128,7 +128,7 @@ public struct BuildsEntity {

// MARK: - BuildsLinksDetails

public struct BuildsLinksDetails {
public struct BuildsLinksDetails: Sendable {
public let related, linksSelf: String?

public init(related: String?, linksSelf: String?) {
Expand All @@ -139,7 +139,7 @@ public struct BuildsEntity {

// MARK: - BuildsBetaGroups

public struct BuildsBetaGroups {
public struct BuildsBetaGroups: Sendable {
public let links: BuildsLinks?

public init(links: BuildsLinks?) {
Expand All @@ -149,7 +149,7 @@ public struct BuildsEntity {

// MARK: - BuildsPerfPowerMetrics

public struct BuildsPerfPowerMetrics {
public struct BuildsPerfPowerMetrics: Sendable {
public let links: BuildsPerfPowerMetricsLinks?

public init(links: BuildsPerfPowerMetricsLinks?) {
Expand All @@ -159,7 +159,7 @@ public struct BuildsEntity {

// MARK: - BuildsPerfPowerMetricsLinks

public struct BuildsPerfPowerMetricsLinks {
public struct BuildsPerfPowerMetricsLinks: Sendable {
public let related: String?

public init(related: String?) {
Expand All @@ -169,7 +169,7 @@ public struct BuildsEntity {

// MARK: - BuildsMeta

public struct BuildsMeta {
public struct BuildsMeta: Sendable {
public let paging: BuildsPaging?

public init(paging: BuildsPaging?) {
Expand All @@ -179,7 +179,7 @@ public struct BuildsEntity {

// MARK: - BuildsPaging

public struct BuildsPaging {
public struct BuildsPaging: Sendable {
public let total, limit: Int?

public init(total: Int?, limit: Int?) {
Expand Down
Loading