From f42c690bca11051e1caafc928bf562220bc0cc60 Mon Sep 17 00:00:00 2001 From: Almaz Ibragimov Date: Mon, 29 Dec 2025 12:44:10 +0300 Subject: [PATCH 1/3] Project structure updated --- .codecov.yml | 20 -- .gitignore | 4 + .swift-version | 2 +- .swiftlint.yml | 19 +- .system-version | 1 + .xcode-runtime-version | 1 + .xcode-version | 2 +- DictionaryCoder.podspec | 2 +- DictionaryCoder.xcodeproj/project.pbxproj | 112 ++++----- .../xcschemes/DictionaryCoder iOS.xcscheme | 2 +- .../xcschemes/DictionaryCoder macOS.xcscheme | 2 +- .../xcschemes/DictionaryCoder tvOS.xcscheme | 2 +- .../DictionaryCoder watchOS.xcscheme | 2 +- Gemfile.lock | 220 ++++++++++-------- Package.swift | 19 +- Package@swift-5.9.swift | 37 +++ README.md | 6 +- Scripts/Bootstrap/aria2.sh | 12 + Scripts/Bootstrap/common.sh | 2 - Scripts/Bootstrap/gemfile.sh | 21 ++ Scripts/Bootstrap/homebrew.sh | 2 +- Scripts/Bootstrap/macos.sh | 2 +- Scripts/Bootstrap/mint.sh | 8 +- Scripts/Bootstrap/rbenv.sh | 11 +- Scripts/Bootstrap/spm.sh | 11 +- Scripts/Bootstrap/swift.sh | 26 --- Scripts/Bootstrap/swiftenv.sh | 33 --- Scripts/Bootstrap/xcode.sh | 41 +++- Scripts/Bootstrap/xcodes.sh | 12 + Scripts/Helpers/script-run.sh | 3 +- Scripts/bootstrap.sh | 5 +- Sources/DictionaryCoder.h | 4 - Tests/Decoder/DictionaryDecoderTesting.swift | 10 +- Tests/Encoder/DictionaryEncoderTesting.swift | 6 +- 34 files changed, 359 insertions(+), 303 deletions(-) delete mode 100644 .codecov.yml create mode 100644 .system-version create mode 100644 .xcode-runtime-version create mode 100644 Package@swift-5.9.swift create mode 100755 Scripts/Bootstrap/aria2.sh delete mode 100755 Scripts/Bootstrap/swift.sh delete mode 100755 Scripts/Bootstrap/swiftenv.sh create mode 100755 Scripts/Bootstrap/xcodes.sh delete mode 100644 Sources/DictionaryCoder.h diff --git a/.codecov.yml b/.codecov.yml deleted file mode 100644 index 3c9edbf..0000000 --- a/.codecov.yml +++ /dev/null @@ -1,20 +0,0 @@ -coverage: - precision: 2 - round: down - range: "70...100" - - status: - project: - default: - threshold: 1.0% - changes: - default: - threshold: 1.0% - patch: off - -comment: - layout: "flags, files" - behavior: new - -ignore: - - Tests/**/* diff --git a/.gitignore b/.gitignore index 7615629..9f177a0 100644 --- a/.gitignore +++ b/.gitignore @@ -52,3 +52,7 @@ fastlane/report.xml fastlane/Preview.html fastlane/screenshots/**/*.png fastlane/test_output + +# JetBrains IDE +.idea/ +*.iml \ No newline at end of file diff --git a/.swift-version b/.swift-version index e0ea36f..95ee81a 100644 --- a/.swift-version +++ b/.swift-version @@ -1 +1 @@ -6.0 +5.9 diff --git a/.swiftlint.yml b/.swiftlint.yml index ce6ebad..41dcde9 100644 --- a/.swiftlint.yml +++ b/.swiftlint.yml @@ -1,4 +1,5 @@ included: + - Example - Sources - Tests @@ -12,8 +13,6 @@ analyzer_rules: - unused_import only_rules: - - accessibility_label_for_image - - accessibility_trait_for_button - anonymous_argument_in_multiline_closure - array_init # - attributes @@ -309,11 +308,12 @@ file_name: excluded: - main.swift prefix_pattern: '' - suffix_pattern: '[+][A-z][A-z]+' - nested_type_separator: '' + suffix_pattern: '([+][A-z][A-z]+)+' + nested_type_separator: '.' file_types_order: order: + - supporting_type - main_type - extension - preview_provider @@ -323,8 +323,8 @@ force_try: severity: warning function_body_length: - warning: 40 - error: 400 + warning: 50 + error: 500 function_parameter_count: warning: 6 @@ -363,7 +363,7 @@ identifier_name: - y - z - w - allowed_symbols: [] + allowed_symbols: [_] validates_start_with_lowercase: warning implicit_return: @@ -399,10 +399,10 @@ modifier_order: preferred_modifier_order: - acl - setterACL + - final - override - owned - mutators - - final - typeMethods - required - convenience @@ -516,7 +516,8 @@ type_name: max_length: warning: 50 error: 500 - excluded: [] + excluded: + - ID allowed_symbols: [] validates_start_with_lowercase: warning validate_protocols: true diff --git a/.system-version b/.system-version new file mode 100644 index 0000000..b5a3208 --- /dev/null +++ b/.system-version @@ -0,0 +1 @@ +15.7 diff --git a/.xcode-runtime-version b/.xcode-runtime-version new file mode 100644 index 0000000..0034b65 --- /dev/null +++ b/.xcode-runtime-version @@ -0,0 +1 @@ +18.0 diff --git a/.xcode-version b/.xcode-version index c32b0ec..0d68f8a 100644 --- a/.xcode-version +++ b/.xcode-version @@ -1 +1 @@ -16.1 +16.0 diff --git a/DictionaryCoder.podspec b/DictionaryCoder.podspec index 96c0dd2..1183883 100644 --- a/DictionaryCoder.podspec +++ b/DictionaryCoder.podspec @@ -8,7 +8,7 @@ Pod::Spec.new do |spec| spec.author = { "Almaz Ibragimov" => "almazrafi@gmail.com" } spec.source = { :git => "https://github.com/almazrafi/DictionaryCoder.git", :tag => "#{spec.version}" } - spec.swift_version = '6.0' + spec.swift_version = '5.9' spec.requires_arc = true spec.source_files = 'Sources/**/*.swift' diff --git a/DictionaryCoder.xcodeproj/project.pbxproj b/DictionaryCoder.xcodeproj/project.pbxproj index 1fd75f0..3164ef1 100644 --- a/DictionaryCoder.xcodeproj/project.pbxproj +++ b/DictionaryCoder.xcodeproj/project.pbxproj @@ -7,6 +7,14 @@ objects = { /* Begin PBXBuildFile section */ + C001ACA22F0274E9008C37A5 /* Mutex.swift in Sources */ = {isa = PBXBuildFile; fileRef = C001ACA12F0274E4008C37A5 /* Mutex.swift */; }; + C001ACA32F0274E9008C37A5 /* Mutex.swift in Sources */ = {isa = PBXBuildFile; fileRef = C001ACA12F0274E4008C37A5 /* Mutex.swift */; }; + C001ACA42F0274E9008C37A5 /* Mutex.swift in Sources */ = {isa = PBXBuildFile; fileRef = C001ACA12F0274E4008C37A5 /* Mutex.swift */; }; + C001ACA52F0274E9008C37A5 /* Mutex.swift in Sources */ = {isa = PBXBuildFile; fileRef = C001ACA12F0274E4008C37A5 /* Mutex.swift */; }; + C001ACA82F027A4B008C37A5 /* MutexStorage.swift in Sources */ = {isa = PBXBuildFile; fileRef = C001ACA72F027A47008C37A5 /* MutexStorage.swift */; }; + C001ACA92F027A4B008C37A5 /* MutexStorage.swift in Sources */ = {isa = PBXBuildFile; fileRef = C001ACA72F027A47008C37A5 /* MutexStorage.swift */; }; + C001ACAA2F027A4B008C37A5 /* MutexStorage.swift in Sources */ = {isa = PBXBuildFile; fileRef = C001ACA72F027A47008C37A5 /* MutexStorage.swift */; }; + C001ACAB2F027A4B008C37A5 /* MutexStorage.swift in Sources */ = {isa = PBXBuildFile; fileRef = C001ACA72F027A47008C37A5 /* MutexStorage.swift */; }; C006F1AA2406B1F000C3F783 /* DictionaryDataDecodingStrategy.swift in Sources */ = {isa = PBXBuildFile; fileRef = C013EAFA23E1E0AF00F12CCB /* DictionaryDataDecodingStrategy.swift */; }; C006F1AB2406B1F000C3F783 /* DictionaryDateDecodingStrategy.swift in Sources */ = {isa = PBXBuildFile; fileRef = C013EAF923E1E0AE00F12CCB /* DictionaryDateDecodingStrategy.swift */; }; C006F1AC2406B1F000C3F783 /* DictionaryKeyDecodingStrategy.swift in Sources */ = {isa = PBXBuildFile; fileRef = C013EAF823E1E0AE00F12CCB /* DictionaryKeyDecodingStrategy.swift */; }; @@ -134,11 +142,8 @@ C0193BBD28D99FE900FD3CDD /* DictionaryNilEncodingStrategy.swift in Sources */ = {isa = PBXBuildFile; fileRef = C0193BBA28D99FE900FD3CDD /* DictionaryNilEncodingStrategy.swift */; }; C0193BBE28D99FE900FD3CDD /* DictionaryNilEncodingStrategy.swift in Sources */ = {isa = PBXBuildFile; fileRef = C0193BBA28D99FE900FD3CDD /* DictionaryNilEncodingStrategy.swift */; }; C057F01823CB8EEB00C2D895 /* DictionaryCoder.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C057F00E23CB8EEB00C2D895 /* DictionaryCoder.framework */; }; - C057F01F23CB8EEB00C2D895 /* DictionaryCoder.h in Headers */ = {isa = PBXBuildFile; fileRef = C057F01123CB8EEB00C2D895 /* DictionaryCoder.h */; settings = {ATTRIBUTES = (Public, ); }; }; C0A01A3223CB90F200AC2C3A /* DictionaryCoder.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C0A01A2923CB90F200AC2C3A /* DictionaryCoder.framework */; }; - C0A01A4123CB912C00AC2C3A /* DictionaryCoder.h in Headers */ = {isa = PBXBuildFile; fileRef = C057F01123CB8EEB00C2D895 /* DictionaryCoder.h */; settings = {ATTRIBUTES = (Public, ); }; }; C0A01A5023CB92EB00AC2C3A /* DictionaryCoder.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C0A01A4723CB92EB00AC2C3A /* DictionaryCoder.framework */; }; - C0A01A5E23CB92F200AC2C3A /* DictionaryCoder.h in Headers */ = {isa = PBXBuildFile; fileRef = C057F01123CB8EEB00C2D895 /* DictionaryCoder.h */; settings = {ATTRIBUTES = (Public, ); }; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -167,6 +172,8 @@ /* Begin PBXFileReference section */ C0007FFA23CBAAA5005F95E0 /* .swift-version */ = {isa = PBXFileReference; lastKnownFileType = text; path = ".swift-version"; sourceTree = ""; }; + C001ACA12F0274E4008C37A5 /* Mutex.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Mutex.swift; sourceTree = ""; }; + C001ACA72F027A47008C37A5 /* MutexStorage.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MutexStorage.swift; sourceTree = ""; }; C006F1A22406B13E00C3F783 /* DictionaryCoder.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = DictionaryCoder.framework; sourceTree = BUILT_PRODUCTS_DIR; }; C013EAF223E1E0AE00F12CCB /* RangeReplaceableCollection+Extensions.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "RangeReplaceableCollection+Extensions.swift"; sourceTree = ""; }; C013EAF323E1E0AE00F12CCB /* AnyCodingKey.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AnyCodingKey.swift; sourceTree = ""; }; @@ -202,10 +209,14 @@ C013EB8423E21A2E00F12CCB /* DictionaryEncoderTesting.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DictionaryEncoderTesting.swift; sourceTree = ""; }; C0193BBA28D99FE900FD3CDD /* DictionaryNilEncodingStrategy.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DictionaryNilEncodingStrategy.swift; sourceTree = ""; }; C057F00E23CB8EEB00C2D895 /* DictionaryCoder.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = DictionaryCoder.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - C057F01123CB8EEB00C2D895 /* DictionaryCoder.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DictionaryCoder.h; sourceTree = ""; }; C057F01223CB8EEB00C2D895 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; C057F01723CB8EEB00C2D895 /* DictionaryCoder Tests iOS.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "DictionaryCoder Tests iOS.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; C057F01E23CB8EEB00C2D895 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + C07587FB2F0282AA00694706 /* .system-version */ = {isa = PBXFileReference; lastKnownFileType = text; path = ".system-version"; sourceTree = ""; }; + C07587FC2F0282AA00694706 /* .xcode-runtime-version */ = {isa = PBXFileReference; lastKnownFileType = text; path = ".xcode-runtime-version"; sourceTree = ""; }; + C07587FD2F0282AA00694706 /* .xcode-version */ = {isa = PBXFileReference; lastKnownFileType = text; path = ".xcode-version"; sourceTree = ""; }; + C07587FE2F0282AA00694706 /* Gemfile.lock */ = {isa = PBXFileReference; lastKnownFileType = text; path = Gemfile.lock; sourceTree = ""; }; + C07587FF2F0282AA00694706 /* Package@swift-5.9.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Package@swift-5.9.swift"; sourceTree = ""; }; C07811BC2675FD15002FE9D4 /* Mintfile */ = {isa = PBXFileReference; lastKnownFileType = text; path = Mintfile; sourceTree = ""; }; C0A01A1523CB8FFC00AC2C3A /* .swiftlint.yml */ = {isa = PBXFileReference; lastKnownFileType = text.yaml; path = .swiftlint.yml; sourceTree = ""; }; C0A01A1623CB900800AC2C3A /* DictionaryCoder.podspec */ = {isa = PBXFileReference; lastKnownFileType = text; path = DictionaryCoder.podspec; sourceTree = ""; }; @@ -213,7 +224,6 @@ C0A01A1823CB900900AC2C3A /* Package.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Package.swift; sourceTree = ""; }; C0A01A1923CB900900AC2C3A /* LICENSE */ = {isa = PBXFileReference; lastKnownFileType = text; path = LICENSE; sourceTree = ""; }; C0A01A1A23CB901C00AC2C3A /* .gitignore */ = {isa = PBXFileReference; lastKnownFileType = text; path = .gitignore; sourceTree = ""; }; - C0A01A1B23CB901C00AC2C3A /* .codecov.yml */ = {isa = PBXFileReference; lastKnownFileType = text.yaml; path = .codecov.yml; sourceTree = ""; }; C0A01A1C23CB901C00AC2C3A /* .swiftlint.yml */ = {isa = PBXFileReference; lastKnownFileType = text.yaml; path = .swiftlint.yml; sourceTree = ""; }; C0A01A1D23CB901C00AC2C3A /* .ruby-version */ = {isa = PBXFileReference; lastKnownFileType = text; path = ".ruby-version"; sourceTree = ""; }; C0A01A2923CB90F200AC2C3A /* DictionaryCoder.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = DictionaryCoder.framework; sourceTree = BUILT_PRODUCTS_DIR; }; @@ -281,9 +291,19 @@ /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ + C001ACA62F027A3B008C37A5 /* Mutex */ = { + isa = PBXGroup; + children = ( + C001ACA12F0274E4008C37A5 /* Mutex.swift */, + C001ACA72F027A47008C37A5 /* MutexStorage.swift */, + ); + path = Mutex; + sourceTree = ""; + }; C013EAF123E1E0AE00F12CCB /* Tools */ = { isa = PBXGroup; children = ( + C001ACA62F027A3B008C37A5 /* Mutex */, C013EAF323E1E0AE00F12CCB /* AnyCodingKey.swift */, C013EB5A23E1E23B00F12CCB /* Optional+Extensions.swift */, C013EAF223E1E0AE00F12CCB /* RangeReplaceableCollection+Extensions.swift */, @@ -372,17 +392,21 @@ C057F01B23CB8EEB00C2D895 /* Tests */, C057F00F23CB8EEB00C2D895 /* Products */, C0A01A6323CB9B0A00AC2C3A /* Scripts */, - C0A01A1B23CB901C00AC2C3A /* .codecov.yml */, C0A01A1A23CB901C00AC2C3A /* .gitignore */, C0A01A1D23CB901C00AC2C3A /* .ruby-version */, C0007FFA23CBAAA5005F95E0 /* .swift-version */, C0A01A1C23CB901C00AC2C3A /* .swiftlint.yml */, + C07587FB2F0282AA00694706 /* .system-version */, + C07587FC2F0282AA00694706 /* .xcode-runtime-version */, + C07587FD2F0282AA00694706 /* .xcode-version */, C0A01A6423CB9B1600AC2C3A /* Dangerfile */, C0A01A6523CB9B1600AC2C3A /* Gemfile */, + C07587FE2F0282AA00694706 /* Gemfile.lock */, C07811BC2675FD15002FE9D4 /* Mintfile */, C0A01A1623CB900800AC2C3A /* DictionaryCoder.podspec */, C0A01A1923CB900900AC2C3A /* LICENSE */, C0A01A1823CB900900AC2C3A /* Package.swift */, + C07587FF2F0282AA00694706 /* Package@swift-5.9.swift */, C0A01A1723CB900900AC2C3A /* README.md */, ); sourceTree = ""; @@ -407,7 +431,6 @@ C013EAF423E1E0AE00F12CCB /* Decoder */, C013EB0023E1E0AF00F12CCB /* Encoder */, C013EAF123E1E0AE00F12CCB /* Tools */, - C057F01123CB8EEB00C2D895 /* DictionaryCoder.h */, C057F01223CB8EEB00C2D895 /* Info.plist */, ); path = Sources; @@ -426,47 +449,12 @@ }; /* End PBXGroup section */ -/* Begin PBXHeadersBuildPhase section */ - C006F19D2406B13E00C3F783 /* Headers */ = { - isa = PBXHeadersBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; - C057F00923CB8EEB00C2D895 /* Headers */ = { - isa = PBXHeadersBuildPhase; - buildActionMask = 2147483647; - files = ( - C057F01F23CB8EEB00C2D895 /* DictionaryCoder.h in Headers */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - C0A01A2423CB90F200AC2C3A /* Headers */ = { - isa = PBXHeadersBuildPhase; - buildActionMask = 2147483647; - files = ( - C0A01A4123CB912C00AC2C3A /* DictionaryCoder.h in Headers */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - C0A01A4223CB92EB00AC2C3A /* Headers */ = { - isa = PBXHeadersBuildPhase; - buildActionMask = 2147483647; - files = ( - C0A01A5E23CB92F200AC2C3A /* DictionaryCoder.h in Headers */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXHeadersBuildPhase section */ - /* Begin PBXNativeTarget section */ C006F1A12406B13E00C3F783 /* DictionaryCoder watchOS */ = { isa = PBXNativeTarget; buildConfigurationList = C006F1A92406B13E00C3F783 /* Build configuration list for PBXNativeTarget "DictionaryCoder watchOS" */; buildPhases = ( C006F1C42406B21000C3F783 /* SwiftLint */, - C006F19D2406B13E00C3F783 /* Headers */, C006F19E2406B13E00C3F783 /* Sources */, C006F19F2406B13E00C3F783 /* Frameworks */, C006F1A02406B13E00C3F783 /* Resources */, @@ -485,7 +473,6 @@ buildConfigurationList = C057F02223CB8EEB00C2D895 /* Build configuration list for PBXNativeTarget "DictionaryCoder iOS" */; buildPhases = ( C0A01A2323CB907300AC2C3A /* SwiftLint */, - C057F00923CB8EEB00C2D895 /* Headers */, C057F00A23CB8EEB00C2D895 /* Sources */, C057F00B23CB8EEB00C2D895 /* Frameworks */, C057F00C23CB8EEB00C2D895 /* Resources */, @@ -522,7 +509,6 @@ buildConfigurationList = C0A01A3A23CB90F200AC2C3A /* Build configuration list for PBXNativeTarget "DictionaryCoder macOS" */; buildPhases = ( C0A01A6123CB931500AC2C3A /* SwiftLint */, - C0A01A2423CB90F200AC2C3A /* Headers */, C0A01A2523CB90F200AC2C3A /* Sources */, C0A01A2623CB90F200AC2C3A /* Frameworks */, C0A01A2723CB90F200AC2C3A /* Resources */, @@ -559,7 +545,6 @@ buildConfigurationList = C0A01A5823CB92EB00AC2C3A /* Build configuration list for PBXNativeTarget "DictionaryCoder tvOS" */; buildPhases = ( C0A01A6223CB932700AC2C3A /* SwiftLint */, - C0A01A4223CB92EB00AC2C3A /* Headers */, C0A01A4323CB92EB00AC2C3A /* Sources */, C0A01A4423CB92EB00AC2C3A /* Frameworks */, C0A01A4523CB92EB00AC2C3A /* Resources */, @@ -597,8 +582,9 @@ C057F00523CB8EEB00C2D895 /* Project object */ = { isa = PBXProject; attributes = { + BuildIndependentTargetsInParallel = YES; LastSwiftUpdateCheck = 1130; - LastUpgradeCheck = 1410; + LastUpgradeCheck = 1640; ORGANIZATIONNAME = "Almaz Ibragimov"; TargetAttributes = { C006F1A12406B13E00C3F783 = { @@ -794,6 +780,7 @@ C006F1C32406B20400C3F783 /* RangeReplaceableCollection+Extensions.swift in Sources */, C006F1B52406B1FA00C3F783 /* DictionaryDateEncodingStrategy.swift in Sources */, C006F1BD2406B1FE00C3F783 /* DictionaryEncodingOptions.swift in Sources */, + C001ACAB2F027A4B008C37A5 /* MutexStorage.swift in Sources */, C006F1B12406B1F500C3F783 /* DictionaryKeyedDecodingContainer.swift in Sources */, C006F1B32406B1F500C3F783 /* DictionaryUnkeyedDecodingContainer.swift in Sources */, C006F1BC2406B1FE00C3F783 /* DictionaryEncoder.swift in Sources */, @@ -813,6 +800,7 @@ C006F1B72406B1FA00C3F783 /* DictionaryNonConformingFloatEncodingStrategy.swift in Sources */, C0193BBE28D99FE900FD3CDD /* DictionaryNilEncodingStrategy.swift in Sources */, C006F1BF2406B1FE00C3F783 /* DictionarySingleValueEncodingContainer.swift in Sources */, + C001ACA32F0274E9008C37A5 /* Mutex.swift in Sources */, C006F1AB2406B1F000C3F783 /* DictionaryDateDecodingStrategy.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; @@ -828,6 +816,7 @@ C013EB3C23E1E0AF00F12CCB /* DictionaryNonConformingFloatEncodingStrategy.swift in Sources */, C013EB5723E1E0AF00F12CCB /* DictionaryComponent.swift in Sources */, C013EB1223E1E0AF00F12CCB /* AnyCodingKey.swift in Sources */, + C001ACAA2F027A4B008C37A5 /* MutexStorage.swift in Sources */, C013EB2723E1E0AF00F12CCB /* DictionaryComponentDecoder.swift in Sources */, C013EB1823E1E0AF00F12CCB /* DictionaryKeyedDecodingContainer.swift in Sources */, C013EB2123E1E0AF00F12CCB /* DictionaryDataDecodingStrategy.swift in Sources */, @@ -847,6 +836,7 @@ C013EB3623E1E0AF00F12CCB /* DictionaryDateEncodingStrategy.swift in Sources */, C0193BBB28D99FE900FD3CDD /* DictionaryNilEncodingStrategy.swift in Sources */, C013EB3323E1E0AF00F12CCB /* DictionaryKeyEncodingStrategy.swift in Sources */, + C001ACA22F0274E9008C37A5 /* Mutex.swift in Sources */, C013EB1E23E1E0AF00F12CCB /* DictionaryDateDecodingStrategy.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; @@ -875,6 +865,7 @@ C013EB3D23E1E0AF00F12CCB /* DictionaryNonConformingFloatEncodingStrategy.swift in Sources */, C013EB5823E1E0AF00F12CCB /* DictionaryComponent.swift in Sources */, C013EB1323E1E0AF00F12CCB /* AnyCodingKey.swift in Sources */, + C001ACA82F027A4B008C37A5 /* MutexStorage.swift in Sources */, C013EB2823E1E0AF00F12CCB /* DictionaryComponentDecoder.swift in Sources */, C013EB1923E1E0AF00F12CCB /* DictionaryKeyedDecodingContainer.swift in Sources */, C013EB2223E1E0AF00F12CCB /* DictionaryDataDecodingStrategy.swift in Sources */, @@ -894,6 +885,7 @@ C013EB3723E1E0AF00F12CCB /* DictionaryDateEncodingStrategy.swift in Sources */, C0193BBC28D99FE900FD3CDD /* DictionaryNilEncodingStrategy.swift in Sources */, C013EB3423E1E0AF00F12CCB /* DictionaryKeyEncodingStrategy.swift in Sources */, + C001ACA42F0274E9008C37A5 /* Mutex.swift in Sources */, C013EB1F23E1E0AF00F12CCB /* DictionaryDateDecodingStrategy.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; @@ -922,6 +914,7 @@ C013EB3E23E1E0AF00F12CCB /* DictionaryNonConformingFloatEncodingStrategy.swift in Sources */, C013EB5923E1E0AF00F12CCB /* DictionaryComponent.swift in Sources */, C013EB1423E1E0AF00F12CCB /* AnyCodingKey.swift in Sources */, + C001ACA92F027A4B008C37A5 /* MutexStorage.swift in Sources */, C013EB2923E1E0AF00F12CCB /* DictionaryComponentDecoder.swift in Sources */, C013EB1A23E1E0AF00F12CCB /* DictionaryKeyedDecodingContainer.swift in Sources */, C013EB2323E1E0AF00F12CCB /* DictionaryDataDecodingStrategy.swift in Sources */, @@ -941,6 +934,7 @@ C013EB3823E1E0AF00F12CCB /* DictionaryDateEncodingStrategy.swift in Sources */, C0193BBD28D99FE900FD3CDD /* DictionaryNilEncodingStrategy.swift in Sources */, C013EB3523E1E0AF00F12CCB /* DictionaryKeyEncodingStrategy.swift in Sources */, + C001ACA52F0274E9008C37A5 /* Mutex.swift in Sources */, C013EB2023E1E0AF00F12CCB /* DictionaryDateDecodingStrategy.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; @@ -989,6 +983,7 @@ DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; + ENABLE_MODULE_VERIFIER = YES; INFOPLIST_FILE = Sources/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; LD_RUNPATH_SEARCH_PATHS = ( @@ -997,6 +992,7 @@ "@loader_path/Frameworks", ); MARKETING_VERSION = 1.2.0; + MODULE_VERIFIER_SUPPORTED_LANGUAGE_STANDARDS = "gnu11 gnu++14"; PRODUCT_BUNDLE_IDENTIFIER = com.almazrafi.DictionaryCoder; PRODUCT_NAME = DictionaryCoder; SDKROOT = watchos; @@ -1016,6 +1012,7 @@ DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; + ENABLE_MODULE_VERIFIER = YES; INFOPLIST_FILE = Sources/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; LD_RUNPATH_SEARCH_PATHS = ( @@ -1024,6 +1021,7 @@ "@loader_path/Frameworks", ); MARKETING_VERSION = 1.2.0; + MODULE_VERIFIER_SUPPORTED_LANGUAGE_STANDARDS = "gnu11 gnu++14"; PRODUCT_BUNDLE_IDENTIFIER = com.almazrafi.DictionaryCoder; PRODUCT_NAME = DictionaryCoder; SDKROOT = watchos; @@ -1037,6 +1035,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; CLANG_ANALYZER_NONNULL = YES; CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; @@ -1071,6 +1070,7 @@ DEBUG_INFORMATION_FORMAT = dwarf; ENABLE_STRICT_OBJC_MSGSEND = YES; ENABLE_TESTABILITY = YES; + ENABLE_USER_SCRIPT_SANDBOXING = NO; GCC_C_LANGUAGE_STANDARD = gnu11; GCC_DYNAMIC_NO_PIC = NO; GCC_NO_COMMON_BLOCKS = YES; @@ -1105,6 +1105,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; CLANG_ANALYZER_NONNULL = YES; CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; @@ -1139,6 +1140,7 @@ DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; ENABLE_NS_ASSERTIONS = NO; ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_USER_SCRIPT_SANDBOXING = NO; GCC_C_LANGUAGE_STANDARD = gnu11; GCC_NO_COMMON_BLOCKS = YES; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; @@ -1175,6 +1177,7 @@ DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; + ENABLE_MODULE_VERIFIER = YES; INFOPLIST_FILE = Sources/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; IPHONEOS_DEPLOYMENT_TARGET = 13.0; @@ -1184,6 +1187,7 @@ "@loader_path/Frameworks", ); MARKETING_VERSION = 1.2.0; + MODULE_VERIFIER_SUPPORTED_LANGUAGE_STANDARDS = "gnu11 gnu++14"; PRODUCT_BUNDLE_IDENTIFIER = com.almazrafi.DictionaryCoder; PRODUCT_NAME = DictionaryCoder; SKIP_INSTALL = YES; @@ -1202,6 +1206,7 @@ DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; + ENABLE_MODULE_VERIFIER = YES; INFOPLIST_FILE = Sources/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; IPHONEOS_DEPLOYMENT_TARGET = 13.0; @@ -1211,6 +1216,7 @@ "@loader_path/Frameworks", ); MARKETING_VERSION = 1.2.0; + MODULE_VERIFIER_SUPPORTED_LANGUAGE_STANDARDS = "gnu11 gnu++14"; PRODUCT_BUNDLE_IDENTIFIER = com.almazrafi.DictionaryCoder; PRODUCT_NAME = DictionaryCoder; SKIP_INSTALL = YES; @@ -1221,7 +1227,6 @@ C057F02623CB8EEB00C2D895 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; CODE_SIGN_IDENTITY = ""; CODE_SIGN_STYLE = Automatic; INFOPLIST_FILE = Tests/Info.plist; @@ -1240,7 +1245,6 @@ C057F02723CB8EEB00C2D895 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; CODE_SIGN_IDENTITY = ""; CODE_SIGN_STYLE = Automatic; INFOPLIST_FILE = Tests/Info.plist; @@ -1268,6 +1272,7 @@ DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; + ENABLE_MODULE_VERIFIER = YES; INFOPLIST_FILE = Sources/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; LD_RUNPATH_SEARCH_PATHS = ( @@ -1277,6 +1282,7 @@ ); MACOSX_DEPLOYMENT_TARGET = 11.5; MARKETING_VERSION = 1.2.0; + MODULE_VERIFIER_SUPPORTED_LANGUAGE_STANDARDS = "gnu11 gnu++14"; PRODUCT_BUNDLE_IDENTIFIER = com.almazrafi.DictionaryCoder; PRODUCT_NAME = DictionaryCoder; SDKROOT = macosx; @@ -1296,6 +1302,7 @@ DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; + ENABLE_MODULE_VERIFIER = YES; INFOPLIST_FILE = Sources/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; LD_RUNPATH_SEARCH_PATHS = ( @@ -1305,6 +1312,7 @@ ); MACOSX_DEPLOYMENT_TARGET = 11.5; MARKETING_VERSION = 1.2.0; + MODULE_VERIFIER_SUPPORTED_LANGUAGE_STANDARDS = "gnu11 gnu++14"; PRODUCT_BUNDLE_IDENTIFIER = com.almazrafi.DictionaryCoder; PRODUCT_NAME = DictionaryCoder; SDKROOT = macosx; @@ -1315,7 +1323,6 @@ C0A01A3E23CB90F200AC2C3A /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; CODE_SIGN_STYLE = Automatic; COMBINE_HIDPI_IMAGES = YES; DEAD_CODE_STRIPPING = YES; @@ -1335,7 +1342,6 @@ C0A01A3F23CB90F200AC2C3A /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; CODE_SIGN_STYLE = Automatic; COMBINE_HIDPI_IMAGES = YES; DEAD_CODE_STRIPPING = YES; @@ -1363,6 +1369,7 @@ DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; + ENABLE_MODULE_VERIFIER = YES; INFOPLIST_FILE = Sources/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; LD_RUNPATH_SEARCH_PATHS = ( @@ -1371,6 +1378,7 @@ "@loader_path/Frameworks", ); MARKETING_VERSION = 1.2.0; + MODULE_VERIFIER_SUPPORTED_LANGUAGE_STANDARDS = "gnu11 gnu++14"; PRODUCT_BUNDLE_IDENTIFIER = com.almazrafi.DictionaryCoder; PRODUCT_NAME = DictionaryCoder; SDKROOT = appletvos; @@ -1391,6 +1399,7 @@ DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; + ENABLE_MODULE_VERIFIER = YES; INFOPLIST_FILE = Sources/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; LD_RUNPATH_SEARCH_PATHS = ( @@ -1399,6 +1408,7 @@ "@loader_path/Frameworks", ); MARKETING_VERSION = 1.2.0; + MODULE_VERIFIER_SUPPORTED_LANGUAGE_STANDARDS = "gnu11 gnu++14"; PRODUCT_BUNDLE_IDENTIFIER = com.almazrafi.DictionaryCoder; PRODUCT_NAME = DictionaryCoder; SDKROOT = appletvos; @@ -1411,7 +1421,6 @@ C0A01A5C23CB92EB00AC2C3A /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; CODE_SIGN_IDENTITY = ""; CODE_SIGN_STYLE = Automatic; INFOPLIST_FILE = Tests/Info.plist; @@ -1431,7 +1440,6 @@ C0A01A5D23CB92EB00AC2C3A /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; CODE_SIGN_IDENTITY = ""; CODE_SIGN_STYLE = Automatic; INFOPLIST_FILE = Tests/Info.plist; diff --git a/DictionaryCoder.xcodeproj/xcshareddata/xcschemes/DictionaryCoder iOS.xcscheme b/DictionaryCoder.xcodeproj/xcshareddata/xcschemes/DictionaryCoder iOS.xcscheme index 9eb1737..7372829 100644 --- a/DictionaryCoder.xcodeproj/xcshareddata/xcschemes/DictionaryCoder iOS.xcscheme +++ b/DictionaryCoder.xcodeproj/xcshareddata/xcschemes/DictionaryCoder iOS.xcscheme @@ -1,6 +1,6 @@ = 0.3) bigdecimal - concurrent-ruby (~> 1.0, >= 1.0.2) + concurrent-ruby (~> 1.0, >= 1.3.1) connection_pool (>= 2.2.5) drb i18n (>= 1.6, < 2) + logger (>= 1.4.2) minitest (>= 5.1) - mutex_m - tzinfo (~> 2.0) - addressable (2.8.6) - public_suffix (>= 2.0.2, < 6.0) + securerandom (>= 0.3) + tzinfo (~> 2.0, >= 2.0.5) + addressable (2.8.8) + public_suffix (>= 2.0.2, < 8.0) algoliasearch (1.27.5) httpclient (~> 2.8, >= 2.8.3) json (>= 1.5.1) - artifactory (3.0.15) + artifactory (3.0.17) atomos (0.1.3) - aws-eventstream (1.3.0) - aws-partitions (1.883.0) - aws-sdk-core (3.191.0) + aws-eventstream (1.4.0) + aws-partitions (1.1199.0) + aws-sdk-core (3.240.0) aws-eventstream (~> 1, >= 1.3.0) - aws-partitions (~> 1, >= 1.651.0) - aws-sigv4 (~> 1.8) + aws-partitions (~> 1, >= 1.992.0) + aws-sigv4 (~> 1.9) + base64 + bigdecimal jmespath (~> 1, >= 1.6.1) - aws-sdk-kms (1.77.0) - aws-sdk-core (~> 3, >= 3.191.0) - aws-sigv4 (~> 1.1) - aws-sdk-s3 (1.143.0) - aws-sdk-core (~> 3, >= 3.191.0) + logger + aws-sdk-kms (1.118.0) + aws-sdk-core (~> 3, >= 3.239.1) + aws-sigv4 (~> 1.5) + aws-sdk-s3 (1.209.0) + aws-sdk-core (~> 3, >= 3.234.0) aws-sdk-kms (~> 1) - aws-sigv4 (~> 1.8) - aws-sigv4 (1.8.0) + aws-sigv4 (~> 1.5) + aws-sigv4 (1.12.1) aws-eventstream (~> 1, >= 1.0.2) babosa (1.0.4) base64 (0.2.0) - bigdecimal (3.1.6) + benchmark (0.5.0) + bigdecimal (4.0.1) claide (1.1.0) claide-plugins (0.9.2) cork nap open4 (~> 1.3) - cocoapods (1.15.0) + cocoapods (1.16.2) addressable (~> 2.8) claide (>= 1.0.2, < 2.0) - cocoapods-core (= 1.15.0) + cocoapods-core (= 1.16.2) cocoapods-deintegrate (>= 1.0.3, < 2.0) cocoapods-downloader (>= 2.1, < 3.0) cocoapods-plugins (>= 1.0.0, < 2.0) @@ -61,8 +67,8 @@ GEM molinillo (~> 0.8.0) nap (~> 1.0) ruby-macho (>= 2.3.0, < 3.0) - xcodeproj (>= 1.23.0, < 2.0) - cocoapods-core (1.15.0) + xcodeproj (>= 1.27.0, < 2.0) + cocoapods-core (1.16.2) activesupport (>= 5.0, < 8) addressable (~> 2.8) algoliasearch (~> 1.0) @@ -85,45 +91,47 @@ GEM colored2 (3.1.2) commander (4.6.0) highline (~> 2.0.0) - concurrent-ruby (1.2.3) - connection_pool (2.4.1) + concurrent-ruby (1.3.6) + connection_pool (2.5.5) cork (0.3.0) colored2 (~> 3.1) - danger (9.4.2) + csv (3.3.5) + danger (9.5.3) + base64 (~> 0.2) claide (~> 1.0) claide-plugins (>= 0.9.2) - colored2 (~> 3.1) + colored2 (>= 3.1, < 5) cork (~> 0.1) faraday (>= 0.9.0, < 3.0) faraday-http-cache (~> 2.0) - git (~> 1.13) - kramdown (~> 2.3) + git (>= 1.13, < 3.0) + kramdown (>= 2.5.1, < 3.0) kramdown-parser-gfm (~> 1.0) - no_proxy_fix octokit (>= 4.0) - terminal-table (>= 1, < 4) + pstore (~> 0.1) + terminal-table (>= 1, < 5) danger-plugin-api (1.0.0) danger (> 2.0) - danger-swiftlint (0.35.0) + danger-swiftlint (0.37.4) danger rake (> 10) - thor (~> 1.0.0) - danger-xcode_summary (1.2.0) + thor (~> 1.4) + danger-xcode_summary (1.5.0) danger-plugin-api (~> 1.0) - xcresult (~> 0.2) + xcresult (~> 0.2.2) declarative (0.0.20) - digest-crc (0.6.5) + digest-crc (0.7.0) rake (>= 12.0.0, < 14.0.0) domain_name (0.6.20240107) dotenv (2.8.1) - drb (2.2.0) - ruby2_keywords + drb (2.2.3) emoji_regex (3.2.3) escape (0.0.4) - ethon (0.16.0) + ethon (0.18.0) ffi (>= 1.15.0) - excon (0.109.0) - faraday (1.10.3) + logger + excon (0.112.0) + faraday (1.10.4) faraday-em_http (~> 1.0) faraday-em_synchrony (~> 1.0) faraday-excon (~> 1.1) @@ -135,34 +143,37 @@ GEM faraday-rack (~> 1.0) faraday-retry (~> 1.0) ruby2_keywords (>= 0.0.4) - faraday-cookie_jar (0.0.7) + faraday-cookie_jar (0.0.8) faraday (>= 0.8.0) - http-cookie (~> 1.0.0) + http-cookie (>= 1.0.0) faraday-em_http (1.0.0) - faraday-em_synchrony (1.0.0) + faraday-em_synchrony (1.0.1) faraday-excon (1.1.0) faraday-http-cache (2.5.1) faraday (>= 0.8) faraday-httpclient (1.0.1) - faraday-multipart (1.0.4) - multipart-post (~> 2) - faraday-net_http (1.0.1) + faraday-multipart (1.2.0) + multipart-post (~> 2.0) + faraday-net_http (1.0.2) faraday-net_http_persistent (1.2.0) faraday-patron (1.0.0) faraday-rack (1.0.0) faraday-retry (1.0.3) - faraday_middleware (1.2.0) + faraday_middleware (1.2.1) faraday (~> 1.0) - fastimage (2.3.0) - fastlane (2.219.0) + fastimage (2.4.0) + fastlane (2.230.0) CFPropertyList (>= 2.3, < 4.0.0) + abbrev (~> 0.1.2) addressable (>= 2.8, < 3.0.0) artifactory (~> 3.0) aws-sdk-s3 (~> 1.0) babosa (>= 1.0.3, < 2.0.0) + base64 (~> 0.2.0) bundler (>= 1.12.0, < 3.0.0) - colored + colored (~> 1.2) commander (~> 4.6) + csv (~> 3.3) dotenv (>= 2.1.1, < 3.0.0) emoji_regex (>= 0.1, < 4.0) excon (>= 0.71.0, < 1.0.0) @@ -170,6 +181,7 @@ GEM faraday-cookie_jar (~> 0.0.6) faraday_middleware (~> 1.0) fastimage (>= 2.1.0, < 3.0.0) + fastlane-sirp (>= 1.0.0) gh_inspector (>= 1.1.2, < 2.0.0) google-apis-androidpublisher_v3 (~> 0.3) google-apis-playcustomapp_v1 (~> 0.1) @@ -179,13 +191,16 @@ GEM http-cookie (~> 1.0.5) json (< 3.0.0) jwt (>= 2.1.0, < 3) + logger (>= 1.6, < 2.0) mini_magick (>= 4.9.4, < 5.0.0) multipart-post (>= 2.0.0, < 3.0.0) + mutex_m (~> 0.3.0) naturally (~> 2.2) - optparse (>= 0.1.1) + nkf (~> 0.2.0) + optparse (>= 0.1.1, < 1.0.0) plist (>= 3.1.0, < 4.0.0) rubyzip (>= 2.0.0, < 3.0.0) - security (= 0.1.3) + security (= 0.1.5) simctl (~> 1.6.3) terminal-notifier (>= 2.0.0, < 3.0.0) terminal-table (~> 3) @@ -193,14 +208,18 @@ GEM tty-spinner (>= 0.8.0, < 1.0.0) word_wrap (~> 1.0.0) xcodeproj (>= 1.13.0, < 2.0.0) - xcpretty (~> 0.3.0) - xcpretty-travis-formatter (>= 0.0.3) - ffi (1.16.3) + xcpretty (~> 0.4.1) + xcpretty-travis-formatter (>= 0.0.3, < 2.0.0) + fastlane-sirp (1.0.0) + sysrandom (~> 1.0) + ffi (1.17.2) fourflusher (2.3.1) fuzzy_match (2.0.4) gh_inspector (1.1.3) - git (1.19.1) + git (2.3.3) + activesupport (>= 5.0) addressable (~> 2.8) + process_executer (~> 1.1) rchardet (~> 1.8) google-apis-androidpublisher_v3 (0.54.0) google-apis-core (>= 0.11.0, < 2.a) @@ -218,12 +237,12 @@ GEM google-apis-core (>= 0.11.0, < 2.a) google-apis-storage_v1 (0.31.0) google-apis-core (>= 0.11.0, < 2.a) - google-cloud-core (1.6.1) + google-cloud-core (1.8.0) google-cloud-env (>= 1.0, < 3.a) google-cloud-errors (~> 1.0) google-cloud-env (1.6.0) faraday (>= 0.17.3, < 3.0) - google-cloud-errors (1.3.1) + google-cloud-errors (1.5.0) google-cloud-storage (1.47.0) addressable (~> 2.8) digest-crc (~> 0.4) @@ -239,66 +258,73 @@ GEM os (>= 0.9, < 2.0) signet (>= 0.16, < 2.a) highline (2.0.3) - http-cookie (1.0.5) + http-cookie (1.0.8) domain_name (~> 0.5) - httpclient (2.8.3) - i18n (1.14.1) + httpclient (2.9.0) + mutex_m + i18n (1.14.8) concurrent-ruby (~> 1.0) jmespath (1.6.2) - json (2.7.1) - jwt (2.7.1) - kramdown (2.4.0) - rexml + json (2.18.0) + jwt (2.10.2) + base64 + kramdown (2.5.1) + rexml (>= 3.3.9) kramdown-parser-gfm (1.1.0) kramdown (~> 2.0) - mini_magick (4.12.0) + logger (1.7.0) + mini_magick (4.13.2) mini_mime (1.1.5) - minitest (5.21.2) + minitest (5.27.0) molinillo (0.8.0) - multi_json (1.15.0) - multipart-post (2.3.0) - mutex_m (0.2.0) - nanaimo (0.3.0) + multi_json (1.19.1) + multipart-post (2.4.1) + mutex_m (0.3.0) + nanaimo (0.4.0) nap (1.1.0) - naturally (2.2.1) + naturally (2.3.0) netrc (0.11.0) - no_proxy_fix (0.1.2) - octokit (8.0.0) + nkf (0.2.0) + octokit (10.0.0) faraday (>= 1, < 3) sawyer (~> 0.9) open4 (1.3.4) - optparse (0.4.0) + optparse (0.8.1) os (1.1.4) - plist (3.7.1) + plist (3.7.2) + process_executer (1.3.0) + pstore (0.2.0) public_suffix (4.0.7) - rake (13.1.0) - rchardet (1.8.0) + rake (13.3.1) + rchardet (1.10.0) representable (3.2.0) declarative (< 0.1.0) trailblazer-option (>= 0.1.1, < 0.2.0) uber (< 0.2.0) retriable (3.1.2) - rexml (3.2.6) - rouge (2.0.7) + rexml (3.4.4) + rouge (3.28.0) ruby-macho (2.5.1) ruby2_keywords (0.0.5) - rubyzip (2.3.2) - sawyer (0.9.2) + rubyzip (2.4.1) + sawyer (0.9.3) addressable (>= 2.3.5) faraday (>= 0.17.3, < 3) - security (0.1.3) - signet (0.18.0) + securerandom (0.4.1) + security (0.1.5) + signet (0.21.0) addressable (~> 2.8) faraday (>= 0.17.5, < 3.a) - jwt (>= 1.5, < 3.0) + jwt (>= 1.5, < 4.0) multi_json (~> 1.10) simctl (1.6.10) CFPropertyList naturally + sysrandom (1.0.5) terminal-notifier (2.0.0) terminal-table (3.0.2) unicode-display_width (>= 1.1.1, < 3) - thor (1.0.1) + thor (1.4.0) trailblazer-option (0.1.2) tty-cursor (0.7.1) tty-screen (0.8.2) @@ -309,25 +335,25 @@ GEM tzinfo (2.0.6) concurrent-ruby (~> 1.0) uber (0.1.0) - unicode-display_width (2.5.0) + unicode-display_width (2.6.0) word_wrap (1.0.0) xcode-install (2.8.1) claide (>= 0.9.1) fastlane (>= 2.1.0, < 3.0.0) - xcodeproj (1.24.0) + xcodeproj (1.27.0) CFPropertyList (>= 2.3.3, < 4.0) atomos (~> 0.1.3) claide (>= 1.0.2, < 2.0) colored2 (~> 3.1) - nanaimo (~> 0.3.0) - rexml (~> 3.2.4) - xcpretty (0.3.0) - rouge (~> 2.0.7) + nanaimo (~> 0.4.0) + rexml (>= 3.3.6, < 4.0) + xcpretty (0.4.1) + rouge (~> 3.28.0) xcpretty-json-formatter (0.1.1) xcpretty (~> 0.2, >= 0.0.7) xcpretty-travis-formatter (1.0.1) xcpretty (~> 0.2, >= 0.0.7) - xcresult (0.2.1) + xcresult (0.2.4) PLATFORMS ruby diff --git a/Package.swift b/Package.swift index 1018e37..0c5062b 100644 --- a/Package.swift +++ b/Package.swift @@ -3,22 +3,35 @@ import PackageDescription let package = Package( name: "DictionaryCoder", + platforms: [ + .macOS(.v12), + .iOS(.v13), + .tvOS(.v13), + .watchOS(.v6) + ], products: [ .library( name: "DictionaryCoder", targets: ["DictionaryCoder"] + ), + .library( + name: "DictionaryCoderDynamic", + type: .dynamic, + targets: ["DictionaryCoder"] ) ], targets: [ .target( name: "DictionaryCoder", - path: "Sources" + path: "Sources", + exclude: ["Info.plist"] ), .testTarget( name: "DictionaryCoderTests", dependencies: ["DictionaryCoder"], - path: "Tests" + path: "Tests", + exclude: ["Info.plist"] ) ], - swiftLanguageVersions: [.v6] + swiftLanguageModes: [.v6] ) diff --git a/Package@swift-5.9.swift b/Package@swift-5.9.swift new file mode 100644 index 0000000..357ff1d --- /dev/null +++ b/Package@swift-5.9.swift @@ -0,0 +1,37 @@ +// swift-tools-version:5.9 +import PackageDescription + +let package = Package( + name: "DictionaryCoder", + platforms: [ + .macOS(.v12), + .iOS(.v13), + .tvOS(.v13), + .watchOS(.v6) + ], + products: [ + .library( + name: "DictionaryCoder", + targets: ["DictionaryCoder"] + ), + .library( + name: "DictionaryCoderDynamic", + type: .dynamic, + targets: ["DictionaryCoder"] + ) + ], + targets: [ + .target( + name: "DictionaryCoder", + path: "Sources", + exclude: ["Info.plist"] + ), + .testTarget( + name: "DictionaryCoderTests", + dependencies: ["DictionaryCoder"], + path: "Tests", + exclude: ["Info.plist"] + ) + ], + swiftLanguageVersions: [.v5] +) diff --git a/README.md b/README.md index 1b0f703..73bfad4 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ [![License](https://img.shields.io/github/license/almazrafi/DictionaryCoder)](https://opensource.org/licenses/MIT) ## Requirements -- iOS 12.0+ / macOS 10.14+ / watchOS 5.0+ / tvOS 12.0+ +- iOS 12.0+ / macOS 11.5+ / watchOS 5.0+ / tvOS 12.0+ - Xcode 13.0+ - Swift 5.5+ @@ -39,7 +39,7 @@ $ gem install cocoapods To integrate DictionaryCoder into your Xcode project using [CocoaPods](http://cocoapods.org), specify it in your `Podfile`: ``` ruby -platform :ios, '12.0' +platform :ios, '13.0' use_frameworks! target '' do @@ -78,7 +78,7 @@ and then specify `"DictionaryCoder"` as a dependency of the Target in which you Here's an example `Package.swift`: ``` swift -// swift-tools-version:5.5 +// swift-tools-version:5.9 import PackageDescription let package = Package( diff --git a/Scripts/Bootstrap/aria2.sh b/Scripts/Bootstrap/aria2.sh new file mode 100755 index 0000000..ffab97c --- /dev/null +++ b/Scripts/Bootstrap/aria2.sh @@ -0,0 +1,12 @@ +#!/bin/sh + +readonly arguments=$@ +readonly script_path="$( cd "$( dirname "$0" )" && pwd )" + +source "${script_path}/common.sh" + +echo "Checking ${xcode_style}aria2${default_style} installation:" + +brew_install_if_needed aria2 "$arguments" + +echo "" diff --git a/Scripts/Bootstrap/common.sh b/Scripts/Bootstrap/common.sh index e463e9e..45f6522 100755 --- a/Scripts/Bootstrap/common.sh +++ b/Scripts/Bootstrap/common.sh @@ -18,9 +18,7 @@ readonly homebrew_style='\033[38;5;208m' readonly rbenv_style='\033[38;5;43m' readonly ruby_style='\033[38;5;89m' readonly bundler_style='\033[38;5;45m' -readonly swiftenv_style='\033[38;5;226m' readonly swift_style='\033[38;5;208m' -readonly spm_style='\033[38;5;202m' readonly mint_style='\033[0;38;5;77m' readonly congratulations_style='\033[38;5;48m' diff --git a/Scripts/Bootstrap/gemfile.sh b/Scripts/Bootstrap/gemfile.sh index 6e6be8f..4187c70 100755 --- a/Scripts/Bootstrap/gemfile.sh +++ b/Scripts/Bootstrap/gemfile.sh @@ -5,6 +5,25 @@ readonly script_path="$( cd "$( dirname "$0" )" && pwd )" source "${script_path}/common.sh" +readonly shell_all_local_line="export LC_ALL=en_US.UTF-8" +readonly shell_default_local_line="export LANG=en_US.UTF-8" + +setup_shell() { + local shell_profile_path=$1 + + if [[ ! -f "${shell_profile_path}" ]]; then + > "${shell_profile_path}" + fi + + if [[ $(grep -L "^${shell_all_local_line}" "${shell_profile_path}") ]]; then + echo "${shell_all_local_line}" >> "${shell_profile_path}" + fi + + if [[ $(grep -L "^${shell_default_local_line}" "${shell_profile_path}") ]]; then + echo "${shell_default_local_line}" >> "${shell_profile_path}" + fi +} + if [[ "$(uname -m)" == "arm64" ]]; then eval "$(/opt/homebrew/bin/brew shellenv)" fi @@ -21,4 +40,6 @@ else assert_failure '(cd "${root_path}" && bundle install)' fi +setup_shell "${HOME}/.zshrc" + echo "" diff --git a/Scripts/Bootstrap/homebrew.sh b/Scripts/Bootstrap/homebrew.sh index 0f26f6c..e2f6b67 100755 --- a/Scripts/Bootstrap/homebrew.sh +++ b/Scripts/Bootstrap/homebrew.sh @@ -14,7 +14,7 @@ setup_shell() { > "${shell_profile_path}" fi - if [[ $(grep -L "${shell_init_line}" "${shell_profile_path}") ]]; then + if [[ $(grep -L "^${shell_init_line}" "${shell_profile_path}") ]]; then echo "${shell_init_line}" >> "${shell_profile_path}" fi } diff --git a/Scripts/Bootstrap/macos.sh b/Scripts/Bootstrap/macos.sh index 8b2d85d..68ac8d5 100755 --- a/Scripts/Bootstrap/macos.sh +++ b/Scripts/Bootstrap/macos.sh @@ -10,7 +10,7 @@ plain_version() { echo "Checking ${macos_style}macOS${default_style} version:" -readonly macos_required_version='11.3.0' +readonly macos_required_version=$(cat "${root_path}"/.system-version) readonly macos_version=$(/usr/bin/sw_vers -productVersion 2>&1) if [ "$(plain_version ${macos_version})" -lt "$(plain_version ${macos_required_version})" ]; then diff --git a/Scripts/Bootstrap/mint.sh b/Scripts/Bootstrap/mint.sh index 5340701..7c17246 100755 --- a/Scripts/Bootstrap/mint.sh +++ b/Scripts/Bootstrap/mint.sh @@ -15,11 +15,11 @@ setup_shell() { > "${shell_profile_path}" fi - if [[ $(grep -L "${shell_mint_path_line}" "${shell_profile_path}") ]]; then + if [[ $(grep -L "^${shell_mint_path_line}" "${shell_profile_path}") ]]; then echo "${shell_mint_path_line}" >> "${shell_profile_path}" fi - if [[ $(grep -L "${shell_mint_link_path_line}" "${shell_profile_path}") ]]; then + if [[ $(grep -L "^${shell_mint_link_path_line}" "${shell_profile_path}") ]]; then echo "${shell_mint_link_path_line}" >> "${shell_profile_path}" fi } @@ -29,8 +29,4 @@ echo "Checking ${mint_style}Mint${default_style} installation:" brew_install_if_needed mint "$arguments" setup_shell "${HOME}/.zshrc" -if [[ -f "${HOME}/.bash_profile" ]]; then - setup_shell "${HOME}/.bash_profile" -fi - echo "" diff --git a/Scripts/Bootstrap/rbenv.sh b/Scripts/Bootstrap/rbenv.sh index 587f85e..e19ccfa 100755 --- a/Scripts/Bootstrap/rbenv.sh +++ b/Scripts/Bootstrap/rbenv.sh @@ -16,31 +16,28 @@ setup_shell() { > "${shell_profile_path}" fi - if [[ $(grep -L "${shell_init_line}" "${shell_profile_path}") ]]; then + if [[ $(grep -L "^${shell_init_line}" "${shell_profile_path}") ]]; then echo "${shell_init_line}" >> "${shell_profile_path}" fi } cleanup() { - rm -rf $doctor_temp_path; + rm -rf "${doctor_temp_path}" } trap cleanup EXIT echo "Checking ${rbenv_style}rbenv${default_style} installation:" -brew_install_if_needed rbenv +brew_install_if_needed rbenv "${arguments}" setup_shell "${HOME}/.zshrc" -if [[ -f "${HOME}/.bash_profile" ]]; then - setup_shell "${HOME}/.bash_profile" -fi - eval "$(rbenv init -)" if [[ " ${arguments[*]} " == *" ${verify_flag} "* ]]; then echo "" echo " Verifying that rbenv is properly set up..." + curl -fsSL "${doctor_url}" > "${doctor_temp_path}" 2> /dev/null rbenv_doctor_exit_code=$? diff --git a/Scripts/Bootstrap/spm.sh b/Scripts/Bootstrap/spm.sh index 61a24a7..39041dc 100755 --- a/Scripts/Bootstrap/spm.sh +++ b/Scripts/Bootstrap/spm.sh @@ -9,14 +9,7 @@ if [[ "$(uname -m)" == "arm64" ]]; then eval "$(/opt/homebrew/bin/brew shellenv)" fi -eval "$(swiftenv init -)" - -if [[ " ${arguments[*]} " == *" ${update_flag} "* ]]; then - echo "Updating ${spm_style}Swift packages${default_style} specified in Package.swift..." - assert_failure '(cd "${root_path}" && swift package update)' -else - echo "Resolving ${spm_style}Swift packages${default_style} specified in Package.swift..." - assert_failure '(cd "${root_path}" && swift package resolve)' -fi +echo "Resolving ${swift_style}Swift packages${default_style} specified in Package.swift..." +assert_failure '(cd "${root_path}" && swift package resolve)' echo "" diff --git a/Scripts/Bootstrap/swift.sh b/Scripts/Bootstrap/swift.sh deleted file mode 100755 index b0a708d..0000000 --- a/Scripts/Bootstrap/swift.sh +++ /dev/null @@ -1,26 +0,0 @@ -#!/bin/sh - -readonly script_path="$( cd "$( dirname "$0" )" && pwd )" - -source "${script_path}/common.sh" - -echo "Checking ${swift_style}Swift${default_style} version:" - -if [[ "$(uname -m)" == "arm64" ]]; then - eval "$(/opt/homebrew/bin/brew shellenv)" -fi - -eval "$(swiftenv init -)" - -readonly swift_required_version=$(cat "${root_path}"/.swift-version) -readonly swift_versions=($(swiftenv versions 2>&1)) - -if [[ " ${swift_versions[@]} " =~ " ${swift_required_version} " ]]; then - echo " Required Swift version ($swift_required_version) already installed." -else - echo " Required Swift version ($swift_required_version) not found. Installing..." - assert_failure '(cd "${root_path}" && swiftenv install $swift_required_version)' - assert_warning '(cd "${root_path}" && swiftenv rehash)' -fi - -echo "" diff --git a/Scripts/Bootstrap/swiftenv.sh b/Scripts/Bootstrap/swiftenv.sh deleted file mode 100755 index 7b7be47..0000000 --- a/Scripts/Bootstrap/swiftenv.sh +++ /dev/null @@ -1,33 +0,0 @@ -#!/bin/sh - -readonly arguments=$@ -readonly script_path="$( cd "$( dirname "$0" )" && pwd )" - -source "${script_path}/common.sh" - -readonly shell_init_line='if which swiftenv > /dev/null; then eval "$(swiftenv init -)"; fi' - -setup_shell() { - local shell_profile_path=$1 - - if [[ ! -f "${shell_profile_path}" ]]; then - > "${shell_profile_path}" - fi - - if [[ $(grep -L "${shell_init_line}" "${shell_profile_path}") ]]; then - echo "${shell_init_line}" >> "${shell_profile_path}" - fi -} - -echo "Checking ${swiftenv_style}swiftenv${default_style} installation:" - -brew_install_if_needed kylef/formulae/swiftenv "$arguments" -setup_shell "${HOME}/.zshrc" - -if [[ -f "${HOME}/.bash_profile" ]]; then - setup_shell "${HOME}/.bash_profile" -fi - -eval "$(swiftenv init -)" - -echo "" diff --git a/Scripts/Bootstrap/xcode.sh b/Scripts/Bootstrap/xcode.sh index c851f64..0957c75 100755 --- a/Scripts/Bootstrap/xcode.sh +++ b/Scripts/Bootstrap/xcode.sh @@ -11,7 +11,7 @@ while [[ "$#" -gt 0 ]]; do done if [ -n "${sudo_password}" ]; then - echo "${sudo_password}" | sudo -S -E "$0" "$@" + echo "${sudo_password}" | sudo -S -E "$0" exit $? fi @@ -25,23 +25,44 @@ if [[ "$(uname -m)" == "arm64" ]]; then eval "$(/opt/homebrew/bin/brew shellenv)" fi -eval "$(rbenv init -)" - readonly xcode_required_version=$(cat "${root_path}"/.xcode-version) -readonly xcode_version=($(bundle exec xcversion selected 2> /dev/null | sed -n 's/Xcode \(.*\)/\1/p')) +readonly xcode_installed_versions=($(xcodes installed 2>&1)) + +if [[ " ${xcode_installed_versions[@]} " =~ " ${xcode_required_version} " ]]; then + readonly xcode_selected_version=$(xcodes installed 2>&1 | sed -n '/Selected/p') -if [[ "$xcode_version" == "$xcode_required_version" ]]; then - echo " Required Xcode version ($xcode_required_version) already installed." + if [[ " ${xcode_selected_version} " =~ " ${xcode_required_version} " ]]; then + echo " Required Xcode version (${xcode_required_version}) already installed and selected." + else + echo " Required Xcode version (${xcode_required_version}) already installed. Selecting..." + assert_failure '(xcodes select "${xcode_required_version}")' + fi else echo " Required Xcode version ($xcode_required_version) not found. Installing..." - bundle exec xcversion update - bundle exec xcversion install ${xcode_required_version} + assert_failure 'xcodes update' + + if [ -n "${FASTLANE_SESSION}" ]; then + xcodes install "${xcode_required_version}" --use-fastlane-auth + else + xcodes install "${xcode_required_version}" + fi echo " Selecting Xcode version..." + assert_failure '(xcodes select "${xcode_required_version}")' - bundle exec xcversion select "${xcode_required_version}" - sudo xcodebuild -license accept + echo " Accepting license..." + assert_failure '(sudo xcodebuild -license accept)' +fi + +readonly xcode_runtime_required_version=$(cat "${root_path}"/.xcode-runtime-version) +readonly xcode_runtime_installed_versions=($(xcrun simctl runtime list 2>&1)) + +if [[ ! " ${xcode_runtime_installed_versions[@]} " =~ " ${xcode_runtime_required_version} " ]]; then + echo " Required Xcode runtime version (${xcode_runtime_required_version}) not found. Installing..." + xcodes runtimes install "iOS ${xcode_runtime_required_version}" +else + echo " Required Xcode runtime version (${xcode_runtime_required_version}) already installed." fi echo "" diff --git a/Scripts/Bootstrap/xcodes.sh b/Scripts/Bootstrap/xcodes.sh new file mode 100755 index 0000000..9422b7b --- /dev/null +++ b/Scripts/Bootstrap/xcodes.sh @@ -0,0 +1,12 @@ +#!/bin/sh + +readonly arguments=$@ +readonly script_path="$( cd "$( dirname "$0" )" && pwd )" + +source "${script_path}/common.sh" + +echo "Checking ${xcode_style}xcodes${default_style} installation:" + +brew_install_if_needed xcodesorg/made/xcodes "$arguments" + +echo "" diff --git a/Scripts/Helpers/script-run.sh b/Scripts/Helpers/script-run.sh index 5b51133..bf1aa4b 100755 --- a/Scripts/Helpers/script-run.sh +++ b/Scripts/Helpers/script-run.sh @@ -19,7 +19,6 @@ run() { if which mint >/dev/null; then (cd "${root_path}" && mint run "$@") else - echo "error: Mint does not exist" - exit 1 + echo "warning: Mint does not exist" fi } diff --git a/Scripts/bootstrap.sh b/Scripts/bootstrap.sh index eab20c8..34f14df 100755 --- a/Scripts/bootstrap.sh +++ b/Scripts/bootstrap.sh @@ -15,11 +15,10 @@ readonly bootstrap_path="${script_path}/Bootstrap" "${bootstrap_path}/bundler.sh" --update "${bootstrap_path}/gemfile.sh" +"${bootstrap_path}/aria2.sh" --update +"${bootstrap_path}/xcodes.sh" --update "${bootstrap_path}/xcode.sh" -"${bootstrap_path}/swiftenv.sh" --update -"${bootstrap_path}/swift.sh" --update - "${bootstrap_path}/spm.sh" "${bootstrap_path}/mint.sh" --update diff --git a/Sources/DictionaryCoder.h b/Sources/DictionaryCoder.h deleted file mode 100644 index 931d022..0000000 --- a/Sources/DictionaryCoder.h +++ /dev/null @@ -1,4 +0,0 @@ -#import - -FOUNDATION_EXPORT double DictionaryCoderVersionNumber; -FOUNDATION_EXPORT const unsigned char DictionaryCoderVersionString[]; diff --git a/Tests/Decoder/DictionaryDecoderTesting.swift b/Tests/Decoder/DictionaryDecoderTesting.swift index 1a421a3..d2b4776 100644 --- a/Tests/Decoder/DictionaryDecoderTesting.swift +++ b/Tests/Decoder/DictionaryDecoderTesting.swift @@ -28,7 +28,7 @@ extension DictionaryDecoderTesting { func assertDecoderSucceeds( decoding expectedValue: [Key: Value], from dictionary: [String: Any], - file: StaticString = #file, + file: StaticString = #filePath, line: UInt = #line ) { do { @@ -48,7 +48,7 @@ extension DictionaryDecoderTesting { func assertDecoderSucceeds( decoding valueType: [Key: Value].Type, from dictionary: [String: Any], - file: StaticString = #file, + file: StaticString = #filePath, line: UInt = #line ) { do { @@ -68,7 +68,7 @@ extension DictionaryDecoderTesting { func assertDecoderSucceeds( decoding expectedValue: T, from dictionary: [String: Any], - file: StaticString = #file, + file: StaticString = #filePath, line: UInt = #line ) { do { @@ -83,7 +83,7 @@ extension DictionaryDecoderTesting { func assertDecoderSucceeds( decoding valueType: T.Type, from dictionary: [String: Any], - file: StaticString = #file, + file: StaticString = #filePath, line: UInt = #line ) { do { @@ -103,7 +103,7 @@ extension DictionaryDecoderTesting { func assertDecoderFails( decoding valueType: T.Type, from dictionary: [String: Any], - file: StaticString = #file, + file: StaticString = #filePath, line: UInt = #line, errorValidation: (_ error: Error) -> Bool ) { diff --git a/Tests/Encoder/DictionaryEncoderTesting.swift b/Tests/Encoder/DictionaryEncoderTesting.swift index e167860..9dcf531 100644 --- a/Tests/Encoder/DictionaryEncoderTesting.swift +++ b/Tests/Encoder/DictionaryEncoderTesting.swift @@ -31,7 +31,7 @@ extension DictionaryEncoderTesting { func assertEncoderSucceeds( encoding value: T, expecting expectedDictionary: [String: Any], - file: StaticString = #file, + file: StaticString = #filePath, line: UInt = #line ) { do { @@ -50,7 +50,7 @@ extension DictionaryEncoderTesting { func assertEncoderSucceeds( encoding value: T, - file: StaticString = #file, + file: StaticString = #filePath, line: UInt = #line ) { do { @@ -69,7 +69,7 @@ extension DictionaryEncoderTesting { func assertEncoderFails( encoding value: T, - file: StaticString = #file, + file: StaticString = #filePath, line: UInt = #line, errorValidation: (_ error: Error) -> Bool ) { From ccabaa60d3ca2b8cd176db5946457986a879cf25 Mon Sep 17 00:00:00 2001 From: Almaz Ibragimov Date: Mon, 29 Dec 2025 12:45:02 +0300 Subject: [PATCH 2/3] Decored and Encoder interface improvements --- Sources/Decoder/DictionaryDecoder.swift | 51 +++++++++++----- .../Options/DictionaryDecodingOptions.swift | 8 +-- Sources/Encoder/DictionaryEncoder.swift | 58 +++++++++++++------ .../Options/DictionaryEncodingOptions.swift | 10 ++-- Sources/Tools/Mutex/Mutex.swift | 36 ++++++++++++ Sources/Tools/Mutex/MutexStorage.swift | 38 ++++++++++++ 6 files changed, 160 insertions(+), 41 deletions(-) create mode 100644 Sources/Tools/Mutex/Mutex.swift create mode 100644 Sources/Tools/Mutex/MutexStorage.swift diff --git a/Sources/Decoder/DictionaryDecoder.swift b/Sources/Decoder/DictionaryDecoder.swift index 1065c6f..63dce5b 100644 --- a/Sources/Decoder/DictionaryDecoder.swift +++ b/Sources/Decoder/DictionaryDecoder.swift @@ -4,11 +4,33 @@ public final class DictionaryDecoder: Sendable { // MARK: - Instance Properties - public let dateDecodingStrategy: DictionaryDateDecodingStrategy - public let dataDecodingStrategy: DictionaryDataDecodingStrategy - public let nonConformingFloatDecodingStrategy: DictionaryNonConformingFloatDecodingStrategy - public let keyDecodingStrategy: DictionaryKeyDecodingStrategy - public let userInfo: [CodingUserInfoKey: Sendable] + private let optionsMutex: Mutex + private let userInfoMutex: Mutex<[CodingUserInfoKey: Sendable]> + + public var dateDecodingStrategy: DictionaryDateDecodingStrategy { + get { optionsMutex.withLock { $0.dateDecodingStrategy } } + set { optionsMutex.withLock { $0.dateDecodingStrategy = newValue } } + } + + public var dataDecodingStrategy: DictionaryDataDecodingStrategy { + get { optionsMutex.withLock { $0.dataDecodingStrategy } } + set { optionsMutex.withLock { $0.dataDecodingStrategy = newValue } } + } + + public var nonConformingFloatDecodingStrategy: DictionaryNonConformingFloatDecodingStrategy { + get { optionsMutex.withLock { $0.nonConformingFloatDecodingStrategy } } + set { optionsMutex.withLock { $0.nonConformingFloatDecodingStrategy = newValue } } + } + + public var keyDecodingStrategy: DictionaryKeyDecodingStrategy { + get { optionsMutex.withLock { $0.keyDecodingStrategy } } + set { optionsMutex.withLock { $0.keyDecodingStrategy = newValue } } + } + + public var userInfo: [CodingUserInfoKey: Sendable] { + get { userInfoMutex.withLock { $0 } } + set { userInfoMutex.withLock { $0 = newValue } } + } // MARK: - Initializers @@ -19,16 +41,6 @@ public final class DictionaryDecoder: Sendable { keyDecodingStrategy: DictionaryKeyDecodingStrategy = .useDefaultKeys, userInfo: [CodingUserInfoKey: Sendable] = [:] ) { - self.dateDecodingStrategy = dateDecodingStrategy - self.dataDecodingStrategy = dataDecodingStrategy - self.nonConformingFloatDecodingStrategy = nonConformingFloatDecodingStrategy - self.keyDecodingStrategy = keyDecodingStrategy - self.userInfo = userInfo - } - - // MARK: - Instance Methods - - public func decode(_ type: T.Type, from dictionary: [String: Any]) throws -> T { let options = DictionaryDecodingOptions( dateDecodingStrategy: dateDecodingStrategy, dataDecodingStrategy: dataDecodingStrategy, @@ -36,6 +48,15 @@ public final class DictionaryDecoder: Sendable { keyDecodingStrategy: keyDecodingStrategy ) + self.optionsMutex = Mutex(value: options) + self.userInfoMutex = Mutex(value: userInfo) + } + + // MARK: - Instance Methods + + public func decode(_ type: T.Type, from dictionary: [String: Any]) throws -> T { + let options = optionsMutex.withLock { $0 } + let decoder = DictionarySingleValueDecodingContainer( component: dictionary, options: options, diff --git a/Sources/Decoder/Options/DictionaryDecodingOptions.swift b/Sources/Decoder/Options/DictionaryDecodingOptions.swift index e09688c..fa2a51f 100644 --- a/Sources/Decoder/Options/DictionaryDecodingOptions.swift +++ b/Sources/Decoder/Options/DictionaryDecodingOptions.swift @@ -4,8 +4,8 @@ internal struct DictionaryDecodingOptions { // MARK: - Instance Properties - internal let dateDecodingStrategy: DictionaryDateDecodingStrategy - internal let dataDecodingStrategy: DictionaryDataDecodingStrategy - internal let nonConformingFloatDecodingStrategy: DictionaryNonConformingFloatDecodingStrategy - internal let keyDecodingStrategy: DictionaryKeyDecodingStrategy + internal var dateDecodingStrategy: DictionaryDateDecodingStrategy + internal var dataDecodingStrategy: DictionaryDataDecodingStrategy + internal var nonConformingFloatDecodingStrategy: DictionaryNonConformingFloatDecodingStrategy + internal var keyDecodingStrategy: DictionaryKeyDecodingStrategy } diff --git a/Sources/Encoder/DictionaryEncoder.swift b/Sources/Encoder/DictionaryEncoder.swift index b01971f..21fa463 100644 --- a/Sources/Encoder/DictionaryEncoder.swift +++ b/Sources/Encoder/DictionaryEncoder.swift @@ -4,12 +4,38 @@ public final class DictionaryEncoder: Sendable { // MARK: - Instance Properties - public let dateEncodingStrategy: DictionaryDateEncodingStrategy - public let dataEncodingStrategy: DictionaryDataEncodingStrategy - public let nonConformingFloatEncodingStrategy: DictionaryNonConformingFloatEncodingStrategy - public let nilEncodingStrategy: DictionaryNilEncodingStrategy - public let keyEncodingStrategy: DictionaryKeyEncodingStrategy - public let userInfo: [CodingUserInfoKey: Sendable] + private let optionsMutex: Mutex + private let userInfoMutex: Mutex<[CodingUserInfoKey: Sendable]> + + public var dateEncodingStrategy: DictionaryDateEncodingStrategy { + get { optionsMutex.withLock { $0.dateEncodingStrategy } } + set { optionsMutex.withLock { $0.dateEncodingStrategy = newValue } } + } + + public var dataEncodingStrategy: DictionaryDataEncodingStrategy { + get { optionsMutex.withLock { $0.dataEncodingStrategy } } + set { optionsMutex.withLock { $0.dataEncodingStrategy = newValue } } + } + + public var nonConformingFloatEncodingStrategy: DictionaryNonConformingFloatEncodingStrategy { + get { optionsMutex.withLock { $0.nonConformingFloatEncodingStrategy } } + set { optionsMutex.withLock { $0.nonConformingFloatEncodingStrategy = newValue } } + } + + public var nilEncodingStrategy: DictionaryNilEncodingStrategy { + get { optionsMutex.withLock { $0.nilEncodingStrategy } } + set { optionsMutex.withLock { $0.nilEncodingStrategy = newValue } } + } + + public var keyEncodingStrategy: DictionaryKeyEncodingStrategy { + get { optionsMutex.withLock { $0.keyEncodingStrategy } } + set { optionsMutex.withLock { $0.keyEncodingStrategy = newValue } } + } + + public var userInfo: [CodingUserInfoKey: Sendable] { + get { userInfoMutex.withLock { $0 } } + set { userInfoMutex.withLock { $0 = newValue } } + } // MARK: - Initializers @@ -21,17 +47,6 @@ public final class DictionaryEncoder: Sendable { keyEncodingStrategy: DictionaryKeyEncodingStrategy = .useDefaultKeys, userInfo: [CodingUserInfoKey: Sendable] = [:] ) { - self.dateEncodingStrategy = dateEncodingStrategy - self.dataEncodingStrategy = dataEncodingStrategy - self.nonConformingFloatEncodingStrategy = nonConformingFloatEncodingStrategy - self.nilEncodingStrategy = nilEncodingStrategy - self.keyEncodingStrategy = keyEncodingStrategy - self.userInfo = userInfo - } - - // MARK: - Instance Methods - - public func encode(_ value: T) throws -> [String: Sendable] { let options = DictionaryEncodingOptions( dateEncodingStrategy: dateEncodingStrategy, dataEncodingStrategy: dataEncodingStrategy, @@ -40,6 +55,15 @@ public final class DictionaryEncoder: Sendable { keyEncodingStrategy: keyEncodingStrategy ) + self.optionsMutex = Mutex(value: options) + self.userInfoMutex = Mutex(value: userInfo) + } + + // MARK: - Instance Methods + + public func encode(_ value: T) throws -> [String: Sendable] { + let options = optionsMutex.withLock { $0 } + let encoder = DictionarySingleValueEncodingContainer( options: options, userInfo: userInfo, diff --git a/Sources/Encoder/Options/DictionaryEncodingOptions.swift b/Sources/Encoder/Options/DictionaryEncodingOptions.swift index 63815f7..6878ada 100644 --- a/Sources/Encoder/Options/DictionaryEncodingOptions.swift +++ b/Sources/Encoder/Options/DictionaryEncodingOptions.swift @@ -4,9 +4,9 @@ internal struct DictionaryEncodingOptions { // MARK: - Instance Properties - internal let dateEncodingStrategy: DictionaryDateEncodingStrategy - internal let dataEncodingStrategy: DictionaryDataEncodingStrategy - internal let nonConformingFloatEncodingStrategy: DictionaryNonConformingFloatEncodingStrategy - internal let nilEncodingStrategy: DictionaryNilEncodingStrategy - internal let keyEncodingStrategy: DictionaryKeyEncodingStrategy + internal var dateEncodingStrategy: DictionaryDateEncodingStrategy + internal var dataEncodingStrategy: DictionaryDataEncodingStrategy + internal var nonConformingFloatEncodingStrategy: DictionaryNonConformingFloatEncodingStrategy + internal var nilEncodingStrategy: DictionaryNilEncodingStrategy + internal var keyEncodingStrategy: DictionaryKeyEncodingStrategy } diff --git a/Sources/Tools/Mutex/Mutex.swift b/Sources/Tools/Mutex/Mutex.swift new file mode 100644 index 0000000..1f3bcb2 --- /dev/null +++ b/Sources/Tools/Mutex/Mutex.swift @@ -0,0 +1,36 @@ +import Foundation + +public struct Mutex: @unchecked Sendable { + + private let storage: MutexStorage + + public init(value: Value) { + self.storage = MutexStorage(value: value) + } + + public borrowing func withLock( + _ body: (inout Value) throws -> Result + ) rethrows -> Result { + storage.lock() + + defer { + storage.unlock() + } + + return try body(&storage.value) + } + + public borrowing func withLockIfAvailable( + _ body: (inout Value) throws -> Result + ) rethrows -> Result? { + guard storage.tryLock() else { + return nil + } + + defer { + storage.unlock() + } + + return try body(&storage.value) + } +} diff --git a/Sources/Tools/Mutex/MutexStorage.swift b/Sources/Tools/Mutex/MutexStorage.swift new file mode 100644 index 0000000..a884dad --- /dev/null +++ b/Sources/Tools/Mutex/MutexStorage.swift @@ -0,0 +1,38 @@ +import Foundation + +import struct os.os_unfair_lock_t +import struct os.os_unfair_lock + +import func os.os_unfair_lock_lock +import func os.os_unfair_lock_unlock +import func os.os_unfair_lock_trylock + +internal final class MutexStorage { + + private let unfairLock = os_unfair_lock_t.allocate(capacity: 1) + + internal var value: Value + + internal init(value: consuming Value) { + self.value = value + + unfairLock.initialize(to: os_unfair_lock()) + } + + deinit { + unfairLock.deinitialize(count: 1) + unfairLock.deallocate() + } + + internal func lock() { + os_unfair_lock_lock(unfairLock) + } + + internal func unlock() { + os_unfair_lock_unlock(unfairLock) + } + + internal func tryLock() -> Bool { + os_unfair_lock_trylock(unfairLock) + } +} From 39e3d64f409e2018a8cfeaa359c5bba762c8a7fc Mon Sep 17 00:00:00 2001 From: Almaz Ibragimov Date: Mon, 29 Dec 2025 15:00:10 +0300 Subject: [PATCH 3/3] Fixed array optionals --- .../Encoder/DictionaryUnkeyedEncodingContainer.swift | 7 ++++++- Tests/Encoder/DictionaryEncoderTests.swift | 11 ++++++++++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/Sources/Encoder/DictionaryUnkeyedEncodingContainer.swift b/Sources/Encoder/DictionaryUnkeyedEncodingContainer.swift index 863471c..842b89e 100644 --- a/Sources/Encoder/DictionaryUnkeyedEncodingContainer.swift +++ b/Sources/Encoder/DictionaryUnkeyedEncodingContainer.swift @@ -148,6 +148,11 @@ internal final class DictionaryUnkeyedEncodingContainer: // MARK: - DictionaryComponentContainer internal func resolveValue() -> Any? { - components.map { $0.resolveValue() } + let values = components + .lazy + .map { $0.resolveValue() } + .compactMap { $0 ?? $0 as Any } + + return Array(values) } } diff --git a/Tests/Encoder/DictionaryEncoderTests.swift b/Tests/Encoder/DictionaryEncoderTests.swift index 8533ad2..17f8083 100644 --- a/Tests/Encoder/DictionaryEncoderTests.swift +++ b/Tests/Encoder/DictionaryEncoderTests.swift @@ -151,7 +151,7 @@ final class DictionaryEncoderTests: XCTestCase, DictionaryEncoderTesting { assertEncoderSucceeds(encoding: value) } - func testThatEncoderSucceedsWhenEncodingStringToArrayDictionary() { + func testThatEncoderSucceedsWhenEncodingStringToArrayWithOptionalsDictionary() { let value: [String: [Int?]] = [ "foo": [1, 2, 3], "bar": [4, nil, 6] @@ -160,6 +160,15 @@ final class DictionaryEncoderTests: XCTestCase, DictionaryEncoderTesting { assertEncoderSucceeds(encoding: value) } + func testThatEncoderSucceedsWhenEncodingStringToArrayWithoutOptionalsDictionary() { + let value: [String: [String]] = [ + "foo": ["qwe", "asd"], + "bar": ["zxc"] + ] + + assertEncoderSucceeds(encoding: value) + } + func testThatEncoderSucceedsWhenEncodingNestedStringToIntDictionary() { let value = [ "foo": [