Simplify Parser — use one target instead of multiple.

This commit is contained in:
Brent Simmons 2024-09-24 14:45:53 -07:00
parent c48e72c3b2
commit 591e451b69
51 changed files with 14 additions and 218 deletions

View File

@ -1,67 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1530"
version = "1.7">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES"
buildArchitectures = "Automatic">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "OPMLParser"
BuildableName = "OPMLParser"
BlueprintName = "OPMLParser"
ReferencedContainer = "container:">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
shouldAutocreateTestPlan = "YES">
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "OPMLParser"
BuildableName = "OPMLParser"
BlueprintName = "OPMLParser"
ReferencedContainer = "container:">
</BuildableReference>
</MacroExpansion>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>

View File

@ -1,67 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1530"
version = "1.7">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES"
buildArchitectures = "Automatic">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "SAX"
BuildableName = "SAX"
BlueprintName = "SAX"
ReferencedContainer = "container:">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
shouldAutocreateTestPlan = "YES">
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "SAX"
BuildableName = "SAX"
BlueprintName = "SAX"
ReferencedContainer = "container:">
</BuildableReference>
</MacroExpansion>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>

View File

@ -9,25 +9,9 @@ let package = Package(
products: [
// Products define the executables and libraries a package produces, and make them visible to other packages.
.library(
name: "FeedParser",
name: "Parser",
type: .dynamic,
targets: ["FeedParser"]),
.library(
name: "SAX",
type: .dynamic,
targets: ["SAX"]),
.library(
name: "OPMLParser",
type: .dynamic,
targets: ["OPMLParser"]),
.library(
name: "HTMLParser",
type: .dynamic,
targets: ["HTMLParser"]),
.library(
name: "DateParser",
type: .dynamic,
targets: ["DateParser"])
targets: ["Parser"])
],
dependencies: [
.package(path: "../FoundationExtras"),
@ -36,53 +20,17 @@ 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: "OPMLParser",
dependencies: [
"SAX"
],
swiftSettings: [
.enableExperimentalFeature("StrictConcurrency")
]),
.target(
name: "HTMLParser",
name: "Parser",
dependencies: [
"FoundationExtras",
"SAX"
],
swiftSettings: [
.enableExperimentalFeature("StrictConcurrency")
]),
.target(
name: "FeedParser",
dependencies: [
"SAX",
"FoundationExtras",
"DateParser"
],
swiftSettings: [
.enableExperimentalFeature("StrictConcurrency")
]),
.target(
name: "SAX",
dependencies: [
"FoundationExtras"
],
swiftSettings: [
.enableExperimentalFeature("StrictConcurrency")
]),
.target(
name: "DateParser",
dependencies: [],
swiftSettings: [
.enableExperimentalFeature("StrictConcurrency")
]),
.testTarget(
name: "ParserTests",
dependencies: [
"FeedParser",
"OPMLParser",
"DateParser",
"HTMLParser"
"Parser"
],
exclude: ["Info.plist"],
resources: [.copy("Resources")]),

View File

@ -7,7 +7,6 @@
//
import Foundation
import SAX
public enum FeedType: Sendable {

View File

@ -7,8 +7,6 @@
//
import Foundation
import SAX
import DateParser
// See https://jsonfeed.org/version/1.1

View File

@ -7,8 +7,6 @@
//
import Foundation
import SAX
import DateParser
// See https://github.com/scripting/Scripting-News/blob/master/rss-in-json/README.md
// Also: http://cyber.harvard.edu/rss/rss.html

View File

@ -8,8 +8,6 @@
import Foundation
import FoundationExtras
import SAX
import DateParser
final class AtomParser {

View File

@ -8,8 +8,6 @@
import Foundation
import FoundationExtras
import SAX
import DateParser
public final class RSSParser {

View File

@ -7,7 +7,6 @@
import Foundation
import FoundationExtras
import SAX
public final class HTMLLinkParser {

View File

@ -6,7 +6,6 @@
//
import Foundation
import SAX
public final class HTMLMetadata {

View File

@ -7,7 +7,6 @@
import Foundation
import FoundationExtras
import SAX
public final class HTMLMetadataParser {

View File

@ -6,7 +6,6 @@
//
import Foundation
import SAX
public struct OPMLFeedSpecifier: Sendable {

View File

@ -6,7 +6,6 @@
//
import Foundation
import SAX
public final class OPMLParser {

View File

@ -7,7 +7,7 @@
//
import XCTest
import FeedParser
import Parser
final class AtomParserTests: XCTestCase {

View File

@ -7,7 +7,7 @@
import Foundation
import XCTest
@testable import DateParser
@testable import Parser
final class DateParserTests: XCTestCase {

View File

@ -7,7 +7,7 @@
//
import XCTest
import SAX
import Parser
final class EntityDecodingTests: XCTestCase {

View File

@ -7,8 +7,7 @@
//
import XCTest
@testable import FeedParser
import SAX
@testable import Parser
final class FeedParserTypeTests: XCTestCase {

View File

@ -7,8 +7,7 @@
//
import XCTest
import HTMLParser
import libxml2
import Parser
final class HTMLLinkTests: XCTestCase {

View File

@ -7,7 +7,7 @@
//
import XCTest
import HTMLParser
import Parser
final class HTMLMetadataTests: XCTestCase {

View File

@ -7,7 +7,7 @@
//
import XCTest
import FeedParser
import Parser
final class JSONFeedParserTests: XCTestCase {

View File

@ -7,8 +7,7 @@
//
import XCTest
import SAX
@testable import OPMLParser
@testable import Parser
final class OPMLTests: XCTestCase {

View File

@ -7,8 +7,7 @@
//
import XCTest
import SAX
import FeedParser
import Parser
final class RSSInJSONParserTests: XCTestCase {

View File

@ -7,7 +7,7 @@
//
import XCTest
import FeedParser
import Parser
final class RSSParserTests: XCTestCase {