Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/build-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:

- name: 🛠️ Build with release configuration
run: |
swift build --configuration release | xcpretty --utf --color && exit ${PIPESTATUS[0]}
swift build --configuration release -skipPackagePluginValidation | xcpretty --utf --color && exit ${PIPESTATUS[0]}

- uses: actions/upload-artifact@v4
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@ jobs:

- name: 🛠️ Run All Tests
run: |
xcodebuild test -scheme public-api-diff -destination "platform=iOS,name=Any iOS Device" | xcpretty --utf --color && exit ${PIPESTATUS[0]}
xcodebuild test -scheme public-api-diff -destination "platform=iOS,name=Any iOS Device" -skipPackagePluginValidation | xcpretty --utf --color && exit ${PIPESTATUS[0]}
9 changes: 9 additions & 0 deletions Package.resolved

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

30 changes: 17 additions & 13 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,13 @@ let package = Package(
.package(url: "https://github.com/apple/swift-argument-parser", from: "1.5.0"),
.package(url: "https://github.com/swiftlang/swift-syntax", from: "600.0.1"),
.package(url: "https://github.com/nicklockwood/SwiftFormat", from: "0.54.6"),
.package(url: "https://github.com/apple/swift-docc-plugin", from: "1.4.3")
.package(url: "https://github.com/apple/swift-docc-plugin", from: "1.4.3"),
.package(url: "https://github.com/SimplyDanny/SwiftLintPlugins", from: "0.57.0")
],
targets: [

// MARK: - Executable Targets

.executableTarget(
name: "public-api-diff",
dependencies: [
Expand All @@ -50,19 +51,22 @@ let package = Package(
"PADSwiftInterfaceFileLocator",
.product(name: "ArgumentParser", package: "swift-argument-parser")
],
path: "Sources/ExecutableTargets/CommandLineTool"
path: "Sources/ExecutableTargets/CommandLineTool",
plugins: [
.plugin(name: "SwiftLintBuildToolPlugin", package: "SwiftLintPlugins")
]
),

// MARK: - Public Modules

.target(
name: "PADSwiftInterfaceDiff",
dependencies: [
"PADCore",
"PADLogging",
"FileHandlingModule",
.product(name: "SwiftSyntax", package: "swift-syntax"),
.product(name: "SwiftParser", package: "swift-syntax"),
.product(name: "SwiftParser", package: "swift-syntax")
],
path: "Sources/PublicModules/PADSwiftInterfaceDiff"
),
Expand Down Expand Up @@ -94,9 +98,9 @@ let package = Package(
dependencies: ["PADCore"],
path: "Sources/PublicModules/PADOutputGenerator"
),

// MARK: - Shared/Public

.target(
name: "PADCore",
path: "Sources/Shared/Public/PADCore"
Expand All @@ -111,9 +115,9 @@ let package = Package(
dependencies: ["FileHandlingModule", "ShellModule", "PADLogging"],
path: "Sources/Shared/Public/PADSwiftInterfaceFileLocator"
),

// MARK: - Shared/Package

.target(
name: "FileHandlingModule",
path: "Sources/Shared/Package/FileHandlingModule"
Expand All @@ -127,9 +131,9 @@ let package = Package(
dependencies: ["FileHandlingModule", "ShellModule", "PADLogging"],
path: "Sources/Shared/Package/SwiftPackageFileHelperModule"
),

// MARK: - Test Targets

.testTarget(
name: "UnitTests",
dependencies: [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import Foundation

public protocol CustomProtocol {
typealias CustomAssociatedType = Equatable

var getSetVar: any CustomAssociatedType { get set }
var getVar: any CustomAssociatedType { get }
func function() -> any CustomAssociatedType
Expand All @@ -40,26 +40,26 @@ public struct CustomStruct: CustomProtocol {
// MARK: - Generic public class

public class CustomClass<T: Equatable> {

public weak var weakObject: CustomClass?
lazy var lazyVar: String = { "I am a lazy" }()
@_spi(SomeSpi)
@_spi(AnotherSpi)
open var computedVar: String { "I am computed" }
package let constantLet: String = "I'm a let"
public var optionalVar: T?

@MainActor
public func asyncThrowingFunc() async throws {}
public func rethrowingFunc(throwingArg: @escaping () throws -> String) rethrows {}

public init(weakObject: CustomClass? = nil, optionalVar: T? = nil) {
self.weakObject = weakObject
self.optionalVar = optionalVar
}

public init() {}

public convenience init(value: T) {
self.init(optionalVar: value)
}
Expand All @@ -70,12 +70,12 @@ public class CustomClass<T: Equatable> {
@_spi(SystemProgrammingInterface)
open class OpenSpiConformingClass: CustomProtocol {
public typealias CustomAssociatedType = any Equatable

public var getSetVar: CustomAssociatedType
public var getVar: CustomAssociatedType
@inlinable
public func function() -> CustomAssociatedType { fatalError() }

public init(getSetVar: CustomAssociatedType, getVar: CustomAssociatedType) {
self.getSetVar = getSetVar
self.getVar = getVar
Expand Down Expand Up @@ -106,11 +106,11 @@ public actor CustomActor {}

public enum OperatorNamespace: String {
case someValue = "1"

public static prefix func ++ (_ counter: OperatorNamespace) -> String {
counter.rawValue
}

public static postfix func ++ (_ counter: OperatorNamespace) -> String {
counter.rawValue
}
Expand All @@ -137,6 +137,6 @@ public enum CustomEnum {
case caseWithString(String)
case caseWithTuple(String, Int)
case caseWithBlock((Int) throws -> Void)

indirect case recursive(CustomEnum)
}
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public protocol ParentProtocol<ParentType> {
public protocol CustomProtocol<CustomAssociatedType, AnotherAssociatedType>: ParentProtocol<Double> {
associatedtype CustomAssociatedType: Equatable
associatedtype AnotherAssociatedType: Strideable

var getSetVar: AnotherAssociatedType { get set }
var getVar: CustomAssociatedType { get }
func function() -> CustomAssociatedType
Expand All @@ -41,16 +41,16 @@ public protocol CustomProtocol<CustomAssociatedType, AnotherAssociatedType>: Par
public struct CustomStruct<T: Strideable>: CustomProtocol {
public typealias CustomAssociatedType = Int
public typealias AnotherAssociatedType = Double
public typealias Iterator = Array<AnotherAssociatedType>
public typealias Iterator = [AnotherAssociatedType]

@available(macOS, unavailable, message: "Unavailable on macOS")
public struct NestedStruct {
@available(*, deprecated, renamed: "nestedVar")
public let nestedLet: String = "let"
@available(swift, introduced: 5.9)
public let nestedVar: String = "var"
}

public var getSetVar: Double
public var getVar: Int
@discardableResult
Expand All @@ -60,34 +60,34 @@ public struct CustomStruct<T: Strideable>: CustomProtocol {
// MARK: - Generic public class

public class CustomClass<T: Equatable> {

public weak var weakObject: CustomClass?
public lazy var lazyVar: String = { "I am a lazy" }()
@_spi(SomeSpi)
@_spi(AnotherSpi)
open var computedVar: String { "I am computed" }
package let constantLet: String = "I'm a let"
public var optionalVar: T?

public let a = 0, b = 0, c = 0, d: Double = 5.0

@MainActor
public func asyncThrowingFunc<Element>(_ element: Element) async throws -> Void where Element: Strideable {}
public func asyncThrowingFunc<Element>(_ element: Element) async throws where Element: Strideable {}
public func rethrowingFunc(throwingArg: @escaping () throws -> String) rethrows {}

public init(weakObject: CustomClass? = nil, optionalVar: T? = nil) {
self.weakObject = weakObject
self.optionalVar = optionalVar

lazyVar = "Great!"
}

public init?() {}

public convenience init!(value: T) {
self.init(optionalVar: value)
}

public subscript(index: Int) -> T? {
get { optionalVar }
set { optionalVar = newValue }
Expand All @@ -107,13 +107,13 @@ extension Array {
open class OpenSpiConformingClass<T: Equatable & Strideable>: CustomProtocol {
public typealias CustomAssociatedType = T
public typealias AnotherAssociatedType = T
public typealias Iterator = Array<Double>
public typealias Iterator = [Double]

public var getSetVar: T
public var getVar: T
@inlinable
public func function() -> T where T: Equatable { getVar }

public init(getSetVar: T, getVar: T) {
self.getSetVar = getSetVar
self.getVar = getVar
Expand Down Expand Up @@ -144,11 +144,11 @@ public actor CustomActor: SimpleProtocol {}

public enum OperatorNamespace: String {
case someValue = "1"

public static prefix func ++ (_ counter: OperatorNamespace) -> String {
counter.rawValue
}

public static postfix func ++ (_ counter: OperatorNamespace) -> String {
counter.rawValue
}
Expand Down Expand Up @@ -176,7 +176,7 @@ public enum CustomEnum<T> {
case caseWithTuple(_ foo: String, bar: Int)
case caseWithBlock((Int) throws -> Void)
case a, b, c, d, e(NestedStructInExtension)

indirect case recursive(CustomEnum)
}

Expand All @@ -186,7 +186,7 @@ public enum RawValueEnum: String {
}

extension CustomEnum: SimpleProtocol {

public struct NestedStructInExtension {
public let string: String
public init(string: String = "Hello") {
Expand All @@ -196,14 +196,14 @@ extension CustomEnum: SimpleProtocol {
}

extension CustomEnum.NestedStructInExtension {

var description: String {
return string
}
}

public extension CustomEnum where T == String {

var titleOfCaseWithNamedString: String? {
if case let .caseWithNamedString(title) = self {
return title
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import PADSwiftInterfaceDiff

@main
struct PublicApiDiff: AsyncParsableCommand {

static var configuration: CommandConfiguration = .init(
commandName: "public-api-diff",
subcommands: [
Expand All @@ -26,14 +26,14 @@ struct PublicApiDiff: AsyncParsableCommand {
FrameworkToOutputCommand.self
]
)

public func run() async throws {
fatalError("No sub command provided")
}
}

extension PublicApiDiff {

static func logger(
with logLevel: LogLevel,
logOutputFilePath: String?
Expand All @@ -43,7 +43,7 @@ extension PublicApiDiff {
loggers += [LogFileLogger(outputFilePath: logOutputFilePath)]
}
loggers += [SystemLogger().withLogLevel(logLevel)]

return LoggingGroup(with: loggers)
}
}
Loading
Loading