Skip to content

Commit

Permalink
Migration to swift testing + fix iso latin for linux platform
Browse files Browse the repository at this point in the history
  • Loading branch information
chicio committed Oct 12, 2024
1 parent 412798b commit 3f7a4dd
Show file tree
Hide file tree
Showing 48 changed files with 1,274 additions and 1,183 deletions.
65 changes: 34 additions & 31 deletions ID3TagEditor.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@
452831CE2044C40700458375 /* ID3TagEditor macOS Tests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "ID3TagEditor macOS Tests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; };
452831E52044C4F500458375 /* ID3TagEditor.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = ID3TagEditor.framework; sourceTree = BUILT_PRODUCTS_DIR; };
452831ED2044C4F500458375 /* ID3TagEditor iOS Tests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "ID3TagEditor iOS Tests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; };
4553D64521946A3000540631 /* LinuxMain.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LinuxMain.swift; sourceTree = "<group>"; };
45541B7720598F6C0025A8BF /* ID3TagEditor.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = ID3TagEditor.framework; sourceTree = BUILT_PRODUCTS_DIR; };
45541BE52059954C0025A8BF /* ID3TagEditor tvOS Tests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "ID3TagEditor tvOS Tests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; };
45541C25205999A20025A8BF /* CHANGELOG.md */ = {isa = PBXFileReference; lastKnownFileType = net.daringfireball.markdown; path = CHANGELOG.md; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.markdown; };
Expand Down Expand Up @@ -106,7 +105,6 @@
membershipExceptions = (
Info.plist,
Utils/PathLoader.swift,
XCTestManifests.swift,
);
target = 452831CD2044C40700458375 /* ID3TagEditor macOS Tests */;
};
Expand All @@ -115,7 +113,6 @@
membershipExceptions = (
Info.plist,
Utils/PathLoader.swift,
XCTestManifests.swift,
);
target = 452831EC2044C4F500458375 /* ID3TagEditor iOS Tests */;
};
Expand All @@ -124,7 +121,6 @@
membershipExceptions = (
Info.plist,
Utils/PathLoader.swift,
XCTestManifests.swift,
);
target = 45541BE42059954C0025A8BF /* ID3TagEditor tvOS Tests */;
};
Expand Down Expand Up @@ -232,7 +228,6 @@
45AB7195204AD842004A2239 /* README.md */,
45AB7194204AD842004A2239 /* LICENSE.md */,
455CF9862340C14B004C880A /* ID3TagEditor.podspec */,
4553D64521946A3000540631 /* LinuxMain.swift */,
45AB7193204AD842004A2239 /* Package.swift */,
45D4C39A25399ABD00501417 /* .codebeatignore */,
45D4C39C25399ABD00501417 /* .gitignore */,
Expand Down Expand Up @@ -464,7 +459,6 @@
452831CD2044C40700458375 = {
CreatedOnToolsVersion = 9.2;
LastSwiftMigration = 1100;
ProvisioningStyle = Automatic;
};
452831E42044C4F500458375 = {
CreatedOnToolsVersion = 9.2;
Expand All @@ -474,7 +468,6 @@
452831EC2044C4F500458375 = {
CreatedOnToolsVersion = 9.2;
LastSwiftMigration = 1100;
ProvisioningStyle = Automatic;
};
45541B7620598F6C0025A8BF = {
CreatedOnToolsVersion = 9.2;
Expand Down Expand Up @@ -788,7 +781,7 @@
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_STRICT_CONCURRENCY = complete;
SWIFT_VERSION = 5.0;
SWIFT_VERSION = 6.0;
VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = "";
};
Expand Down Expand Up @@ -849,7 +842,7 @@
SWIFT_COMPILATION_MODE = wholemodule;
SWIFT_OPTIMIZATION_LEVEL = "-O";
SWIFT_STRICT_CONCURRENCY = complete;
SWIFT_VERSION = 5.0;
SWIFT_VERSION = 6.0;
VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = "";
};
Expand All @@ -866,6 +859,7 @@
DEAD_CODE_STRIPPING = YES;
DEFINES_MODULE = YES;
DEVELOPMENT_TEAM = Y682K92RZU;
"DEVELOPMENT_TEAM[sdk=macosx*]" = 5Y4K7JX2AU;
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
DYLIB_INSTALL_NAME_BASE = "@rpath";
Expand All @@ -887,7 +881,7 @@
PROVISIONING_PROFILE_SPECIFIER = "";
SKIP_INSTALL = YES;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 5.0;
SWIFT_VERSION = 6.0;
};
name = Debug;
};
Expand All @@ -902,6 +896,7 @@
DEAD_CODE_STRIPPING = YES;
DEFINES_MODULE = YES;
DEVELOPMENT_TEAM = Y682K92RZU;
"DEVELOPMENT_TEAM[sdk=macosx*]" = 5Y4K7JX2AU;
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
DYLIB_INSTALL_NAME_BASE = "@rpath";
Expand All @@ -922,18 +917,20 @@
PRODUCT_NAME = ID3TagEditor;
PROVISIONING_PROFILE_SPECIFIER = "";
SKIP_INSTALL = YES;
SWIFT_VERSION = 5.0;
SWIFT_VERSION = 6.0;
};
name = Release;
};
452831DD2044C40700458375 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_IDENTITY = "Apple Development";
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "-";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
DEAD_CODE_STRIPPING = YES;
DEVELOPMENT_TEAM = Y682K92RZU;
DEVELOPMENT_TEAM = "";
INFOPLIST_FILE = Tests/Info.plist;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
Expand All @@ -943,19 +940,22 @@
MACOSX_DEPLOYMENT_TARGET = 12.0;
PRODUCT_BUNDLE_IDENTIFIER = it.chicio.ID3TagEditorTests;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 5.0;
SWIFT_VERSION = 6.0;
};
name = Debug;
};
452831DE2044C40700458375 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_IDENTITY = "Apple Development";
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "-";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
DEAD_CODE_STRIPPING = YES;
DEVELOPMENT_TEAM = Y682K92RZU;
DEVELOPMENT_TEAM = "";
INFOPLIST_FILE = Tests/Info.plist;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
Expand All @@ -965,7 +965,8 @@
MACOSX_DEPLOYMENT_TARGET = 12.0;
PRODUCT_BUNDLE_IDENTIFIER = it.chicio.ID3TagEditorTests;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
PROVISIONING_PROFILE_SPECIFIER = "";
SWIFT_VERSION = 6.0;
};
name = Release;
};
Expand Down Expand Up @@ -1002,7 +1003,7 @@
SDKROOT = iphoneos;
SKIP_INSTALL = YES;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 5.0;
SWIFT_VERSION = 6.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Debug;
Expand Down Expand Up @@ -1039,7 +1040,7 @@
"PROVISIONING_PROFILE_SPECIFIER[sdk=macosx*]" = "";
SDKROOT = iphoneos;
SKIP_INSTALL = YES;
SWIFT_VERSION = 5.0;
SWIFT_VERSION = 6.0;
TARGETED_DEVICE_FAMILY = "1,2";
VALIDATE_PRODUCT = YES;
};
Expand All @@ -1049,10 +1050,10 @@
isa = XCBuildConfiguration;
buildSettings = {
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_IDENTITY = "iPhone Developer";
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
COMPRESS_PNG_FILES = NO;
DEVELOPMENT_TEAM = Y682K92RZU;
DEVELOPMENT_TEAM = 5Y4K7JX2AU;
INFOPLIST_FILE = Tests/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 15.0;
LD_RUNPATH_SEARCH_PATHS = (
Expand All @@ -1063,10 +1064,11 @@
MACOSX_DEPLOYMENT_TARGET = 11.0;
PRODUCT_BUNDLE_IDENTIFIER = "it.chicio.ID3TagEditor-iOSTests";
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
SDKROOT = iphoneos;
STRIP_PNG_TEXT = NO;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 5.0;
SWIFT_VERSION = 6.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Debug;
Expand All @@ -1075,10 +1077,10 @@
isa = XCBuildConfiguration;
buildSettings = {
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_IDENTITY = "iPhone Developer";
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
COMPRESS_PNG_FILES = NO;
DEVELOPMENT_TEAM = Y682K92RZU;
DEVELOPMENT_TEAM = 5Y4K7JX2AU;
INFOPLIST_FILE = Tests/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 15.0;
LD_RUNPATH_SEARCH_PATHS = (
Expand All @@ -1089,9 +1091,10 @@
MACOSX_DEPLOYMENT_TARGET = 11.0;
PRODUCT_BUNDLE_IDENTIFIER = "it.chicio.ID3TagEditor-iOSTests";
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
SDKROOT = iphoneos;
STRIP_PNG_TEXT = NO;
SWIFT_VERSION = 5.0;
SWIFT_VERSION = 6.0;
TARGETED_DEVICE_FAMILY = "1,2";
VALIDATE_PRODUCT = YES;
};
Expand Down Expand Up @@ -1125,7 +1128,7 @@
PROVISIONING_PROFILE_SPECIFIER = "";
SDKROOT = appletvos;
SKIP_INSTALL = YES;
SWIFT_VERSION = 5.0;
SWIFT_VERSION = 6.0;
TARGETED_DEVICE_FAMILY = 3;
TVOS_DEPLOYMENT_TARGET = 12.0;
};
Expand Down Expand Up @@ -1159,7 +1162,7 @@
PROVISIONING_PROFILE_SPECIFIER = "";
SDKROOT = appletvos;
SKIP_INSTALL = YES;
SWIFT_VERSION = 5.0;
SWIFT_VERSION = 6.0;
TARGETED_DEVICE_FAMILY = 3;
TVOS_DEPLOYMENT_TARGET = 12.0;
VALIDATE_PRODUCT = YES;
Expand All @@ -1172,7 +1175,7 @@
CODE_SIGN_IDENTITY = "iPhone Developer";
CODE_SIGN_STYLE = Automatic;
COMPRESS_PNG_FILES = NO;
DEVELOPMENT_TEAM = Y682K92RZU;
DEVELOPMENT_TEAM = 5Y4K7JX2AU;
INFOPLIST_FILE = Tests/Info.plist;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
Expand All @@ -1184,7 +1187,7 @@
PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = appletvos;
STRIP_PNG_TEXT = NO;
SWIFT_VERSION = 5.0;
SWIFT_VERSION = 6.0;
TARGETED_DEVICE_FAMILY = 3;
TVOS_DEPLOYMENT_TARGET = 15.0;
};
Expand All @@ -1196,7 +1199,7 @@
CODE_SIGN_IDENTITY = "iPhone Developer";
CODE_SIGN_STYLE = Automatic;
COMPRESS_PNG_FILES = NO;
DEVELOPMENT_TEAM = Y682K92RZU;
DEVELOPMENT_TEAM = 5Y4K7JX2AU;
INFOPLIST_FILE = Tests/Info.plist;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
Expand All @@ -1208,7 +1211,7 @@
PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = appletvos;
STRIP_PNG_TEXT = NO;
SWIFT_VERSION = 5.0;
SWIFT_VERSION = 6.0;
TARGETED_DEVICE_FAMILY = 3;
TVOS_DEPLOYMENT_TARGET = 15.0;
VALIDATE_PRODUCT = YES;
Expand Down Expand Up @@ -1243,7 +1246,7 @@
PROVISIONING_PROFILE_SPECIFIER = "";
SDKROOT = watchos;
SKIP_INSTALL = YES;
SWIFT_VERSION = 5.0;
SWIFT_VERSION = 6.0;
TARGETED_DEVICE_FAMILY = 4;
TVOS_DEPLOYMENT_TARGET = 15.0;
WATCHOS_DEPLOYMENT_TARGET = 8.0;
Expand Down Expand Up @@ -1278,7 +1281,7 @@
PROVISIONING_PROFILE_SPECIFIER = "";
SDKROOT = watchos;
SKIP_INSTALL = YES;
SWIFT_VERSION = 5.0;
SWIFT_VERSION = 6.0;
TARGETED_DEVICE_FAMILY = 4;
TVOS_DEPLOYMENT_TARGET = 15.0;
VALIDATE_PRODUCT = YES;
Expand Down
8 changes: 0 additions & 8 deletions LinuxMain.swift

This file was deleted.

5 changes: 2 additions & 3 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// swift-tools-version:5.3
// swift-tools-version: 6.0

import PackageDescription

Expand All @@ -25,6 +25,5 @@ let package = Package(
exclude: ["Utils/PathLoaderXcodeProj.swift", "Info.plist"],
resources: [.process("Examples")]
)
],
swiftLanguageVersions: [.v5]
]
)
1 change: 0 additions & 1 deletion Source/Frame/FrameName.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ struct FrameNamesWithLocalizedContent {
}
}


/// An enum used to identify the different types of frame parsed by the ID3TagEditor.
/// This must be used to acces the frame data as identifier inside the dictionary
/// of frame in the `ID3tag` `frames` properties.
Expand Down
14 changes: 13 additions & 1 deletion Source/Parse/ID3FrameStringContentParser.swift
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,25 @@ class ID3FrameStringContentParser {
let headerSize = id3FrameConfiguration.headerSizeFor(version: version)
let frameContentRangeStart = headerSize + id3FrameConfiguration.encodingSize()

guard frameContentRangeStart < frame.count else { return nil }
guard frameContentRangeStart < frame.count else {
return nil
}

let frameContent = frame.subdata(in: frameContentRangeStart..<frame.count)
let encoding = stringEncodingDetector.detect(frame: frame, version: version)

if let frameContentAsString = String(data: frameContent, encoding: encoding) {
return paddingRemover.removeFrom(string: frameContentAsString)
} else {
/**
Swift 6 migration - it seems like for some reason, iso latin 1 support on non apple platform is broken.
Given the compatibility between iso latin 1 and utf-8 (the latter is a unicode super set of the first one)
we try as last resot to convert to utf-8 and get the result. If it fails, return nil.
*/
if let fallbackUtf8Content = String(data: frameContent, encoding: .utf8) {

Check failure on line 42 in Source/Parse/ID3FrameStringContentParser.swift

View workflow job for this annotation

GitHub Actions / SwiftLint

Opening Brace Spacing Violation: Opening braces should be preceded by a single space and on the same line as the declaration. (opening_brace)
return paddingRemover.removeFrom(string: fallbackUtf8Content)
}

return nil
}
}
Expand Down
Loading

0 comments on commit 3f7a4dd

Please sign in to comment.