Unify Core and RSCore into RSCore.

This commit is contained in:
Brent Simmons
2025-04-22 20:48:56 -07:00
parent ac372fc79b
commit 57a170beed
15 changed files with 41 additions and 89 deletions

View File

@@ -5,13 +5,13 @@ import PackageDescription
var dependencies: [Package.Dependency] = [
.package(url: "https://github.com/Ranchero-Software/RSDatabase.git", .upToNextMajor(from: "1.0.0")),
.package(url: "https://github.com/Ranchero-Software/RSParser.git", .upToNextMajor(from: "2.0.2")),
]
#if swift(>=5.6)
dependencies.append(contentsOf: [
.package(path: "../Articles"),
.package(path: "../RSCore"),
.package(path: "../RSParser"),
])
#else
dependencies.append(contentsOf: [

View File

@@ -1,21 +0,0 @@
// swift-tools-version: 6.0
import PackageDescription
let package = Package(
name: "Core",
platforms: [.macOS(.v13), .iOS(.v16)],
products: [
.library(
name: "Core",
targets: ["Core"]),
],
targets: [
.target(
name: "Core"),
.testTarget(
name: "CoreTests",
dependencies: ["Core"]
),
]
)

View File

@@ -1,37 +0,0 @@
//
// Date+Extensions.swift
// RSCore
//
// Created by Brent Simmons on 6/21/16.
// Copyright © 2016 Ranchero Software, LLC. All rights reserved.
//
import Foundation
public extension Date {
// Below are for rough use only they don't use the calendar.
func bySubtracting(days: Int) -> Date {
return addingTimeInterval(0.0 - TimeInterval(days: days))
}
func bySubtracting(hours: Int) -> Date {
return addingTimeInterval(0.0 - TimeInterval(hours: hours))
}
func byAdding(days: Int) -> Date {
return addingTimeInterval(TimeInterval(days: days))
}
}
public extension TimeInterval {
init(days: Int) {
self.init(days * 24 * 60 * 60)
}
init(hours: Int) {
self.init(hours * 60 * 60)
}
}

View File

@@ -1,12 +0,0 @@
import XCTest
@testable import Core
final class CoreTests: XCTestCase {
func testExample() throws {
// XCTest Documentation
// https://developer.apple.com/documentation/xctest
// Defining Test Cases and Test Methods
// https://developer.apple.com/documentation/xctest/defining_test_cases_and_test_methods
}
}

View File

@@ -738,7 +738,6 @@
8405DDA122168920008CE1BF /* TimelineTableView.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = TimelineTableView.xib; sourceTree = "<group>"; };
8405DDA422168C62008CE1BF /* TimelineContainerViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TimelineContainerViewController.swift; sourceTree = "<group>"; };
840BEE4021D70E64009BBAFA /* CrashReportWindowController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CrashReportWindowController.swift; sourceTree = "<group>"; };
840C544F2D0C9A4A00A240DB /* Core */ = {isa = PBXFileReference; lastKnownFileType = wrapper; path = Core; sourceTree = "<group>"; };
840D617C2029031C009BC708 /* NetNewsWire.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = NetNewsWire.app; sourceTree = BUILT_PRODUCTS_DIR; };
840D61952029031D009BC708 /* NetNewsWire_iOSTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NetNewsWire_iOSTests.swift; sourceTree = "<group>"; };
840D61972029031D009BC708 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
@@ -1537,7 +1536,6 @@
8424B3162DB73D320053AA11 /* RSParser */,
843E2F152CF2B43700ED170F /* RSWeb */,
848E84CB2DB749300023F3BA /* RSCore */,
840C544F2D0C9A4A00A240DB /* Core */,
);
sourceTree = "<group>";
usesTabs = 1;

View File

@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<Workspace
version = "1.0">
<FileRef
location = "self:">
</FileRef>
</Workspace>

View File

@@ -1,13 +1,12 @@
// swift-tools-version:5.3
// The swift-tools-version declares the minimum version of Swift required to build this package.
// swift-tools-version:5.10
import PackageDescription
let package = Package(
name: "RSCore",
platforms: [.macOS(SupportedPlatform.MacOSVersion.v10_15), .iOS(SupportedPlatform.IOSVersion.v13)],
products: [
.library(name: "RSCore", type: .dynamic, targets: ["RSCore"]),
name: "RSCore",
platforms: [.macOS(.v13), .iOS(.v17)],
products: [
.library(name: "RSCore", type: .dynamic, targets: ["RSCore"]),
.library(name: "RSCoreObjC", type: .dynamic, targets: ["RSCoreObjC"]),
.library(name: "RSCoreResources", type: .static, targets: ["RSCoreResources"])
],
@@ -19,8 +18,12 @@ let package = Package(
name: "RSCoreObjC",
dependencies: [],
cSettings: [
.headerSearchPath("include")
]
.headerSearchPath("include"),
.unsafeFlags(["-fprofile-instr-generate", "-fcoverage-mapping"])
],
linkerSettings: [
.unsafeFlags(["-fprofile-instr-generate"])
]
),
.target(
name: "RSCoreResources",

View File

@@ -16,14 +16,22 @@ public extension Date {
return addingTimeInterval(0.0 - TimeInterval(days: days))
}
func bySubtracting(hours: Int) -> Date {
return addingTimeInterval(0.0 - TimeInterval(hours: hours))
}
func byAdding(days: Int) -> Date {
return addingTimeInterval(TimeInterval(days: days))
}
}
private extension TimeInterval {
public extension TimeInterval {
init(days: Int) {
self.init(days * 24 * 60 * 60)
}
init(hours: Int) {
self.init(hours * 60 * 60)
}
}

View File

@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<Workspace
version = "1.0">
<FileRef
location = "self:">
</FileRef>
</Workspace>

View File

@@ -12,15 +12,15 @@ let package = Package(
targets: ["RSWeb"]),
],
dependencies: [
.package(url: "https://github.com/Ranchero-Software/RSParser.git", .upToNextMinor(from: "2.0.2")),
.package(path: "../Core")
.package(path: "../RSParser"),
.package(path: "../RSCore")
],
targets: [
.target(
name: "RSWeb",
dependencies: [
"RSParser",
"Core"
"RSCore"
],
resources: [.copy("UTS46/uts46")],
swiftSettings: [.define("SWIFT_PACKAGE")]),
@@ -29,7 +29,7 @@ let package = Package(
dependencies: [
"RSWeb",
"RSParser",
"Core"
"RSCore"
]),
]
)

View File

@@ -6,7 +6,7 @@
//
import Foundation
import Core
import RSCore
@preconcurrency import RSParser
public extension Notification.Name {

View File

@@ -11,7 +11,6 @@ import Account
import RSCore
import RSWeb
import RSParser
import Core
extension Notification.Name {

View File

@@ -10,7 +10,7 @@ import Foundation
import os.log
import RSCore
import RSWeb
import Core
import RSCore
extension Notification.Name {