From 7edb89575c0a7572f4a34e98dfa8247cc098f6cc Mon Sep 17 00:00:00 2001 From: Stuart Breckenridge Date: Wed, 29 Jul 2020 21:06:04 +0800 Subject: [PATCH 01/19] Initial work on RSParser SPM --- .../contents.xcworkspacedata | 7 ++++ Package.swift | 37 +++++++++++++++++++ Sources/{ => ObjC}/Feeds/FeedParser.h | 0 Sources/{ => ObjC}/HTML/RSHTMLLinkParser.h | 0 Sources/{ => ObjC}/HTML/RSHTMLLinkParser.m | 0 Sources/{ => ObjC}/HTML/RSHTMLMetadata.h | 0 Sources/{ => ObjC}/HTML/RSHTMLMetadata.m | 0 .../{ => ObjC}/HTML/RSHTMLMetadataParser.h | 0 .../{ => ObjC}/HTML/RSHTMLMetadataParser.m | 0 Sources/{ => ObjC}/HTML/RSHTMLTag.h | 0 Sources/{ => ObjC}/HTML/RSHTMLTag.m | 0 Sources/{ => ObjC}/HTML/RSSAXHTMLParser.h | 0 Sources/{ => ObjC}/HTML/RSSAXHTMLParser.m | 0 Sources/{ => ObjC}/OPML/RSOPMLAttributes.h | 0 Sources/{ => ObjC}/OPML/RSOPMLAttributes.m | 0 Sources/{ => ObjC}/OPML/RSOPMLDocument.h | 0 Sources/{ => ObjC}/OPML/RSOPMLDocument.m | 0 Sources/{ => ObjC}/OPML/RSOPMLError.h | 0 Sources/{ => ObjC}/OPML/RSOPMLError.m | 0 Sources/{ => ObjC}/OPML/RSOPMLFeedSpecifier.h | 0 Sources/{ => ObjC}/OPML/RSOPMLFeedSpecifier.m | 0 Sources/{ => ObjC}/OPML/RSOPMLItem.h | 0 Sources/{ => ObjC}/OPML/RSOPMLItem.m | 0 Sources/{ => ObjC}/OPML/RSOPMLParser.h | 0 Sources/{ => ObjC}/OPML/RSOPMLParser.m | 0 Sources/{ => ObjC}/ParserData.h | 0 Sources/{ => ObjC}/ParserData.m | 0 Sources/{ => ObjC}/RSParser.h | 0 Sources/{ => ObjC}/SAX/RSSAXParser.h | 0 Sources/{ => ObjC}/SAX/RSSAXParser.m | 0 .../{ => ObjC}/Utilities/NSData+RSParser.h | 0 .../{ => ObjC}/Utilities/NSData+RSParser.m | 0 .../{ => ObjC}/Utilities/NSString+RSParser.h | 0 .../{ => ObjC}/Utilities/NSString+RSParser.m | 0 Sources/{ => ObjC}/Utilities/RSDateParser.h | 0 Sources/{ => ObjC}/Utilities/RSDateParser.m | 0 .../{ => ObjC}/Utilities/RSParserInternal.h | 0 .../{ => ObjC}/Utilities/RSParserInternal.m | 0 Sources/{ => Swift}/Feeds/FeedParser.swift | 0 .../{ => Swift}/Feeds/FeedParserError.swift | 0 Sources/{ => Swift}/Feeds/FeedType.swift | 0 .../Feeds/JSON/JSONFeedParser.swift | 0 .../Feeds/JSON/RSSInJSONParser.swift | 0 .../{ => Swift}/Feeds/ParsedAttachment.swift | 0 Sources/{ => Swift}/Feeds/ParsedAuthor.swift | 0 Sources/{ => Swift}/Feeds/ParsedFeed.swift | 0 Sources/{ => Swift}/Feeds/ParsedHub.swift | 0 Sources/{ => Swift}/Feeds/ParsedItem.swift | 0 .../{ => Swift}/Feeds/XML/AtomParser.swift | 0 .../Feeds/XML/RSParsedFeedTransformer.swift | 0 Sources/{ => Swift}/Feeds/XML/RSSParser.swift | 0 Sources/{ => Swift}/JSON/JSONTypes.swift | 0 Sources/{ => Swift}/JSON/JSONUtilities.swift | 0 .../Utilities/String+RSParser.swift | 0 Tests/LinuxMain.swift | 7 ++++ Tests/RSParserTests/RSParserTests.swift | 15 ++++++++ Tests/RSParserTests/XCTestManifests.swift | 9 +++++ 57 files changed, 75 insertions(+) create mode 100644 .swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata create mode 100644 Package.swift rename Sources/{ => ObjC}/Feeds/FeedParser.h (100%) rename Sources/{ => ObjC}/HTML/RSHTMLLinkParser.h (100%) rename Sources/{ => ObjC}/HTML/RSHTMLLinkParser.m (100%) rename Sources/{ => ObjC}/HTML/RSHTMLMetadata.h (100%) rename Sources/{ => ObjC}/HTML/RSHTMLMetadata.m (100%) rename Sources/{ => ObjC}/HTML/RSHTMLMetadataParser.h (100%) rename Sources/{ => ObjC}/HTML/RSHTMLMetadataParser.m (100%) rename Sources/{ => ObjC}/HTML/RSHTMLTag.h (100%) rename Sources/{ => ObjC}/HTML/RSHTMLTag.m (100%) rename Sources/{ => ObjC}/HTML/RSSAXHTMLParser.h (100%) rename Sources/{ => ObjC}/HTML/RSSAXHTMLParser.m (100%) rename Sources/{ => ObjC}/OPML/RSOPMLAttributes.h (100%) rename Sources/{ => ObjC}/OPML/RSOPMLAttributes.m (100%) rename Sources/{ => ObjC}/OPML/RSOPMLDocument.h (100%) rename Sources/{ => ObjC}/OPML/RSOPMLDocument.m (100%) rename Sources/{ => ObjC}/OPML/RSOPMLError.h (100%) rename Sources/{ => ObjC}/OPML/RSOPMLError.m (100%) rename Sources/{ => ObjC}/OPML/RSOPMLFeedSpecifier.h (100%) rename Sources/{ => ObjC}/OPML/RSOPMLFeedSpecifier.m (100%) rename Sources/{ => ObjC}/OPML/RSOPMLItem.h (100%) rename Sources/{ => ObjC}/OPML/RSOPMLItem.m (100%) rename Sources/{ => ObjC}/OPML/RSOPMLParser.h (100%) rename Sources/{ => ObjC}/OPML/RSOPMLParser.m (100%) rename Sources/{ => ObjC}/ParserData.h (100%) rename Sources/{ => ObjC}/ParserData.m (100%) rename Sources/{ => ObjC}/RSParser.h (100%) rename Sources/{ => ObjC}/SAX/RSSAXParser.h (100%) rename Sources/{ => ObjC}/SAX/RSSAXParser.m (100%) rename Sources/{ => ObjC}/Utilities/NSData+RSParser.h (100%) rename Sources/{ => ObjC}/Utilities/NSData+RSParser.m (100%) rename Sources/{ => ObjC}/Utilities/NSString+RSParser.h (100%) rename Sources/{ => ObjC}/Utilities/NSString+RSParser.m (100%) rename Sources/{ => ObjC}/Utilities/RSDateParser.h (100%) rename Sources/{ => ObjC}/Utilities/RSDateParser.m (100%) rename Sources/{ => ObjC}/Utilities/RSParserInternal.h (100%) rename Sources/{ => ObjC}/Utilities/RSParserInternal.m (100%) rename Sources/{ => Swift}/Feeds/FeedParser.swift (100%) rename Sources/{ => Swift}/Feeds/FeedParserError.swift (100%) rename Sources/{ => Swift}/Feeds/FeedType.swift (100%) rename Sources/{ => Swift}/Feeds/JSON/JSONFeedParser.swift (100%) rename Sources/{ => Swift}/Feeds/JSON/RSSInJSONParser.swift (100%) rename Sources/{ => Swift}/Feeds/ParsedAttachment.swift (100%) rename Sources/{ => Swift}/Feeds/ParsedAuthor.swift (100%) rename Sources/{ => Swift}/Feeds/ParsedFeed.swift (100%) rename Sources/{ => Swift}/Feeds/ParsedHub.swift (100%) rename Sources/{ => Swift}/Feeds/ParsedItem.swift (100%) rename Sources/{ => Swift}/Feeds/XML/AtomParser.swift (100%) rename Sources/{ => Swift}/Feeds/XML/RSParsedFeedTransformer.swift (100%) rename Sources/{ => Swift}/Feeds/XML/RSSParser.swift (100%) rename Sources/{ => Swift}/JSON/JSONTypes.swift (100%) rename Sources/{ => Swift}/JSON/JSONUtilities.swift (100%) rename Sources/{ => Swift}/Utilities/String+RSParser.swift (100%) create mode 100644 Tests/LinuxMain.swift create mode 100644 Tests/RSParserTests/RSParserTests.swift create mode 100644 Tests/RSParserTests/XCTestManifests.swift diff --git a/.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata b/.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..919434a --- /dev/null +++ b/.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/Package.swift b/Package.swift new file mode 100644 index 0000000..1aa4ab4 --- /dev/null +++ b/Package.swift @@ -0,0 +1,37 @@ +// swift-tools-version:5.3 +// The swift-tools-version declares the minimum version of Swift required to build this package. + +import PackageDescription + +let package = Package( + name: "RSParser", + platforms: [.macOS(SupportedPlatform.MacOSVersion.v10_15), .iOS(SupportedPlatform.IOSVersion.v13)], + products: [ + // Products define the executables and libraries a package produces, and make them visible to other packages. + .library( + name: "RSParser", + targets: ["RSParser"]), + .library( + name: "RSParser-ObjC", + targets: ["RSParser-ObjC"]), + ], + dependencies: [ + // Dependencies declare other packages that this package depends on. + // .package(url: /* package url */, from: "1.0.0"), + ], + targets: [ + // Targets are the basic building blocks of a package. A target can define a module or a test suite. + // Targets can depend on other targets in this package, and on products in packages this package depends on. + .target( + name: "RSParser", + dependencies: [], + path: "Sources/Swift"), + .target( + name: "RSParser-ObjC", + dependencies: [], + path: "Sources/ObjC"), + .testTarget( + name: "RSParserTests", + dependencies: ["RSParser"]), + ] +) diff --git a/Sources/Feeds/FeedParser.h b/Sources/ObjC/Feeds/FeedParser.h similarity index 100% rename from Sources/Feeds/FeedParser.h rename to Sources/ObjC/Feeds/FeedParser.h diff --git a/Sources/HTML/RSHTMLLinkParser.h b/Sources/ObjC/HTML/RSHTMLLinkParser.h similarity index 100% rename from Sources/HTML/RSHTMLLinkParser.h rename to Sources/ObjC/HTML/RSHTMLLinkParser.h diff --git a/Sources/HTML/RSHTMLLinkParser.m b/Sources/ObjC/HTML/RSHTMLLinkParser.m similarity index 100% rename from Sources/HTML/RSHTMLLinkParser.m rename to Sources/ObjC/HTML/RSHTMLLinkParser.m diff --git a/Sources/HTML/RSHTMLMetadata.h b/Sources/ObjC/HTML/RSHTMLMetadata.h similarity index 100% rename from Sources/HTML/RSHTMLMetadata.h rename to Sources/ObjC/HTML/RSHTMLMetadata.h diff --git a/Sources/HTML/RSHTMLMetadata.m b/Sources/ObjC/HTML/RSHTMLMetadata.m similarity index 100% rename from Sources/HTML/RSHTMLMetadata.m rename to Sources/ObjC/HTML/RSHTMLMetadata.m diff --git a/Sources/HTML/RSHTMLMetadataParser.h b/Sources/ObjC/HTML/RSHTMLMetadataParser.h similarity index 100% rename from Sources/HTML/RSHTMLMetadataParser.h rename to Sources/ObjC/HTML/RSHTMLMetadataParser.h diff --git a/Sources/HTML/RSHTMLMetadataParser.m b/Sources/ObjC/HTML/RSHTMLMetadataParser.m similarity index 100% rename from Sources/HTML/RSHTMLMetadataParser.m rename to Sources/ObjC/HTML/RSHTMLMetadataParser.m diff --git a/Sources/HTML/RSHTMLTag.h b/Sources/ObjC/HTML/RSHTMLTag.h similarity index 100% rename from Sources/HTML/RSHTMLTag.h rename to Sources/ObjC/HTML/RSHTMLTag.h diff --git a/Sources/HTML/RSHTMLTag.m b/Sources/ObjC/HTML/RSHTMLTag.m similarity index 100% rename from Sources/HTML/RSHTMLTag.m rename to Sources/ObjC/HTML/RSHTMLTag.m diff --git a/Sources/HTML/RSSAXHTMLParser.h b/Sources/ObjC/HTML/RSSAXHTMLParser.h similarity index 100% rename from Sources/HTML/RSSAXHTMLParser.h rename to Sources/ObjC/HTML/RSSAXHTMLParser.h diff --git a/Sources/HTML/RSSAXHTMLParser.m b/Sources/ObjC/HTML/RSSAXHTMLParser.m similarity index 100% rename from Sources/HTML/RSSAXHTMLParser.m rename to Sources/ObjC/HTML/RSSAXHTMLParser.m diff --git a/Sources/OPML/RSOPMLAttributes.h b/Sources/ObjC/OPML/RSOPMLAttributes.h similarity index 100% rename from Sources/OPML/RSOPMLAttributes.h rename to Sources/ObjC/OPML/RSOPMLAttributes.h diff --git a/Sources/OPML/RSOPMLAttributes.m b/Sources/ObjC/OPML/RSOPMLAttributes.m similarity index 100% rename from Sources/OPML/RSOPMLAttributes.m rename to Sources/ObjC/OPML/RSOPMLAttributes.m diff --git a/Sources/OPML/RSOPMLDocument.h b/Sources/ObjC/OPML/RSOPMLDocument.h similarity index 100% rename from Sources/OPML/RSOPMLDocument.h rename to Sources/ObjC/OPML/RSOPMLDocument.h diff --git a/Sources/OPML/RSOPMLDocument.m b/Sources/ObjC/OPML/RSOPMLDocument.m similarity index 100% rename from Sources/OPML/RSOPMLDocument.m rename to Sources/ObjC/OPML/RSOPMLDocument.m diff --git a/Sources/OPML/RSOPMLError.h b/Sources/ObjC/OPML/RSOPMLError.h similarity index 100% rename from Sources/OPML/RSOPMLError.h rename to Sources/ObjC/OPML/RSOPMLError.h diff --git a/Sources/OPML/RSOPMLError.m b/Sources/ObjC/OPML/RSOPMLError.m similarity index 100% rename from Sources/OPML/RSOPMLError.m rename to Sources/ObjC/OPML/RSOPMLError.m diff --git a/Sources/OPML/RSOPMLFeedSpecifier.h b/Sources/ObjC/OPML/RSOPMLFeedSpecifier.h similarity index 100% rename from Sources/OPML/RSOPMLFeedSpecifier.h rename to Sources/ObjC/OPML/RSOPMLFeedSpecifier.h diff --git a/Sources/OPML/RSOPMLFeedSpecifier.m b/Sources/ObjC/OPML/RSOPMLFeedSpecifier.m similarity index 100% rename from Sources/OPML/RSOPMLFeedSpecifier.m rename to Sources/ObjC/OPML/RSOPMLFeedSpecifier.m diff --git a/Sources/OPML/RSOPMLItem.h b/Sources/ObjC/OPML/RSOPMLItem.h similarity index 100% rename from Sources/OPML/RSOPMLItem.h rename to Sources/ObjC/OPML/RSOPMLItem.h diff --git a/Sources/OPML/RSOPMLItem.m b/Sources/ObjC/OPML/RSOPMLItem.m similarity index 100% rename from Sources/OPML/RSOPMLItem.m rename to Sources/ObjC/OPML/RSOPMLItem.m diff --git a/Sources/OPML/RSOPMLParser.h b/Sources/ObjC/OPML/RSOPMLParser.h similarity index 100% rename from Sources/OPML/RSOPMLParser.h rename to Sources/ObjC/OPML/RSOPMLParser.h diff --git a/Sources/OPML/RSOPMLParser.m b/Sources/ObjC/OPML/RSOPMLParser.m similarity index 100% rename from Sources/OPML/RSOPMLParser.m rename to Sources/ObjC/OPML/RSOPMLParser.m diff --git a/Sources/ParserData.h b/Sources/ObjC/ParserData.h similarity index 100% rename from Sources/ParserData.h rename to Sources/ObjC/ParserData.h diff --git a/Sources/ParserData.m b/Sources/ObjC/ParserData.m similarity index 100% rename from Sources/ParserData.m rename to Sources/ObjC/ParserData.m diff --git a/Sources/RSParser.h b/Sources/ObjC/RSParser.h similarity index 100% rename from Sources/RSParser.h rename to Sources/ObjC/RSParser.h diff --git a/Sources/SAX/RSSAXParser.h b/Sources/ObjC/SAX/RSSAXParser.h similarity index 100% rename from Sources/SAX/RSSAXParser.h rename to Sources/ObjC/SAX/RSSAXParser.h diff --git a/Sources/SAX/RSSAXParser.m b/Sources/ObjC/SAX/RSSAXParser.m similarity index 100% rename from Sources/SAX/RSSAXParser.m rename to Sources/ObjC/SAX/RSSAXParser.m diff --git a/Sources/Utilities/NSData+RSParser.h b/Sources/ObjC/Utilities/NSData+RSParser.h similarity index 100% rename from Sources/Utilities/NSData+RSParser.h rename to Sources/ObjC/Utilities/NSData+RSParser.h diff --git a/Sources/Utilities/NSData+RSParser.m b/Sources/ObjC/Utilities/NSData+RSParser.m similarity index 100% rename from Sources/Utilities/NSData+RSParser.m rename to Sources/ObjC/Utilities/NSData+RSParser.m diff --git a/Sources/Utilities/NSString+RSParser.h b/Sources/ObjC/Utilities/NSString+RSParser.h similarity index 100% rename from Sources/Utilities/NSString+RSParser.h rename to Sources/ObjC/Utilities/NSString+RSParser.h diff --git a/Sources/Utilities/NSString+RSParser.m b/Sources/ObjC/Utilities/NSString+RSParser.m similarity index 100% rename from Sources/Utilities/NSString+RSParser.m rename to Sources/ObjC/Utilities/NSString+RSParser.m diff --git a/Sources/Utilities/RSDateParser.h b/Sources/ObjC/Utilities/RSDateParser.h similarity index 100% rename from Sources/Utilities/RSDateParser.h rename to Sources/ObjC/Utilities/RSDateParser.h diff --git a/Sources/Utilities/RSDateParser.m b/Sources/ObjC/Utilities/RSDateParser.m similarity index 100% rename from Sources/Utilities/RSDateParser.m rename to Sources/ObjC/Utilities/RSDateParser.m diff --git a/Sources/Utilities/RSParserInternal.h b/Sources/ObjC/Utilities/RSParserInternal.h similarity index 100% rename from Sources/Utilities/RSParserInternal.h rename to Sources/ObjC/Utilities/RSParserInternal.h diff --git a/Sources/Utilities/RSParserInternal.m b/Sources/ObjC/Utilities/RSParserInternal.m similarity index 100% rename from Sources/Utilities/RSParserInternal.m rename to Sources/ObjC/Utilities/RSParserInternal.m diff --git a/Sources/Feeds/FeedParser.swift b/Sources/Swift/Feeds/FeedParser.swift similarity index 100% rename from Sources/Feeds/FeedParser.swift rename to Sources/Swift/Feeds/FeedParser.swift diff --git a/Sources/Feeds/FeedParserError.swift b/Sources/Swift/Feeds/FeedParserError.swift similarity index 100% rename from Sources/Feeds/FeedParserError.swift rename to Sources/Swift/Feeds/FeedParserError.swift diff --git a/Sources/Feeds/FeedType.swift b/Sources/Swift/Feeds/FeedType.swift similarity index 100% rename from Sources/Feeds/FeedType.swift rename to Sources/Swift/Feeds/FeedType.swift diff --git a/Sources/Feeds/JSON/JSONFeedParser.swift b/Sources/Swift/Feeds/JSON/JSONFeedParser.swift similarity index 100% rename from Sources/Feeds/JSON/JSONFeedParser.swift rename to Sources/Swift/Feeds/JSON/JSONFeedParser.swift diff --git a/Sources/Feeds/JSON/RSSInJSONParser.swift b/Sources/Swift/Feeds/JSON/RSSInJSONParser.swift similarity index 100% rename from Sources/Feeds/JSON/RSSInJSONParser.swift rename to Sources/Swift/Feeds/JSON/RSSInJSONParser.swift diff --git a/Sources/Feeds/ParsedAttachment.swift b/Sources/Swift/Feeds/ParsedAttachment.swift similarity index 100% rename from Sources/Feeds/ParsedAttachment.swift rename to Sources/Swift/Feeds/ParsedAttachment.swift diff --git a/Sources/Feeds/ParsedAuthor.swift b/Sources/Swift/Feeds/ParsedAuthor.swift similarity index 100% rename from Sources/Feeds/ParsedAuthor.swift rename to Sources/Swift/Feeds/ParsedAuthor.swift diff --git a/Sources/Feeds/ParsedFeed.swift b/Sources/Swift/Feeds/ParsedFeed.swift similarity index 100% rename from Sources/Feeds/ParsedFeed.swift rename to Sources/Swift/Feeds/ParsedFeed.swift diff --git a/Sources/Feeds/ParsedHub.swift b/Sources/Swift/Feeds/ParsedHub.swift similarity index 100% rename from Sources/Feeds/ParsedHub.swift rename to Sources/Swift/Feeds/ParsedHub.swift diff --git a/Sources/Feeds/ParsedItem.swift b/Sources/Swift/Feeds/ParsedItem.swift similarity index 100% rename from Sources/Feeds/ParsedItem.swift rename to Sources/Swift/Feeds/ParsedItem.swift diff --git a/Sources/Feeds/XML/AtomParser.swift b/Sources/Swift/Feeds/XML/AtomParser.swift similarity index 100% rename from Sources/Feeds/XML/AtomParser.swift rename to Sources/Swift/Feeds/XML/AtomParser.swift diff --git a/Sources/Feeds/XML/RSParsedFeedTransformer.swift b/Sources/Swift/Feeds/XML/RSParsedFeedTransformer.swift similarity index 100% rename from Sources/Feeds/XML/RSParsedFeedTransformer.swift rename to Sources/Swift/Feeds/XML/RSParsedFeedTransformer.swift diff --git a/Sources/Feeds/XML/RSSParser.swift b/Sources/Swift/Feeds/XML/RSSParser.swift similarity index 100% rename from Sources/Feeds/XML/RSSParser.swift rename to Sources/Swift/Feeds/XML/RSSParser.swift diff --git a/Sources/JSON/JSONTypes.swift b/Sources/Swift/JSON/JSONTypes.swift similarity index 100% rename from Sources/JSON/JSONTypes.swift rename to Sources/Swift/JSON/JSONTypes.swift diff --git a/Sources/JSON/JSONUtilities.swift b/Sources/Swift/JSON/JSONUtilities.swift similarity index 100% rename from Sources/JSON/JSONUtilities.swift rename to Sources/Swift/JSON/JSONUtilities.swift diff --git a/Sources/Utilities/String+RSParser.swift b/Sources/Swift/Utilities/String+RSParser.swift similarity index 100% rename from Sources/Utilities/String+RSParser.swift rename to Sources/Swift/Utilities/String+RSParser.swift diff --git a/Tests/LinuxMain.swift b/Tests/LinuxMain.swift new file mode 100644 index 0000000..93c8b6d --- /dev/null +++ b/Tests/LinuxMain.swift @@ -0,0 +1,7 @@ +import XCTest + +import RSParserTests + +var tests = [XCTestCaseEntry]() +tests += RSParserTests.allTests() +XCTMain(tests) diff --git a/Tests/RSParserTests/RSParserTests.swift b/Tests/RSParserTests/RSParserTests.swift new file mode 100644 index 0000000..0503f80 --- /dev/null +++ b/Tests/RSParserTests/RSParserTests.swift @@ -0,0 +1,15 @@ +import XCTest +@testable import RSParser + +final class RSParserTests: XCTestCase { + func testExample() { + // This is an example of a functional test case. + // Use XCTAssert and related functions to verify your tests produce the correct + // results. + XCTAssertEqual(RSParser().text, "Hello, World!") + } + + static var allTests = [ + ("testExample", testExample), + ] +} diff --git a/Tests/RSParserTests/XCTestManifests.swift b/Tests/RSParserTests/XCTestManifests.swift new file mode 100644 index 0000000..e9e1190 --- /dev/null +++ b/Tests/RSParserTests/XCTestManifests.swift @@ -0,0 +1,9 @@ +import XCTest + +#if !canImport(ObjectiveC) +public func allTests() -> [XCTestCaseEntry] { + return [ + testCase(RSParserTests.allTests), + ] +} +#endif From 47221fa4867876ff8b70ada9996acfd8d6bea510 Mon Sep 17 00:00:00 2001 From: Stuart Breckenridge Date: Wed, 29 Jul 2020 21:49:57 +0800 Subject: [PATCH 02/19] objc / swift work --- Package.swift | 17 ++++--- .../{Feeds/XML => ObjC/Feeds}/RSAtomParser.m | 16 ++++++- .../XML => ObjC/Feeds}/RSParsedArticle.m | 11 +++++ .../XML => ObjC/Feeds}/RSParsedAuthor.m | 5 ++ .../XML => ObjC/Feeds}/RSParsedEnclosure.m | 0 .../{Feeds/XML => ObjC/Feeds}/RSParsedFeed.m | 6 +++ .../{Feeds/XML => ObjC/Feeds}/RSRSSParser.m | 19 +++++++- Sources/ObjC/HTML/RSHTMLLinkParser.m | 13 +++++- Sources/ObjC/HTML/RSHTMLMetadata.m | 8 ++++ Sources/ObjC/HTML/RSHTMLMetadataParser.m | 15 +++++- Sources/ObjC/HTML/RSSAXHTMLParser.m | 10 +++- Sources/ObjC/OPML/RSOPMLAttributes.m | 7 +++ Sources/ObjC/OPML/RSOPMLDocument.m | 6 +++ Sources/ObjC/OPML/RSOPMLError.m | 4 ++ Sources/ObjC/OPML/RSOPMLFeedSpecifier.m | 6 +++ Sources/ObjC/OPML/RSOPMLItem.m | 8 ++++ Sources/ObjC/OPML/RSOPMLParser.m | 15 +++++- Sources/ObjC/SAX/RSSAXParser.m | 12 ++++- Sources/ObjC/Utilities/NSData+RSParser.m | 7 +++ Sources/ObjC/Utilities/NSString+RSParser.m | 7 +++ Sources/ObjC/Utilities/RSDateParser.m | 9 +++- Sources/ObjC/Utilities/RSParserInternal.m | 6 +++ Sources/ObjC/{Feeds => include}/FeedParser.h | 0 .../{Utilities => include}/NSData+RSParser.h | 0 .../NSString+RSParser.h | 0 Sources/ObjC/{ => include}/ParserData.h | 0 .../XML => ObjC/include}/RSAtomParser.h | 0 .../{Utilities => include}/RSDateParser.h | 0 .../ObjC/{HTML => include}/RSHTMLLinkParser.h | 0 .../ObjC/{HTML => include}/RSHTMLMetadata.h | 0 .../{HTML => include}/RSHTMLMetadataParser.h | 0 Sources/ObjC/{HTML => include}/RSHTMLTag.h | 0 .../ObjC/{OPML => include}/RSOPMLAttributes.h | 0 .../ObjC/{OPML => include}/RSOPMLDocument.h | 7 +++ Sources/ObjC/{OPML => include}/RSOPMLError.h | 0 .../{OPML => include}/RSOPMLFeedSpecifier.h | 0 Sources/ObjC/{OPML => include}/RSOPMLItem.h | 0 Sources/ObjC/{OPML => include}/RSOPMLParser.h | 0 .../XML => ObjC/include}/RSParsedArticle.h | 0 .../XML => ObjC/include}/RSParsedAuthor.h | 0 .../XML => ObjC/include}/RSParsedEnclosure.h | 0 .../XML => ObjC/include}/RSParsedFeed.h | 0 Sources/ObjC/{ => include}/RSParser.h | 46 +++++++++++++++++++ .../{Utilities => include}/RSParserInternal.h | 0 .../{Feeds/XML => ObjC/include}/RSRSSParser.h | 0 .../ObjC/{HTML => include}/RSSAXHTMLParser.h | 0 Sources/ObjC/{SAX => include}/RSSAXParser.h | 0 Sources/Swift/Feeds/FeedParser.swift | 3 ++ Sources/Swift/Feeds/FeedType.swift | 3 ++ Sources/Swift/Feeds/JSON/JSONFeedParser.swift | 3 ++ .../Swift/Feeds/JSON/RSSInJSONParser.swift | 3 ++ Sources/Swift/Feeds/XML/AtomParser.swift | 4 ++ .../Feeds/XML/RSParsedFeedTransformer.swift | 3 ++ Sources/Swift/Feeds/XML/RSSParser.swift | 1 + 54 files changed, 264 insertions(+), 16 deletions(-) rename Sources/{Feeds/XML => ObjC/Feeds}/RSAtomParser.m (98%) rename Sources/{Feeds/XML => ObjC/Feeds}/RSParsedArticle.m (94%) rename Sources/{Feeds/XML => ObjC/Feeds}/RSParsedAuthor.m (91%) rename Sources/{Feeds/XML => ObjC/Feeds}/RSParsedEnclosure.m (100%) rename Sources/{Feeds/XML => ObjC/Feeds}/RSParsedFeed.m (90%) rename Sources/{Feeds/XML => ObjC/Feeds}/RSRSSParser.m (97%) rename Sources/ObjC/{Feeds => include}/FeedParser.h (100%) rename Sources/ObjC/{Utilities => include}/NSData+RSParser.h (100%) rename Sources/ObjC/{Utilities => include}/NSString+RSParser.h (100%) rename Sources/ObjC/{ => include}/ParserData.h (100%) rename Sources/{Feeds/XML => ObjC/include}/RSAtomParser.h (100%) rename Sources/ObjC/{Utilities => include}/RSDateParser.h (100%) rename Sources/ObjC/{HTML => include}/RSHTMLLinkParser.h (100%) rename Sources/ObjC/{HTML => include}/RSHTMLMetadata.h (100%) rename Sources/ObjC/{HTML => include}/RSHTMLMetadataParser.h (100%) rename Sources/ObjC/{HTML => include}/RSHTMLTag.h (100%) rename Sources/ObjC/{OPML => include}/RSOPMLAttributes.h (100%) rename Sources/ObjC/{OPML => include}/RSOPMLDocument.h (85%) rename Sources/ObjC/{OPML => include}/RSOPMLError.h (100%) rename Sources/ObjC/{OPML => include}/RSOPMLFeedSpecifier.h (100%) rename Sources/ObjC/{OPML => include}/RSOPMLItem.h (100%) rename Sources/ObjC/{OPML => include}/RSOPMLParser.h (100%) rename Sources/{Feeds/XML => ObjC/include}/RSParsedArticle.h (100%) rename Sources/{Feeds/XML => ObjC/include}/RSParsedAuthor.h (100%) rename Sources/{Feeds/XML => ObjC/include}/RSParsedEnclosure.h (100%) rename Sources/{Feeds/XML => ObjC/include}/RSParsedFeed.h (100%) rename Sources/ObjC/{ => include}/RSParser.h (59%) rename Sources/ObjC/{Utilities => include}/RSParserInternal.h (100%) rename Sources/{Feeds/XML => ObjC/include}/RSRSSParser.h (100%) rename Sources/ObjC/{HTML => include}/RSSAXHTMLParser.h (100%) rename Sources/ObjC/{SAX => include}/RSSAXParser.h (100%) diff --git a/Package.swift b/Package.swift index 1aa4ab4..cc6118f 100644 --- a/Package.swift +++ b/Package.swift @@ -8,12 +8,12 @@ let package = Package( platforms: [.macOS(SupportedPlatform.MacOSVersion.v10_15), .iOS(SupportedPlatform.IOSVersion.v13)], products: [ // Products define the executables and libraries a package produces, and make them visible to other packages. + .library( + name: "RSParserSwift", + targets: ["RSParserSwift"]), .library( name: "RSParser", targets: ["RSParser"]), - .library( - name: "RSParser-ObjC", - targets: ["RSParser-ObjC"]), ], dependencies: [ // Dependencies declare other packages that this package depends on. @@ -23,13 +23,16 @@ let package = Package( // Targets are the basic building blocks of a package. A target can define a module or a test suite. // Targets can depend on other targets in this package, and on products in packages this package depends on. .target( - name: "RSParser", - dependencies: [], + name: "RSParserSwift", + dependencies: ["RSParser"], path: "Sources/Swift"), .target( - name: "RSParser-ObjC", + name: "RSParser", dependencies: [], - path: "Sources/ObjC"), + path: "Sources/ObjC", + cSettings: [ + .headerSearchPath("include"), + ]), .testTarget( name: "RSParserTests", dependencies: ["RSParser"]), diff --git a/Sources/Feeds/XML/RSAtomParser.m b/Sources/ObjC/Feeds/RSAtomParser.m similarity index 98% rename from Sources/Feeds/XML/RSAtomParser.m rename to Sources/ObjC/Feeds/RSAtomParser.m index 56a564e..6a29207 100755 --- a/Sources/Feeds/XML/RSAtomParser.m +++ b/Sources/ObjC/Feeds/RSAtomParser.m @@ -6,7 +6,18 @@ // Copyright (c) 2015 Ranchero Software LLC. All rights reserved. // -#import + +#if SWIFT_PACKAGE +#import "RSAtomParser.h" +#import "RSSAXParser.h" +#import "RSParsedFeed.h" +#import "RSParsedArticle.h" +#import "NSString+RSParser.h" +#import "RSDateParser.h" +#import "ParserData.h" +#import "RSParsedEnclosure.h" +#import "RSParsedAuthor.h" +#else #import #import #import @@ -16,6 +27,9 @@ #import #import #import +#endif + +#import @interface RSAtomParser () diff --git a/Sources/Feeds/XML/RSParsedArticle.m b/Sources/ObjC/Feeds/RSParsedArticle.m similarity index 94% rename from Sources/Feeds/XML/RSParsedArticle.m rename to Sources/ObjC/Feeds/RSParsedArticle.m index 436f5af..6e72879 100755 --- a/Sources/Feeds/XML/RSParsedArticle.m +++ b/Sources/ObjC/Feeds/RSParsedArticle.m @@ -6,11 +6,22 @@ // Copyright (c) 2014 Ranchero Software LLC. All rights reserved. // + +#if SWIFT_PACKAGE +#import "RSParsedArticle.h" +#import "RSParserInternal.h" +#import "NSString+RSParser.h" +#import "RSParsedAuthor.h" +#import "RSParsedEnclosure.h" +#else #import #import #import #import #import +#endif + + @implementation RSParsedArticle diff --git a/Sources/Feeds/XML/RSParsedAuthor.m b/Sources/ObjC/Feeds/RSParsedAuthor.m similarity index 91% rename from Sources/Feeds/XML/RSParsedAuthor.m rename to Sources/ObjC/Feeds/RSParsedAuthor.m index 01faf63..02536d6 100644 --- a/Sources/Feeds/XML/RSParsedAuthor.m +++ b/Sources/ObjC/Feeds/RSParsedAuthor.m @@ -6,7 +6,12 @@ // Copyright © 2017 Ranchero Software, LLC. All rights reserved. // +#if SWIFT_PACKAGE +#import "NSString+RSParser.h" +#else #import +#endif + #import "RSParsedAuthor.h" @implementation RSParsedAuthor diff --git a/Sources/Feeds/XML/RSParsedEnclosure.m b/Sources/ObjC/Feeds/RSParsedEnclosure.m similarity index 100% rename from Sources/Feeds/XML/RSParsedEnclosure.m rename to Sources/ObjC/Feeds/RSParsedEnclosure.m diff --git a/Sources/Feeds/XML/RSParsedFeed.m b/Sources/ObjC/Feeds/RSParsedFeed.m similarity index 90% rename from Sources/Feeds/XML/RSParsedFeed.m rename to Sources/ObjC/Feeds/RSParsedFeed.m index ae7cf79..c4211d4 100755 --- a/Sources/Feeds/XML/RSParsedFeed.m +++ b/Sources/ObjC/Feeds/RSParsedFeed.m @@ -6,7 +6,13 @@ // Copyright © 2015 Ranchero Software, LLC. All rights reserved. // +#if SWIFT_PACKAGE +#import "RSParsedFeed.h" +#else #import +#endif + + @implementation RSParsedFeed diff --git a/Sources/Feeds/XML/RSRSSParser.m b/Sources/ObjC/Feeds/RSRSSParser.m similarity index 97% rename from Sources/Feeds/XML/RSRSSParser.m rename to Sources/ObjC/Feeds/RSRSSParser.m index eb4c315..bdb63da 100755 --- a/Sources/Feeds/XML/RSRSSParser.m +++ b/Sources/ObjC/Feeds/RSRSSParser.m @@ -6,7 +6,18 @@ // Copyright (c) 2015 Ranchero Software LLC. All rights reserved. // -#import +#if SWIFT_PACKAGE +#import "RSRSSParser.h" +#import "RSSAXParser.h" +#import "RSParsedFeed.h" +#import "RSParsedArticle.h" +#import "RSParserInternal.h" +#import "NSString+RSParser.h" +#import "RSDateParser.h" +#import "ParserData.h" +#import "RSParsedEnclosure.h" +#import "RSParsedAuthor.h" +#else #import #import #import @@ -17,6 +28,12 @@ #import #import #import +#endif + + + +#import + @interface RSRSSParser () diff --git a/Sources/ObjC/HTML/RSHTMLLinkParser.m b/Sources/ObjC/HTML/RSHTMLLinkParser.m index c6e7bd7..5bfdfeb 100755 --- a/Sources/ObjC/HTML/RSHTMLLinkParser.m +++ b/Sources/ObjC/HTML/RSHTMLLinkParser.m @@ -6,12 +6,23 @@ // Copyright © 2016 Ranchero Software, LLC. All rights reserved. // -#import + +#if SWIFT_PACKAGE +#import "RSHTMLLinkParser.h" +#import "RSSAXHTMLParser.h" +#import "RSSAXParser.h" +#import "RSParserInternal.h" +#import "ParserData.h" +#else #import #import #import #import #import +#endif + +#import + @interface RSHTMLLinkParser() diff --git a/Sources/ObjC/HTML/RSHTMLMetadata.m b/Sources/ObjC/HTML/RSHTMLMetadata.m index e1b3bcb..d771940 100755 --- a/Sources/ObjC/HTML/RSHTMLMetadata.m +++ b/Sources/ObjC/HTML/RSHTMLMetadata.m @@ -6,9 +6,17 @@ // Copyright © 2016 Ranchero Software, LLC. All rights reserved. // +#if SWIFT_PACKAGE +#import "RSHTMLMetadata.h" +#import "RSParserInternal.h" +#import "RSHTMLTag.h" +#else #import #import #import +#endif + + static NSString *urlStringFromDictionary(NSDictionary *d); static NSString *absoluteURLStringWithRelativeURLString(NSString *relativeURLString, NSString *baseURLString); diff --git a/Sources/ObjC/HTML/RSHTMLMetadataParser.m b/Sources/ObjC/HTML/RSHTMLMetadataParser.m index d154cf4..92d2947 100755 --- a/Sources/ObjC/HTML/RSHTMLMetadataParser.m +++ b/Sources/ObjC/HTML/RSHTMLMetadataParser.m @@ -6,7 +6,16 @@ // Copyright © 2016 Ranchero Software, LLC. All rights reserved. // -#import +#if SWIFT_PACKAGE +#import "RSHTMLMetadataParser.h" +#import "RSHTMLMetadata.h" +#import "RSSAXHTMLParser.h" +#import "RSSAXHTMLParser.h" +#import "RSSAXParser.h" +#import "RSParserInternal.h" +#import "ParserData.h" +#import "RSHTMLTag.h" +#else #import #import #import @@ -14,6 +23,10 @@ #import #import #import +#endif + +#import + @interface RSHTMLMetadataParser () diff --git a/Sources/ObjC/HTML/RSSAXHTMLParser.m b/Sources/ObjC/HTML/RSSAXHTMLParser.m index c24653a..98ce38b 100755 --- a/Sources/ObjC/HTML/RSSAXHTMLParser.m +++ b/Sources/ObjC/HTML/RSSAXHTMLParser.m @@ -6,12 +6,20 @@ // Copyright © 2016 Ranchero Software, LLC. All rights reserved. // +#if SWIFT_PACKAGE +#import "RSSAXHTMLParser.h" +#import "RSSAXParser.h" +#import "RSParserInternal.h" +#else +#import #import #import +#endif + #import #import #import -#import + @interface RSSAXHTMLParser () diff --git a/Sources/ObjC/OPML/RSOPMLAttributes.m b/Sources/ObjC/OPML/RSOPMLAttributes.m index 49bb91e..ba90964 100755 --- a/Sources/ObjC/OPML/RSOPMLAttributes.m +++ b/Sources/ObjC/OPML/RSOPMLAttributes.m @@ -6,8 +6,15 @@ // Copyright © 2016 Ranchero Software, LLC. All rights reserved. // +#if SWIFT_PACKAGE +#import "RSOPMLAttributes.h" +#import "RSParserInternal.h" +#else #import #import +#endif + + NSString *OPMLTextKey = @"text"; diff --git a/Sources/ObjC/OPML/RSOPMLDocument.m b/Sources/ObjC/OPML/RSOPMLDocument.m index 02ac559..b1a20b8 100755 --- a/Sources/ObjC/OPML/RSOPMLDocument.m +++ b/Sources/ObjC/OPML/RSOPMLDocument.m @@ -6,7 +6,13 @@ // Copyright © 2016 Ranchero Software, LLC. All rights reserved. // + +#if SWIFT_PACKAGE +#import "RSOPMLDocument.h" +#else #import +#endif + @implementation RSOPMLDocument diff --git a/Sources/ObjC/OPML/RSOPMLError.m b/Sources/ObjC/OPML/RSOPMLError.m index 93b477a..a323760 100755 --- a/Sources/ObjC/OPML/RSOPMLError.m +++ b/Sources/ObjC/OPML/RSOPMLError.m @@ -6,7 +6,11 @@ // Copyright © 2016 Ranchero Software, LLC. All rights reserved. // +#if SWIFT_PACKAGE +#import "RSOPMLError.h" +#else #import +#endif NSString *RSOPMLErrorDomain = @"com.ranchero.OPML"; diff --git a/Sources/ObjC/OPML/RSOPMLFeedSpecifier.m b/Sources/ObjC/OPML/RSOPMLFeedSpecifier.m index 2147ff9..4ad7a10 100755 --- a/Sources/ObjC/OPML/RSOPMLFeedSpecifier.m +++ b/Sources/ObjC/OPML/RSOPMLFeedSpecifier.m @@ -6,8 +6,14 @@ // Copyright © 2016 Ranchero Software, LLC. All rights reserved. // +#if SWIFT_PACKAGE +#import "RSOPMLFeedSpecifier.h" +#import "RSParserInternal.h" +#else #import #import +#endif + @implementation RSOPMLFeedSpecifier diff --git a/Sources/ObjC/OPML/RSOPMLItem.m b/Sources/ObjC/OPML/RSOPMLItem.m index 34628bd..42461b1 100755 --- a/Sources/ObjC/OPML/RSOPMLItem.m +++ b/Sources/ObjC/OPML/RSOPMLItem.m @@ -6,10 +6,18 @@ // Copyright © 2016 Ranchero Software, LLC. All rights reserved. // +#if SWIFT_PACKAGE +#import "RSOPMLItem.h" +#import "RSOPMLAttributes.h" +#import "RSOPMLFeedSpecifier.h" +#import "RSParserInternal.h" +#else #import #import #import #import +#endif + @interface RSOPMLItem () diff --git a/Sources/ObjC/OPML/RSOPMLParser.m b/Sources/ObjC/OPML/RSOPMLParser.m index 4c90e8e..8a5eeb1 100755 --- a/Sources/ObjC/OPML/RSOPMLParser.m +++ b/Sources/ObjC/OPML/RSOPMLParser.m @@ -6,14 +6,27 @@ // Copyright © 2015 Ranchero Software, LLC. All rights reserved. // +#if SWIFT_PACKAGE #import "RSOPMLParser.h" -#import +#import "RSSAXParser.h" +#import "RSOPMLItem.h" +#import "RSOPMLDocument.h" +#import "RSOPMLAttributes.h" +#import "RSOPMLError.h" +#import "RSOPMLParser.h" +#import "ParserData.h" +#else +#import #import #import #import #import #import #import +#endif + +#import + @interface RSOPMLParser () diff --git a/Sources/ObjC/SAX/RSSAXParser.m b/Sources/ObjC/SAX/RSSAXParser.m index 8ee1272..2e77a30 100755 --- a/Sources/ObjC/SAX/RSSAXParser.m +++ b/Sources/ObjC/SAX/RSSAXParser.m @@ -6,11 +6,19 @@ // Copyright (c) 2015 Ranchero Software, LLC. All rights reserved. // +#if SWIFT_PACKAGE +#import "RSSAXParser.h" +#import "RSParserInternal.h" +#else +#import +#import +#endif + + #import #import #import -#import -#import + @interface RSSAXParser () diff --git a/Sources/ObjC/Utilities/NSData+RSParser.m b/Sources/ObjC/Utilities/NSData+RSParser.m index b63f621..0f8f33d 100644 --- a/Sources/ObjC/Utilities/NSData+RSParser.m +++ b/Sources/ObjC/Utilities/NSData+RSParser.m @@ -6,7 +6,14 @@ // Copyright © 2017 Ranchero Software, LLC. All rights reserved. // +#if SWIFT_PACKAGE +#import "NSData+RSParser.h" +#else #import +#endif + + + /* TODO: find real-world cases where the isProbably* cases fail when they should succeed, and add them to tests.*/ diff --git a/Sources/ObjC/Utilities/NSString+RSParser.m b/Sources/ObjC/Utilities/NSString+RSParser.m index 405c3a4..47f2207 100755 --- a/Sources/ObjC/Utilities/NSString+RSParser.m +++ b/Sources/ObjC/Utilities/NSString+RSParser.m @@ -6,8 +6,15 @@ // Copyright © 2015 Ranchero Software, LLC. All rights reserved. // +#if SWIFT_PACKAGE +#import "NSString+RSParser.h" #import +#else #import +#import +#endif + + @interface NSScanner (RSParser) diff --git a/Sources/ObjC/Utilities/RSDateParser.m b/Sources/ObjC/Utilities/RSDateParser.m index 4a92f80..8ecaa45 100755 --- a/Sources/ObjC/Utilities/RSDateParser.m +++ b/Sources/ObjC/Utilities/RSDateParser.m @@ -6,8 +6,15 @@ // Copyright (c) 2015 Ranchero Software, LLC. All rights reserved. // + +#if SWIFT_PACKAGE +#import "RSDateParser.h" +#import +#else +#import #import -#import +#endif + typedef struct { const char *abbreviation; diff --git a/Sources/ObjC/Utilities/RSParserInternal.m b/Sources/ObjC/Utilities/RSParserInternal.m index ecc944b..b7dbe82 100755 --- a/Sources/ObjC/Utilities/RSParserInternal.m +++ b/Sources/ObjC/Utilities/RSParserInternal.m @@ -6,8 +6,14 @@ // Copyright © 2016 Ranchero Software, LLC. All rights reserved. // + +#if SWIFT_PACKAGE +#import "RSParserInternal.h" +#import +#else #import #import +#endif static BOOL RSParserIsNil(id obj) { diff --git a/Sources/ObjC/Feeds/FeedParser.h b/Sources/ObjC/include/FeedParser.h similarity index 100% rename from Sources/ObjC/Feeds/FeedParser.h rename to Sources/ObjC/include/FeedParser.h diff --git a/Sources/ObjC/Utilities/NSData+RSParser.h b/Sources/ObjC/include/NSData+RSParser.h similarity index 100% rename from Sources/ObjC/Utilities/NSData+RSParser.h rename to Sources/ObjC/include/NSData+RSParser.h diff --git a/Sources/ObjC/Utilities/NSString+RSParser.h b/Sources/ObjC/include/NSString+RSParser.h similarity index 100% rename from Sources/ObjC/Utilities/NSString+RSParser.h rename to Sources/ObjC/include/NSString+RSParser.h diff --git a/Sources/ObjC/ParserData.h b/Sources/ObjC/include/ParserData.h similarity index 100% rename from Sources/ObjC/ParserData.h rename to Sources/ObjC/include/ParserData.h diff --git a/Sources/Feeds/XML/RSAtomParser.h b/Sources/ObjC/include/RSAtomParser.h similarity index 100% rename from Sources/Feeds/XML/RSAtomParser.h rename to Sources/ObjC/include/RSAtomParser.h diff --git a/Sources/ObjC/Utilities/RSDateParser.h b/Sources/ObjC/include/RSDateParser.h similarity index 100% rename from Sources/ObjC/Utilities/RSDateParser.h rename to Sources/ObjC/include/RSDateParser.h diff --git a/Sources/ObjC/HTML/RSHTMLLinkParser.h b/Sources/ObjC/include/RSHTMLLinkParser.h similarity index 100% rename from Sources/ObjC/HTML/RSHTMLLinkParser.h rename to Sources/ObjC/include/RSHTMLLinkParser.h diff --git a/Sources/ObjC/HTML/RSHTMLMetadata.h b/Sources/ObjC/include/RSHTMLMetadata.h similarity index 100% rename from Sources/ObjC/HTML/RSHTMLMetadata.h rename to Sources/ObjC/include/RSHTMLMetadata.h diff --git a/Sources/ObjC/HTML/RSHTMLMetadataParser.h b/Sources/ObjC/include/RSHTMLMetadataParser.h similarity index 100% rename from Sources/ObjC/HTML/RSHTMLMetadataParser.h rename to Sources/ObjC/include/RSHTMLMetadataParser.h diff --git a/Sources/ObjC/HTML/RSHTMLTag.h b/Sources/ObjC/include/RSHTMLTag.h similarity index 100% rename from Sources/ObjC/HTML/RSHTMLTag.h rename to Sources/ObjC/include/RSHTMLTag.h diff --git a/Sources/ObjC/OPML/RSOPMLAttributes.h b/Sources/ObjC/include/RSOPMLAttributes.h similarity index 100% rename from Sources/ObjC/OPML/RSOPMLAttributes.h rename to Sources/ObjC/include/RSOPMLAttributes.h diff --git a/Sources/ObjC/OPML/RSOPMLDocument.h b/Sources/ObjC/include/RSOPMLDocument.h similarity index 85% rename from Sources/ObjC/OPML/RSOPMLDocument.h rename to Sources/ObjC/include/RSOPMLDocument.h index 2de8cf5..27790c1 100755 --- a/Sources/ObjC/OPML/RSOPMLDocument.h +++ b/Sources/ObjC/include/RSOPMLDocument.h @@ -7,7 +7,14 @@ // @import Foundation; + +#if SWIFT_PACKAGE +#import "RSOPMLItem.h" +#else #import +#endif + + @interface RSOPMLDocument : RSOPMLItem diff --git a/Sources/ObjC/OPML/RSOPMLError.h b/Sources/ObjC/include/RSOPMLError.h similarity index 100% rename from Sources/ObjC/OPML/RSOPMLError.h rename to Sources/ObjC/include/RSOPMLError.h diff --git a/Sources/ObjC/OPML/RSOPMLFeedSpecifier.h b/Sources/ObjC/include/RSOPMLFeedSpecifier.h similarity index 100% rename from Sources/ObjC/OPML/RSOPMLFeedSpecifier.h rename to Sources/ObjC/include/RSOPMLFeedSpecifier.h diff --git a/Sources/ObjC/OPML/RSOPMLItem.h b/Sources/ObjC/include/RSOPMLItem.h similarity index 100% rename from Sources/ObjC/OPML/RSOPMLItem.h rename to Sources/ObjC/include/RSOPMLItem.h diff --git a/Sources/ObjC/OPML/RSOPMLParser.h b/Sources/ObjC/include/RSOPMLParser.h similarity index 100% rename from Sources/ObjC/OPML/RSOPMLParser.h rename to Sources/ObjC/include/RSOPMLParser.h diff --git a/Sources/Feeds/XML/RSParsedArticle.h b/Sources/ObjC/include/RSParsedArticle.h similarity index 100% rename from Sources/Feeds/XML/RSParsedArticle.h rename to Sources/ObjC/include/RSParsedArticle.h diff --git a/Sources/Feeds/XML/RSParsedAuthor.h b/Sources/ObjC/include/RSParsedAuthor.h similarity index 100% rename from Sources/Feeds/XML/RSParsedAuthor.h rename to Sources/ObjC/include/RSParsedAuthor.h diff --git a/Sources/Feeds/XML/RSParsedEnclosure.h b/Sources/ObjC/include/RSParsedEnclosure.h similarity index 100% rename from Sources/Feeds/XML/RSParsedEnclosure.h rename to Sources/ObjC/include/RSParsedEnclosure.h diff --git a/Sources/Feeds/XML/RSParsedFeed.h b/Sources/ObjC/include/RSParsedFeed.h similarity index 100% rename from Sources/Feeds/XML/RSParsedFeed.h rename to Sources/ObjC/include/RSParsedFeed.h diff --git a/Sources/ObjC/RSParser.h b/Sources/ObjC/include/RSParser.h similarity index 59% rename from Sources/ObjC/RSParser.h rename to Sources/ObjC/include/RSParser.h index 9bb1b10..b544537 100644 --- a/Sources/ObjC/RSParser.h +++ b/Sources/ObjC/include/RSParser.h @@ -8,6 +8,47 @@ @import Foundation; +#if SWIFT_PACKAGE +#import "ParserData.h" +#import "RSDateParser.h" + +// OPML + +#import "RSOPMLParser.h" +#import "RSOPMLDocument.h" +#import "RSOPMLItem.h" +#import "RSOPMLAttributes.h" +#import "RSOPMLFeedSpecifier.h" +#import "RSOPMLError.h" + +// For writing your own XML parser. + +#import "RSSAXParser.h" + +// You should use FeedParser (Swift) instead of these two specific parsers +// and the objects they create. +// But they’re available if you want them. + +#import "RSRSSParser.h" +#import "RSAtomParser.h" +#import "RSParsedFeed.h" +#import "RSParsedArticle.h" +#import "RSParsedEnclosure.h" +#import "RSParsedAuthor.h" + +// HTML + +#import "RSHTMLMetadataParser.h" +#import "RSHTMLMetadata.h" +#import "RSHTMLLinkParser.h" +#import "RSSAXHTMLParser.h" // For writing your own HTML parser. +#import "RSHTMLTag.h" + +// Utilities + +#import "NSData+RSParser.h" +#import "NSString+RSParser.h" +#else // To parse RSS, Atom, JSON Feed, and RSS-in-JSON the easy way, see FeedParser.swift. #import @@ -52,3 +93,8 @@ #import #import +#endif + + + + diff --git a/Sources/ObjC/Utilities/RSParserInternal.h b/Sources/ObjC/include/RSParserInternal.h similarity index 100% rename from Sources/ObjC/Utilities/RSParserInternal.h rename to Sources/ObjC/include/RSParserInternal.h diff --git a/Sources/Feeds/XML/RSRSSParser.h b/Sources/ObjC/include/RSRSSParser.h similarity index 100% rename from Sources/Feeds/XML/RSRSSParser.h rename to Sources/ObjC/include/RSRSSParser.h diff --git a/Sources/ObjC/HTML/RSSAXHTMLParser.h b/Sources/ObjC/include/RSSAXHTMLParser.h similarity index 100% rename from Sources/ObjC/HTML/RSSAXHTMLParser.h rename to Sources/ObjC/include/RSSAXHTMLParser.h diff --git a/Sources/ObjC/SAX/RSSAXParser.h b/Sources/ObjC/include/RSSAXParser.h similarity index 100% rename from Sources/ObjC/SAX/RSSAXParser.h rename to Sources/ObjC/include/RSSAXParser.h diff --git a/Sources/Swift/Feeds/FeedParser.swift b/Sources/Swift/Feeds/FeedParser.swift index bd85f8e..d9d6186 100644 --- a/Sources/Swift/Feeds/FeedParser.swift +++ b/Sources/Swift/Feeds/FeedParser.swift @@ -7,6 +7,9 @@ // import Foundation +#if SWIFT_PACKAGE +import RSParser +#endif // FeedParser handles RSS, Atom, JSON Feed, and RSS-in-JSON. // You don’t need to know the type of feed. diff --git a/Sources/Swift/Feeds/FeedType.swift b/Sources/Swift/Feeds/FeedType.swift index 16cefbe..83b9dfa 100644 --- a/Sources/Swift/Feeds/FeedType.swift +++ b/Sources/Swift/Feeds/FeedType.swift @@ -7,6 +7,9 @@ // import Foundation +#if SWIFT_PACKAGE +import RSParser +#endif public enum FeedType { case rss diff --git a/Sources/Swift/Feeds/JSON/JSONFeedParser.swift b/Sources/Swift/Feeds/JSON/JSONFeedParser.swift index 0c3822d..a8c9400 100644 --- a/Sources/Swift/Feeds/JSON/JSONFeedParser.swift +++ b/Sources/Swift/Feeds/JSON/JSONFeedParser.swift @@ -7,6 +7,9 @@ // import Foundation +#if SWIFT_PACKAGE +import RSParser +#endif // See https://jsonfeed.org/version/1 diff --git a/Sources/Swift/Feeds/JSON/RSSInJSONParser.swift b/Sources/Swift/Feeds/JSON/RSSInJSONParser.swift index 74e6b06..1817b51 100644 --- a/Sources/Swift/Feeds/JSON/RSSInJSONParser.swift +++ b/Sources/Swift/Feeds/JSON/RSSInJSONParser.swift @@ -7,6 +7,9 @@ // import Foundation +#if SWIFT_PACKAGE +import RSParser +#endif // See https://github.com/scripting/Scripting-News/blob/master/rss-in-json/README.md // Also: http://cyber.harvard.edu/rss/rss.html diff --git a/Sources/Swift/Feeds/XML/AtomParser.swift b/Sources/Swift/Feeds/XML/AtomParser.swift index 151349a..651bc03 100644 --- a/Sources/Swift/Feeds/XML/AtomParser.swift +++ b/Sources/Swift/Feeds/XML/AtomParser.swift @@ -8,6 +8,10 @@ import Foundation +#if SWIFT_PACKAGE +import RSParser +#endif + // RSSParser wraps the Objective-C RSAtomParser. // // The Objective-C parser creates RSParsedFeed, RSParsedArticle, etc. diff --git a/Sources/Swift/Feeds/XML/RSParsedFeedTransformer.swift b/Sources/Swift/Feeds/XML/RSParsedFeedTransformer.swift index c6d0b2b..2c00e5b 100644 --- a/Sources/Swift/Feeds/XML/RSParsedFeedTransformer.swift +++ b/Sources/Swift/Feeds/XML/RSParsedFeedTransformer.swift @@ -7,6 +7,9 @@ // import Foundation +#if SWIFT_PACKAGE +import RSParser +#endif // RSRSSParser and RSAtomParser were written in Objective-C quite a while ago. // They create an RSParsedFeed object and related Objective-C objects. diff --git a/Sources/Swift/Feeds/XML/RSSParser.swift b/Sources/Swift/Feeds/XML/RSSParser.swift index 885790e..353f97c 100644 --- a/Sources/Swift/Feeds/XML/RSSParser.swift +++ b/Sources/Swift/Feeds/XML/RSSParser.swift @@ -7,6 +7,7 @@ // import Foundation +import RSParser // RSSParser wraps the Objective-C RSRSSParser. // From c2e8674f946be549990e89fb73136cd37cca9705 Mon Sep 17 00:00:00 2001 From: Stuart Breckenridge Date: Wed, 29 Jul 2020 21:52:57 +0800 Subject: [PATCH 03/19] RSParser is now the swift package --- Package.swift | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Package.swift b/Package.swift index cc6118f..792d010 100644 --- a/Package.swift +++ b/Package.swift @@ -8,12 +8,12 @@ let package = Package( platforms: [.macOS(SupportedPlatform.MacOSVersion.v10_15), .iOS(SupportedPlatform.IOSVersion.v13)], products: [ // Products define the executables and libraries a package produces, and make them visible to other packages. - .library( - name: "RSParserSwift", - targets: ["RSParserSwift"]), .library( name: "RSParser", targets: ["RSParser"]), + .library( + name: "RSParser-ObjC", + targets: ["RSParser-ObjC"]), ], dependencies: [ // Dependencies declare other packages that this package depends on. @@ -23,11 +23,11 @@ let package = Package( // Targets are the basic building blocks of a package. A target can define a module or a test suite. // Targets can depend on other targets in this package, and on products in packages this package depends on. .target( - name: "RSParserSwift", - dependencies: ["RSParser"], + name: "RSParser", + dependencies: ["RSParser-ObjC"], path: "Sources/Swift"), .target( - name: "RSParser", + name: "RSParser-ObjC", dependencies: [], path: "Sources/ObjC", cSettings: [ From 008b62f1298186d7511012a71ef247bf4a20cac5 Mon Sep 17 00:00:00 2001 From: Stuart Breckenridge Date: Wed, 29 Jul 2020 22:05:37 +0800 Subject: [PATCH 04/19] Updated import statements --- Sources/Swift/Feeds/FeedParser.swift | 2 +- Sources/Swift/Feeds/FeedType.swift | 2 +- Sources/Swift/Feeds/JSON/JSONFeedParser.swift | 2 +- Sources/Swift/Feeds/JSON/RSSInJSONParser.swift | 2 +- Sources/Swift/Feeds/XML/AtomParser.swift | 2 +- Sources/Swift/Feeds/XML/RSParsedFeedTransformer.swift | 2 +- Sources/Swift/Feeds/XML/RSSParser.swift | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Sources/Swift/Feeds/FeedParser.swift b/Sources/Swift/Feeds/FeedParser.swift index d9d6186..7774415 100644 --- a/Sources/Swift/Feeds/FeedParser.swift +++ b/Sources/Swift/Feeds/FeedParser.swift @@ -8,7 +8,7 @@ import Foundation #if SWIFT_PACKAGE -import RSParser +import RSParser_ObjC #endif // FeedParser handles RSS, Atom, JSON Feed, and RSS-in-JSON. diff --git a/Sources/Swift/Feeds/FeedType.swift b/Sources/Swift/Feeds/FeedType.swift index 83b9dfa..0f27578 100644 --- a/Sources/Swift/Feeds/FeedType.swift +++ b/Sources/Swift/Feeds/FeedType.swift @@ -8,7 +8,7 @@ import Foundation #if SWIFT_PACKAGE -import RSParser +import RSParser_ObjC #endif public enum FeedType { diff --git a/Sources/Swift/Feeds/JSON/JSONFeedParser.swift b/Sources/Swift/Feeds/JSON/JSONFeedParser.swift index a8c9400..02b2929 100644 --- a/Sources/Swift/Feeds/JSON/JSONFeedParser.swift +++ b/Sources/Swift/Feeds/JSON/JSONFeedParser.swift @@ -8,7 +8,7 @@ import Foundation #if SWIFT_PACKAGE -import RSParser +import RSParser_ObjC #endif // See https://jsonfeed.org/version/1 diff --git a/Sources/Swift/Feeds/JSON/RSSInJSONParser.swift b/Sources/Swift/Feeds/JSON/RSSInJSONParser.swift index 1817b51..1a37914 100644 --- a/Sources/Swift/Feeds/JSON/RSSInJSONParser.swift +++ b/Sources/Swift/Feeds/JSON/RSSInJSONParser.swift @@ -8,7 +8,7 @@ import Foundation #if SWIFT_PACKAGE -import RSParser +import RSParser_ObjC #endif // See https://github.com/scripting/Scripting-News/blob/master/rss-in-json/README.md diff --git a/Sources/Swift/Feeds/XML/AtomParser.swift b/Sources/Swift/Feeds/XML/AtomParser.swift index 651bc03..be9c5d4 100644 --- a/Sources/Swift/Feeds/XML/AtomParser.swift +++ b/Sources/Swift/Feeds/XML/AtomParser.swift @@ -9,7 +9,7 @@ import Foundation #if SWIFT_PACKAGE -import RSParser +import RSParser_ObjC #endif // RSSParser wraps the Objective-C RSAtomParser. diff --git a/Sources/Swift/Feeds/XML/RSParsedFeedTransformer.swift b/Sources/Swift/Feeds/XML/RSParsedFeedTransformer.swift index 2c00e5b..8a1426f 100644 --- a/Sources/Swift/Feeds/XML/RSParsedFeedTransformer.swift +++ b/Sources/Swift/Feeds/XML/RSParsedFeedTransformer.swift @@ -8,7 +8,7 @@ import Foundation #if SWIFT_PACKAGE -import RSParser +import RSParser_ObjC #endif // RSRSSParser and RSAtomParser were written in Objective-C quite a while ago. diff --git a/Sources/Swift/Feeds/XML/RSSParser.swift b/Sources/Swift/Feeds/XML/RSSParser.swift index 353f97c..9d83595 100644 --- a/Sources/Swift/Feeds/XML/RSSParser.swift +++ b/Sources/Swift/Feeds/XML/RSSParser.swift @@ -7,7 +7,7 @@ // import Foundation -import RSParser +import RSParser_ObjC // RSSParser wraps the Objective-C RSRSSParser. // From 2bcaadf70433f0c8624884062ce45c240fcf3443 Mon Sep 17 00:00:00 2001 From: Stuart Breckenridge Date: Wed, 29 Jul 2020 22:09:11 +0800 Subject: [PATCH 05/19] Updated import statements --- Sources/ObjC/Feeds/RSAtomParser.m | 18 ++++----- Sources/ObjC/Feeds/RSParsedArticle.m | 10 ++--- Sources/ObjC/Feeds/RSParsedAuthor.m | 2 +- Sources/ObjC/Feeds/RSParsedFeed.m | 2 +- Sources/ObjC/Feeds/RSRSSParser.m | 20 +++++----- Sources/ObjC/HTML/RSHTMLLinkParser.m | 10 ++--- Sources/ObjC/HTML/RSHTMLMetadata.m | 6 +-- Sources/ObjC/HTML/RSHTMLMetadataParser.m | 14 +++---- Sources/ObjC/HTML/RSSAXHTMLParser.m | 6 +-- Sources/ObjC/OPML/RSOPMLAttributes.m | 4 +- Sources/ObjC/OPML/RSOPMLDocument.m | 2 +- Sources/ObjC/OPML/RSOPMLError.m | 2 +- Sources/ObjC/OPML/RSOPMLFeedSpecifier.m | 4 +- Sources/ObjC/OPML/RSOPMLItem.m | 8 ++-- Sources/ObjC/OPML/RSOPMLParser.m | 14 +++---- Sources/ObjC/SAX/RSSAXParser.m | 4 +- Sources/ObjC/Utilities/NSData+RSParser.m | 2 +- Sources/ObjC/Utilities/NSString+RSParser.m | 2 +- Sources/ObjC/Utilities/RSParserInternal.m | 2 +- Sources/ObjC/include/RSOPMLDocument.h | 2 +- Sources/ObjC/include/RSParser.h | 44 +++++++++++----------- 21 files changed, 89 insertions(+), 89 deletions(-) diff --git a/Sources/ObjC/Feeds/RSAtomParser.m b/Sources/ObjC/Feeds/RSAtomParser.m index 6a29207..8eac691 100755 --- a/Sources/ObjC/Feeds/RSAtomParser.m +++ b/Sources/ObjC/Feeds/RSAtomParser.m @@ -18,15 +18,15 @@ #import "RSParsedEnclosure.h" #import "RSParsedAuthor.h" #else -#import -#import -#import -#import -#import -#import -#import -#import -#import +#import +#import +#import +#import +#import +#import +#import +#import +#import #endif #import diff --git a/Sources/ObjC/Feeds/RSParsedArticle.m b/Sources/ObjC/Feeds/RSParsedArticle.m index 6e72879..c784779 100755 --- a/Sources/ObjC/Feeds/RSParsedArticle.m +++ b/Sources/ObjC/Feeds/RSParsedArticle.m @@ -14,11 +14,11 @@ #import "RSParsedAuthor.h" #import "RSParsedEnclosure.h" #else -#import -#import -#import -#import -#import +#import +#import +#import +#import +#import #endif diff --git a/Sources/ObjC/Feeds/RSParsedAuthor.m b/Sources/ObjC/Feeds/RSParsedAuthor.m index 02536d6..8e9a9f0 100644 --- a/Sources/ObjC/Feeds/RSParsedAuthor.m +++ b/Sources/ObjC/Feeds/RSParsedAuthor.m @@ -9,7 +9,7 @@ #if SWIFT_PACKAGE #import "NSString+RSParser.h" #else -#import +#import #endif #import "RSParsedAuthor.h" diff --git a/Sources/ObjC/Feeds/RSParsedFeed.m b/Sources/ObjC/Feeds/RSParsedFeed.m index c4211d4..f8f0eaf 100755 --- a/Sources/ObjC/Feeds/RSParsedFeed.m +++ b/Sources/ObjC/Feeds/RSParsedFeed.m @@ -9,7 +9,7 @@ #if SWIFT_PACKAGE #import "RSParsedFeed.h" #else -#import +#import #endif diff --git a/Sources/ObjC/Feeds/RSRSSParser.m b/Sources/ObjC/Feeds/RSRSSParser.m index bdb63da..6026391 100755 --- a/Sources/ObjC/Feeds/RSRSSParser.m +++ b/Sources/ObjC/Feeds/RSRSSParser.m @@ -18,16 +18,16 @@ #import "RSParsedEnclosure.h" #import "RSParsedAuthor.h" #else -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import #endif diff --git a/Sources/ObjC/HTML/RSHTMLLinkParser.m b/Sources/ObjC/HTML/RSHTMLLinkParser.m index 5bfdfeb..cb41d39 100755 --- a/Sources/ObjC/HTML/RSHTMLLinkParser.m +++ b/Sources/ObjC/HTML/RSHTMLLinkParser.m @@ -14,11 +14,11 @@ #import "RSParserInternal.h" #import "ParserData.h" #else -#import -#import -#import -#import -#import +#import +#import +#import +#import +#import #endif #import diff --git a/Sources/ObjC/HTML/RSHTMLMetadata.m b/Sources/ObjC/HTML/RSHTMLMetadata.m index d771940..aa9d2b6 100755 --- a/Sources/ObjC/HTML/RSHTMLMetadata.m +++ b/Sources/ObjC/HTML/RSHTMLMetadata.m @@ -11,9 +11,9 @@ #import "RSParserInternal.h" #import "RSHTMLTag.h" #else -#import -#import -#import +#import +#import +#import #endif diff --git a/Sources/ObjC/HTML/RSHTMLMetadataParser.m b/Sources/ObjC/HTML/RSHTMLMetadataParser.m index 92d2947..e997237 100755 --- a/Sources/ObjC/HTML/RSHTMLMetadataParser.m +++ b/Sources/ObjC/HTML/RSHTMLMetadataParser.m @@ -16,13 +16,13 @@ #import "ParserData.h" #import "RSHTMLTag.h" #else -#import -#import -#import -#import -#import -#import -#import +#import +#import +#import +#import +#import +#import +#import #endif #import diff --git a/Sources/ObjC/HTML/RSSAXHTMLParser.m b/Sources/ObjC/HTML/RSSAXHTMLParser.m index 98ce38b..3d365f3 100755 --- a/Sources/ObjC/HTML/RSSAXHTMLParser.m +++ b/Sources/ObjC/HTML/RSSAXHTMLParser.m @@ -11,9 +11,9 @@ #import "RSSAXParser.h" #import "RSParserInternal.h" #else -#import -#import -#import +#import +#import +#import #endif #import diff --git a/Sources/ObjC/OPML/RSOPMLAttributes.m b/Sources/ObjC/OPML/RSOPMLAttributes.m index ba90964..494cb0d 100755 --- a/Sources/ObjC/OPML/RSOPMLAttributes.m +++ b/Sources/ObjC/OPML/RSOPMLAttributes.m @@ -10,8 +10,8 @@ #import "RSOPMLAttributes.h" #import "RSParserInternal.h" #else -#import -#import +#import +#import #endif diff --git a/Sources/ObjC/OPML/RSOPMLDocument.m b/Sources/ObjC/OPML/RSOPMLDocument.m index b1a20b8..0ce4961 100755 --- a/Sources/ObjC/OPML/RSOPMLDocument.m +++ b/Sources/ObjC/OPML/RSOPMLDocument.m @@ -10,7 +10,7 @@ #if SWIFT_PACKAGE #import "RSOPMLDocument.h" #else -#import +#import #endif diff --git a/Sources/ObjC/OPML/RSOPMLError.m b/Sources/ObjC/OPML/RSOPMLError.m index a323760..28f7478 100755 --- a/Sources/ObjC/OPML/RSOPMLError.m +++ b/Sources/ObjC/OPML/RSOPMLError.m @@ -9,7 +9,7 @@ #if SWIFT_PACKAGE #import "RSOPMLError.h" #else -#import +#import #endif NSString *RSOPMLErrorDomain = @"com.ranchero.OPML"; diff --git a/Sources/ObjC/OPML/RSOPMLFeedSpecifier.m b/Sources/ObjC/OPML/RSOPMLFeedSpecifier.m index 4ad7a10..2a4d2ac 100755 --- a/Sources/ObjC/OPML/RSOPMLFeedSpecifier.m +++ b/Sources/ObjC/OPML/RSOPMLFeedSpecifier.m @@ -10,8 +10,8 @@ #import "RSOPMLFeedSpecifier.h" #import "RSParserInternal.h" #else -#import -#import +#import +#import #endif diff --git a/Sources/ObjC/OPML/RSOPMLItem.m b/Sources/ObjC/OPML/RSOPMLItem.m index 42461b1..e54698f 100755 --- a/Sources/ObjC/OPML/RSOPMLItem.m +++ b/Sources/ObjC/OPML/RSOPMLItem.m @@ -12,10 +12,10 @@ #import "RSOPMLFeedSpecifier.h" #import "RSParserInternal.h" #else -#import -#import -#import -#import +#import +#import +#import +#import #endif diff --git a/Sources/ObjC/OPML/RSOPMLParser.m b/Sources/ObjC/OPML/RSOPMLParser.m index 8a5eeb1..4260635 100755 --- a/Sources/ObjC/OPML/RSOPMLParser.m +++ b/Sources/ObjC/OPML/RSOPMLParser.m @@ -16,13 +16,13 @@ #import "RSOPMLParser.h" #import "ParserData.h" #else -#import -#import -#import -#import -#import -#import -#import +#import +#import +#import +#import +#import +#import +#import #endif #import diff --git a/Sources/ObjC/SAX/RSSAXParser.m b/Sources/ObjC/SAX/RSSAXParser.m index 2e77a30..60a5d3e 100755 --- a/Sources/ObjC/SAX/RSSAXParser.m +++ b/Sources/ObjC/SAX/RSSAXParser.m @@ -10,8 +10,8 @@ #import "RSSAXParser.h" #import "RSParserInternal.h" #else -#import -#import +#import +#import #endif diff --git a/Sources/ObjC/Utilities/NSData+RSParser.m b/Sources/ObjC/Utilities/NSData+RSParser.m index 0f8f33d..ec5d534 100644 --- a/Sources/ObjC/Utilities/NSData+RSParser.m +++ b/Sources/ObjC/Utilities/NSData+RSParser.m @@ -9,7 +9,7 @@ #if SWIFT_PACKAGE #import "NSData+RSParser.h" #else -#import +#import #endif diff --git a/Sources/ObjC/Utilities/NSString+RSParser.m b/Sources/ObjC/Utilities/NSString+RSParser.m index 47f2207..6d50c3c 100755 --- a/Sources/ObjC/Utilities/NSString+RSParser.m +++ b/Sources/ObjC/Utilities/NSString+RSParser.m @@ -10,7 +10,7 @@ #import "NSString+RSParser.h" #import #else -#import +#import #import #endif diff --git a/Sources/ObjC/Utilities/RSParserInternal.m b/Sources/ObjC/Utilities/RSParserInternal.m index b7dbe82..ccecc64 100755 --- a/Sources/ObjC/Utilities/RSParserInternal.m +++ b/Sources/ObjC/Utilities/RSParserInternal.m @@ -12,7 +12,7 @@ #import #else #import -#import +#import #endif diff --git a/Sources/ObjC/include/RSOPMLDocument.h b/Sources/ObjC/include/RSOPMLDocument.h index 27790c1..3d9cf61 100755 --- a/Sources/ObjC/include/RSOPMLDocument.h +++ b/Sources/ObjC/include/RSOPMLDocument.h @@ -11,7 +11,7 @@ #if SWIFT_PACKAGE #import "RSOPMLItem.h" #else -#import +#import #endif diff --git a/Sources/ObjC/include/RSParser.h b/Sources/ObjC/include/RSParser.h index b544537..4680c94 100644 --- a/Sources/ObjC/include/RSParser.h +++ b/Sources/ObjC/include/RSParser.h @@ -51,48 +51,48 @@ #else // To parse RSS, Atom, JSON Feed, and RSS-in-JSON the easy way, see FeedParser.swift. -#import +#import // Dates -#import +#import // OPML -#import -#import -#import -#import -#import -#import +#import +#import +#import +#import +#import +#import // For writing your own XML parser. -#import +#import // You should use FeedParser (Swift) instead of these two specific parsers // and the objects they create. // But they’re available if you want them. -#import -#import -#import -#import -#import -#import +#import +#import +#import +#import +#import +#import // HTML -#import -#import -#import -#import // For writing your own HTML parser. -#import +#import +#import +#import +#import // For writing your own HTML parser. +#import // Utilities -#import -#import +#import +#import #endif From 78055942fb62438ababb370e183e8229c3661289 Mon Sep 17 00:00:00 2001 From: Stuart Breckenridge Date: Wed, 29 Jul 2020 22:11:08 +0800 Subject: [PATCH 06/19] Renamed --- Package.swift | 8 ++-- Sources/ObjC/Feeds/RSAtomParser.m | 18 ++++---- Sources/ObjC/Feeds/RSParsedArticle.m | 10 ++--- Sources/ObjC/Feeds/RSParsedAuthor.m | 2 +- Sources/ObjC/Feeds/RSParsedFeed.m | 2 +- Sources/ObjC/Feeds/RSRSSParser.m | 20 ++++----- Sources/ObjC/HTML/RSHTMLLinkParser.m | 10 ++--- Sources/ObjC/HTML/RSHTMLMetadata.m | 6 +-- Sources/ObjC/HTML/RSHTMLMetadataParser.m | 14 +++--- Sources/ObjC/HTML/RSSAXHTMLParser.m | 6 +-- Sources/ObjC/OPML/RSOPMLAttributes.m | 4 +- Sources/ObjC/OPML/RSOPMLDocument.m | 2 +- Sources/ObjC/OPML/RSOPMLError.m | 2 +- Sources/ObjC/OPML/RSOPMLFeedSpecifier.m | 4 +- Sources/ObjC/OPML/RSOPMLItem.m | 8 ++-- Sources/ObjC/OPML/RSOPMLParser.m | 14 +++--- Sources/ObjC/SAX/RSSAXParser.m | 4 +- Sources/ObjC/Utilities/NSData+RSParser.m | 2 +- Sources/ObjC/Utilities/NSString+RSParser.m | 2 +- Sources/ObjC/Utilities/RSParserInternal.m | 2 +- Sources/ObjC/include/RSOPMLDocument.h | 2 +- Sources/ObjC/include/RSParser.h | 44 +++++++++---------- Sources/Swift/Feeds/FeedParser.swift | 2 +- Sources/Swift/Feeds/FeedType.swift | 2 +- Sources/Swift/Feeds/JSON/JSONFeedParser.swift | 2 +- .../Swift/Feeds/JSON/RSSInJSONParser.swift | 2 +- Sources/Swift/Feeds/XML/AtomParser.swift | 2 +- .../Feeds/XML/RSParsedFeedTransformer.swift | 2 +- Sources/Swift/Feeds/XML/RSSParser.swift | 2 +- 29 files changed, 100 insertions(+), 100 deletions(-) diff --git a/Package.swift b/Package.swift index 792d010..60e5ee4 100644 --- a/Package.swift +++ b/Package.swift @@ -12,8 +12,8 @@ let package = Package( name: "RSParser", targets: ["RSParser"]), .library( - name: "RSParser-ObjC", - targets: ["RSParser-ObjC"]), + name: "RSParserObjC", + targets: ["RSParserObjC"]), ], dependencies: [ // Dependencies declare other packages that this package depends on. @@ -24,10 +24,10 @@ let package = Package( // Targets can depend on other targets in this package, and on products in packages this package depends on. .target( name: "RSParser", - dependencies: ["RSParser-ObjC"], + dependencies: ["RSParserObjC"], path: "Sources/Swift"), .target( - name: "RSParser-ObjC", + name: "RSParserObjC", dependencies: [], path: "Sources/ObjC", cSettings: [ diff --git a/Sources/ObjC/Feeds/RSAtomParser.m b/Sources/ObjC/Feeds/RSAtomParser.m index 8eac691..79da1e8 100755 --- a/Sources/ObjC/Feeds/RSAtomParser.m +++ b/Sources/ObjC/Feeds/RSAtomParser.m @@ -18,15 +18,15 @@ #import "RSParsedEnclosure.h" #import "RSParsedAuthor.h" #else -#import -#import -#import -#import -#import -#import -#import -#import -#import +#import +#import +#import +#import +#import +#import +#import +#import +#import #endif #import diff --git a/Sources/ObjC/Feeds/RSParsedArticle.m b/Sources/ObjC/Feeds/RSParsedArticle.m index c784779..ed2cdad 100755 --- a/Sources/ObjC/Feeds/RSParsedArticle.m +++ b/Sources/ObjC/Feeds/RSParsedArticle.m @@ -14,11 +14,11 @@ #import "RSParsedAuthor.h" #import "RSParsedEnclosure.h" #else -#import -#import -#import -#import -#import +#import +#import +#import +#import +#import #endif diff --git a/Sources/ObjC/Feeds/RSParsedAuthor.m b/Sources/ObjC/Feeds/RSParsedAuthor.m index 8e9a9f0..56aa503 100644 --- a/Sources/ObjC/Feeds/RSParsedAuthor.m +++ b/Sources/ObjC/Feeds/RSParsedAuthor.m @@ -9,7 +9,7 @@ #if SWIFT_PACKAGE #import "NSString+RSParser.h" #else -#import +#import #endif #import "RSParsedAuthor.h" diff --git a/Sources/ObjC/Feeds/RSParsedFeed.m b/Sources/ObjC/Feeds/RSParsedFeed.m index f8f0eaf..3fc61f6 100755 --- a/Sources/ObjC/Feeds/RSParsedFeed.m +++ b/Sources/ObjC/Feeds/RSParsedFeed.m @@ -9,7 +9,7 @@ #if SWIFT_PACKAGE #import "RSParsedFeed.h" #else -#import +#import #endif diff --git a/Sources/ObjC/Feeds/RSRSSParser.m b/Sources/ObjC/Feeds/RSRSSParser.m index 6026391..dcffe5b 100755 --- a/Sources/ObjC/Feeds/RSRSSParser.m +++ b/Sources/ObjC/Feeds/RSRSSParser.m @@ -18,16 +18,16 @@ #import "RSParsedEnclosure.h" #import "RSParsedAuthor.h" #else -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import #endif diff --git a/Sources/ObjC/HTML/RSHTMLLinkParser.m b/Sources/ObjC/HTML/RSHTMLLinkParser.m index cb41d39..59a8465 100755 --- a/Sources/ObjC/HTML/RSHTMLLinkParser.m +++ b/Sources/ObjC/HTML/RSHTMLLinkParser.m @@ -14,11 +14,11 @@ #import "RSParserInternal.h" #import "ParserData.h" #else -#import -#import -#import -#import -#import +#import +#import +#import +#import +#import #endif #import diff --git a/Sources/ObjC/HTML/RSHTMLMetadata.m b/Sources/ObjC/HTML/RSHTMLMetadata.m index aa9d2b6..4ef67e0 100755 --- a/Sources/ObjC/HTML/RSHTMLMetadata.m +++ b/Sources/ObjC/HTML/RSHTMLMetadata.m @@ -11,9 +11,9 @@ #import "RSParserInternal.h" #import "RSHTMLTag.h" #else -#import -#import -#import +#import +#import +#import #endif diff --git a/Sources/ObjC/HTML/RSHTMLMetadataParser.m b/Sources/ObjC/HTML/RSHTMLMetadataParser.m index e997237..13f4575 100755 --- a/Sources/ObjC/HTML/RSHTMLMetadataParser.m +++ b/Sources/ObjC/HTML/RSHTMLMetadataParser.m @@ -16,13 +16,13 @@ #import "ParserData.h" #import "RSHTMLTag.h" #else -#import -#import -#import -#import -#import -#import -#import +#import +#import +#import +#import +#import +#import +#import #endif #import diff --git a/Sources/ObjC/HTML/RSSAXHTMLParser.m b/Sources/ObjC/HTML/RSSAXHTMLParser.m index 3d365f3..47d1e82 100755 --- a/Sources/ObjC/HTML/RSSAXHTMLParser.m +++ b/Sources/ObjC/HTML/RSSAXHTMLParser.m @@ -11,9 +11,9 @@ #import "RSSAXParser.h" #import "RSParserInternal.h" #else -#import -#import -#import +#import +#import +#import #endif #import diff --git a/Sources/ObjC/OPML/RSOPMLAttributes.m b/Sources/ObjC/OPML/RSOPMLAttributes.m index 494cb0d..bd515fd 100755 --- a/Sources/ObjC/OPML/RSOPMLAttributes.m +++ b/Sources/ObjC/OPML/RSOPMLAttributes.m @@ -10,8 +10,8 @@ #import "RSOPMLAttributes.h" #import "RSParserInternal.h" #else -#import -#import +#import +#import #endif diff --git a/Sources/ObjC/OPML/RSOPMLDocument.m b/Sources/ObjC/OPML/RSOPMLDocument.m index 0ce4961..4cc4979 100755 --- a/Sources/ObjC/OPML/RSOPMLDocument.m +++ b/Sources/ObjC/OPML/RSOPMLDocument.m @@ -10,7 +10,7 @@ #if SWIFT_PACKAGE #import "RSOPMLDocument.h" #else -#import +#import #endif diff --git a/Sources/ObjC/OPML/RSOPMLError.m b/Sources/ObjC/OPML/RSOPMLError.m index 28f7478..bedd45b 100755 --- a/Sources/ObjC/OPML/RSOPMLError.m +++ b/Sources/ObjC/OPML/RSOPMLError.m @@ -9,7 +9,7 @@ #if SWIFT_PACKAGE #import "RSOPMLError.h" #else -#import +#import #endif NSString *RSOPMLErrorDomain = @"com.ranchero.OPML"; diff --git a/Sources/ObjC/OPML/RSOPMLFeedSpecifier.m b/Sources/ObjC/OPML/RSOPMLFeedSpecifier.m index 2a4d2ac..74ad66b 100755 --- a/Sources/ObjC/OPML/RSOPMLFeedSpecifier.m +++ b/Sources/ObjC/OPML/RSOPMLFeedSpecifier.m @@ -10,8 +10,8 @@ #import "RSOPMLFeedSpecifier.h" #import "RSParserInternal.h" #else -#import -#import +#import +#import #endif diff --git a/Sources/ObjC/OPML/RSOPMLItem.m b/Sources/ObjC/OPML/RSOPMLItem.m index e54698f..b812886 100755 --- a/Sources/ObjC/OPML/RSOPMLItem.m +++ b/Sources/ObjC/OPML/RSOPMLItem.m @@ -12,10 +12,10 @@ #import "RSOPMLFeedSpecifier.h" #import "RSParserInternal.h" #else -#import -#import -#import -#import +#import +#import +#import +#import #endif diff --git a/Sources/ObjC/OPML/RSOPMLParser.m b/Sources/ObjC/OPML/RSOPMLParser.m index 4260635..be9b376 100755 --- a/Sources/ObjC/OPML/RSOPMLParser.m +++ b/Sources/ObjC/OPML/RSOPMLParser.m @@ -16,13 +16,13 @@ #import "RSOPMLParser.h" #import "ParserData.h" #else -#import -#import -#import -#import -#import -#import -#import +#import +#import +#import +#import +#import +#import +#import #endif #import diff --git a/Sources/ObjC/SAX/RSSAXParser.m b/Sources/ObjC/SAX/RSSAXParser.m index 60a5d3e..9b7c4ca 100755 --- a/Sources/ObjC/SAX/RSSAXParser.m +++ b/Sources/ObjC/SAX/RSSAXParser.m @@ -10,8 +10,8 @@ #import "RSSAXParser.h" #import "RSParserInternal.h" #else -#import -#import +#import +#import #endif diff --git a/Sources/ObjC/Utilities/NSData+RSParser.m b/Sources/ObjC/Utilities/NSData+RSParser.m index ec5d534..87e7c37 100644 --- a/Sources/ObjC/Utilities/NSData+RSParser.m +++ b/Sources/ObjC/Utilities/NSData+RSParser.m @@ -9,7 +9,7 @@ #if SWIFT_PACKAGE #import "NSData+RSParser.h" #else -#import +#import #endif diff --git a/Sources/ObjC/Utilities/NSString+RSParser.m b/Sources/ObjC/Utilities/NSString+RSParser.m index 6d50c3c..c652e29 100755 --- a/Sources/ObjC/Utilities/NSString+RSParser.m +++ b/Sources/ObjC/Utilities/NSString+RSParser.m @@ -10,7 +10,7 @@ #import "NSString+RSParser.h" #import #else -#import +#import #import #endif diff --git a/Sources/ObjC/Utilities/RSParserInternal.m b/Sources/ObjC/Utilities/RSParserInternal.m index ccecc64..d63f54a 100755 --- a/Sources/ObjC/Utilities/RSParserInternal.m +++ b/Sources/ObjC/Utilities/RSParserInternal.m @@ -12,7 +12,7 @@ #import #else #import -#import +#import #endif diff --git a/Sources/ObjC/include/RSOPMLDocument.h b/Sources/ObjC/include/RSOPMLDocument.h index 3d9cf61..187f555 100755 --- a/Sources/ObjC/include/RSOPMLDocument.h +++ b/Sources/ObjC/include/RSOPMLDocument.h @@ -11,7 +11,7 @@ #if SWIFT_PACKAGE #import "RSOPMLItem.h" #else -#import +#import #endif diff --git a/Sources/ObjC/include/RSParser.h b/Sources/ObjC/include/RSParser.h index 4680c94..db9aada 100644 --- a/Sources/ObjC/include/RSParser.h +++ b/Sources/ObjC/include/RSParser.h @@ -51,48 +51,48 @@ #else // To parse RSS, Atom, JSON Feed, and RSS-in-JSON the easy way, see FeedParser.swift. -#import +#import // Dates -#import +#import // OPML -#import -#import -#import -#import -#import -#import +#import +#import +#import +#import +#import +#import // For writing your own XML parser. -#import +#import // You should use FeedParser (Swift) instead of these two specific parsers // and the objects they create. // But they’re available if you want them. -#import -#import -#import -#import -#import -#import +#import +#import +#import +#import +#import +#import // HTML -#import -#import -#import -#import // For writing your own HTML parser. -#import +#import +#import +#import +#import // For writing your own HTML parser. +#import // Utilities -#import -#import +#import +#import #endif diff --git a/Sources/Swift/Feeds/FeedParser.swift b/Sources/Swift/Feeds/FeedParser.swift index 7774415..590eaab 100644 --- a/Sources/Swift/Feeds/FeedParser.swift +++ b/Sources/Swift/Feeds/FeedParser.swift @@ -8,7 +8,7 @@ import Foundation #if SWIFT_PACKAGE -import RSParser_ObjC +import RSParserObjC #endif // FeedParser handles RSS, Atom, JSON Feed, and RSS-in-JSON. diff --git a/Sources/Swift/Feeds/FeedType.swift b/Sources/Swift/Feeds/FeedType.swift index 0f27578..bfe33c0 100644 --- a/Sources/Swift/Feeds/FeedType.swift +++ b/Sources/Swift/Feeds/FeedType.swift @@ -8,7 +8,7 @@ import Foundation #if SWIFT_PACKAGE -import RSParser_ObjC +import RSParserObjC #endif public enum FeedType { diff --git a/Sources/Swift/Feeds/JSON/JSONFeedParser.swift b/Sources/Swift/Feeds/JSON/JSONFeedParser.swift index 02b2929..54b9af7 100644 --- a/Sources/Swift/Feeds/JSON/JSONFeedParser.swift +++ b/Sources/Swift/Feeds/JSON/JSONFeedParser.swift @@ -8,7 +8,7 @@ import Foundation #if SWIFT_PACKAGE -import RSParser_ObjC +import RSParserObjC #endif // See https://jsonfeed.org/version/1 diff --git a/Sources/Swift/Feeds/JSON/RSSInJSONParser.swift b/Sources/Swift/Feeds/JSON/RSSInJSONParser.swift index 1a37914..ea19073 100644 --- a/Sources/Swift/Feeds/JSON/RSSInJSONParser.swift +++ b/Sources/Swift/Feeds/JSON/RSSInJSONParser.swift @@ -8,7 +8,7 @@ import Foundation #if SWIFT_PACKAGE -import RSParser_ObjC +import RSParserObjC #endif // See https://github.com/scripting/Scripting-News/blob/master/rss-in-json/README.md diff --git a/Sources/Swift/Feeds/XML/AtomParser.swift b/Sources/Swift/Feeds/XML/AtomParser.swift index be9c5d4..ad6b664 100644 --- a/Sources/Swift/Feeds/XML/AtomParser.swift +++ b/Sources/Swift/Feeds/XML/AtomParser.swift @@ -9,7 +9,7 @@ import Foundation #if SWIFT_PACKAGE -import RSParser_ObjC +import RSParserObjC #endif // RSSParser wraps the Objective-C RSAtomParser. diff --git a/Sources/Swift/Feeds/XML/RSParsedFeedTransformer.swift b/Sources/Swift/Feeds/XML/RSParsedFeedTransformer.swift index 8a1426f..4d680ac 100644 --- a/Sources/Swift/Feeds/XML/RSParsedFeedTransformer.swift +++ b/Sources/Swift/Feeds/XML/RSParsedFeedTransformer.swift @@ -8,7 +8,7 @@ import Foundation #if SWIFT_PACKAGE -import RSParser_ObjC +import RSParserObjC #endif // RSRSSParser and RSAtomParser were written in Objective-C quite a while ago. diff --git a/Sources/Swift/Feeds/XML/RSSParser.swift b/Sources/Swift/Feeds/XML/RSSParser.swift index 9d83595..f14d9c7 100644 --- a/Sources/Swift/Feeds/XML/RSSParser.swift +++ b/Sources/Swift/Feeds/XML/RSSParser.swift @@ -7,7 +7,7 @@ // import Foundation -import RSParser_ObjC +import RSParserObjC // RSSParser wraps the Objective-C RSRSSParser. // From 40fd44d819851da722408b49632cc226ab8ff584 Mon Sep 17 00:00:00 2001 From: Stuart Breckenridge Date: Wed, 29 Jul 2020 22:14:57 +0800 Subject: [PATCH 07/19] Adds Exports.swift --- Sources/Swift/Exports.swift | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 Sources/Swift/Exports.swift diff --git a/Sources/Swift/Exports.swift b/Sources/Swift/Exports.swift new file mode 100644 index 0000000..135f54b --- /dev/null +++ b/Sources/Swift/Exports.swift @@ -0,0 +1,9 @@ +// +// Exports.swift +// +// +// Created by Stuart Breckenridge on 29/7/20. +// + +import Foundation +@_exported import RSParserObjC From 1b609dfc9259f690ec7af8fd0ae94720166630af Mon Sep 17 00:00:00 2001 From: Stuart Breckenridge Date: Wed, 29 Jul 2020 22:22:32 +0800 Subject: [PATCH 08/19] Adds .define --- Package.swift | 1 + 1 file changed, 1 insertion(+) diff --git a/Package.swift b/Package.swift index 60e5ee4..199609b 100644 --- a/Package.swift +++ b/Package.swift @@ -32,6 +32,7 @@ let package = Package( path: "Sources/ObjC", cSettings: [ .headerSearchPath("include"), + .define("SWIFT_PACKAGE") ]), .testTarget( name: "RSParserTests", From c88732ac50f58f9d74190886b3fd02f501ff9db9 Mon Sep 17 00:00:00 2001 From: Stuart Breckenridge Date: Wed, 29 Jul 2020 22:25:34 +0800 Subject: [PATCH 09/19] changed RSParser.h --- Sources/ObjC/include/RSParser.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Sources/ObjC/include/RSParser.h b/Sources/ObjC/include/RSParser.h index db9aada..3a3980b 100644 --- a/Sources/ObjC/include/RSParser.h +++ b/Sources/ObjC/include/RSParser.h @@ -8,7 +8,7 @@ @import Foundation; -#if SWIFT_PACKAGE + #import "ParserData.h" #import "RSDateParser.h" @@ -48,9 +48,11 @@ #import "NSData+RSParser.h" #import "NSString+RSParser.h" -#else + // To parse RSS, Atom, JSON Feed, and RSS-in-JSON the easy way, see FeedParser.swift. +/* + #import // Dates @@ -93,7 +95,7 @@ #import #import -#endif +*/ From e3098512e1dad6a0ce361cee035b2b040c2b8663 Mon Sep 17 00:00:00 2001 From: Stuart Breckenridge Date: Wed, 29 Jul 2020 22:31:53 +0800 Subject: [PATCH 10/19] Changed import --- Sources/ObjC/include/RSOPMLDocument.h | 4 ---- 1 file changed, 4 deletions(-) diff --git a/Sources/ObjC/include/RSOPMLDocument.h b/Sources/ObjC/include/RSOPMLDocument.h index 187f555..5061853 100755 --- a/Sources/ObjC/include/RSOPMLDocument.h +++ b/Sources/ObjC/include/RSOPMLDocument.h @@ -8,11 +8,7 @@ @import Foundation; -#if SWIFT_PACKAGE #import "RSOPMLItem.h" -#else -#import -#endif From 2ca48cca7994555544ad32d4bb047551aef2273d Mon Sep 17 00:00:00 2001 From: Stuart Breckenridge Date: Wed, 29 Jul 2020 22:36:56 +0800 Subject: [PATCH 11/19] Adds dynamic --- Package.swift | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Package.swift b/Package.swift index 199609b..9d3f650 100644 --- a/Package.swift +++ b/Package.swift @@ -10,9 +10,11 @@ let package = Package( // Products define the executables and libraries a package produces, and make them visible to other packages. .library( name: "RSParser", + type: .dynamic, targets: ["RSParser"]), .library( name: "RSParserObjC", + type: .dynamic, targets: ["RSParserObjC"]), ], dependencies: [ From 42ef7751afe47bbfabf21aee782d1ae8f1068233 Mon Sep 17 00:00:00 2001 From: Stuart Breckenridge Date: Wed, 29 Jul 2020 22:55:09 +0800 Subject: [PATCH 12/19] tidy up --- Sources/FeedServices/README.md | 5 ----- Sources/XML-RPC/README.md | 5 ----- 2 files changed, 10 deletions(-) delete mode 100644 Sources/FeedServices/README.md delete mode 100644 Sources/XML-RPC/README.md diff --git a/Sources/FeedServices/README.md b/Sources/FeedServices/README.md deleted file mode 100644 index ab3ed1b..0000000 --- a/Sources/FeedServices/README.md +++ /dev/null @@ -1,5 +0,0 @@ -# Feed Services - -This folder contains parsers for the APIs for the various online RSS readers. - -Or, it will. diff --git a/Sources/XML-RPC/README.md b/Sources/XML-RPC/README.md deleted file mode 100644 index 13750c8..0000000 --- a/Sources/XML-RPC/README.md +++ /dev/null @@ -1,5 +0,0 @@ -# XML-RPC - -This folder contains code for reading and writing XML-RPC. - -Or, it will. \ No newline at end of file From 9206b8f768aff60b35f6d4de08f1b06a265e44bc Mon Sep 17 00:00:00 2001 From: Stuart Breckenridge Date: Thu, 30 Jul 2020 09:39:26 +0800 Subject: [PATCH 13/19] Reorgs code --- Sources/ObjC/{include => }/FeedParser.h | 0 Sources/ObjC/{include => }/NSData+RSParser.h | 0 Sources/ObjC/{Utilities => }/NSData+RSParser.m | 0 Sources/ObjC/{include => }/NSString+RSParser.h | 0 Sources/ObjC/{Utilities => }/NSString+RSParser.m | 0 Sources/ObjC/{include => }/ParserData.h | 0 Sources/ObjC/{include => }/RSAtomParser.h | 0 Sources/ObjC/{Feeds => }/RSAtomParser.m | 0 Sources/ObjC/{include => }/RSDateParser.h | 0 Sources/ObjC/{Utilities => }/RSDateParser.m | 0 Sources/ObjC/{include => }/RSHTMLLinkParser.h | 0 Sources/ObjC/{HTML => }/RSHTMLLinkParser.m | 0 Sources/ObjC/{include => }/RSHTMLMetadata.h | 0 Sources/ObjC/{HTML => }/RSHTMLMetadata.m | 0 Sources/ObjC/{include => }/RSHTMLMetadataParser.h | 0 Sources/ObjC/{HTML => }/RSHTMLMetadataParser.m | 0 Sources/ObjC/{include => }/RSHTMLTag.h | 0 Sources/ObjC/{HTML => }/RSHTMLTag.m | 0 Sources/ObjC/{include => }/RSOPMLAttributes.h | 0 Sources/ObjC/{OPML => }/RSOPMLAttributes.m | 0 Sources/ObjC/{include => }/RSOPMLDocument.h | 0 Sources/ObjC/{OPML => }/RSOPMLDocument.m | 0 Sources/ObjC/{include => }/RSOPMLError.h | 0 Sources/ObjC/{OPML => }/RSOPMLError.m | 0 Sources/ObjC/{include => }/RSOPMLFeedSpecifier.h | 0 Sources/ObjC/{OPML => }/RSOPMLFeedSpecifier.m | 0 Sources/ObjC/{include => }/RSOPMLItem.h | 0 Sources/ObjC/{OPML => }/RSOPMLItem.m | 0 Sources/ObjC/{include => }/RSOPMLParser.h | 0 Sources/ObjC/{OPML => }/RSOPMLParser.m | 0 Sources/ObjC/{include => }/RSParsedArticle.h | 0 Sources/ObjC/{Feeds => }/RSParsedArticle.m | 0 Sources/ObjC/{include => }/RSParsedAuthor.h | 0 Sources/ObjC/{Feeds => }/RSParsedAuthor.m | 0 Sources/ObjC/{include => }/RSParsedEnclosure.h | 0 Sources/ObjC/{Feeds => }/RSParsedEnclosure.m | 0 Sources/ObjC/{include => }/RSParsedFeed.h | 0 Sources/ObjC/{Feeds => }/RSParsedFeed.m | 0 Sources/ObjC/{include => }/RSParserInternal.h | 0 Sources/ObjC/{Utilities => }/RSParserInternal.m | 0 Sources/ObjC/{include => }/RSRSSParser.h | 0 Sources/ObjC/{Feeds => }/RSRSSParser.m | 0 Sources/ObjC/{include => }/RSSAXHTMLParser.h | 0 Sources/ObjC/{HTML => }/RSSAXHTMLParser.m | 0 Sources/ObjC/{include => }/RSSAXParser.h | 0 Sources/ObjC/{SAX => }/RSSAXParser.m | 0 46 files changed, 0 insertions(+), 0 deletions(-) rename Sources/ObjC/{include => }/FeedParser.h (100%) rename Sources/ObjC/{include => }/NSData+RSParser.h (100%) rename Sources/ObjC/{Utilities => }/NSData+RSParser.m (100%) rename Sources/ObjC/{include => }/NSString+RSParser.h (100%) rename Sources/ObjC/{Utilities => }/NSString+RSParser.m (100%) rename Sources/ObjC/{include => }/ParserData.h (100%) rename Sources/ObjC/{include => }/RSAtomParser.h (100%) rename Sources/ObjC/{Feeds => }/RSAtomParser.m (100%) rename Sources/ObjC/{include => }/RSDateParser.h (100%) rename Sources/ObjC/{Utilities => }/RSDateParser.m (100%) rename Sources/ObjC/{include => }/RSHTMLLinkParser.h (100%) rename Sources/ObjC/{HTML => }/RSHTMLLinkParser.m (100%) rename Sources/ObjC/{include => }/RSHTMLMetadata.h (100%) rename Sources/ObjC/{HTML => }/RSHTMLMetadata.m (100%) rename Sources/ObjC/{include => }/RSHTMLMetadataParser.h (100%) rename Sources/ObjC/{HTML => }/RSHTMLMetadataParser.m (100%) rename Sources/ObjC/{include => }/RSHTMLTag.h (100%) rename Sources/ObjC/{HTML => }/RSHTMLTag.m (100%) rename Sources/ObjC/{include => }/RSOPMLAttributes.h (100%) rename Sources/ObjC/{OPML => }/RSOPMLAttributes.m (100%) rename Sources/ObjC/{include => }/RSOPMLDocument.h (100%) rename Sources/ObjC/{OPML => }/RSOPMLDocument.m (100%) rename Sources/ObjC/{include => }/RSOPMLError.h (100%) rename Sources/ObjC/{OPML => }/RSOPMLError.m (100%) rename Sources/ObjC/{include => }/RSOPMLFeedSpecifier.h (100%) rename Sources/ObjC/{OPML => }/RSOPMLFeedSpecifier.m (100%) rename Sources/ObjC/{include => }/RSOPMLItem.h (100%) rename Sources/ObjC/{OPML => }/RSOPMLItem.m (100%) rename Sources/ObjC/{include => }/RSOPMLParser.h (100%) rename Sources/ObjC/{OPML => }/RSOPMLParser.m (100%) rename Sources/ObjC/{include => }/RSParsedArticle.h (100%) rename Sources/ObjC/{Feeds => }/RSParsedArticle.m (100%) rename Sources/ObjC/{include => }/RSParsedAuthor.h (100%) rename Sources/ObjC/{Feeds => }/RSParsedAuthor.m (100%) rename Sources/ObjC/{include => }/RSParsedEnclosure.h (100%) rename Sources/ObjC/{Feeds => }/RSParsedEnclosure.m (100%) rename Sources/ObjC/{include => }/RSParsedFeed.h (100%) rename Sources/ObjC/{Feeds => }/RSParsedFeed.m (100%) rename Sources/ObjC/{include => }/RSParserInternal.h (100%) rename Sources/ObjC/{Utilities => }/RSParserInternal.m (100%) rename Sources/ObjC/{include => }/RSRSSParser.h (100%) rename Sources/ObjC/{Feeds => }/RSRSSParser.m (100%) rename Sources/ObjC/{include => }/RSSAXHTMLParser.h (100%) rename Sources/ObjC/{HTML => }/RSSAXHTMLParser.m (100%) rename Sources/ObjC/{include => }/RSSAXParser.h (100%) rename Sources/ObjC/{SAX => }/RSSAXParser.m (100%) diff --git a/Sources/ObjC/include/FeedParser.h b/Sources/ObjC/FeedParser.h similarity index 100% rename from Sources/ObjC/include/FeedParser.h rename to Sources/ObjC/FeedParser.h diff --git a/Sources/ObjC/include/NSData+RSParser.h b/Sources/ObjC/NSData+RSParser.h similarity index 100% rename from Sources/ObjC/include/NSData+RSParser.h rename to Sources/ObjC/NSData+RSParser.h diff --git a/Sources/ObjC/Utilities/NSData+RSParser.m b/Sources/ObjC/NSData+RSParser.m similarity index 100% rename from Sources/ObjC/Utilities/NSData+RSParser.m rename to Sources/ObjC/NSData+RSParser.m diff --git a/Sources/ObjC/include/NSString+RSParser.h b/Sources/ObjC/NSString+RSParser.h similarity index 100% rename from Sources/ObjC/include/NSString+RSParser.h rename to Sources/ObjC/NSString+RSParser.h diff --git a/Sources/ObjC/Utilities/NSString+RSParser.m b/Sources/ObjC/NSString+RSParser.m similarity index 100% rename from Sources/ObjC/Utilities/NSString+RSParser.m rename to Sources/ObjC/NSString+RSParser.m diff --git a/Sources/ObjC/include/ParserData.h b/Sources/ObjC/ParserData.h similarity index 100% rename from Sources/ObjC/include/ParserData.h rename to Sources/ObjC/ParserData.h diff --git a/Sources/ObjC/include/RSAtomParser.h b/Sources/ObjC/RSAtomParser.h similarity index 100% rename from Sources/ObjC/include/RSAtomParser.h rename to Sources/ObjC/RSAtomParser.h diff --git a/Sources/ObjC/Feeds/RSAtomParser.m b/Sources/ObjC/RSAtomParser.m similarity index 100% rename from Sources/ObjC/Feeds/RSAtomParser.m rename to Sources/ObjC/RSAtomParser.m diff --git a/Sources/ObjC/include/RSDateParser.h b/Sources/ObjC/RSDateParser.h similarity index 100% rename from Sources/ObjC/include/RSDateParser.h rename to Sources/ObjC/RSDateParser.h diff --git a/Sources/ObjC/Utilities/RSDateParser.m b/Sources/ObjC/RSDateParser.m similarity index 100% rename from Sources/ObjC/Utilities/RSDateParser.m rename to Sources/ObjC/RSDateParser.m diff --git a/Sources/ObjC/include/RSHTMLLinkParser.h b/Sources/ObjC/RSHTMLLinkParser.h similarity index 100% rename from Sources/ObjC/include/RSHTMLLinkParser.h rename to Sources/ObjC/RSHTMLLinkParser.h diff --git a/Sources/ObjC/HTML/RSHTMLLinkParser.m b/Sources/ObjC/RSHTMLLinkParser.m similarity index 100% rename from Sources/ObjC/HTML/RSHTMLLinkParser.m rename to Sources/ObjC/RSHTMLLinkParser.m diff --git a/Sources/ObjC/include/RSHTMLMetadata.h b/Sources/ObjC/RSHTMLMetadata.h similarity index 100% rename from Sources/ObjC/include/RSHTMLMetadata.h rename to Sources/ObjC/RSHTMLMetadata.h diff --git a/Sources/ObjC/HTML/RSHTMLMetadata.m b/Sources/ObjC/RSHTMLMetadata.m similarity index 100% rename from Sources/ObjC/HTML/RSHTMLMetadata.m rename to Sources/ObjC/RSHTMLMetadata.m diff --git a/Sources/ObjC/include/RSHTMLMetadataParser.h b/Sources/ObjC/RSHTMLMetadataParser.h similarity index 100% rename from Sources/ObjC/include/RSHTMLMetadataParser.h rename to Sources/ObjC/RSHTMLMetadataParser.h diff --git a/Sources/ObjC/HTML/RSHTMLMetadataParser.m b/Sources/ObjC/RSHTMLMetadataParser.m similarity index 100% rename from Sources/ObjC/HTML/RSHTMLMetadataParser.m rename to Sources/ObjC/RSHTMLMetadataParser.m diff --git a/Sources/ObjC/include/RSHTMLTag.h b/Sources/ObjC/RSHTMLTag.h similarity index 100% rename from Sources/ObjC/include/RSHTMLTag.h rename to Sources/ObjC/RSHTMLTag.h diff --git a/Sources/ObjC/HTML/RSHTMLTag.m b/Sources/ObjC/RSHTMLTag.m similarity index 100% rename from Sources/ObjC/HTML/RSHTMLTag.m rename to Sources/ObjC/RSHTMLTag.m diff --git a/Sources/ObjC/include/RSOPMLAttributes.h b/Sources/ObjC/RSOPMLAttributes.h similarity index 100% rename from Sources/ObjC/include/RSOPMLAttributes.h rename to Sources/ObjC/RSOPMLAttributes.h diff --git a/Sources/ObjC/OPML/RSOPMLAttributes.m b/Sources/ObjC/RSOPMLAttributes.m similarity index 100% rename from Sources/ObjC/OPML/RSOPMLAttributes.m rename to Sources/ObjC/RSOPMLAttributes.m diff --git a/Sources/ObjC/include/RSOPMLDocument.h b/Sources/ObjC/RSOPMLDocument.h similarity index 100% rename from Sources/ObjC/include/RSOPMLDocument.h rename to Sources/ObjC/RSOPMLDocument.h diff --git a/Sources/ObjC/OPML/RSOPMLDocument.m b/Sources/ObjC/RSOPMLDocument.m similarity index 100% rename from Sources/ObjC/OPML/RSOPMLDocument.m rename to Sources/ObjC/RSOPMLDocument.m diff --git a/Sources/ObjC/include/RSOPMLError.h b/Sources/ObjC/RSOPMLError.h similarity index 100% rename from Sources/ObjC/include/RSOPMLError.h rename to Sources/ObjC/RSOPMLError.h diff --git a/Sources/ObjC/OPML/RSOPMLError.m b/Sources/ObjC/RSOPMLError.m similarity index 100% rename from Sources/ObjC/OPML/RSOPMLError.m rename to Sources/ObjC/RSOPMLError.m diff --git a/Sources/ObjC/include/RSOPMLFeedSpecifier.h b/Sources/ObjC/RSOPMLFeedSpecifier.h similarity index 100% rename from Sources/ObjC/include/RSOPMLFeedSpecifier.h rename to Sources/ObjC/RSOPMLFeedSpecifier.h diff --git a/Sources/ObjC/OPML/RSOPMLFeedSpecifier.m b/Sources/ObjC/RSOPMLFeedSpecifier.m similarity index 100% rename from Sources/ObjC/OPML/RSOPMLFeedSpecifier.m rename to Sources/ObjC/RSOPMLFeedSpecifier.m diff --git a/Sources/ObjC/include/RSOPMLItem.h b/Sources/ObjC/RSOPMLItem.h similarity index 100% rename from Sources/ObjC/include/RSOPMLItem.h rename to Sources/ObjC/RSOPMLItem.h diff --git a/Sources/ObjC/OPML/RSOPMLItem.m b/Sources/ObjC/RSOPMLItem.m similarity index 100% rename from Sources/ObjC/OPML/RSOPMLItem.m rename to Sources/ObjC/RSOPMLItem.m diff --git a/Sources/ObjC/include/RSOPMLParser.h b/Sources/ObjC/RSOPMLParser.h similarity index 100% rename from Sources/ObjC/include/RSOPMLParser.h rename to Sources/ObjC/RSOPMLParser.h diff --git a/Sources/ObjC/OPML/RSOPMLParser.m b/Sources/ObjC/RSOPMLParser.m similarity index 100% rename from Sources/ObjC/OPML/RSOPMLParser.m rename to Sources/ObjC/RSOPMLParser.m diff --git a/Sources/ObjC/include/RSParsedArticle.h b/Sources/ObjC/RSParsedArticle.h similarity index 100% rename from Sources/ObjC/include/RSParsedArticle.h rename to Sources/ObjC/RSParsedArticle.h diff --git a/Sources/ObjC/Feeds/RSParsedArticle.m b/Sources/ObjC/RSParsedArticle.m similarity index 100% rename from Sources/ObjC/Feeds/RSParsedArticle.m rename to Sources/ObjC/RSParsedArticle.m diff --git a/Sources/ObjC/include/RSParsedAuthor.h b/Sources/ObjC/RSParsedAuthor.h similarity index 100% rename from Sources/ObjC/include/RSParsedAuthor.h rename to Sources/ObjC/RSParsedAuthor.h diff --git a/Sources/ObjC/Feeds/RSParsedAuthor.m b/Sources/ObjC/RSParsedAuthor.m similarity index 100% rename from Sources/ObjC/Feeds/RSParsedAuthor.m rename to Sources/ObjC/RSParsedAuthor.m diff --git a/Sources/ObjC/include/RSParsedEnclosure.h b/Sources/ObjC/RSParsedEnclosure.h similarity index 100% rename from Sources/ObjC/include/RSParsedEnclosure.h rename to Sources/ObjC/RSParsedEnclosure.h diff --git a/Sources/ObjC/Feeds/RSParsedEnclosure.m b/Sources/ObjC/RSParsedEnclosure.m similarity index 100% rename from Sources/ObjC/Feeds/RSParsedEnclosure.m rename to Sources/ObjC/RSParsedEnclosure.m diff --git a/Sources/ObjC/include/RSParsedFeed.h b/Sources/ObjC/RSParsedFeed.h similarity index 100% rename from Sources/ObjC/include/RSParsedFeed.h rename to Sources/ObjC/RSParsedFeed.h diff --git a/Sources/ObjC/Feeds/RSParsedFeed.m b/Sources/ObjC/RSParsedFeed.m similarity index 100% rename from Sources/ObjC/Feeds/RSParsedFeed.m rename to Sources/ObjC/RSParsedFeed.m diff --git a/Sources/ObjC/include/RSParserInternal.h b/Sources/ObjC/RSParserInternal.h similarity index 100% rename from Sources/ObjC/include/RSParserInternal.h rename to Sources/ObjC/RSParserInternal.h diff --git a/Sources/ObjC/Utilities/RSParserInternal.m b/Sources/ObjC/RSParserInternal.m similarity index 100% rename from Sources/ObjC/Utilities/RSParserInternal.m rename to Sources/ObjC/RSParserInternal.m diff --git a/Sources/ObjC/include/RSRSSParser.h b/Sources/ObjC/RSRSSParser.h similarity index 100% rename from Sources/ObjC/include/RSRSSParser.h rename to Sources/ObjC/RSRSSParser.h diff --git a/Sources/ObjC/Feeds/RSRSSParser.m b/Sources/ObjC/RSRSSParser.m similarity index 100% rename from Sources/ObjC/Feeds/RSRSSParser.m rename to Sources/ObjC/RSRSSParser.m diff --git a/Sources/ObjC/include/RSSAXHTMLParser.h b/Sources/ObjC/RSSAXHTMLParser.h similarity index 100% rename from Sources/ObjC/include/RSSAXHTMLParser.h rename to Sources/ObjC/RSSAXHTMLParser.h diff --git a/Sources/ObjC/HTML/RSSAXHTMLParser.m b/Sources/ObjC/RSSAXHTMLParser.m similarity index 100% rename from Sources/ObjC/HTML/RSSAXHTMLParser.m rename to Sources/ObjC/RSSAXHTMLParser.m diff --git a/Sources/ObjC/include/RSSAXParser.h b/Sources/ObjC/RSSAXParser.h similarity index 100% rename from Sources/ObjC/include/RSSAXParser.h rename to Sources/ObjC/RSSAXParser.h diff --git a/Sources/ObjC/SAX/RSSAXParser.m b/Sources/ObjC/RSSAXParser.m similarity index 100% rename from Sources/ObjC/SAX/RSSAXParser.m rename to Sources/ObjC/RSSAXParser.m From 860911a91224b3dacee57dd7e74bf5cbb1e7079c Mon Sep 17 00:00:00 2001 From: Stuart Breckenridge Date: Thu, 30 Jul 2020 09:39:47 +0800 Subject: [PATCH 14/19] Removes #if --- Sources/ObjC/include/RSParser.h | 90 +++++++--------------------- Sources/Swift/Feeds/FeedParser.swift | 2 - 2 files changed, 22 insertions(+), 70 deletions(-) diff --git a/Sources/ObjC/include/RSParser.h b/Sources/ObjC/include/RSParser.h index 3a3980b..c9bd000 100644 --- a/Sources/ObjC/include/RSParser.h +++ b/Sources/ObjC/include/RSParser.h @@ -9,93 +9,47 @@ @import Foundation; -#import "ParserData.h" -#import "RSDateParser.h" +#import "../ParserData.h" +#import "../RSDateParser.h" // OPML -#import "RSOPMLParser.h" -#import "RSOPMLDocument.h" -#import "RSOPMLItem.h" -#import "RSOPMLAttributes.h" -#import "RSOPMLFeedSpecifier.h" -#import "RSOPMLError.h" +#import "../RSOPMLParser.h" +#import "../RSOPMLDocument.h" +#import "../RSOPMLItem.h" +#import "../RSOPMLAttributes.h" +#import "../RSOPMLFeedSpecifier.h" +#import "../RSOPMLError.h" // For writing your own XML parser. -#import "RSSAXParser.h" +#import "../RSSAXParser.h" // You should use FeedParser (Swift) instead of these two specific parsers // and the objects they create. // But they’re available if you want them. -#import "RSRSSParser.h" -#import "RSAtomParser.h" -#import "RSParsedFeed.h" -#import "RSParsedArticle.h" -#import "RSParsedEnclosure.h" -#import "RSParsedAuthor.h" +#import "../RSRSSParser.h" +#import "../RSAtomParser.h" +#import "../RSParsedFeed.h" +#import "../RSParsedArticle.h" +#import "../RSParsedEnclosure.h" +#import "../RSParsedAuthor.h" // HTML -#import "RSHTMLMetadataParser.h" -#import "RSHTMLMetadata.h" -#import "RSHTMLLinkParser.h" -#import "RSSAXHTMLParser.h" // For writing your own HTML parser. -#import "RSHTMLTag.h" +#import "../RSHTMLMetadataParser.h" +#import "../RSHTMLMetadata.h" +#import "../RSHTMLLinkParser.h" +#import "../RSSAXHTMLParser.h" // For writing your own HTML parser. +#import "../RSHTMLTag.h" // Utilities -#import "NSData+RSParser.h" -#import "NSString+RSParser.h" +#import "../NSData+RSParser.h" +#import "../NSString+RSParser.h" -// To parse RSS, Atom, JSON Feed, and RSS-in-JSON the easy way, see FeedParser.swift. -/* - -#import - -// Dates - -#import - -// OPML - -#import -#import -#import -#import -#import -#import - -// For writing your own XML parser. - -#import - -// You should use FeedParser (Swift) instead of these two specific parsers -// and the objects they create. -// But they’re available if you want them. - -#import -#import -#import -#import -#import -#import - -// HTML - -#import -#import -#import -#import // For writing your own HTML parser. -#import - -// Utilities - -#import -#import -*/ diff --git a/Sources/Swift/Feeds/FeedParser.swift b/Sources/Swift/Feeds/FeedParser.swift index 590eaab..41d6284 100644 --- a/Sources/Swift/Feeds/FeedParser.swift +++ b/Sources/Swift/Feeds/FeedParser.swift @@ -7,9 +7,7 @@ // import Foundation -#if SWIFT_PACKAGE import RSParserObjC -#endif // FeedParser handles RSS, Atom, JSON Feed, and RSS-in-JSON. // You don’t need to know the type of feed. From 64e101fd0eece7366bdb0dedcfbd62d41ae269ba Mon Sep 17 00:00:00 2001 From: Stuart Breckenridge Date: Thu, 30 Jul 2020 09:52:21 +0800 Subject: [PATCH 15/19] Removes workflows --- .github/workflows/build.yml | 35 ----------------------------------- 1 file changed, 35 deletions(-) delete mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml deleted file mode 100644 index 8655b56..0000000 --- a/.github/workflows/build.yml +++ /dev/null @@ -1,35 +0,0 @@ -name: CI - -on: [push, pull_request] - -jobs: - build: - - runs-on: macOS-latest - strategy: - matrix: - destination: ['platform=macOS', 'platform=iOS Simulator,OS=13.0,name=iPhone 11'] - - steps: - - name: Checkout Project - uses: actions/checkout@v1 - - - name: Switch to Xcode 11 - run: sudo xcode-select -s /Applications/Xcode_11.app - - - name: Show Build Version - run: xcodebuild -version - - - name: Show Build Settings - run: xcodebuild -showBuildSettings - - - name: Show Build SDK - run: xcodebuild -showsdks - - - name: Show Available Destinations - run: xcodebuild -scheme RSParser -showdestinations - - - name: Run Build - env: - destination: ${{ matrix.destination }} - run: xcodebuild -scheme RSParser test -destination "${destination}" -showBuildTimingSummary CODE_SIGN_IDENTITY= From 3ebcfe4218aca279a583b1eb9f0f5251832919ba Mon Sep 17 00:00:00 2001 From: Stuart Breckenridge Date: Thu, 30 Jul 2020 10:18:12 +0800 Subject: [PATCH 16/19] Tidied up import statements --- Sources/ObjC/NSData+RSParser.m | 4 -- Sources/ObjC/NSString+RSParser.m | 5 -- Sources/ObjC/RSAtomParser.m | 12 ---- Sources/ObjC/RSDateParser.m | 5 -- Sources/ObjC/RSHTMLLinkParser.m | 8 --- Sources/ObjC/RSHTMLMetadata.m | 6 -- Sources/ObjC/RSHTMLMetadataParser.m | 10 --- Sources/ObjC/RSOPMLAttributes.m | 5 -- Sources/ObjC/RSOPMLDocument.m | 5 -- Sources/ObjC/RSOPMLError.m | 4 -- Sources/ObjC/RSOPMLFeedSpecifier.m | 5 -- Sources/ObjC/RSOPMLItem.m | 7 -- Sources/ObjC/RSOPMLParser.m | 10 --- Sources/ObjC/RSParsedArticle.m | 8 --- Sources/ObjC/RSParsedAuthor.m | 4 -- Sources/ObjC/RSParsedFeed.m | 4 -- Sources/ObjC/RSParserInternal.m | 5 -- Sources/ObjC/RSRSSParser.m | 13 ---- Sources/ObjC/RSSAXHTMLParser.m | 6 -- Sources/ObjC/RSSAXParser.m | 6 -- Sources/Swift/Exports.swift | 9 --- buildscripts/VerifyNoBuildSettings.swift | 84 ------------------------ 22 files changed, 225 deletions(-) delete mode 100644 Sources/Swift/Exports.swift delete mode 100755 buildscripts/VerifyNoBuildSettings.swift diff --git a/Sources/ObjC/NSData+RSParser.m b/Sources/ObjC/NSData+RSParser.m index 87e7c37..d2f7c16 100644 --- a/Sources/ObjC/NSData+RSParser.m +++ b/Sources/ObjC/NSData+RSParser.m @@ -6,11 +6,7 @@ // Copyright © 2017 Ranchero Software, LLC. All rights reserved. // -#if SWIFT_PACKAGE #import "NSData+RSParser.h" -#else -#import -#endif diff --git a/Sources/ObjC/NSString+RSParser.m b/Sources/ObjC/NSString+RSParser.m index c652e29..8d51ffa 100755 --- a/Sources/ObjC/NSString+RSParser.m +++ b/Sources/ObjC/NSString+RSParser.m @@ -6,13 +6,8 @@ // Copyright © 2015 Ranchero Software, LLC. All rights reserved. // -#if SWIFT_PACKAGE #import "NSString+RSParser.h" #import -#else -#import -#import -#endif diff --git a/Sources/ObjC/RSAtomParser.m b/Sources/ObjC/RSAtomParser.m index 79da1e8..04b1b6c 100755 --- a/Sources/ObjC/RSAtomParser.m +++ b/Sources/ObjC/RSAtomParser.m @@ -7,7 +7,6 @@ // -#if SWIFT_PACKAGE #import "RSAtomParser.h" #import "RSSAXParser.h" #import "RSParsedFeed.h" @@ -17,17 +16,6 @@ #import "ParserData.h" #import "RSParsedEnclosure.h" #import "RSParsedAuthor.h" -#else -#import -#import -#import -#import -#import -#import -#import -#import -#import -#endif #import diff --git a/Sources/ObjC/RSDateParser.m b/Sources/ObjC/RSDateParser.m index 8ecaa45..cb9c572 100755 --- a/Sources/ObjC/RSDateParser.m +++ b/Sources/ObjC/RSDateParser.m @@ -7,13 +7,8 @@ // -#if SWIFT_PACKAGE #import "RSDateParser.h" #import -#else -#import -#import -#endif typedef struct { diff --git a/Sources/ObjC/RSHTMLLinkParser.m b/Sources/ObjC/RSHTMLLinkParser.m index 59a8465..624e335 100755 --- a/Sources/ObjC/RSHTMLLinkParser.m +++ b/Sources/ObjC/RSHTMLLinkParser.m @@ -7,19 +7,11 @@ // -#if SWIFT_PACKAGE #import "RSHTMLLinkParser.h" #import "RSSAXHTMLParser.h" #import "RSSAXParser.h" #import "RSParserInternal.h" #import "ParserData.h" -#else -#import -#import -#import -#import -#import -#endif #import diff --git a/Sources/ObjC/RSHTMLMetadata.m b/Sources/ObjC/RSHTMLMetadata.m index 4ef67e0..2def0b0 100755 --- a/Sources/ObjC/RSHTMLMetadata.m +++ b/Sources/ObjC/RSHTMLMetadata.m @@ -6,15 +6,9 @@ // Copyright © 2016 Ranchero Software, LLC. All rights reserved. // -#if SWIFT_PACKAGE #import "RSHTMLMetadata.h" #import "RSParserInternal.h" #import "RSHTMLTag.h" -#else -#import -#import -#import -#endif diff --git a/Sources/ObjC/RSHTMLMetadataParser.m b/Sources/ObjC/RSHTMLMetadataParser.m index 13f4575..7423afb 100755 --- a/Sources/ObjC/RSHTMLMetadataParser.m +++ b/Sources/ObjC/RSHTMLMetadataParser.m @@ -6,7 +6,6 @@ // Copyright © 2016 Ranchero Software, LLC. All rights reserved. // -#if SWIFT_PACKAGE #import "RSHTMLMetadataParser.h" #import "RSHTMLMetadata.h" #import "RSSAXHTMLParser.h" @@ -15,15 +14,6 @@ #import "RSParserInternal.h" #import "ParserData.h" #import "RSHTMLTag.h" -#else -#import -#import -#import -#import -#import -#import -#import -#endif #import diff --git a/Sources/ObjC/RSOPMLAttributes.m b/Sources/ObjC/RSOPMLAttributes.m index bd515fd..db6508b 100755 --- a/Sources/ObjC/RSOPMLAttributes.m +++ b/Sources/ObjC/RSOPMLAttributes.m @@ -6,13 +6,8 @@ // Copyright © 2016 Ranchero Software, LLC. All rights reserved. // -#if SWIFT_PACKAGE #import "RSOPMLAttributes.h" #import "RSParserInternal.h" -#else -#import -#import -#endif diff --git a/Sources/ObjC/RSOPMLDocument.m b/Sources/ObjC/RSOPMLDocument.m index 4cc4979..1506bd9 100755 --- a/Sources/ObjC/RSOPMLDocument.m +++ b/Sources/ObjC/RSOPMLDocument.m @@ -7,12 +7,7 @@ // -#if SWIFT_PACKAGE #import "RSOPMLDocument.h" -#else -#import -#endif - @implementation RSOPMLDocument diff --git a/Sources/ObjC/RSOPMLError.m b/Sources/ObjC/RSOPMLError.m index bedd45b..7aa3c5e 100755 --- a/Sources/ObjC/RSOPMLError.m +++ b/Sources/ObjC/RSOPMLError.m @@ -6,11 +6,7 @@ // Copyright © 2016 Ranchero Software, LLC. All rights reserved. // -#if SWIFT_PACKAGE #import "RSOPMLError.h" -#else -#import -#endif NSString *RSOPMLErrorDomain = @"com.ranchero.OPML"; diff --git a/Sources/ObjC/RSOPMLFeedSpecifier.m b/Sources/ObjC/RSOPMLFeedSpecifier.m index 74ad66b..bb32ccf 100755 --- a/Sources/ObjC/RSOPMLFeedSpecifier.m +++ b/Sources/ObjC/RSOPMLFeedSpecifier.m @@ -6,13 +6,8 @@ // Copyright © 2016 Ranchero Software, LLC. All rights reserved. // -#if SWIFT_PACKAGE #import "RSOPMLFeedSpecifier.h" #import "RSParserInternal.h" -#else -#import -#import -#endif diff --git a/Sources/ObjC/RSOPMLItem.m b/Sources/ObjC/RSOPMLItem.m index b812886..a273cd3 100755 --- a/Sources/ObjC/RSOPMLItem.m +++ b/Sources/ObjC/RSOPMLItem.m @@ -6,17 +6,10 @@ // Copyright © 2016 Ranchero Software, LLC. All rights reserved. // -#if SWIFT_PACKAGE #import "RSOPMLItem.h" #import "RSOPMLAttributes.h" #import "RSOPMLFeedSpecifier.h" #import "RSParserInternal.h" -#else -#import -#import -#import -#import -#endif diff --git a/Sources/ObjC/RSOPMLParser.m b/Sources/ObjC/RSOPMLParser.m index be9b376..93f2c42 100755 --- a/Sources/ObjC/RSOPMLParser.m +++ b/Sources/ObjC/RSOPMLParser.m @@ -6,7 +6,6 @@ // Copyright © 2015 Ranchero Software, LLC. All rights reserved. // -#if SWIFT_PACKAGE #import "RSOPMLParser.h" #import "RSSAXParser.h" #import "RSOPMLItem.h" @@ -15,15 +14,6 @@ #import "RSOPMLError.h" #import "RSOPMLParser.h" #import "ParserData.h" -#else -#import -#import -#import -#import -#import -#import -#import -#endif #import diff --git a/Sources/ObjC/RSParsedArticle.m b/Sources/ObjC/RSParsedArticle.m index ed2cdad..b94930a 100755 --- a/Sources/ObjC/RSParsedArticle.m +++ b/Sources/ObjC/RSParsedArticle.m @@ -7,19 +7,11 @@ // -#if SWIFT_PACKAGE #import "RSParsedArticle.h" #import "RSParserInternal.h" #import "NSString+RSParser.h" #import "RSParsedAuthor.h" #import "RSParsedEnclosure.h" -#else -#import -#import -#import -#import -#import -#endif diff --git a/Sources/ObjC/RSParsedAuthor.m b/Sources/ObjC/RSParsedAuthor.m index 56aa503..154b546 100644 --- a/Sources/ObjC/RSParsedAuthor.m +++ b/Sources/ObjC/RSParsedAuthor.m @@ -6,11 +6,7 @@ // Copyright © 2017 Ranchero Software, LLC. All rights reserved. // -#if SWIFT_PACKAGE #import "NSString+RSParser.h" -#else -#import -#endif #import "RSParsedAuthor.h" diff --git a/Sources/ObjC/RSParsedFeed.m b/Sources/ObjC/RSParsedFeed.m index 3fc61f6..ef0c42e 100755 --- a/Sources/ObjC/RSParsedFeed.m +++ b/Sources/ObjC/RSParsedFeed.m @@ -6,11 +6,7 @@ // Copyright © 2015 Ranchero Software, LLC. All rights reserved. // -#if SWIFT_PACKAGE #import "RSParsedFeed.h" -#else -#import -#endif diff --git a/Sources/ObjC/RSParserInternal.m b/Sources/ObjC/RSParserInternal.m index d63f54a..4ba6f8a 100755 --- a/Sources/ObjC/RSParserInternal.m +++ b/Sources/ObjC/RSParserInternal.m @@ -7,13 +7,8 @@ // -#if SWIFT_PACKAGE #import "RSParserInternal.h" #import -#else -#import -#import -#endif static BOOL RSParserIsNil(id obj) { diff --git a/Sources/ObjC/RSRSSParser.m b/Sources/ObjC/RSRSSParser.m index dcffe5b..aca7c93 100755 --- a/Sources/ObjC/RSRSSParser.m +++ b/Sources/ObjC/RSRSSParser.m @@ -6,7 +6,6 @@ // Copyright (c) 2015 Ranchero Software LLC. All rights reserved. // -#if SWIFT_PACKAGE #import "RSRSSParser.h" #import "RSSAXParser.h" #import "RSParsedFeed.h" @@ -17,18 +16,6 @@ #import "ParserData.h" #import "RSParsedEnclosure.h" #import "RSParsedAuthor.h" -#else -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#endif diff --git a/Sources/ObjC/RSSAXHTMLParser.m b/Sources/ObjC/RSSAXHTMLParser.m index 47d1e82..5df2d84 100755 --- a/Sources/ObjC/RSSAXHTMLParser.m +++ b/Sources/ObjC/RSSAXHTMLParser.m @@ -6,15 +6,9 @@ // Copyright © 2016 Ranchero Software, LLC. All rights reserved. // -#if SWIFT_PACKAGE #import "RSSAXHTMLParser.h" #import "RSSAXParser.h" #import "RSParserInternal.h" -#else -#import -#import -#import -#endif #import #import diff --git a/Sources/ObjC/RSSAXParser.m b/Sources/ObjC/RSSAXParser.m index 9b7c4ca..02d6988 100755 --- a/Sources/ObjC/RSSAXParser.m +++ b/Sources/ObjC/RSSAXParser.m @@ -6,14 +6,8 @@ // Copyright (c) 2015 Ranchero Software, LLC. All rights reserved. // -#if SWIFT_PACKAGE #import "RSSAXParser.h" #import "RSParserInternal.h" -#else -#import -#import -#endif - #import #import diff --git a/Sources/Swift/Exports.swift b/Sources/Swift/Exports.swift deleted file mode 100644 index 135f54b..0000000 --- a/Sources/Swift/Exports.swift +++ /dev/null @@ -1,9 +0,0 @@ -// -// Exports.swift -// -// -// Created by Stuart Breckenridge on 29/7/20. -// - -import Foundation -@_exported import RSParserObjC diff --git a/buildscripts/VerifyNoBuildSettings.swift b/buildscripts/VerifyNoBuildSettings.swift deleted file mode 100755 index 82e839b..0000000 --- a/buildscripts/VerifyNoBuildSettings.swift +++ /dev/null @@ -1,84 +0,0 @@ -#!/usr/bin/swift - -// This script is originally from github.com/olofhellman/VerifyNoBS -// The idea is that all build settings should be kept in .xcconfig files, -// rather than in the xcode pbxproj file inside an Xcode project bundle -// Having the script run as part of a regular build ensures that the project file -// doesn't accidentally accumulate build settings - -import Darwin -import Foundation - -func reportError(message: String) { - print("error message was \(message)") - let stderr = FileHandle.standardError - if let data = message.data(using: String.Encoding.utf8, allowLossyConversion: false) { - stderr.write(data) - } else { - print("there was an error. script \"VerifyNoBuildSettings\" could not convert error message to printable string") - } -} - -public enum ProcessXcodeprojResult { - case FoundBuildSettings([String]) - case Error(String) - case OK(String) -} - -public func processXcodeprojAt(url: URL) -> ProcessXcodeprojResult { - let startTime = Date() - guard let xcodeproj = try? String(contentsOf: url, encoding: String.Encoding.utf8) else { - return .Error("script \"VerifyNoBuildSettings\" failed making xcodeproj from url") - } - let lines = xcodeproj.components(separatedBy: CharacterSet.newlines) - print ("found \(lines.count) lines") - - var badLines: [String] = [] - var inBuildSettingsBlock = false - for nthLine in lines { - if inBuildSettingsBlock { - if let _ = nthLine.range(of:"\\u007d[:space:]*;", options: .regularExpression) { - inBuildSettingsBlock = false - } else if let _ = nthLine.range(of:"CODE_SIGN_IDENTITY") { - - } else if let _ = nthLine.range(of:"PRODUCT_NAME") { - - } else { - badLines.append(nthLine) - } - } else { - if let _ = nthLine.range(of:"buildSettings[:space:]*=", options: .regularExpression) { - inBuildSettingsBlock = true - } - } - } - - let timeInterval = Date().timeIntervalSince(startTime) - print ("process took \(timeInterval) seconds") - if (badLines.count > 0) { - return .FoundBuildSettings(badLines) - } - return .OK(":-)") -} -print("Verifying no buildSettings...") - -let commandLineArgs = CommandLine.arguments -print("processArgs were \(commandLineArgs)") -let xcodeprojfilepath = commandLineArgs[1] -let myUrl = URL(fileURLWithPath:xcodeprojfilepath) -let result = processXcodeprojAt(url: myUrl) - -switch result { - case .Error(let str): - reportError (message: "error script \"VerifyNoBuildSettings\" encountered an error: \(str)") - exit(EXIT_FAILURE) - case .FoundBuildSettings(let badLines): - reportError (message: "script \"VerifyNoBuildSettings\" found build settings in the project file:") - for badLine in badLines { - reportError (message: " \(badLine)\n") - } - exit(EXIT_FAILURE) - case .OK: - print ("script \"VerifyNoBuildSettings\" verified the project contained no buildSettings") - exit(EXIT_SUCCESS) -} From 7be0ed611da357c4a2c554439e54b33d2e662fb4 Mon Sep 17 00:00:00 2001 From: Stuart Breckenridge Date: Thu, 30 Jul 2020 10:41:52 +0800 Subject: [PATCH 17/19] Moves tests to SPM test folder --- Package.swift | 4 +++- .../RSParserTests}/AtomParserTests.swift | 0 .../RSParserTests}/EntityDecodingTests.swift | 0 .../RSParserTests}/FeedParserTypeTests.swift | 1 + .../RSParserTests}/HTMLLinkTests.swift | 1 + .../RSParserTests}/HTMLMetadataTests.swift | 1 + {RSParserTests => Tests/RSParserTests}/Info.plist | 0 .../RSParserTests}/JSONFeedParserTests.swift | 0 .../RSParserTests}/OPMLTests.swift | 1 + .../RSParserTests}/RSDateParserTests.m | 0 Tests/RSParserTests/RSParserTests.swift | 15 --------------- .../RSParserTests}/RSSInJSONParserTests.swift | 0 .../RSParserTests}/RSSParserTests.swift | 0 .../RSParserTests}/Resources/3960.json | 0 .../RSParserTests}/Resources/489.rss | 0 .../RSParserTests}/Resources/4fsodonline.atom | 0 .../RSParserTests}/Resources/DaringFireball.atom | 0 .../RSParserTests}/Resources/DaringFireball.html | 0 .../RSParserTests}/Resources/DaringFireball.json | 0 .../RSParserTests}/Resources/DaringFireball.rss | 0 .../RSParserTests}/Resources/EMarley.rss | 0 .../RSParserTests}/Resources/KatieFloyd.rss | 0 .../RSParserTests}/Resources/OneFootTsunami.atom | 0 .../RSParserTests}/Resources/ScriptingNews.json | 0 .../RSParserTests}/Resources/Subs.opml | 0 .../Resources/SubsNoTitleAttributes.opml | 0 .../RSParserTests}/Resources/allthis-partial.json | 0 .../RSParserTests}/Resources/allthis.atom | 0 .../RSParserTests}/Resources/allthis.json | 0 .../RSParserTests}/Resources/atp.rss | 0 .../RSParserTests}/Resources/bio.rdf | 0 .../RSParserTests}/Resources/cloudblog.rss | 0 .../RSParserTests}/Resources/coco.html | 0 .../RSParserTests}/Resources/curt.json | 0 .../RSParserTests}/Resources/dcrainmaker.xml | 0 .../RSParserTests}/Resources/donthitsave.xml | 0 .../Resources/expertopinionent.atom | 0 .../RSParserTests}/Resources/furbo.html | 0 .../RSParserTests}/Resources/inessential.html | 0 .../RSParserTests}/Resources/inessential.json | 0 .../RSParserTests}/Resources/kc0011.rss | 0 .../RSParserTests}/Resources/livemint.xml | 0 .../RSParserTests}/Resources/macworld.rss | 0 .../RSParserTests}/Resources/manton.rss | 0 .../RSParserTests}/Resources/monkeydom.rss | 0 .../RSParserTests}/Resources/natasha.xml | 0 .../RSParserTests}/Resources/pxlnv.json | 0 .../RSParserTests}/Resources/rose.json | 0 .../RSParserTests}/Resources/russcox.atom | 0 .../RSParserTests}/Resources/scriptingNews.rss | 0 .../RSParserTests}/Resources/sixcolors.html | 0 .../RSParserTests}/Resources/theomnishow.rss | 0 Tests/RSParserTests/XCTestManifests.swift | 9 --------- 53 files changed, 7 insertions(+), 25 deletions(-) rename {RSParserTests => Tests/RSParserTests}/AtomParserTests.swift (100%) rename {RSParserTests => Tests/RSParserTests}/EntityDecodingTests.swift (100%) rename {RSParserTests => Tests/RSParserTests}/FeedParserTypeTests.swift (99%) rename {RSParserTests => Tests/RSParserTests}/HTMLLinkTests.swift (97%) rename {RSParserTests => Tests/RSParserTests}/HTMLMetadataTests.swift (99%) rename {RSParserTests => Tests/RSParserTests}/Info.plist (100%) rename {RSParserTests => Tests/RSParserTests}/JSONFeedParserTests.swift (100%) rename {RSParserTests => Tests/RSParserTests}/OPMLTests.swift (99%) rename {RSParserTests => Tests/RSParserTests}/RSDateParserTests.m (100%) delete mode 100644 Tests/RSParserTests/RSParserTests.swift rename {RSParserTests => Tests/RSParserTests}/RSSInJSONParserTests.swift (100%) rename {RSParserTests => Tests/RSParserTests}/RSSParserTests.swift (100%) rename {RSParserTests => Tests/RSParserTests}/Resources/3960.json (100%) rename {RSParserTests => Tests/RSParserTests}/Resources/489.rss (100%) rename {RSParserTests => Tests/RSParserTests}/Resources/4fsodonline.atom (100%) rename {RSParserTests => Tests/RSParserTests}/Resources/DaringFireball.atom (100%) rename {RSParserTests => Tests/RSParserTests}/Resources/DaringFireball.html (100%) rename {RSParserTests => Tests/RSParserTests}/Resources/DaringFireball.json (100%) rename {RSParserTests => Tests/RSParserTests}/Resources/DaringFireball.rss (100%) rename {RSParserTests => Tests/RSParserTests}/Resources/EMarley.rss (100%) rename {RSParserTests => Tests/RSParserTests}/Resources/KatieFloyd.rss (100%) rename {RSParserTests => Tests/RSParserTests}/Resources/OneFootTsunami.atom (100%) rename {RSParserTests => Tests/RSParserTests}/Resources/ScriptingNews.json (100%) rename {RSParserTests => Tests/RSParserTests}/Resources/Subs.opml (100%) rename {RSParserTests => Tests/RSParserTests}/Resources/SubsNoTitleAttributes.opml (100%) rename {RSParserTests => Tests/RSParserTests}/Resources/allthis-partial.json (100%) rename {RSParserTests => Tests/RSParserTests}/Resources/allthis.atom (100%) rename {RSParserTests => Tests/RSParserTests}/Resources/allthis.json (100%) rename {RSParserTests => Tests/RSParserTests}/Resources/atp.rss (100%) rename {RSParserTests => Tests/RSParserTests}/Resources/bio.rdf (100%) rename {RSParserTests => Tests/RSParserTests}/Resources/cloudblog.rss (100%) rename {RSParserTests => Tests/RSParserTests}/Resources/coco.html (100%) rename {RSParserTests => Tests/RSParserTests}/Resources/curt.json (100%) rename {RSParserTests => Tests/RSParserTests}/Resources/dcrainmaker.xml (100%) rename {RSParserTests => Tests/RSParserTests}/Resources/donthitsave.xml (100%) rename {RSParserTests => Tests/RSParserTests}/Resources/expertopinionent.atom (100%) rename {RSParserTests => Tests/RSParserTests}/Resources/furbo.html (100%) rename {RSParserTests => Tests/RSParserTests}/Resources/inessential.html (100%) rename {RSParserTests => Tests/RSParserTests}/Resources/inessential.json (100%) rename {RSParserTests => Tests/RSParserTests}/Resources/kc0011.rss (100%) rename {RSParserTests => Tests/RSParserTests}/Resources/livemint.xml (100%) rename {RSParserTests => Tests/RSParserTests}/Resources/macworld.rss (100%) rename {RSParserTests => Tests/RSParserTests}/Resources/manton.rss (100%) rename {RSParserTests => Tests/RSParserTests}/Resources/monkeydom.rss (100%) rename {RSParserTests => Tests/RSParserTests}/Resources/natasha.xml (100%) rename {RSParserTests => Tests/RSParserTests}/Resources/pxlnv.json (100%) rename {RSParserTests => Tests/RSParserTests}/Resources/rose.json (100%) rename {RSParserTests => Tests/RSParserTests}/Resources/russcox.atom (100%) rename {RSParserTests => Tests/RSParserTests}/Resources/scriptingNews.rss (100%) rename {RSParserTests => Tests/RSParserTests}/Resources/sixcolors.html (100%) rename {RSParserTests => Tests/RSParserTests}/Resources/theomnishow.rss (100%) delete mode 100644 Tests/RSParserTests/XCTestManifests.swift diff --git a/Package.swift b/Package.swift index 9d3f650..879b920 100644 --- a/Package.swift +++ b/Package.swift @@ -38,6 +38,8 @@ let package = Package( ]), .testTarget( name: "RSParserTests", - dependencies: ["RSParser"]), + dependencies: ["RSParser"], + exclude: ["RSDateParserTests.m", "Info.plist"], + resources: [.copy("Resources")]), ] ) diff --git a/RSParserTests/AtomParserTests.swift b/Tests/RSParserTests/AtomParserTests.swift similarity index 100% rename from RSParserTests/AtomParserTests.swift rename to Tests/RSParserTests/AtomParserTests.swift diff --git a/RSParserTests/EntityDecodingTests.swift b/Tests/RSParserTests/EntityDecodingTests.swift similarity index 100% rename from RSParserTests/EntityDecodingTests.swift rename to Tests/RSParserTests/EntityDecodingTests.swift diff --git a/RSParserTests/FeedParserTypeTests.swift b/Tests/RSParserTests/FeedParserTypeTests.swift similarity index 99% rename from RSParserTests/FeedParserTypeTests.swift rename to Tests/RSParserTests/FeedParserTypeTests.swift index 4f7e033..533d1c5 100644 --- a/RSParserTests/FeedParserTypeTests.swift +++ b/Tests/RSParserTests/FeedParserTypeTests.swift @@ -8,6 +8,7 @@ import XCTest import RSParser +import RSParserObjC class FeedParserTypeTests: XCTestCase { diff --git a/RSParserTests/HTMLLinkTests.swift b/Tests/RSParserTests/HTMLLinkTests.swift similarity index 97% rename from RSParserTests/HTMLLinkTests.swift rename to Tests/RSParserTests/HTMLLinkTests.swift index 7c8d012..5817148 100644 --- a/RSParserTests/HTMLLinkTests.swift +++ b/Tests/RSParserTests/HTMLLinkTests.swift @@ -8,6 +8,7 @@ import XCTest import RSParser +import RSParserObjC class HTMLLinkTests: XCTestCase { diff --git a/RSParserTests/HTMLMetadataTests.swift b/Tests/RSParserTests/HTMLMetadataTests.swift similarity index 99% rename from RSParserTests/HTMLMetadataTests.swift rename to Tests/RSParserTests/HTMLMetadataTests.swift index b407bc3..684700f 100644 --- a/RSParserTests/HTMLMetadataTests.swift +++ b/Tests/RSParserTests/HTMLMetadataTests.swift @@ -8,6 +8,7 @@ import XCTest import RSParser +import RSParserObjC class HTMLMetadataTests: XCTestCase { diff --git a/RSParserTests/Info.plist b/Tests/RSParserTests/Info.plist similarity index 100% rename from RSParserTests/Info.plist rename to Tests/RSParserTests/Info.plist diff --git a/RSParserTests/JSONFeedParserTests.swift b/Tests/RSParserTests/JSONFeedParserTests.swift similarity index 100% rename from RSParserTests/JSONFeedParserTests.swift rename to Tests/RSParserTests/JSONFeedParserTests.swift diff --git a/RSParserTests/OPMLTests.swift b/Tests/RSParserTests/OPMLTests.swift similarity index 99% rename from RSParserTests/OPMLTests.swift rename to Tests/RSParserTests/OPMLTests.swift index 633ed57..a9f45f6 100644 --- a/RSParserTests/OPMLTests.swift +++ b/Tests/RSParserTests/OPMLTests.swift @@ -8,6 +8,7 @@ import XCTest import RSParser +import RSParserObjC class OPMLTests: XCTestCase { diff --git a/RSParserTests/RSDateParserTests.m b/Tests/RSParserTests/RSDateParserTests.m similarity index 100% rename from RSParserTests/RSDateParserTests.m rename to Tests/RSParserTests/RSDateParserTests.m diff --git a/Tests/RSParserTests/RSParserTests.swift b/Tests/RSParserTests/RSParserTests.swift deleted file mode 100644 index 0503f80..0000000 --- a/Tests/RSParserTests/RSParserTests.swift +++ /dev/null @@ -1,15 +0,0 @@ -import XCTest -@testable import RSParser - -final class RSParserTests: XCTestCase { - func testExample() { - // This is an example of a functional test case. - // Use XCTAssert and related functions to verify your tests produce the correct - // results. - XCTAssertEqual(RSParser().text, "Hello, World!") - } - - static var allTests = [ - ("testExample", testExample), - ] -} diff --git a/RSParserTests/RSSInJSONParserTests.swift b/Tests/RSParserTests/RSSInJSONParserTests.swift similarity index 100% rename from RSParserTests/RSSInJSONParserTests.swift rename to Tests/RSParserTests/RSSInJSONParserTests.swift diff --git a/RSParserTests/RSSParserTests.swift b/Tests/RSParserTests/RSSParserTests.swift similarity index 100% rename from RSParserTests/RSSParserTests.swift rename to Tests/RSParserTests/RSSParserTests.swift diff --git a/RSParserTests/Resources/3960.json b/Tests/RSParserTests/Resources/3960.json similarity index 100% rename from RSParserTests/Resources/3960.json rename to Tests/RSParserTests/Resources/3960.json diff --git a/RSParserTests/Resources/489.rss b/Tests/RSParserTests/Resources/489.rss similarity index 100% rename from RSParserTests/Resources/489.rss rename to Tests/RSParserTests/Resources/489.rss diff --git a/RSParserTests/Resources/4fsodonline.atom b/Tests/RSParserTests/Resources/4fsodonline.atom similarity index 100% rename from RSParserTests/Resources/4fsodonline.atom rename to Tests/RSParserTests/Resources/4fsodonline.atom diff --git a/RSParserTests/Resources/DaringFireball.atom b/Tests/RSParserTests/Resources/DaringFireball.atom similarity index 100% rename from RSParserTests/Resources/DaringFireball.atom rename to Tests/RSParserTests/Resources/DaringFireball.atom diff --git a/RSParserTests/Resources/DaringFireball.html b/Tests/RSParserTests/Resources/DaringFireball.html similarity index 100% rename from RSParserTests/Resources/DaringFireball.html rename to Tests/RSParserTests/Resources/DaringFireball.html diff --git a/RSParserTests/Resources/DaringFireball.json b/Tests/RSParserTests/Resources/DaringFireball.json similarity index 100% rename from RSParserTests/Resources/DaringFireball.json rename to Tests/RSParserTests/Resources/DaringFireball.json diff --git a/RSParserTests/Resources/DaringFireball.rss b/Tests/RSParserTests/Resources/DaringFireball.rss similarity index 100% rename from RSParserTests/Resources/DaringFireball.rss rename to Tests/RSParserTests/Resources/DaringFireball.rss diff --git a/RSParserTests/Resources/EMarley.rss b/Tests/RSParserTests/Resources/EMarley.rss similarity index 100% rename from RSParserTests/Resources/EMarley.rss rename to Tests/RSParserTests/Resources/EMarley.rss diff --git a/RSParserTests/Resources/KatieFloyd.rss b/Tests/RSParserTests/Resources/KatieFloyd.rss similarity index 100% rename from RSParserTests/Resources/KatieFloyd.rss rename to Tests/RSParserTests/Resources/KatieFloyd.rss diff --git a/RSParserTests/Resources/OneFootTsunami.atom b/Tests/RSParserTests/Resources/OneFootTsunami.atom similarity index 100% rename from RSParserTests/Resources/OneFootTsunami.atom rename to Tests/RSParserTests/Resources/OneFootTsunami.atom diff --git a/RSParserTests/Resources/ScriptingNews.json b/Tests/RSParserTests/Resources/ScriptingNews.json similarity index 100% rename from RSParserTests/Resources/ScriptingNews.json rename to Tests/RSParserTests/Resources/ScriptingNews.json diff --git a/RSParserTests/Resources/Subs.opml b/Tests/RSParserTests/Resources/Subs.opml similarity index 100% rename from RSParserTests/Resources/Subs.opml rename to Tests/RSParserTests/Resources/Subs.opml diff --git a/RSParserTests/Resources/SubsNoTitleAttributes.opml b/Tests/RSParserTests/Resources/SubsNoTitleAttributes.opml similarity index 100% rename from RSParserTests/Resources/SubsNoTitleAttributes.opml rename to Tests/RSParserTests/Resources/SubsNoTitleAttributes.opml diff --git a/RSParserTests/Resources/allthis-partial.json b/Tests/RSParserTests/Resources/allthis-partial.json similarity index 100% rename from RSParserTests/Resources/allthis-partial.json rename to Tests/RSParserTests/Resources/allthis-partial.json diff --git a/RSParserTests/Resources/allthis.atom b/Tests/RSParserTests/Resources/allthis.atom similarity index 100% rename from RSParserTests/Resources/allthis.atom rename to Tests/RSParserTests/Resources/allthis.atom diff --git a/RSParserTests/Resources/allthis.json b/Tests/RSParserTests/Resources/allthis.json similarity index 100% rename from RSParserTests/Resources/allthis.json rename to Tests/RSParserTests/Resources/allthis.json diff --git a/RSParserTests/Resources/atp.rss b/Tests/RSParserTests/Resources/atp.rss similarity index 100% rename from RSParserTests/Resources/atp.rss rename to Tests/RSParserTests/Resources/atp.rss diff --git a/RSParserTests/Resources/bio.rdf b/Tests/RSParserTests/Resources/bio.rdf similarity index 100% rename from RSParserTests/Resources/bio.rdf rename to Tests/RSParserTests/Resources/bio.rdf diff --git a/RSParserTests/Resources/cloudblog.rss b/Tests/RSParserTests/Resources/cloudblog.rss similarity index 100% rename from RSParserTests/Resources/cloudblog.rss rename to Tests/RSParserTests/Resources/cloudblog.rss diff --git a/RSParserTests/Resources/coco.html b/Tests/RSParserTests/Resources/coco.html similarity index 100% rename from RSParserTests/Resources/coco.html rename to Tests/RSParserTests/Resources/coco.html diff --git a/RSParserTests/Resources/curt.json b/Tests/RSParserTests/Resources/curt.json similarity index 100% rename from RSParserTests/Resources/curt.json rename to Tests/RSParserTests/Resources/curt.json diff --git a/RSParserTests/Resources/dcrainmaker.xml b/Tests/RSParserTests/Resources/dcrainmaker.xml similarity index 100% rename from RSParserTests/Resources/dcrainmaker.xml rename to Tests/RSParserTests/Resources/dcrainmaker.xml diff --git a/RSParserTests/Resources/donthitsave.xml b/Tests/RSParserTests/Resources/donthitsave.xml similarity index 100% rename from RSParserTests/Resources/donthitsave.xml rename to Tests/RSParserTests/Resources/donthitsave.xml diff --git a/RSParserTests/Resources/expertopinionent.atom b/Tests/RSParserTests/Resources/expertopinionent.atom similarity index 100% rename from RSParserTests/Resources/expertopinionent.atom rename to Tests/RSParserTests/Resources/expertopinionent.atom diff --git a/RSParserTests/Resources/furbo.html b/Tests/RSParserTests/Resources/furbo.html similarity index 100% rename from RSParserTests/Resources/furbo.html rename to Tests/RSParserTests/Resources/furbo.html diff --git a/RSParserTests/Resources/inessential.html b/Tests/RSParserTests/Resources/inessential.html similarity index 100% rename from RSParserTests/Resources/inessential.html rename to Tests/RSParserTests/Resources/inessential.html diff --git a/RSParserTests/Resources/inessential.json b/Tests/RSParserTests/Resources/inessential.json similarity index 100% rename from RSParserTests/Resources/inessential.json rename to Tests/RSParserTests/Resources/inessential.json diff --git a/RSParserTests/Resources/kc0011.rss b/Tests/RSParserTests/Resources/kc0011.rss similarity index 100% rename from RSParserTests/Resources/kc0011.rss rename to Tests/RSParserTests/Resources/kc0011.rss diff --git a/RSParserTests/Resources/livemint.xml b/Tests/RSParserTests/Resources/livemint.xml similarity index 100% rename from RSParserTests/Resources/livemint.xml rename to Tests/RSParserTests/Resources/livemint.xml diff --git a/RSParserTests/Resources/macworld.rss b/Tests/RSParserTests/Resources/macworld.rss similarity index 100% rename from RSParserTests/Resources/macworld.rss rename to Tests/RSParserTests/Resources/macworld.rss diff --git a/RSParserTests/Resources/manton.rss b/Tests/RSParserTests/Resources/manton.rss similarity index 100% rename from RSParserTests/Resources/manton.rss rename to Tests/RSParserTests/Resources/manton.rss diff --git a/RSParserTests/Resources/monkeydom.rss b/Tests/RSParserTests/Resources/monkeydom.rss similarity index 100% rename from RSParserTests/Resources/monkeydom.rss rename to Tests/RSParserTests/Resources/monkeydom.rss diff --git a/RSParserTests/Resources/natasha.xml b/Tests/RSParserTests/Resources/natasha.xml similarity index 100% rename from RSParserTests/Resources/natasha.xml rename to Tests/RSParserTests/Resources/natasha.xml diff --git a/RSParserTests/Resources/pxlnv.json b/Tests/RSParserTests/Resources/pxlnv.json similarity index 100% rename from RSParserTests/Resources/pxlnv.json rename to Tests/RSParserTests/Resources/pxlnv.json diff --git a/RSParserTests/Resources/rose.json b/Tests/RSParserTests/Resources/rose.json similarity index 100% rename from RSParserTests/Resources/rose.json rename to Tests/RSParserTests/Resources/rose.json diff --git a/RSParserTests/Resources/russcox.atom b/Tests/RSParserTests/Resources/russcox.atom similarity index 100% rename from RSParserTests/Resources/russcox.atom rename to Tests/RSParserTests/Resources/russcox.atom diff --git a/RSParserTests/Resources/scriptingNews.rss b/Tests/RSParserTests/Resources/scriptingNews.rss similarity index 100% rename from RSParserTests/Resources/scriptingNews.rss rename to Tests/RSParserTests/Resources/scriptingNews.rss diff --git a/RSParserTests/Resources/sixcolors.html b/Tests/RSParserTests/Resources/sixcolors.html similarity index 100% rename from RSParserTests/Resources/sixcolors.html rename to Tests/RSParserTests/Resources/sixcolors.html diff --git a/RSParserTests/Resources/theomnishow.rss b/Tests/RSParserTests/Resources/theomnishow.rss similarity index 100% rename from RSParserTests/Resources/theomnishow.rss rename to Tests/RSParserTests/Resources/theomnishow.rss diff --git a/Tests/RSParserTests/XCTestManifests.swift b/Tests/RSParserTests/XCTestManifests.swift deleted file mode 100644 index e9e1190..0000000 --- a/Tests/RSParserTests/XCTestManifests.swift +++ /dev/null @@ -1,9 +0,0 @@ -import XCTest - -#if !canImport(ObjectiveC) -public func allTests() -> [XCTestCaseEntry] { - return [ - testCase(RSParserTests.allTests), - ] -} -#endif From 5daee5e844eecf7544016028cf61863e0baa0389 Mon Sep 17 00:00:00 2001 From: Stuart Breckenridge Date: Thu, 30 Jul 2020 10:48:11 +0800 Subject: [PATCH 18/19] Restores Exports.swift --- Sources/Swift/Exports.swift | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 Sources/Swift/Exports.swift diff --git a/Sources/Swift/Exports.swift b/Sources/Swift/Exports.swift new file mode 100644 index 0000000..c9c3068 --- /dev/null +++ b/Sources/Swift/Exports.swift @@ -0,0 +1,9 @@ +// +// Exports.swift +// +// +// Created by Stuart Breckenridge on 29/7/20. +// + +import Foundation +@_exported import RSParserObjC From ec7dc531312d70e2ba89a61f8191c4a5a44d8eb1 Mon Sep 17 00:00:00 2001 From: Stuart Breckenridge Date: Thu, 30 Jul 2020 10:54:21 +0800 Subject: [PATCH 19/19] Removes unused cSettings --- Package.swift | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Package.swift b/Package.swift index 879b920..9b96331 100644 --- a/Package.swift +++ b/Package.swift @@ -33,8 +33,7 @@ let package = Package( dependencies: [], path: "Sources/ObjC", cSettings: [ - .headerSearchPath("include"), - .define("SWIFT_PACKAGE") + .headerSearchPath("include") ]), .testTarget( name: "RSParserTests",