From f6f1a899b49e4814d9402eafb03afa36468f2bb0 Mon Sep 17 00:00:00 2001 From: Alex Guretzki Date: Thu, 10 Oct 2024 15:20:47 +0200 Subject: [PATCH 01/12] Moving files around --- Package.swift | 120 ++++++++++++++++- .../public-api-diff.swift | 80 ++++-------- .../Models => CoreModule}/Change.swift | 28 ++-- Sources/CoreModule/ProjectType.swift | 6 + .../RandomStringGenerating.swift | 8 +- Sources/CoreModule/SwiftInterfaceFile.swift | 13 ++ .../FileHandling+Convenience.swift | 7 +- .../FileHandling.swift | 8 +- .../FileManager+FileHandling.swift | 7 +- Sources/{Helpers => GitModule}/Git.swift | 17 ++- Sources/Helpers/Models/Constants.swift | 12 -- .../LogFileLogger.swift | 10 +- .../LogLevelLogger.swift | 11 +- Sources/LoggingModule/Logging.swift | 7 + .../LoggingGroup.swift | 9 +- .../SystemLogger.swift | 9 +- .../MarkdownOutputGenerator.swift | 7 +- .../OutputGenerating.swift | 18 +++ Sources/Pipeline/Pipeline+Protocols.swift | 62 --------- .../ProjectBuilderModule/ProjectBuilder.swift | 121 ++++++++++++++++++ .../ProjectSetupHelper.swift | 20 ++- .../ProjectSetupHelping.swift | 6 + .../ProjectSource.swift | 7 +- Sources/{Helpers => ShellModule}/Shell.swift | 8 +- .../IndependentSwiftInterfaceChange.swift | 5 +- .../SwiftInterfaceAnalyzer.swift | 7 +- .../SwiftInterfaceAnalyzing.swift | 6 + .../SwiftInterfaceChangeConsolidator.swift | 9 +- .../SwiftInterfaceElement+DiffHelper.swift | 1 + .../SwiftInterfaceElement.swift | 10 +- .../DeclSyntax+Convenience.swift | 0 .../ActorDeclSyntax+SwiftInterface.swift | 0 ...ociatedTypeDeclSyntax+SwiftInterface.swift | 0 .../ClassDeclSyntac+SwiftInterface.swift | 0 .../EnumCaseDeclSyntax+SwiftInterface.swift | 0 .../EnumDeclSyntax+SwiftInterface.swift | 0 .../ExtensionDeclSyntax+SwiftInterface.swift | 0 .../FunctionDeclSyntax+SwiftInterface.swift | 0 ...InitializerDeclSyntax+SwiftInterface.swift | 0 .../ProtocolDeclSyntax+SwiftInterface.swift | 0 .../StructDeclSyntax+SwiftInterface.swift | 0 .../SubscriptDeclSyntax+SwiftInterface.swift | 0 .../TypeAliasDeclSyntax+SwiftInterface.swift | 0 .../VarDeclSyntax+SwiftInterface.swift | 0 .../SwiftInterfaceElement+Actor.swift | 0 ...SwiftInterfaceElement+AssociatedType.swift | 0 .../SwiftInterfaceElement+Class.swift | 0 .../SwiftInterfaceElement+Enum.swift | 0 .../SwiftInterfaceElement+EnumCase.swift | 0 .../SwiftInterfaceElement+Extension.swift | 0 .../SwiftInterfaceElement+Function.swift | 0 .../SwiftInterfaceElement+Initializer.swift | 0 .../SwiftInterfaceElement+Protocol.swift | 0 .../SwiftInterfaceElement+Struct.swift | 0 .../SwiftInterfaceElement+Subscript.swift | 0 .../SwiftInterfaceElement+TypeAlias.swift | 0 .../SwiftInterfaceElement+Var.swift | 0 .../SwiftInterfaceParser+Root.swift | 0 .../SwiftInterfaceParser.swift | 2 +- .../SwiftInterfaceParsing.swift | 5 + .../SwiftInterfacePipeline.swift | 22 ++-- .../SwiftInterfaceFileLocator.swift | 4 + .../SwiftInterfaceProducer.swift | 14 +- .../SwiftInterfaceProducerError.swift} | 2 +- .../SwiftInterfaceType.swift | 4 +- .../XcodeTools.swift | 11 +- .../SwiftPackageFileAnalyzer.swift | 16 ++- .../SwiftPackageFileAnalyzing.swift | 15 +++ .../SwiftPackageDescription.swift | 79 ++++++------ .../SwiftPackageFileHelper.swift | 17 +-- 70 files changed, 540 insertions(+), 290 deletions(-) rename Sources/{ => CommandLineTool}/public-api-diff.swift (61%) rename Sources/{Helpers/Models => CoreModule}/Change.swift (66%) create mode 100644 Sources/CoreModule/ProjectType.swift rename Sources/{Helpers => CoreModule}/RandomStringGenerating.swift (58%) create mode 100644 Sources/CoreModule/SwiftInterfaceFile.swift rename Sources/{Helpers/FileHandling => FileHandlingModule}/FileHandling+Convenience.swift (94%) rename Sources/{Helpers/FileHandling => FileHandlingModule}/FileHandling.swift (72%) rename Sources/{Helpers/FileHandling => FileHandlingModule}/FileManager+FileHandling.swift (75%) rename Sources/{Helpers => GitModule}/Git.swift (84%) delete mode 100644 Sources/Helpers/Models/Constants.swift rename Sources/{Helpers/Logging => LoggingModule}/LogFileLogger.swift (67%) rename Sources/{Helpers/Logging => LoggingModule}/LogLevelLogger.swift (79%) create mode 100644 Sources/LoggingModule/Logging.swift rename Sources/{Helpers/Logging => LoggingModule}/LoggingGroup.swift (50%) rename Sources/{Helpers/Logging => LoggingModule}/SystemLogger.swift (65%) rename Sources/{Pipeline/Modules => OutputGeneratorModule}/MarkdownOutputGenerator.swift (97%) create mode 100644 Sources/OutputGeneratorModule/OutputGenerating.swift delete mode 100644 Sources/Pipeline/Pipeline+Protocols.swift create mode 100644 Sources/ProjectBuilderModule/ProjectBuilder.swift rename Sources/{Pipeline/Modules => ProjectSetupModule}/ProjectSetupHelper.swift (90%) create mode 100644 Sources/ProjectSetupModule/ProjectSetupHelping.swift rename Sources/{Helpers => ProjectSetupModule}/ProjectSource.swift (87%) rename Sources/{Helpers => ShellModule}/Shell.swift (82%) rename Sources/{Helpers/Models/SwiftInterface => SwiftInterfaceAnalyzerModule/SwiftInterfaceAnalyzer}/IndependentSwiftInterfaceChange.swift (85%) rename Sources/{Pipeline/Modules => SwiftInterfaceAnalyzerModule}/SwiftInterfaceAnalyzer/SwiftInterfaceAnalyzer.swift (97%) create mode 100644 Sources/SwiftInterfaceAnalyzerModule/SwiftInterfaceAnalyzer/SwiftInterfaceAnalyzing.swift rename Sources/{Pipeline/Modules => SwiftInterfaceAnalyzerModule}/SwiftInterfaceAnalyzer/SwiftInterfaceChangeConsolidator.swift (95%) rename Sources/{Helpers/Models/SwiftInterface => SwiftInterfaceAnalyzerModule}/SwiftInterfaceElement+DiffHelper.swift (99%) rename Sources/{Helpers/Models/SwiftInterface => SwiftInterfaceAnalyzerModule}/SwiftInterfaceElement.swift (95%) rename Sources/{Helpers/Models/SwiftInterface => SwiftInterfaceAnalyzerModule/SwiftInterfaceParser}/DeclSyntax+Convenience.swift (100%) rename Sources/{Helpers/Models/SwiftInterface => SwiftInterfaceAnalyzerModule/SwiftInterfaceParser}/DeclSyntax+SwiftInterface/ActorDeclSyntax+SwiftInterface.swift (100%) rename Sources/{Helpers/Models/SwiftInterface => SwiftInterfaceAnalyzerModule/SwiftInterfaceParser}/DeclSyntax+SwiftInterface/AssociatedTypeDeclSyntax+SwiftInterface.swift (100%) rename Sources/{Helpers/Models/SwiftInterface => SwiftInterfaceAnalyzerModule/SwiftInterfaceParser}/DeclSyntax+SwiftInterface/ClassDeclSyntac+SwiftInterface.swift (100%) rename Sources/{Helpers/Models/SwiftInterface => SwiftInterfaceAnalyzerModule/SwiftInterfaceParser}/DeclSyntax+SwiftInterface/EnumCaseDeclSyntax+SwiftInterface.swift (100%) rename Sources/{Helpers/Models/SwiftInterface => SwiftInterfaceAnalyzerModule/SwiftInterfaceParser}/DeclSyntax+SwiftInterface/EnumDeclSyntax+SwiftInterface.swift (100%) rename Sources/{Helpers/Models/SwiftInterface => SwiftInterfaceAnalyzerModule/SwiftInterfaceParser}/DeclSyntax+SwiftInterface/ExtensionDeclSyntax+SwiftInterface.swift (100%) rename Sources/{Helpers/Models/SwiftInterface => SwiftInterfaceAnalyzerModule/SwiftInterfaceParser}/DeclSyntax+SwiftInterface/FunctionDeclSyntax+SwiftInterface.swift (100%) rename Sources/{Helpers/Models/SwiftInterface => SwiftInterfaceAnalyzerModule/SwiftInterfaceParser}/DeclSyntax+SwiftInterface/InitializerDeclSyntax+SwiftInterface.swift (100%) rename Sources/{Helpers/Models/SwiftInterface => SwiftInterfaceAnalyzerModule/SwiftInterfaceParser}/DeclSyntax+SwiftInterface/ProtocolDeclSyntax+SwiftInterface.swift (100%) rename Sources/{Helpers/Models/SwiftInterface => SwiftInterfaceAnalyzerModule/SwiftInterfaceParser}/DeclSyntax+SwiftInterface/StructDeclSyntax+SwiftInterface.swift (100%) rename Sources/{Helpers/Models/SwiftInterface => SwiftInterfaceAnalyzerModule/SwiftInterfaceParser}/DeclSyntax+SwiftInterface/SubscriptDeclSyntax+SwiftInterface.swift (100%) rename Sources/{Helpers/Models/SwiftInterface => SwiftInterfaceAnalyzerModule/SwiftInterfaceParser}/DeclSyntax+SwiftInterface/TypeAliasDeclSyntax+SwiftInterface.swift (100%) rename Sources/{Helpers/Models/SwiftInterface => SwiftInterfaceAnalyzerModule/SwiftInterfaceParser}/DeclSyntax+SwiftInterface/VarDeclSyntax+SwiftInterface.swift (100%) rename Sources/{Helpers/Models/SwiftInterface => SwiftInterfaceAnalyzerModule/SwiftInterfaceParser}/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+Actor.swift (100%) rename Sources/{Helpers/Models/SwiftInterface => SwiftInterfaceAnalyzerModule/SwiftInterfaceParser}/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+AssociatedType.swift (100%) rename Sources/{Helpers/Models/SwiftInterface => SwiftInterfaceAnalyzerModule/SwiftInterfaceParser}/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+Class.swift (100%) rename Sources/{Helpers/Models/SwiftInterface => SwiftInterfaceAnalyzerModule/SwiftInterfaceParser}/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+Enum.swift (100%) rename Sources/{Helpers/Models/SwiftInterface => SwiftInterfaceAnalyzerModule/SwiftInterfaceParser}/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+EnumCase.swift (100%) rename Sources/{Helpers/Models/SwiftInterface => SwiftInterfaceAnalyzerModule/SwiftInterfaceParser}/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+Extension.swift (100%) rename Sources/{Helpers/Models/SwiftInterface => SwiftInterfaceAnalyzerModule/SwiftInterfaceParser}/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+Function.swift (100%) rename Sources/{Helpers/Models/SwiftInterface => SwiftInterfaceAnalyzerModule/SwiftInterfaceParser}/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+Initializer.swift (100%) rename Sources/{Helpers/Models/SwiftInterface => SwiftInterfaceAnalyzerModule/SwiftInterfaceParser}/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+Protocol.swift (100%) rename Sources/{Helpers/Models/SwiftInterface => SwiftInterfaceAnalyzerModule/SwiftInterfaceParser}/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+Struct.swift (100%) rename Sources/{Helpers/Models/SwiftInterface => SwiftInterfaceAnalyzerModule/SwiftInterfaceParser}/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+Subscript.swift (100%) rename Sources/{Helpers/Models/SwiftInterface => SwiftInterfaceAnalyzerModule/SwiftInterfaceParser}/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+TypeAlias.swift (100%) rename Sources/{Helpers/Models/SwiftInterface => SwiftInterfaceAnalyzerModule/SwiftInterfaceParser}/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+Var.swift (100%) rename Sources/{Pipeline/Modules => SwiftInterfaceAnalyzerModule}/SwiftInterfaceParser/SwiftInterfaceParser+Root.swift (100%) rename Sources/{Pipeline/Modules => SwiftInterfaceAnalyzerModule}/SwiftInterfaceParser/SwiftInterfaceParser.swift (98%) create mode 100644 Sources/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/SwiftInterfaceParsing.swift rename Sources/{Pipeline => SwiftInterfaceAnalyzerModule}/SwiftInterfacePipeline.swift (74%) rename Sources/{Pipeline/Modules => SwiftInterfaceProducerModule}/SwiftInterfaceFileLocator.swift (97%) rename Sources/{Pipeline => SwiftInterfaceProducerModule}/SwiftInterfaceProducer.swift (95%) rename Sources/{Pipeline/PipelineError.swift => SwiftInterfaceProducerModule/SwiftInterfaceProducerError.swift} (86%) rename Sources/{Helpers => SwiftInterfaceProducerModule}/SwiftInterfaceType.swift (87%) rename Sources/{Helpers => SwiftInterfaceProducerModule}/XcodeTools.swift (94%) rename Sources/{Pipeline/Modules => SwiftPackageFileAnalyzerModule}/SwiftPackageFileAnalyzer.swift (97%) create mode 100644 Sources/SwiftPackageFileAnalyzerModule/SwiftPackageFileAnalyzing.swift rename Sources/{Helpers/Models => SwiftPackageFileHelperModule}/SwiftPackageDescription.swift (78%) rename Sources/{Helpers => SwiftPackageFileHelperModule}/SwiftPackageFileHelper.swift (93%) diff --git a/Package.swift b/Package.swift index 262273b..9c27cce 100644 --- a/Package.swift +++ b/Package.swift @@ -3,28 +3,136 @@ import PackageDescription +private extension String { + static var core: Self { "CoreModule" } + static var fileHandling: Self { "FileHandlingModule" } + static var shell: Self { "ShellModule" } + static var git: Self { "GitModule" } + static var logging: Self { "LoggingModule" } + static var outputGenerator: Self { "OutputGeneratorModule" } + static var swiftInterfaceAnalyzerModule: Self { "SwiftInterfaceAnalyzerModule" } + static var projectSetupModule: Self { "ProjectSetupModule" } + static var swiftInterfaceProducerModule: Self { "SwiftInterfaceProducerModule" } + static var swiftPackageFileHelperModule: Self { "SwiftPackageFileHelperModule" } + static var swiftPackageFileAnalyzerModule: Self { "SwiftPackageFileAnalyzerModule" } + +} + +extension Target.Dependency { + static var core: Self { .byName(name: .core) } + static var fileHandling: Self { .byName(name: .fileHandling) } + static var shell: Self { .byName(name: .shell) } + static var git: Self { .byName(name: .git) } + static var logging: Self { .byName(name: .logging) } + static var outputGenerator: Self { .byName(name: .outputGenerator) } + static var swiftInterfaceAnalyzerModule: Self { .byName(name: .swiftInterfaceAnalyzerModule) } + static var projectSetupModule: Self { .byName(name: .projectSetupModule) } + static var swiftInterfaceProducerModule: Self { .byName(name: .swiftInterfaceProducerModule) } + static var swiftPackageFileHelperModule: Self { .byName(name: .swiftPackageFileHelperModule) } + static var swiftPackageFileAnalyzerModule: Self { .byName(name: .swiftPackageFileAnalyzerModule) } +} + let package = Package( name: "public-api-diff", platforms: [ .macOS(.v13) ], + products: [ + .executable( + name: "public-api-diff", + targets: ["public-api-diff"] + ), + .library( + name: "SwiftInterfaceDiff", + targets: [.swiftInterfaceAnalyzerModule] + ) + ], dependencies: [ .package(url: "https://github.com/apple/swift-argument-parser", from: "1.5.0"), .package(url: "https://github.com/swiftlang/swift-syntax", from: "600.0.0"), .package(url: "https://github.com/nicklockwood/SwiftFormat", from: "0.54.6") ], targets: [ - // Targets are the basic building blocks of a package, defining a module or a test suite. - // Targets can depend on other targets in this package and products from dependencies. .executableTarget( name: "public-api-diff", dependencies: [ - .product(name: "ArgumentParser", package: "swift-argument-parser"), - .product(name: "SwiftSyntax", package: "swift-syntax"), - .product(name: "SwiftParser", package: "swift-syntax"), + .core, + .logging, + .shell, + .git, + .outputGenerator, + .fileHandling, + .projectSetupModule, + .swiftInterfaceProducerModule, + .swiftInterfaceAnalyzerModule, + .swiftPackageFileHelperModule, + .swiftPackageFileAnalyzerModule, + "ProjectBuilderModule", + .product(name: "ArgumentParser", package: "swift-argument-parser") ], - path: "Sources" + path: "Sources/CommandLineTool" ), + + // MARK: - Modules + + .target(name: .core), + .target(name: .shell, dependencies: [ + .core + ]), + .target(name: .logging, dependencies: [ + .core, + .fileHandling + ]), + .target(name: .git, dependencies: [ + .core, + .shell, + .fileHandling, + .logging + ]), + .target(name: .outputGenerator, dependencies: [ + .core + ]), + .target(name: .fileHandling, dependencies: [ + .core + ]), + .target(name: .swiftInterfaceAnalyzerModule, dependencies: [ + .core, + .product(name: "SwiftSyntax", package: "swift-syntax"), + .product(name: "SwiftParser", package: "swift-syntax"), + ]), + .target(name: .swiftInterfaceProducerModule, dependencies: [ + .core, + .fileHandling, + .logging, + .swiftPackageFileHelperModule + ]), + .target(name: .projectSetupModule, dependencies: [ + .shell, + .fileHandling, + .logging, + .git + ]), + .target(name: .swiftPackageFileHelperModule, dependencies: [ + .core, + .fileHandling, + .logging + ]), + .target(name: .swiftPackageFileAnalyzerModule, dependencies: [ + .core, + .fileHandling, + .shell, + .logging, + .swiftPackageFileHelperModule + ]), + .target(name: "ProjectBuilderModule", dependencies: [ + .swiftPackageFileAnalyzerModule, + .swiftPackageFileHelperModule, + .fileHandling, + .logging + ]), + + // MARK: - Test Targets + .testTarget( name: "UnitTests", dependencies: [ diff --git a/Sources/public-api-diff.swift b/Sources/CommandLineTool/public-api-diff.swift similarity index 61% rename from Sources/public-api-diff.swift rename to Sources/CommandLineTool/public-api-diff.swift index 59b22b0..1961c7c 100644 --- a/Sources/public-api-diff.swift +++ b/Sources/CommandLineTool/public-api-diff.swift @@ -7,6 +7,16 @@ import ArgumentParser import Foundation +import LoggingModule +import FileHandlingModule +import CoreModule +import ProjectSetupModule +import ShellModule +import SwiftInterfaceProducerModule +import SwiftInterfaceAnalyzerModule +import OutputGeneratorModule +import ProjectBuilderModule + @main struct PublicApiDiff: AsyncParsableCommand { @@ -42,80 +52,36 @@ struct PublicApiDiff: AsyncParsableCommand { var warnings = [String]() var changes = [String: [Change]]() - // MARK: START: BUILD PROJECT RELATED - let oldSource: ProjectSource = try ProjectSource.from(old, fileHandler: fileHandler) let newSource: ProjectSource = try ProjectSource.from(new, fileHandler: fileHandler) let oldVersionName = oldSource.description - let newVersionName = oldSource.description - - logger.log("Comparing `\(newVersionName)` to `\(oldVersionName)`", from: "Main") + let newVersionName = newSource.description - let currentDirectory = fileHandler.currentDirectoryPath - let workingDirectoryPath = currentDirectory.appending("/tmp-public-api-diff") + // MARK: - Producing .swiftinterface files - // MARK: - Setup projects - - let projectSetupHelper = ProjectSetupHelper( - workingDirectoryPath: workingDirectoryPath, - shell: shell, - fileHandler: fileHandler, + let projectBuilder = ProjectBuilder( + projectType: projectType, + swiftInterfaceType: swiftInterfaceType, logger: logger ) - let projectDirectories = try await projectSetupHelper.setupProjects( + let projectBuilderResult = try await projectBuilder.build( oldSource: oldSource, - newSource: newSource, - projectType: projectType + newSource: newSource ) - // MARK: - Analyze Package.swift (optional) - - switch projectType { - case .swiftPackage: - let swiftPackageFileAnalyzer = SwiftPackageFileAnalyzer(fileHandler: fileHandler, shell: shell, logger: logger) - let swiftPackageAnalysis = try swiftPackageFileAnalyzer.analyze( - oldProjectUrl: projectDirectories.old, - newProjectUrl: projectDirectories.new - ) - - warnings = swiftPackageAnalysis.warnings - if !swiftPackageAnalysis.changes.isEmpty { - changes["Package.swift"] = swiftPackageAnalysis.changes - } - case .xcodeProject: - warnings = [] - break // Nothing to do + warnings += projectBuilderResult.warnings + if !projectBuilderResult.packageFileChanges.isEmpty { + changes["Package.swift"] = projectBuilderResult.packageFileChanges } - // MARK: - Produce .swiftinterface files - - let producer = SwiftInterfaceProducer( - workingDirectoryPath: workingDirectoryPath, - projectType: projectType, - swiftInterfaceType: swiftInterfaceType, - fileHandler: fileHandler, - shell: shell, - logger: logger - ) - - let swiftInterfaceFiles = try await producer.produceInterfaceFiles( - oldProjectDirectory: projectDirectories.old, - newProjectDirectory: projectDirectories.new - ) - // MARK: - Analyze .swiftinterface files - let pipeline = SwiftInterfacePipeline( - fileHandler: fileHandler, - swiftInterfaceParser: SwiftInterfaceParser(), - swiftInterfaceAnalyzer: SwiftInterfaceAnalyzer(), - logger: logger - ) + let pipeline = SwiftInterfacePipeline(logger: logger) let pipelineOutput = try await pipeline.run( - with: swiftInterfaceFiles + with: projectBuilderResult.swiftInterfaceFiles ) // Merging pipeline output into existing changes - making sure we're not overriding any keys @@ -133,7 +99,7 @@ struct PublicApiDiff: AsyncParsableCommand { let generatedOutput = try outputGenerator.generate( from: changes, - allTargets: swiftInterfaceFiles.map(\.name).sorted(), + allTargets: projectBuilderResult.swiftInterfaceFiles.map(\.name).sorted(), oldVersionName: oldVersionName, newVersionName: newVersionName, warnings: warnings diff --git a/Sources/Helpers/Models/Change.swift b/Sources/CoreModule/Change.swift similarity index 66% rename from Sources/Helpers/Models/Change.swift rename to Sources/CoreModule/Change.swift index cd0807c..bf09763 100644 --- a/Sources/Helpers/Models/Change.swift +++ b/Sources/CoreModule/Change.swift @@ -7,22 +7,32 @@ import Foundation /// A change indicating an `addition`, `removal` or genuine `change` of an element -struct Change: Equatable { - enum ChangeType: Equatable { +public struct Change: Equatable { + public enum ChangeType: Equatable { case addition(description: String) case removal(description: String) case change(oldDescription: String, newDescription: String) } - var changeType: ChangeType - var parentPath: String? + public private(set) var changeType: ChangeType + public private(set) var parentPath: String? - var listOfChanges: [String] = [] + public private(set) var listOfChanges: [String] = [] + + public init( + changeType: ChangeType, + parentPath: String? = nil, + listOfChanges: [String] = [] + ) { + self.changeType = changeType + self.parentPath = parentPath + self.listOfChanges = listOfChanges + } } extension Change.ChangeType { - var isAddition: Bool { + public var isAddition: Bool { switch self { case .addition: return true @@ -33,7 +43,7 @@ extension Change.ChangeType { } } - var isRemoval: Bool { + public var isRemoval: Bool { switch self { case .addition: return false @@ -44,7 +54,7 @@ extension Change.ChangeType { } } - var isChange: Bool { + public var isChange: Bool { switch self { case .addition: return false @@ -56,7 +66,7 @@ extension Change.ChangeType { } } -extension [String: [Change]] { +public extension [String: [Change]] { var totalChangeCount: Int { var totalChangeCount = 0 diff --git a/Sources/CoreModule/ProjectType.swift b/Sources/CoreModule/ProjectType.swift new file mode 100644 index 0000000..e79dcd7 --- /dev/null +++ b/Sources/CoreModule/ProjectType.swift @@ -0,0 +1,6 @@ +import Foundation + +public enum ProjectType { + case swiftPackage + case xcodeProject(scheme: String) +} diff --git a/Sources/Helpers/RandomStringGenerating.swift b/Sources/CoreModule/RandomStringGenerating.swift similarity index 58% rename from Sources/Helpers/RandomStringGenerating.swift rename to Sources/CoreModule/RandomStringGenerating.swift index 6123b18..a52e4d0 100644 --- a/Sources/Helpers/RandomStringGenerating.swift +++ b/Sources/CoreModule/RandomStringGenerating.swift @@ -6,14 +6,16 @@ import Foundation -protocol RandomStringGenerating { +public protocol RandomStringGenerating { func generateRandomString() -> String } -struct RandomStringGenerator: RandomStringGenerating { +public struct RandomStringGenerator: RandomStringGenerating { - func generateRandomString() -> String { + public init() {} + + public func generateRandomString() -> String { UUID().uuidString } } diff --git a/Sources/CoreModule/SwiftInterfaceFile.swift b/Sources/CoreModule/SwiftInterfaceFile.swift new file mode 100644 index 0000000..8d88ee0 --- /dev/null +++ b/Sources/CoreModule/SwiftInterfaceFile.swift @@ -0,0 +1,13 @@ +import Foundation + +public struct SwiftInterfaceFile { + public let name: String + public let oldFilePath: String + public let newFilePath: String + + public init(name: String, oldFilePath: String, newFilePath: String) { + self.name = name + self.oldFilePath = oldFilePath + self.newFilePath = newFilePath + } +} diff --git a/Sources/Helpers/FileHandling/FileHandling+Convenience.swift b/Sources/FileHandlingModule/FileHandling+Convenience.swift similarity index 94% rename from Sources/Helpers/FileHandling/FileHandling+Convenience.swift rename to Sources/FileHandlingModule/FileHandling+Convenience.swift index d23200f..7c7f691 100644 --- a/Sources/Helpers/FileHandling/FileHandling+Convenience.swift +++ b/Sources/FileHandlingModule/FileHandling+Convenience.swift @@ -5,8 +5,9 @@ // import Foundation +import CoreModule -enum FileHandlerError: LocalizedError, Equatable { +public enum FileHandlerError: LocalizedError, Equatable { /// Could not encode the output string into data case couldNotEncodeOutput /// Could not persist output at the specified `outputFilePath` @@ -16,7 +17,7 @@ enum FileHandlerError: LocalizedError, Equatable { /// File/Directory does not exist at `path` case pathDoesNotExist(path: String) - var errorDescription: String? { + public var errorDescription: String? { switch self { case .couldNotEncodeOutput: "Could not encode the output string into data" @@ -32,7 +33,7 @@ enum FileHandlerError: LocalizedError, Equatable { // MARK: - Convenience -extension FileHandling { +public extension FileHandling { /// Creates a directory at the specified path and deletes any old directory if existing /// diff --git a/Sources/Helpers/FileHandling/FileHandling.swift b/Sources/FileHandlingModule/FileHandling.swift similarity index 72% rename from Sources/Helpers/FileHandling/FileHandling.swift rename to Sources/FileHandlingModule/FileHandling.swift index 720f0f7..23c3de7 100644 --- a/Sources/Helpers/FileHandling/FileHandling.swift +++ b/Sources/FileHandlingModule/FileHandling.swift @@ -1,12 +1,6 @@ -// -// Copyright (c) 2024 Adyen N.V. -// -// This file is open source and available under the MIT license. See the LICENSE file for more info. -// - import Foundation -protocol FileHandling { +public protocol FileHandling { var currentDirectoryPath: String { get } diff --git a/Sources/Helpers/FileHandling/FileManager+FileHandling.swift b/Sources/FileHandlingModule/FileManager+FileHandling.swift similarity index 75% rename from Sources/Helpers/FileHandling/FileManager+FileHandling.swift rename to Sources/FileHandlingModule/FileManager+FileHandling.swift index 1823519..27a0d22 100644 --- a/Sources/Helpers/FileHandling/FileManager+FileHandling.swift +++ b/Sources/FileHandlingModule/FileManager+FileHandling.swift @@ -5,20 +5,21 @@ // import Foundation +import CoreModule extension FileManager: FileHandling { /// Creates a directory at the specified path - func createDirectory(atPath path: String) throws { + public func createDirectory(atPath path: String) throws { try createDirectory(atPath: path, withIntermediateDirectories: true) } /// Creates a file at the specified path with the provided content - func createFile(atPath path: String, contents data: Data) -> Bool { + public func createFile(atPath path: String, contents data: Data) -> Bool { createFile(atPath: path, contents: data, attributes: nil) } - func loadData(from filePath: String) throws -> Data { + public func loadData(from filePath: String) throws -> Data { guard let data = self.contents(atPath: filePath) else { throw FileHandlerError.couldNotLoadFile(filePath: filePath) } diff --git a/Sources/Helpers/Git.swift b/Sources/GitModule/Git.swift similarity index 84% rename from Sources/Helpers/Git.swift rename to Sources/GitModule/Git.swift index 904da49..c7897d5 100644 --- a/Sources/Helpers/Git.swift +++ b/Sources/GitModule/Git.swift @@ -1,11 +1,10 @@ -// -// Copyright (c) 2024 Adyen N.V. -// -// This file is open source and available under the MIT license. See the LICENSE file for more info. -// - import Foundation +import CoreModule +import ShellModule +import FileHandlingModule +import LoggingModule + enum GitError: LocalizedError, Equatable { case couldNotClone(branchOrTag: String, repository: String) @@ -17,13 +16,13 @@ enum GitError: LocalizedError, Equatable { } } -struct Git { +public struct Git { private let shell: ShellHandling private let fileHandler: FileHandling private let logger: Logging? - init( + public init( shell: ShellHandling, fileHandler: FileHandling, logger: Logging? @@ -41,7 +40,7 @@ struct Git { /// - targetDirectoryPath: The directory to clone into /// /// - Returns: The local directory path where to find the cloned repository - func clone(_ repository: String, at branchOrTag: String, targetDirectoryPath: String) throws { + public func clone(_ repository: String, at branchOrTag: String, targetDirectoryPath: String) throws { logger?.log("🐱 Cloning \(repository) @ \(branchOrTag) into \(targetDirectoryPath)", from: String(describing: Self.self)) let command = "git clone -b \(branchOrTag) \(repository) \(targetDirectoryPath)" shell.execute(command) diff --git a/Sources/Helpers/Models/Constants.swift b/Sources/Helpers/Models/Constants.swift deleted file mode 100644 index cf7554d..0000000 --- a/Sources/Helpers/Models/Constants.swift +++ /dev/null @@ -1,12 +0,0 @@ -// -// Copyright (c) 2024 Adyen N.V. -// -// This file is open source and available under the MIT license. See the LICENSE file for more info. -// - -import Foundation - -enum Constants { - static let unknownType = "UNKNOWN_TYPE" - static let defaultArg = "$DEFAULT_ARG" -} diff --git a/Sources/Helpers/Logging/LogFileLogger.swift b/Sources/LoggingModule/LogFileLogger.swift similarity index 67% rename from Sources/Helpers/Logging/LogFileLogger.swift rename to Sources/LoggingModule/LogFileLogger.swift index 00dffa2..0588db3 100644 --- a/Sources/Helpers/Logging/LogFileLogger.swift +++ b/Sources/LoggingModule/LogFileLogger.swift @@ -1,6 +1,8 @@ import Foundation +import CoreModule +import FileHandlingModule -class LogFileLogger: Logging { +public class LogFileLogger: Logging { private let fileHandler: any FileHandling private let outputFilePath: String @@ -12,18 +14,18 @@ class LogFileLogger: Logging { } } - init(fileHandler: any FileHandling, outputFilePath: String) { + public init(fileHandler: any FileHandling, outputFilePath: String) { self.fileHandler = fileHandler self.outputFilePath = outputFilePath } - func log(_ message: String, from subsystem: String) { + public func log(_ message: String, from subsystem: String) { Task { @MainActor in output += ["🪵 [\(subsystem)] \(message)\n"] } } - func debug(_ message: String, from subsystem: String) { + public func debug(_ message: String, from subsystem: String) { Task { @MainActor in output += ["🐞 [\(subsystem)] \(message)\n"] } diff --git a/Sources/Helpers/Logging/LogLevelLogger.swift b/Sources/LoggingModule/LogLevelLogger.swift similarity index 79% rename from Sources/Helpers/Logging/LogLevelLogger.swift rename to Sources/LoggingModule/LogLevelLogger.swift index 1e64b7c..15bcbfd 100644 --- a/Sources/Helpers/Logging/LogLevelLogger.swift +++ b/Sources/LoggingModule/LogLevelLogger.swift @@ -1,7 +1,8 @@ import Foundation import OSLog +import CoreModule -enum LogLevel { +public enum LogLevel { /// No logs case quiet /// All logs except `debug` @@ -35,7 +36,7 @@ enum LogLevel { // MARK: - LogLevelLogger /// Logger that respects a ``LogLevel`` -struct LogLevelLogger: Logging { +public struct LogLevelLogger: Logging { private let logLevel: LogLevel internal let wrappedLogger: LoggerType @@ -45,12 +46,12 @@ struct LogLevelLogger: Logging { self.logLevel = logLevel } - func log(_ message: String, from subsystem: String) { + public func log(_ message: String, from subsystem: String) { guard logLevel.shouldLog else { return } wrappedLogger.log("\(message)", from: subsystem) } - func debug(_ message: String, from subsystem: String) { + public func debug(_ message: String, from subsystem: String) { guard logLevel.shouldDebugLog else { return } wrappedLogger.debug("\(message)", from: subsystem) } @@ -59,7 +60,7 @@ struct LogLevelLogger: Logging { // MARK: - Logging Extension extension Logging { - func withLogLevel(_ logLevel: LogLevel) -> LogLevelLogger { + public func withLogLevel(_ logLevel: LogLevel) -> LogLevelLogger { .init(with: self, logLevel: logLevel) } } diff --git a/Sources/LoggingModule/Logging.swift b/Sources/LoggingModule/Logging.swift new file mode 100644 index 0000000..1ea2af8 --- /dev/null +++ b/Sources/LoggingModule/Logging.swift @@ -0,0 +1,7 @@ +import Foundation + +public protocol Logging { + + func log(_ message: String, from subsystem: String) + func debug(_ message: String, from subsystem: String) +} diff --git a/Sources/Helpers/Logging/LoggingGroup.swift b/Sources/LoggingModule/LoggingGroup.swift similarity index 50% rename from Sources/Helpers/Logging/LoggingGroup.swift rename to Sources/LoggingModule/LoggingGroup.swift index 49e3176..56150e6 100644 --- a/Sources/Helpers/Logging/LoggingGroup.swift +++ b/Sources/LoggingModule/LoggingGroup.swift @@ -1,18 +1,19 @@ import Foundation +import CoreModule -struct LoggingGroup: Logging { +public struct LoggingGroup: Logging { let logger: [any Logging] - init(with logger: [any Logging]) { + public init(with logger: [any Logging]) { self.logger = logger } - func log(_ message: String, from subsystem: String) { + public func log(_ message: String, from subsystem: String) { logger.forEach { $0.log(message, from: subsystem) } } - func debug(_ message: String, from subsystem: String) { + public func debug(_ message: String, from subsystem: String) { logger.forEach { $0.debug(message, from: subsystem) } } } diff --git a/Sources/Helpers/Logging/SystemLogger.swift b/Sources/LoggingModule/SystemLogger.swift similarity index 65% rename from Sources/Helpers/Logging/SystemLogger.swift rename to Sources/LoggingModule/SystemLogger.swift index d7de7cc..794be1c 100644 --- a/Sources/Helpers/Logging/SystemLogger.swift +++ b/Sources/LoggingModule/SystemLogger.swift @@ -1,13 +1,16 @@ import Foundation import OSLog +import CoreModule -struct SystemLogger: Logging { +public struct SystemLogger: Logging { - func log(_ message: String, from subsystem: String) { + public init() {} + + public func log(_ message: String, from subsystem: String) { logger(for: subsystem).log("\(message)") } - func debug(_ message: String, from subsystem: String) { + public func debug(_ message: String, from subsystem: String) { logger(for: subsystem).debug("\(message)") } } diff --git a/Sources/Pipeline/Modules/MarkdownOutputGenerator.swift b/Sources/OutputGeneratorModule/MarkdownOutputGenerator.swift similarity index 97% rename from Sources/Pipeline/Modules/MarkdownOutputGenerator.swift rename to Sources/OutputGeneratorModule/MarkdownOutputGenerator.swift index eef0a40..d579792 100644 --- a/Sources/Pipeline/Modules/MarkdownOutputGenerator.swift +++ b/Sources/OutputGeneratorModule/MarkdownOutputGenerator.swift @@ -5,12 +5,15 @@ // import Foundation +import CoreModule /// Allows generation of human readable output from the provided information -struct MarkdownOutputGenerator: OutputGenerating { +public struct MarkdownOutputGenerator: OutputGenerating { + + public init() {} /// Generates human readable output from the provided information - func generate( + public func generate( from changesPerTarget: [String: [Change]], allTargets: [String], oldVersionName: String, diff --git a/Sources/OutputGeneratorModule/OutputGenerating.swift b/Sources/OutputGeneratorModule/OutputGenerating.swift new file mode 100644 index 0000000..1e9e441 --- /dev/null +++ b/Sources/OutputGeneratorModule/OutputGenerating.swift @@ -0,0 +1,18 @@ +// +// Copyright (c) 2024 Adyen N.V. +// +// This file is open source and available under the MIT license. See the LICENSE file for more info. +// + +import Foundation +import CoreModule + +public protocol OutputGenerating { + func generate( + from changesPerTarget: [String: [Change]], + allTargets: [String], + oldVersionName: String, + newVersionName: String, + warnings: [String] + ) throws -> String +} diff --git a/Sources/Pipeline/Pipeline+Protocols.swift b/Sources/Pipeline/Pipeline+Protocols.swift deleted file mode 100644 index fdd7806..0000000 --- a/Sources/Pipeline/Pipeline+Protocols.swift +++ /dev/null @@ -1,62 +0,0 @@ -// -// Copyright (c) 2024 Adyen N.V. -// -// This file is open source and available under the MIT license. See the LICENSE file for more info. -// - -import Foundation - -enum ProjectType { - case swiftPackage - case xcodeProject(scheme: String) -} - -protocol ProjectSetupHelping { - func setup(_ projectSource: ProjectSource, projectType: ProjectType) async throws -> URL -} - -struct ABIGeneratorOutput: Equatable { - let targetName: String - let abiJsonFileUrl: URL -} - -protocol ABIGenerating { - func generate(for projectDirectory: URL, scheme: String?, description: String) throws -> [ABIGeneratorOutput] -} - -protocol SwiftInterfaceParsing { - func parse(source: String, moduleName: String) -> any SwiftInterfaceElement -} - -protocol SwiftInterfaceAnalyzing { - func analyze(old: some SwiftInterfaceElement, new: some SwiftInterfaceElement) throws -> [Change] -} - -protocol OutputGenerating { - func generate( - from changesPerTarget: [String: [Change]], - allTargets: [String], - oldVersionName: String, - newVersionName: String, - warnings: [String] - ) throws -> String -} - -struct ProjectAnalyzerResult { - let changes: [Change] - let warnings: [String] -} - -protocol ProjectAnalyzing { - /// Analyzes whether or not the available libraries changed between the old and new version - func analyze( - oldProjectUrl: URL, - newProjectUrl: URL - ) throws -> ProjectAnalyzerResult -} - -protocol Logging { - - func log(_ message: String, from subsystem: String) - func debug(_ message: String, from subsystem: String) -} diff --git a/Sources/ProjectBuilderModule/ProjectBuilder.swift b/Sources/ProjectBuilderModule/ProjectBuilder.swift new file mode 100644 index 0000000..e4fc0fc --- /dev/null +++ b/Sources/ProjectBuilderModule/ProjectBuilder.swift @@ -0,0 +1,121 @@ +// +// File.swift +// +// +// Created by Alexander Guretzki on 10/10/2024. +// + +import Foundation + +import FileHandlingModule +import ProjectSetupModule +import LoggingModule +import CoreModule +import ShellModule +import SwiftPackageFileAnalyzerModule +import SwiftInterfaceProducerModule + +public struct ProjectBuilder { + + public struct Result { + public let packageFileChanges: [Change] + public let warnings: [String] + public let swiftInterfaceFiles: [SwiftInterfaceFile] + } + + private let projectType: ProjectType + private let swiftInterfaceType: SwiftInterfaceType + private let fileHandler: any FileHandling + private let shell: any ShellHandling + private let logger: (any Logging)? + + public init( + projectType: ProjectType, + swiftInterfaceType: SwiftInterfaceType, + fileHandler: any FileHandling = FileManager.default, + shell: any ShellHandling = Shell(), + logger: (any Logging)? + ) { + self.projectType = projectType + self.swiftInterfaceType = swiftInterfaceType + self.fileHandler = fileHandler + self.shell = shell + self.logger = logger + } + + public func build( + oldSource: ProjectSource, + newSource: ProjectSource + ) async throws -> Result { + + let oldVersionName = oldSource.description + let newVersionName = newSource.description + + logger?.log("Comparing `\(newVersionName)` to `\(oldVersionName)`", from: "Main") + + let currentDirectory = fileHandler.currentDirectoryPath + let workingDirectoryPath = currentDirectory.appending("/tmp-public-api-diff") + + // MARK: - Setup projects + + let projectSetupHelper = ProjectSetupHelper( + workingDirectoryPath: workingDirectoryPath, + shell: shell, + fileHandler: fileHandler, + logger: logger + ) + + let projectDirectories = try await projectSetupHelper.setupProjects( + oldSource: oldSource, + newSource: newSource, + projectType: projectType + ) + + // MARK: - Analyze Package.swift (optional) + + let warnings: [String] + let packageFileChanges: [Change] + + switch projectType { + case .swiftPackage: + let swiftPackageFileAnalyzer = SwiftPackageFileAnalyzer( + fileHandler: fileHandler, + shell: shell, + logger: logger + ) + let swiftPackageAnalysis = try swiftPackageFileAnalyzer.analyze( + oldProjectUrl: projectDirectories.old, + newProjectUrl: projectDirectories.new + ) + + warnings = swiftPackageAnalysis.warnings + packageFileChanges = swiftPackageAnalysis.changes + case .xcodeProject: + warnings = [] + packageFileChanges = [] + break // Nothing to do + } + + // MARK: - Produce .swiftinterface files + + let producer = SwiftInterfaceProducer( + workingDirectoryPath: workingDirectoryPath, + projectType: projectType, + swiftInterfaceType: swiftInterfaceType, + fileHandler: fileHandler, + shell: shell, + logger: logger + ) + + let swiftInterfaceFiles = try await producer.produceInterfaceFiles( + oldProjectDirectory: projectDirectories.old, + newProjectDirectory: projectDirectories.new + ) + + return .init( + packageFileChanges: packageFileChanges, + warnings: warnings, + swiftInterfaceFiles: swiftInterfaceFiles + ) + } +} diff --git a/Sources/Pipeline/Modules/ProjectSetupHelper.swift b/Sources/ProjectSetupModule/ProjectSetupHelper.swift similarity index 90% rename from Sources/Pipeline/Modules/ProjectSetupHelper.swift rename to Sources/ProjectSetupModule/ProjectSetupHelper.swift index 5bc75a4..2188e92 100644 --- a/Sources/Pipeline/Modules/ProjectSetupHelper.swift +++ b/Sources/ProjectSetupModule/ProjectSetupHelper.swift @@ -1,6 +1,12 @@ import Foundation -struct ProjectSetupHelper: ProjectSetupHelping { +import CoreModule +import ShellModule +import FileHandlingModule +import LoggingModule +import GitModule + +public struct ProjectSetupHelper: ProjectSetupHelping { let workingDirectoryPath: String let shell: any ShellHandling @@ -8,7 +14,7 @@ struct ProjectSetupHelper: ProjectSetupHelping { let fileHandler: any FileHandling let logger: (any Logging)? - init( + public init( workingDirectoryPath: String, randomStringGenerator: any RandomStringGenerating = RandomStringGenerator(), shell: any ShellHandling = Shell(), @@ -22,7 +28,7 @@ struct ProjectSetupHelper: ProjectSetupHelping { self.logger = logger } - func setup( + public func setup( _ projectSource: ProjectSource, projectType: ProjectType ) async throws -> URL { @@ -52,12 +58,12 @@ struct ProjectSetupHelper: ProjectSetupHelping { extension ProjectSetupHelper { - struct ProjectDirectories { - let old: URL - let new: URL + public struct ProjectDirectories { + public let old: URL + public let new: URL } - func setupProjects( + public func setupProjects( oldSource: ProjectSource, newSource: ProjectSource, projectType: ProjectType diff --git a/Sources/ProjectSetupModule/ProjectSetupHelping.swift b/Sources/ProjectSetupModule/ProjectSetupHelping.swift new file mode 100644 index 0000000..8b0ff1e --- /dev/null +++ b/Sources/ProjectSetupModule/ProjectSetupHelping.swift @@ -0,0 +1,6 @@ +import Foundation +import CoreModule + +public protocol ProjectSetupHelping { + func setup(_ projectSource: ProjectSource, projectType: ProjectType) async throws -> URL +} diff --git a/Sources/Helpers/ProjectSource.swift b/Sources/ProjectSetupModule/ProjectSource.swift similarity index 87% rename from Sources/Helpers/ProjectSource.swift rename to Sources/ProjectSetupModule/ProjectSource.swift index f09c029..7b0e7db 100644 --- a/Sources/Helpers/ProjectSource.swift +++ b/Sources/ProjectSetupModule/ProjectSource.swift @@ -5,6 +5,7 @@ // import Foundation +import FileHandlingModule enum ProjectSourceError: LocalizedError, Equatable { case invalidSourceValue(value: String) @@ -17,7 +18,7 @@ enum ProjectSourceError: LocalizedError, Equatable { } } -enum ProjectSource: Equatable { +public enum ProjectSource: Equatable { /// The separator used to join branch & repository static var gitSourceSeparator: String { "~" } @@ -25,7 +26,7 @@ enum ProjectSource: Equatable { case local(path: String) case remote(branch: String, repository: String) - static func from(_ rawValue: String, fileHandler: FileHandling) throws -> ProjectSource { + public static func from(_ rawValue: String, fileHandler: FileHandling) throws -> ProjectSource { if fileHandler.fileExists(atPath: rawValue) { return .local(path: rawValue) } @@ -38,7 +39,7 @@ enum ProjectSource: Equatable { throw ProjectSourceError.invalidSourceValue(value: rawValue) } - var description: String { + public var description: String { switch self { case let .local(path): return path diff --git a/Sources/Helpers/Shell.swift b/Sources/ShellModule/Shell.swift similarity index 82% rename from Sources/Helpers/Shell.swift rename to Sources/ShellModule/Shell.swift index 5cd3c89..2aa3674 100644 --- a/Sources/Helpers/Shell.swift +++ b/Sources/ShellModule/Shell.swift @@ -6,16 +6,18 @@ import Foundation -protocol ShellHandling { +public protocol ShellHandling { @discardableResult func execute(_ command: String) -> String } -struct Shell: ShellHandling { +public struct Shell: ShellHandling { + + public init() {} @discardableResult - func execute(_ command: String) -> String { + public func execute(_ command: String) -> String { let task = Process() let pipe = Pipe() diff --git a/Sources/Helpers/Models/SwiftInterface/IndependentSwiftInterfaceChange.swift b/Sources/SwiftInterfaceAnalyzerModule/SwiftInterfaceAnalyzer/IndependentSwiftInterfaceChange.swift similarity index 85% rename from Sources/Helpers/Models/SwiftInterface/IndependentSwiftInterfaceChange.swift rename to Sources/SwiftInterfaceAnalyzerModule/SwiftInterfaceAnalyzer/IndependentSwiftInterfaceChange.swift index bc0081e..0c84b7a 100644 --- a/Sources/Helpers/Models/SwiftInterface/IndependentSwiftInterfaceChange.swift +++ b/Sources/SwiftInterfaceAnalyzerModule/SwiftInterfaceAnalyzer/IndependentSwiftInterfaceChange.swift @@ -1,10 +1,11 @@ import Foundation +import CoreModule /// A change indicating an `addition` or `removal` of an element /// /// This intermediate structure helps gathering a list of additions and removals /// that are later consolidated to a ``Change`` -struct IndependentSwiftInterfaceChange: Equatable { +public struct IndependentSwiftInterfaceChange: Equatable { enum ChangeType: Equatable { case addition(_ description: String) @@ -24,7 +25,7 @@ struct IndependentSwiftInterfaceChange: Equatable { let oldFirst: Bool var parentPath: String? { element.parentPath } - static func == (lhs: IndependentSwiftInterfaceChange, rhs: IndependentSwiftInterfaceChange) -> Bool { + public static func == (lhs: IndependentSwiftInterfaceChange, rhs: IndependentSwiftInterfaceChange) -> Bool { lhs.changeType == rhs.changeType && lhs.element.description == rhs.element.description && lhs.oldFirst == rhs.oldFirst && diff --git a/Sources/Pipeline/Modules/SwiftInterfaceAnalyzer/SwiftInterfaceAnalyzer.swift b/Sources/SwiftInterfaceAnalyzerModule/SwiftInterfaceAnalyzer/SwiftInterfaceAnalyzer.swift similarity index 97% rename from Sources/Pipeline/Modules/SwiftInterfaceAnalyzer/SwiftInterfaceAnalyzer.swift rename to Sources/SwiftInterfaceAnalyzerModule/SwiftInterfaceAnalyzer/SwiftInterfaceAnalyzer.swift index 4c8c9bc..8d59232 100644 --- a/Sources/Pipeline/Modules/SwiftInterfaceAnalyzer/SwiftInterfaceAnalyzer.swift +++ b/Sources/SwiftInterfaceAnalyzerModule/SwiftInterfaceAnalyzer/SwiftInterfaceAnalyzer.swift @@ -5,18 +5,19 @@ // import Foundation +import CoreModule -struct SwiftInterfaceAnalyzer: SwiftInterfaceAnalyzing { +public struct SwiftInterfaceAnalyzer: SwiftInterfaceAnalyzing { let changeConsolidator: SwiftInterfaceChangeConsolidating - init( + public init( changeConsolidator: SwiftInterfaceChangeConsolidating = SwiftInterfaceChangeConsolidator() ) { self.changeConsolidator = changeConsolidator } - func analyze( + public func analyze( old: some SwiftInterfaceElement, new: some SwiftInterfaceElement ) -> [Change] { diff --git a/Sources/SwiftInterfaceAnalyzerModule/SwiftInterfaceAnalyzer/SwiftInterfaceAnalyzing.swift b/Sources/SwiftInterfaceAnalyzerModule/SwiftInterfaceAnalyzer/SwiftInterfaceAnalyzing.swift new file mode 100644 index 0000000..4239736 --- /dev/null +++ b/Sources/SwiftInterfaceAnalyzerModule/SwiftInterfaceAnalyzer/SwiftInterfaceAnalyzing.swift @@ -0,0 +1,6 @@ +import Foundation +import CoreModule + +public protocol SwiftInterfaceAnalyzing { + func analyze(old: some SwiftInterfaceElement, new: some SwiftInterfaceElement) throws -> [Change] +} diff --git a/Sources/Pipeline/Modules/SwiftInterfaceAnalyzer/SwiftInterfaceChangeConsolidator.swift b/Sources/SwiftInterfaceAnalyzerModule/SwiftInterfaceAnalyzer/SwiftInterfaceChangeConsolidator.swift similarity index 95% rename from Sources/Pipeline/Modules/SwiftInterfaceAnalyzer/SwiftInterfaceChangeConsolidator.swift rename to Sources/SwiftInterfaceAnalyzerModule/SwiftInterfaceAnalyzer/SwiftInterfaceChangeConsolidator.swift index b83d1e2..7100ea1 100644 --- a/Sources/Pipeline/Modules/SwiftInterfaceAnalyzer/SwiftInterfaceChangeConsolidator.swift +++ b/Sources/SwiftInterfaceAnalyzerModule/SwiftInterfaceAnalyzer/SwiftInterfaceChangeConsolidator.swift @@ -5,9 +5,10 @@ // import Foundation +import CoreModule /// A helper to consolidate a `removal` and `addition` to `change` -protocol SwiftInterfaceChangeConsolidating { +public protocol SwiftInterfaceChangeConsolidating { /// Tries to match a `removal` and `addition` to a `change` /// @@ -16,8 +17,10 @@ protocol SwiftInterfaceChangeConsolidating { func consolidate(_ changes: [IndependentSwiftInterfaceChange]) -> [Change] } -struct SwiftInterfaceChangeConsolidator: SwiftInterfaceChangeConsolidating { +public struct SwiftInterfaceChangeConsolidator: SwiftInterfaceChangeConsolidating { + public init() {} + /// Tries to match a `removal` and `addition` to a `change` /// /// - Parameters: @@ -31,7 +34,7 @@ struct SwiftInterfaceChangeConsolidator: SwiftInterfaceChangeConsolidating { /// e.g. a second `addition` `init(unrelated: String)` might be matched as a change of `init(foo: Int, bar: Int)` /// as they share the same comparison features but might not be an actual change but a genuine addition. /// This is acceptable for now but might be improved in the future (e.g. calculating a matching-percentage) - func consolidate(_ changes: [IndependentSwiftInterfaceChange]) -> [Change] { + public func consolidate(_ changes: [IndependentSwiftInterfaceChange]) -> [Change] { var independentChanges = changes var consolidatedChanges = [Change]() diff --git a/Sources/Helpers/Models/SwiftInterface/SwiftInterfaceElement+DiffHelper.swift b/Sources/SwiftInterfaceAnalyzerModule/SwiftInterfaceElement+DiffHelper.swift similarity index 99% rename from Sources/Helpers/Models/SwiftInterface/SwiftInterfaceElement+DiffHelper.swift rename to Sources/SwiftInterfaceAnalyzerModule/SwiftInterfaceElement+DiffHelper.swift index 283072b..f722b54 100644 --- a/Sources/Helpers/Models/SwiftInterface/SwiftInterfaceElement+DiffHelper.swift +++ b/Sources/SwiftInterfaceAnalyzerModule/SwiftInterfaceElement+DiffHelper.swift @@ -1,4 +1,5 @@ import Foundation +import CoreModule extension SwiftInterfaceElement { diff --git a/Sources/Helpers/Models/SwiftInterface/SwiftInterfaceElement.swift b/Sources/SwiftInterfaceAnalyzerModule/SwiftInterfaceElement.swift similarity index 95% rename from Sources/Helpers/Models/SwiftInterface/SwiftInterfaceElement.swift rename to Sources/SwiftInterfaceAnalyzerModule/SwiftInterfaceElement.swift index 73fb803..2d89b5e 100644 --- a/Sources/Helpers/Models/SwiftInterface/SwiftInterfaceElement.swift +++ b/Sources/SwiftInterfaceAnalyzerModule/SwiftInterfaceElement.swift @@ -1,6 +1,6 @@ import Foundation -protocol SwiftInterfaceExtendableElement: SwiftInterfaceElement { +public protocol SwiftInterfaceExtendableElement: SwiftInterfaceElement { /// Name of the type /// @@ -13,7 +13,7 @@ protocol SwiftInterfaceExtendableElement: SwiftInterfaceElement { var children: [any SwiftInterfaceElement] { get set } } -protocol SwiftInterfaceElement: CustomStringConvertible, AnyObject { +public protocol SwiftInterfaceElement: CustomStringConvertible, AnyObject { /// The name of the element used to construct the parent path for its children var pathComponentName: String { get } @@ -42,7 +42,7 @@ protocol SwiftInterfaceElement: CustomStringConvertible, AnyObject { func differences(to otherElement: T) -> [String] } -extension SwiftInterfaceElement { +public extension SwiftInterfaceElement { func setupParentRelationships(parent: (any SwiftInterfaceElement)? = nil) { self.parent = parent @@ -94,7 +94,7 @@ extension SwiftInterfaceElement { } } -extension SwiftInterfaceElement { +public extension SwiftInterfaceElement { /// Checks whether or not 2 elements can be compared based on their `printedName`, `type` and `parentPath` /// /// If the `printedName`, `type` + `parentPath` is the same we can assume that it's the same element but altered @@ -109,7 +109,7 @@ extension SwiftInterfaceElement { } } -extension SwiftInterfaceElement { +public extension SwiftInterfaceElement { /// Produces the complete recursive description of the element func recursiveDescription(indentation: Int = 0) -> String { diff --git a/Sources/Helpers/Models/SwiftInterface/DeclSyntax+Convenience.swift b/Sources/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/DeclSyntax+Convenience.swift similarity index 100% rename from Sources/Helpers/Models/SwiftInterface/DeclSyntax+Convenience.swift rename to Sources/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/DeclSyntax+Convenience.swift diff --git a/Sources/Helpers/Models/SwiftInterface/DeclSyntax+SwiftInterface/ActorDeclSyntax+SwiftInterface.swift b/Sources/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/DeclSyntax+SwiftInterface/ActorDeclSyntax+SwiftInterface.swift similarity index 100% rename from Sources/Helpers/Models/SwiftInterface/DeclSyntax+SwiftInterface/ActorDeclSyntax+SwiftInterface.swift rename to Sources/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/DeclSyntax+SwiftInterface/ActorDeclSyntax+SwiftInterface.swift diff --git a/Sources/Helpers/Models/SwiftInterface/DeclSyntax+SwiftInterface/AssociatedTypeDeclSyntax+SwiftInterface.swift b/Sources/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/DeclSyntax+SwiftInterface/AssociatedTypeDeclSyntax+SwiftInterface.swift similarity index 100% rename from Sources/Helpers/Models/SwiftInterface/DeclSyntax+SwiftInterface/AssociatedTypeDeclSyntax+SwiftInterface.swift rename to Sources/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/DeclSyntax+SwiftInterface/AssociatedTypeDeclSyntax+SwiftInterface.swift diff --git a/Sources/Helpers/Models/SwiftInterface/DeclSyntax+SwiftInterface/ClassDeclSyntac+SwiftInterface.swift b/Sources/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/DeclSyntax+SwiftInterface/ClassDeclSyntac+SwiftInterface.swift similarity index 100% rename from Sources/Helpers/Models/SwiftInterface/DeclSyntax+SwiftInterface/ClassDeclSyntac+SwiftInterface.swift rename to Sources/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/DeclSyntax+SwiftInterface/ClassDeclSyntac+SwiftInterface.swift diff --git a/Sources/Helpers/Models/SwiftInterface/DeclSyntax+SwiftInterface/EnumCaseDeclSyntax+SwiftInterface.swift b/Sources/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/DeclSyntax+SwiftInterface/EnumCaseDeclSyntax+SwiftInterface.swift similarity index 100% rename from Sources/Helpers/Models/SwiftInterface/DeclSyntax+SwiftInterface/EnumCaseDeclSyntax+SwiftInterface.swift rename to Sources/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/DeclSyntax+SwiftInterface/EnumCaseDeclSyntax+SwiftInterface.swift diff --git a/Sources/Helpers/Models/SwiftInterface/DeclSyntax+SwiftInterface/EnumDeclSyntax+SwiftInterface.swift b/Sources/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/DeclSyntax+SwiftInterface/EnumDeclSyntax+SwiftInterface.swift similarity index 100% rename from Sources/Helpers/Models/SwiftInterface/DeclSyntax+SwiftInterface/EnumDeclSyntax+SwiftInterface.swift rename to Sources/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/DeclSyntax+SwiftInterface/EnumDeclSyntax+SwiftInterface.swift diff --git a/Sources/Helpers/Models/SwiftInterface/DeclSyntax+SwiftInterface/ExtensionDeclSyntax+SwiftInterface.swift b/Sources/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/DeclSyntax+SwiftInterface/ExtensionDeclSyntax+SwiftInterface.swift similarity index 100% rename from Sources/Helpers/Models/SwiftInterface/DeclSyntax+SwiftInterface/ExtensionDeclSyntax+SwiftInterface.swift rename to Sources/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/DeclSyntax+SwiftInterface/ExtensionDeclSyntax+SwiftInterface.swift diff --git a/Sources/Helpers/Models/SwiftInterface/DeclSyntax+SwiftInterface/FunctionDeclSyntax+SwiftInterface.swift b/Sources/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/DeclSyntax+SwiftInterface/FunctionDeclSyntax+SwiftInterface.swift similarity index 100% rename from Sources/Helpers/Models/SwiftInterface/DeclSyntax+SwiftInterface/FunctionDeclSyntax+SwiftInterface.swift rename to Sources/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/DeclSyntax+SwiftInterface/FunctionDeclSyntax+SwiftInterface.swift diff --git a/Sources/Helpers/Models/SwiftInterface/DeclSyntax+SwiftInterface/InitializerDeclSyntax+SwiftInterface.swift b/Sources/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/DeclSyntax+SwiftInterface/InitializerDeclSyntax+SwiftInterface.swift similarity index 100% rename from Sources/Helpers/Models/SwiftInterface/DeclSyntax+SwiftInterface/InitializerDeclSyntax+SwiftInterface.swift rename to Sources/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/DeclSyntax+SwiftInterface/InitializerDeclSyntax+SwiftInterface.swift diff --git a/Sources/Helpers/Models/SwiftInterface/DeclSyntax+SwiftInterface/ProtocolDeclSyntax+SwiftInterface.swift b/Sources/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/DeclSyntax+SwiftInterface/ProtocolDeclSyntax+SwiftInterface.swift similarity index 100% rename from Sources/Helpers/Models/SwiftInterface/DeclSyntax+SwiftInterface/ProtocolDeclSyntax+SwiftInterface.swift rename to Sources/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/DeclSyntax+SwiftInterface/ProtocolDeclSyntax+SwiftInterface.swift diff --git a/Sources/Helpers/Models/SwiftInterface/DeclSyntax+SwiftInterface/StructDeclSyntax+SwiftInterface.swift b/Sources/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/DeclSyntax+SwiftInterface/StructDeclSyntax+SwiftInterface.swift similarity index 100% rename from Sources/Helpers/Models/SwiftInterface/DeclSyntax+SwiftInterface/StructDeclSyntax+SwiftInterface.swift rename to Sources/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/DeclSyntax+SwiftInterface/StructDeclSyntax+SwiftInterface.swift diff --git a/Sources/Helpers/Models/SwiftInterface/DeclSyntax+SwiftInterface/SubscriptDeclSyntax+SwiftInterface.swift b/Sources/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/DeclSyntax+SwiftInterface/SubscriptDeclSyntax+SwiftInterface.swift similarity index 100% rename from Sources/Helpers/Models/SwiftInterface/DeclSyntax+SwiftInterface/SubscriptDeclSyntax+SwiftInterface.swift rename to Sources/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/DeclSyntax+SwiftInterface/SubscriptDeclSyntax+SwiftInterface.swift diff --git a/Sources/Helpers/Models/SwiftInterface/DeclSyntax+SwiftInterface/TypeAliasDeclSyntax+SwiftInterface.swift b/Sources/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/DeclSyntax+SwiftInterface/TypeAliasDeclSyntax+SwiftInterface.swift similarity index 100% rename from Sources/Helpers/Models/SwiftInterface/DeclSyntax+SwiftInterface/TypeAliasDeclSyntax+SwiftInterface.swift rename to Sources/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/DeclSyntax+SwiftInterface/TypeAliasDeclSyntax+SwiftInterface.swift diff --git a/Sources/Helpers/Models/SwiftInterface/DeclSyntax+SwiftInterface/VarDeclSyntax+SwiftInterface.swift b/Sources/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/DeclSyntax+SwiftInterface/VarDeclSyntax+SwiftInterface.swift similarity index 100% rename from Sources/Helpers/Models/SwiftInterface/DeclSyntax+SwiftInterface/VarDeclSyntax+SwiftInterface.swift rename to Sources/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/DeclSyntax+SwiftInterface/VarDeclSyntax+SwiftInterface.swift diff --git a/Sources/Helpers/Models/SwiftInterface/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+Actor.swift b/Sources/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+Actor.swift similarity index 100% rename from Sources/Helpers/Models/SwiftInterface/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+Actor.swift rename to Sources/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+Actor.swift diff --git a/Sources/Helpers/Models/SwiftInterface/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+AssociatedType.swift b/Sources/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+AssociatedType.swift similarity index 100% rename from Sources/Helpers/Models/SwiftInterface/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+AssociatedType.swift rename to Sources/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+AssociatedType.swift diff --git a/Sources/Helpers/Models/SwiftInterface/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+Class.swift b/Sources/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+Class.swift similarity index 100% rename from Sources/Helpers/Models/SwiftInterface/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+Class.swift rename to Sources/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+Class.swift diff --git a/Sources/Helpers/Models/SwiftInterface/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+Enum.swift b/Sources/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+Enum.swift similarity index 100% rename from Sources/Helpers/Models/SwiftInterface/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+Enum.swift rename to Sources/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+Enum.swift diff --git a/Sources/Helpers/Models/SwiftInterface/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+EnumCase.swift b/Sources/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+EnumCase.swift similarity index 100% rename from Sources/Helpers/Models/SwiftInterface/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+EnumCase.swift rename to Sources/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+EnumCase.swift diff --git a/Sources/Helpers/Models/SwiftInterface/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+Extension.swift b/Sources/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+Extension.swift similarity index 100% rename from Sources/Helpers/Models/SwiftInterface/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+Extension.swift rename to Sources/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+Extension.swift diff --git a/Sources/Helpers/Models/SwiftInterface/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+Function.swift b/Sources/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+Function.swift similarity index 100% rename from Sources/Helpers/Models/SwiftInterface/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+Function.swift rename to Sources/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+Function.swift diff --git a/Sources/Helpers/Models/SwiftInterface/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+Initializer.swift b/Sources/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+Initializer.swift similarity index 100% rename from Sources/Helpers/Models/SwiftInterface/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+Initializer.swift rename to Sources/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+Initializer.swift diff --git a/Sources/Helpers/Models/SwiftInterface/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+Protocol.swift b/Sources/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+Protocol.swift similarity index 100% rename from Sources/Helpers/Models/SwiftInterface/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+Protocol.swift rename to Sources/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+Protocol.swift diff --git a/Sources/Helpers/Models/SwiftInterface/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+Struct.swift b/Sources/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+Struct.swift similarity index 100% rename from Sources/Helpers/Models/SwiftInterface/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+Struct.swift rename to Sources/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+Struct.swift diff --git a/Sources/Helpers/Models/SwiftInterface/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+Subscript.swift b/Sources/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+Subscript.swift similarity index 100% rename from Sources/Helpers/Models/SwiftInterface/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+Subscript.swift rename to Sources/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+Subscript.swift diff --git a/Sources/Helpers/Models/SwiftInterface/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+TypeAlias.swift b/Sources/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+TypeAlias.swift similarity index 100% rename from Sources/Helpers/Models/SwiftInterface/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+TypeAlias.swift rename to Sources/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+TypeAlias.swift diff --git a/Sources/Helpers/Models/SwiftInterface/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+Var.swift b/Sources/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+Var.swift similarity index 100% rename from Sources/Helpers/Models/SwiftInterface/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+Var.swift rename to Sources/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+Var.swift diff --git a/Sources/Pipeline/Modules/SwiftInterfaceParser/SwiftInterfaceParser+Root.swift b/Sources/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/SwiftInterfaceParser+Root.swift similarity index 100% rename from Sources/Pipeline/Modules/SwiftInterfaceParser/SwiftInterfaceParser+Root.swift rename to Sources/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/SwiftInterfaceParser+Root.swift diff --git a/Sources/Pipeline/Modules/SwiftInterfaceParser/SwiftInterfaceParser.swift b/Sources/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/SwiftInterfaceParser.swift similarity index 98% rename from Sources/Pipeline/Modules/SwiftInterfaceParser/SwiftInterfaceParser.swift rename to Sources/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/SwiftInterfaceParser.swift index 958bb23..88bf37d 100644 --- a/Sources/Pipeline/Modules/SwiftInterfaceParser/SwiftInterfaceParser.swift +++ b/Sources/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/SwiftInterfaceParser.swift @@ -6,7 +6,7 @@ import SwiftParser Documentation about DeclSyntax: - https://swiftpackageindex.com/swiftlang/swift-syntax/600.0.1/documentation/swiftsyntax/declsyntax */ -class SwiftInterfaceParser: SyntaxVisitor, SwiftInterfaceParsing { +public class SwiftInterfaceParser: SyntaxVisitor, SwiftInterfaceParsing { // TODO: Handle (Nice to have) // - DeinitializerDeclSyntax diff --git a/Sources/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/SwiftInterfaceParsing.swift b/Sources/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/SwiftInterfaceParsing.swift new file mode 100644 index 0000000..0788442 --- /dev/null +++ b/Sources/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/SwiftInterfaceParsing.swift @@ -0,0 +1,5 @@ +import Foundation + +public protocol SwiftInterfaceParsing { + func parse(source: String, moduleName: String) -> any SwiftInterfaceElement +} diff --git a/Sources/Pipeline/SwiftInterfacePipeline.swift b/Sources/SwiftInterfaceAnalyzerModule/SwiftInterfacePipeline.swift similarity index 74% rename from Sources/Pipeline/SwiftInterfacePipeline.swift rename to Sources/SwiftInterfaceAnalyzerModule/SwiftInterfacePipeline.swift index 5499804..02b9299 100644 --- a/Sources/Pipeline/SwiftInterfacePipeline.swift +++ b/Sources/SwiftInterfaceAnalyzerModule/SwiftInterfacePipeline.swift @@ -1,24 +1,22 @@ import Foundation -struct SwiftInterfaceFile { - let name: String - let oldFilePath: String - let newFilePath: String -} +import CoreModule +import FileHandlingModule +import LoggingModule /// Takes a list of ``SwiftInterfaceFile`` and detects changes between the old and new version -struct SwiftInterfacePipeline { +public struct SwiftInterfacePipeline { let fileHandler: any FileHandling let swiftInterfaceParser: any SwiftInterfaceParsing let swiftInterfaceAnalyzer: any SwiftInterfaceAnalyzing let logger: (any Logging)? - init( - fileHandler: FileHandling, - swiftInterfaceParser: any SwiftInterfaceParsing, - swiftInterfaceAnalyzer: any SwiftInterfaceAnalyzing, - logger: (any Logging)? + public init( + fileHandler: FileHandling = FileManager.default, + swiftInterfaceParser: any SwiftInterfaceParsing = SwiftInterfaceParser(), + swiftInterfaceAnalyzer: any SwiftInterfaceAnalyzing = SwiftInterfaceAnalyzer(), + logger: (any Logging)? = nil ) { self.fileHandler = fileHandler self.swiftInterfaceParser = swiftInterfaceParser @@ -26,7 +24,7 @@ struct SwiftInterfacePipeline { self.logger = logger } - func run(with swiftInterfaceFiles: [SwiftInterfaceFile]) async throws -> [String: [Change]] { + public func run(with swiftInterfaceFiles: [SwiftInterfaceFile]) async throws -> [String: [Change]] { var changes = [String: [Change]]() diff --git a/Sources/Pipeline/Modules/SwiftInterfaceFileLocator.swift b/Sources/SwiftInterfaceProducerModule/SwiftInterfaceFileLocator.swift similarity index 97% rename from Sources/Pipeline/Modules/SwiftInterfaceFileLocator.swift rename to Sources/SwiftInterfaceProducerModule/SwiftInterfaceFileLocator.swift index d55073f..6e5cef9 100644 --- a/Sources/Pipeline/Modules/SwiftInterfaceFileLocator.swift +++ b/Sources/SwiftInterfaceProducerModule/SwiftInterfaceFileLocator.swift @@ -1,5 +1,9 @@ import Foundation +import FileHandlingModule +import ShellModule +import LoggingModule + /// A helper to locate `.swiftinterface` files struct SwiftInterfaceFileLocator { diff --git a/Sources/Pipeline/SwiftInterfaceProducer.swift b/Sources/SwiftInterfaceProducerModule/SwiftInterfaceProducer.swift similarity index 95% rename from Sources/Pipeline/SwiftInterfaceProducer.swift rename to Sources/SwiftInterfaceProducerModule/SwiftInterfaceProducer.swift index 9bf4eb0..2310a3a 100644 --- a/Sources/Pipeline/SwiftInterfaceProducer.swift +++ b/Sources/SwiftInterfaceProducerModule/SwiftInterfaceProducer.swift @@ -1,7 +1,13 @@ import Foundation +import FileHandlingModule +import ShellModule +import LoggingModule +import CoreModule +import SwiftPackageFileHelperModule + /// Allows building of the old & new project and returns the `.swiftinterface` files -struct SwiftInterfaceProducer { +public struct SwiftInterfaceProducer { private typealias ProjectPreparationResult = (archiveScheme: String, schemesToCompare: [String]) private typealias DerivedDataPaths = (new: String, old: String) @@ -13,7 +19,7 @@ struct SwiftInterfaceProducer { let shell: any ShellHandling let logger: (any Logging)? - init( + public init( workingDirectoryPath: String, projectType: ProjectType, swiftInterfaceType: SwiftInterfaceType, @@ -30,7 +36,7 @@ struct SwiftInterfaceProducer { } /// Builds the projects and returns the `.swiftinterface` files - func produceInterfaceFiles( + public func produceInterfaceFiles( oldProjectDirectory: URL, newProjectDirectory: URL ) async throws -> [SwiftInterfaceFile] { @@ -90,7 +96,7 @@ extension SwiftInterfaceProducer { schemesToCompare = newTargets.intersection(oldTargets).sorted() if schemesToCompare.isEmpty { - throw PipelineError.noTargetFound + throw SwiftInterfaceProducerError.noTargetFound } case let .xcodeProject(scheme): diff --git a/Sources/Pipeline/PipelineError.swift b/Sources/SwiftInterfaceProducerModule/SwiftInterfaceProducerError.swift similarity index 86% rename from Sources/Pipeline/PipelineError.swift rename to Sources/SwiftInterfaceProducerModule/SwiftInterfaceProducerError.swift index 3994a6e..675bb15 100644 --- a/Sources/Pipeline/PipelineError.swift +++ b/Sources/SwiftInterfaceProducerModule/SwiftInterfaceProducerError.swift @@ -6,7 +6,7 @@ import Foundation -enum PipelineError: LocalizedError { +enum SwiftInterfaceProducerError: LocalizedError { case noTargetFound var errorDescription: String? { diff --git a/Sources/Helpers/SwiftInterfaceType.swift b/Sources/SwiftInterfaceProducerModule/SwiftInterfaceType.swift similarity index 87% rename from Sources/Helpers/SwiftInterfaceType.swift rename to Sources/SwiftInterfaceProducerModule/SwiftInterfaceType.swift index 061fa5e..39d1557 100644 --- a/Sources/Helpers/SwiftInterfaceType.swift +++ b/Sources/SwiftInterfaceProducerModule/SwiftInterfaceType.swift @@ -2,7 +2,7 @@ import Foundation import ArgumentParser /// The type of the .swiftinterface to parse/generate -enum SwiftInterfaceType { +public enum SwiftInterfaceType { case `private` case `public` @@ -15,7 +15,7 @@ enum SwiftInterfaceType { } extension SwiftInterfaceType: ExpressibleByArgument { - init?(argument: String) { + public init?(argument: String) { switch argument { case "private": self = .private case "public": self = .public diff --git a/Sources/Helpers/XcodeTools.swift b/Sources/SwiftInterfaceProducerModule/XcodeTools.swift similarity index 94% rename from Sources/Helpers/XcodeTools.swift rename to Sources/SwiftInterfaceProducerModule/XcodeTools.swift index 4ba982e..1d32168 100644 --- a/Sources/Helpers/XcodeTools.swift +++ b/Sources/SwiftInterfaceProducerModule/XcodeTools.swift @@ -6,6 +6,11 @@ import Foundation +import CoreModule +import ShellModule +import FileHandlingModule +import LoggingModule + struct XcodeToolsError: LocalizedError, CustomDebugStringConvertible { var errorDescription: String var underlyingError: String @@ -13,7 +18,7 @@ struct XcodeToolsError: LocalizedError, CustomDebugStringConvertible { var debugDescription: String { errorDescription } } -struct XcodeTools { +public struct XcodeTools { internal enum Constants { static let derivedDataPath: String = ".build" @@ -24,7 +29,7 @@ struct XcodeTools { private let fileHandler: FileHandling private let logger: Logging? - init( + public init( shell: ShellHandling = Shell(), fileHandler: FileHandling = FileManager.default, logger: Logging? @@ -34,7 +39,7 @@ struct XcodeTools { self.logger = logger } - func archive( + public func archive( projectDirectoryPath: String, scheme: String, projectType: ProjectType diff --git a/Sources/Pipeline/Modules/SwiftPackageFileAnalyzer.swift b/Sources/SwiftPackageFileAnalyzerModule/SwiftPackageFileAnalyzer.swift similarity index 97% rename from Sources/Pipeline/Modules/SwiftPackageFileAnalyzer.swift rename to Sources/SwiftPackageFileAnalyzerModule/SwiftPackageFileAnalyzer.swift index 1acb403..816a893 100644 --- a/Sources/Pipeline/Modules/SwiftPackageFileAnalyzer.swift +++ b/Sources/SwiftPackageFileAnalyzerModule/SwiftPackageFileAnalyzer.swift @@ -6,10 +6,15 @@ import Foundation -struct SwiftPackageFileAnalyzer: ProjectAnalyzing { +import CoreModule +import FileHandlingModule +import ShellModule +import LoggingModule +import SwiftPackageFileHelperModule + +public struct SwiftPackageFileAnalyzer: SwiftPackageFileAnalyzing { private let fileHandler: any FileHandling - private let xcodeTools: XcodeTools private let shell: any ShellHandling private let logger: (any Logging)? @@ -20,18 +25,17 @@ struct SwiftPackageFileAnalyzer: ProjectAnalyzing { } } - init( + public init( fileHandler: FileHandling = FileManager.default, shell: ShellHandling = Shell(), logger: (any Logging)? ) { self.fileHandler = fileHandler - self.xcodeTools = XcodeTools(shell: shell, fileHandler: fileHandler, logger: logger) self.logger = logger self.shell = shell } - func analyze(oldProjectUrl: URL, newProjectUrl: URL) throws -> ProjectAnalyzerResult { + public func analyze(oldProjectUrl: URL, newProjectUrl: URL) throws -> SwiftPackageFileAnalyzingResult { let oldProjectPath = oldProjectUrl.path() let newProjectPath = newProjectUrl.path() @@ -61,7 +65,7 @@ private extension SwiftPackageFileAnalyzer { private func analyze( old: SwiftPackageDescription, new: SwiftPackageDescription - ) throws -> ProjectAnalyzerResult { + ) throws -> SwiftPackageFileAnalyzingResult { guard old != new else { return .init(changes: [], warnings: []) } diff --git a/Sources/SwiftPackageFileAnalyzerModule/SwiftPackageFileAnalyzing.swift b/Sources/SwiftPackageFileAnalyzerModule/SwiftPackageFileAnalyzing.swift new file mode 100644 index 0000000..36896fc --- /dev/null +++ b/Sources/SwiftPackageFileAnalyzerModule/SwiftPackageFileAnalyzing.swift @@ -0,0 +1,15 @@ +import Foundation +import CoreModule + +public struct SwiftPackageFileAnalyzingResult { + public let changes: [Change] + public let warnings: [String] +} + +public protocol SwiftPackageFileAnalyzing { + /// Analyzes whether or not the available libraries changed between the old and new version + func analyze( + oldProjectUrl: URL, + newProjectUrl: URL + ) throws -> SwiftPackageFileAnalyzingResult +} diff --git a/Sources/Helpers/Models/SwiftPackageDescription.swift b/Sources/SwiftPackageFileHelperModule/SwiftPackageDescription.swift similarity index 78% rename from Sources/Helpers/Models/SwiftPackageDescription.swift rename to Sources/SwiftPackageFileHelperModule/SwiftPackageDescription.swift index 7410d2a..2d15628 100644 --- a/Sources/Helpers/Models/SwiftPackageDescription.swift +++ b/Sources/SwiftPackageFileHelperModule/SwiftPackageDescription.swift @@ -9,19 +9,19 @@ import Foundation // See: https://docs.swift.org/package-manager/PackageDescription/index.html // See: https://github.com/swiftlang/swift-package-manager/blob/main/Sources/PackageDescription/PackageDescriptionSerialization.swift -struct SwiftPackageDescription: Codable, Equatable { +public struct SwiftPackageDescription: Codable, Equatable { - let name: String - let platforms: [Platform] - let defaultLocalization: String? + public let name: String + public let platforms: [Platform] + public let defaultLocalization: String? - let targets: [Target] - let products: [Product] - let dependencies: [Dependency] + public let targets: [Target] + public let products: [Product] + public let dependencies: [Dependency] - let toolsVersion: String + public let toolsVersion: String - var warnings = [String]() + public var warnings = [String]() init( defaultLocalization: String?, @@ -56,32 +56,34 @@ struct SwiftPackageDescription: Codable, Equatable { extension SwiftPackageDescription { - struct Platform: Codable, Equatable, Hashable { + public struct Platform: Codable, Equatable, Hashable { - let name: String - let version: String + public let name: String + public let version: String } } extension SwiftPackageDescription.Platform: CustomStringConvertible { - var description: String { + + public var description: String { "\(name)(\(version))" } } extension SwiftPackageDescription { - struct Product: Codable, Equatable, Hashable { + public struct Product: Codable, Equatable, Hashable { // TODO: Add `rule` property - let name: String - let targets: [String] + public let name: String + public let targets: [String] } } extension SwiftPackageDescription.Product: CustomStringConvertible { - var description: String { + + public var description: String { let targetsDescription = targets.map { "\"\($0)\"" }.joined(separator: ", ") return ".library(name: \"\(name)\", targets: [\(targetsDescription)])" } @@ -89,18 +91,18 @@ extension SwiftPackageDescription.Product: CustomStringConvertible { extension SwiftPackageDescription { - struct Dependency: Codable, Equatable { + public struct Dependency: Codable, Equatable { - let identity: String - let requirement: Requirement - let type: String - let url: String? + public let identity: String + public let requirement: Requirement + public let type: String + public let url: String? } } extension SwiftPackageDescription.Dependency: CustomStringConvertible { - var description: String { + public var description: String { var description = ".package(" var fields = [String]() @@ -120,17 +122,17 @@ extension SwiftPackageDescription.Dependency: CustomStringConvertible { extension SwiftPackageDescription.Dependency { - struct Requirement: Codable, Equatable { + public struct Requirement: Codable, Equatable { // TODO: Which other requirements exist? - let exact: [String]? + public let exact: [String]? } } extension SwiftPackageDescription.Dependency.Requirement: CustomStringConvertible { - var description: String { + public var description: String { if let exactVersion = exact?.first { return "exact: \"\(exactVersion)\"" } @@ -141,29 +143,29 @@ extension SwiftPackageDescription.Dependency.Requirement: CustomStringConvertibl extension SwiftPackageDescription { - struct Target: Codable, Equatable { + public struct Target: Codable, Equatable { - enum ModuleType: String, Codable, Equatable { + public enum ModuleType: String, Codable, Equatable { case swiftTarget = "SwiftTarget" case binaryTarget = "BinaryTarget" case clangTarget = "ClangTarget" } - enum TargetType: String, Codable, Equatable { + public enum TargetType: String, Codable, Equatable { case library = "library" case binary = "binary" case test = "test" } - let name: String - let type: TargetType - let path: String - let moduleType: ModuleType + public let name: String + public let type: TargetType + public let path: String + public let moduleType: ModuleType /// `.product(name: ...)` dependency - let productDependencies: [String]? + public let productDependencies: [String]? /// `.target(name: ...) dependency - let targetDependencies: [String]? + public let targetDependencies: [String]? // Ignoring following properties for now as they are not handled in the `PackageAnalyzer` // and thus would produce changes that are not visible @@ -172,7 +174,7 @@ extension SwiftPackageDescription { // let sources: [String] // let resources: [Resource]? - init( + public init( name: String, type: TargetType, path: String, @@ -200,7 +202,8 @@ extension SwiftPackageDescription { } extension SwiftPackageDescription.Target.TargetType: CustomStringConvertible { - var description: String { + + public var description: String { switch self { case .binary: "binaryTarget" case .library: "target" @@ -211,7 +214,7 @@ extension SwiftPackageDescription.Target.TargetType: CustomStringConvertible { extension SwiftPackageDescription.Target: CustomStringConvertible { - var description: String { + public var description: String { var description = ".\(type.description)(name: \"\(name)\"" var dependencyDescriptions = [String]() diff --git a/Sources/Helpers/SwiftPackageFileHelper.swift b/Sources/SwiftPackageFileHelperModule/SwiftPackageFileHelper.swift similarity index 93% rename from Sources/Helpers/SwiftPackageFileHelper.swift rename to Sources/SwiftPackageFileHelperModule/SwiftPackageFileHelper.swift index 5281a11..b46da1a 100644 --- a/Sources/Helpers/SwiftPackageFileHelper.swift +++ b/Sources/SwiftPackageFileHelperModule/SwiftPackageFileHelper.swift @@ -5,6 +5,9 @@ // import Foundation +import FileHandlingModule +import ShellModule +import LoggingModule enum SwiftPackageFileHelperError: LocalizedError { case packageDescriptionError(_ description: String) @@ -23,29 +26,27 @@ enum SwiftPackageFileHelperError: LocalizedError { } } -struct SwiftPackageFileHelper { +public struct SwiftPackageFileHelper { private let fileHandler: FileHandling - private let xcodeTools: XcodeTools private let shell: any ShellHandling private let logger: (any Logging)? - init( + public init( fileHandler: FileHandling, shell: any ShellHandling, logger: (any Logging)? ) { self.fileHandler = fileHandler - self.xcodeTools = XcodeTools(shell: shell, fileHandler: fileHandler, logger: logger) self.shell = shell self.logger = logger } - static func packagePath(for projectDirectoryPath: String) -> String { + public static func packagePath(for projectDirectoryPath: String) -> String { projectDirectoryPath.appending("/Package.swift") } - func availableTargets( + public func availableTargets( at projectDirectoryPath: String, moduleType: SwiftPackageDescription.Target.ModuleType? = nil, targetType: SwiftPackageDescription.Target.TargetType? = nil @@ -64,12 +65,12 @@ struct SwiftPackageFileHelper { return Set(targets.map(\.name)) } - func packageDescription(at projectDirectoryPath: String) throws -> SwiftPackageDescription { + public func packageDescription(at projectDirectoryPath: String) throws -> SwiftPackageDescription { try generatePackageDescription(at: projectDirectoryPath) } /// Inserts a new library into the targets section containing all targets from the target section - func preparePackageWithConsolidatedLibrary( + public func preparePackageWithConsolidatedLibrary( named consolidatedLibraryName: String, at projectDirectoryPath: String ) throws { From 07fc160b0e070aefa4144c24d1a5c48429c04fcb Mon Sep 17 00:00:00 2001 From: Alex Guretzki Date: Thu, 10 Oct 2024 16:06:34 +0200 Subject: [PATCH 02/12] Better modularization --- Package.swift | 110 ++++-------------- Sources/CommandLineTool/public-api-diff.swift | 30 +++-- .../FileHandling+Convenience.swift | 1 - .../FileManager+FileHandling.swift | 1 - Sources/LoggingModule/LogFileLogger.swift | 3 +- Sources/LoggingModule/LogLevelLogger.swift | 1 - Sources/LoggingModule/LoggingGroup.swift | 1 - Sources/LoggingModule/SystemLogger.swift | 1 - .../ProjectBuilderModule/ProjectBuilder.swift | 3 - .../ProjectSetup}/Git.swift | 0 .../ProjectSetup}/ProjectSetupHelper.swift | 1 - .../ProjectSetup}/ProjectSetupHelping.swift | 0 .../ProjectSetup}/ProjectSource.swift | 2 +- .../RandomStringGenerating.swift | 0 .../ProjectType.swift | 0 .../SwiftInterfaceFileLocator.swift | 0 .../SwiftInterfaceProducer.swift | 1 - .../SwiftInterfaceProducerError.swift | 0 .../SwiftInterfaceType.swift | 0 .../SwiftInterfaceProducer}/XcodeTools.swift | 0 .../SwiftPackageFileAnalyzer.swift | 1 - .../SwiftPackageFileAnalyzing.swift | 0 .../SwiftPackageDescription.swift | 0 .../SwiftPackageFileHelper.swift | 0 .../ReferencePackageTests.swift | 6 +- Tests/UnitTests/FileHandlingTests.swift | 2 +- Tests/UnitTests/GitTests.swift | 2 +- Tests/UnitTests/LoggerTests.swift | 2 +- Tests/UnitTests/OutputGeneratorTests.swift | 14 +-- Tests/UnitTests/PipelineTests.swift | 3 +- Tests/UnitTests/ProjectSourceTests.swift | 2 +- .../SwiftPackageFileAnalyzerTests.swift | 3 +- .../UnitTests/Utilities/MockFileHandler.swift | 2 +- Tests/UnitTests/Utilities/MockLogger.swift | 2 +- .../MockLibraryAnalyzer.swift | 8 +- .../MockOutputGenerator.swift | 3 +- .../Utilities/MockRandomStringGenerator.swift | 2 +- Tests/UnitTests/Utilities/MockShell.swift | 2 +- .../MockSwiftInterfaceAnalyzer.swift | 3 +- .../Utilities/MockSwiftInterfaceParser.swift | 2 +- Tests/UnitTests/XcodeToolsTests.swift | 2 +- 41 files changed, 71 insertions(+), 145 deletions(-) rename Sources/{GitModule => ProjectBuilderModule/ProjectSetup}/Git.swift (100%) rename Sources/{ProjectSetupModule => ProjectBuilderModule/ProjectSetup}/ProjectSetupHelper.swift (99%) rename Sources/{ProjectSetupModule => ProjectBuilderModule/ProjectSetup}/ProjectSetupHelping.swift (100%) rename Sources/{ProjectSetupModule => ProjectBuilderModule/ProjectSetup}/ProjectSource.swift (96%) rename Sources/{CoreModule => ProjectBuilderModule/ProjectSetup}/RandomStringGenerating.swift (100%) rename Sources/{CoreModule => ProjectBuilderModule}/ProjectType.swift (100%) rename Sources/{SwiftInterfaceProducerModule => ProjectBuilderModule/SwiftInterfaceProducer}/SwiftInterfaceFileLocator.swift (100%) rename Sources/{SwiftInterfaceProducerModule => ProjectBuilderModule/SwiftInterfaceProducer}/SwiftInterfaceProducer.swift (99%) rename Sources/{SwiftInterfaceProducerModule => ProjectBuilderModule/SwiftInterfaceProducer}/SwiftInterfaceProducerError.swift (100%) rename Sources/{SwiftInterfaceProducerModule => ProjectBuilderModule/SwiftInterfaceProducer}/SwiftInterfaceType.swift (100%) rename Sources/{SwiftInterfaceProducerModule => ProjectBuilderModule/SwiftInterfaceProducer}/XcodeTools.swift (100%) rename Sources/{SwiftPackageFileAnalyzerModule => ProjectBuilderModule/SwiftPackageFileAnalyzer}/SwiftPackageFileAnalyzer.swift (99%) rename Sources/{SwiftPackageFileAnalyzerModule => ProjectBuilderModule/SwiftPackageFileAnalyzer}/SwiftPackageFileAnalyzing.swift (100%) rename Sources/{SwiftPackageFileHelperModule => ProjectBuilderModule/SwiftPackageFileHelper}/SwiftPackageDescription.swift (100%) rename Sources/{SwiftPackageFileHelperModule => ProjectBuilderModule/SwiftPackageFileHelper}/SwiftPackageFileHelper.swift (100%) diff --git a/Package.swift b/Package.swift index 9c27cce..8f052cf 100644 --- a/Package.swift +++ b/Package.swift @@ -3,35 +3,6 @@ import PackageDescription -private extension String { - static var core: Self { "CoreModule" } - static var fileHandling: Self { "FileHandlingModule" } - static var shell: Self { "ShellModule" } - static var git: Self { "GitModule" } - static var logging: Self { "LoggingModule" } - static var outputGenerator: Self { "OutputGeneratorModule" } - static var swiftInterfaceAnalyzerModule: Self { "SwiftInterfaceAnalyzerModule" } - static var projectSetupModule: Self { "ProjectSetupModule" } - static var swiftInterfaceProducerModule: Self { "SwiftInterfaceProducerModule" } - static var swiftPackageFileHelperModule: Self { "SwiftPackageFileHelperModule" } - static var swiftPackageFileAnalyzerModule: Self { "SwiftPackageFileAnalyzerModule" } - -} - -extension Target.Dependency { - static var core: Self { .byName(name: .core) } - static var fileHandling: Self { .byName(name: .fileHandling) } - static var shell: Self { .byName(name: .shell) } - static var git: Self { .byName(name: .git) } - static var logging: Self { .byName(name: .logging) } - static var outputGenerator: Self { .byName(name: .outputGenerator) } - static var swiftInterfaceAnalyzerModule: Self { .byName(name: .swiftInterfaceAnalyzerModule) } - static var projectSetupModule: Self { .byName(name: .projectSetupModule) } - static var swiftInterfaceProducerModule: Self { .byName(name: .swiftInterfaceProducerModule) } - static var swiftPackageFileHelperModule: Self { .byName(name: .swiftPackageFileHelperModule) } - static var swiftPackageFileAnalyzerModule: Self { .byName(name: .swiftPackageFileAnalyzerModule) } -} - let package = Package( name: "public-api-diff", platforms: [ @@ -44,7 +15,7 @@ let package = Package( ), .library( name: "SwiftInterfaceDiff", - targets: [.swiftInterfaceAnalyzerModule] + targets: ["SwiftInterfaceAnalyzerModule"] ) ], dependencies: [ @@ -56,18 +27,12 @@ let package = Package( .executableTarget( name: "public-api-diff", dependencies: [ - .core, - .logging, - .shell, - .git, - .outputGenerator, - .fileHandling, - .projectSetupModule, - .swiftInterfaceProducerModule, - .swiftInterfaceAnalyzerModule, - .swiftPackageFileHelperModule, - .swiftPackageFileAnalyzerModule, + "CoreModule", + "LoggingModule", + "OutputGeneratorModule", + "FileHandlingModule", "ProjectBuilderModule", + "SwiftInterfaceAnalyzerModule", .product(name: "ArgumentParser", package: "swift-argument-parser") ], path: "Sources/CommandLineTool" @@ -75,60 +40,27 @@ let package = Package( // MARK: - Modules - .target(name: .core), - .target(name: .shell, dependencies: [ - .core - ]), - .target(name: .logging, dependencies: [ - .core, - .fileHandling + .target(name: "CoreModule"), + .target(name: "FileHandlingModule", dependencies: []), + .target(name: "ShellModule"), + .target(name: "LoggingModule", dependencies: [ + "FileHandlingModule" ]), - .target(name: .git, dependencies: [ - .core, - .shell, - .fileHandling, - .logging + .target(name: "OutputGeneratorModule", dependencies: [ + "CoreModule" ]), - .target(name: .outputGenerator, dependencies: [ - .core - ]), - .target(name: .fileHandling, dependencies: [ - .core - ]), - .target(name: .swiftInterfaceAnalyzerModule, dependencies: [ - .core, + .target(name: "SwiftInterfaceAnalyzerModule", dependencies: [ + "CoreModule", .product(name: "SwiftSyntax", package: "swift-syntax"), .product(name: "SwiftParser", package: "swift-syntax"), ]), - .target(name: .swiftInterfaceProducerModule, dependencies: [ - .core, - .fileHandling, - .logging, - .swiftPackageFileHelperModule - ]), - .target(name: .projectSetupModule, dependencies: [ - .shell, - .fileHandling, - .logging, - .git - ]), - .target(name: .swiftPackageFileHelperModule, dependencies: [ - .core, - .fileHandling, - .logging - ]), - .target(name: .swiftPackageFileAnalyzerModule, dependencies: [ - .core, - .fileHandling, - .shell, - .logging, - .swiftPackageFileHelperModule - ]), .target(name: "ProjectBuilderModule", dependencies: [ - .swiftPackageFileAnalyzerModule, - .swiftPackageFileHelperModule, - .fileHandling, - .logging + "CoreModule", + "FileHandlingModule", + "LoggingModule", + "ShellModule", + .product(name: "SwiftSyntax", package: "swift-syntax"), + .product(name: "SwiftParser", package: "swift-syntax"), ]), // MARK: - Test Targets diff --git a/Sources/CommandLineTool/public-api-diff.swift b/Sources/CommandLineTool/public-api-diff.swift index 1961c7c..6ec3bc3 100644 --- a/Sources/CommandLineTool/public-api-diff.swift +++ b/Sources/CommandLineTool/public-api-diff.swift @@ -7,15 +7,12 @@ import ArgumentParser import Foundation -import LoggingModule -import FileHandlingModule import CoreModule -import ProjectSetupModule -import ShellModule -import SwiftInterfaceProducerModule +import LoggingModule + import SwiftInterfaceAnalyzerModule -import OutputGeneratorModule import ProjectBuilderModule +import OutputGeneratorModule @main struct PublicApiDiff: AsyncParsableCommand { @@ -44,22 +41,20 @@ struct PublicApiDiff: AsyncParsableCommand { }() let swiftInterfaceType: SwiftInterfaceType = .public // Only needed when we have to produce the .swiftinterface files - let fileHandler: FileHandling = FileManager.default - let shell: any ShellHandling = Shell() - let logger = Self.logger(with: logLevel, logOutputFilePath: logOutput, fileHandler: fileHandler) + let logger = Self.logger(with: logLevel, logOutputFilePath: logOutput) do { var warnings = [String]() var changes = [String: [Change]]() - let oldSource: ProjectSource = try ProjectSource.from(old, fileHandler: fileHandler) - let newSource: ProjectSource = try ProjectSource.from(new, fileHandler: fileHandler) + // MARK: - Producing .swiftinterface files + + let oldSource: ProjectSource = try ProjectSource.from(old) + let newSource: ProjectSource = try ProjectSource.from(new) let oldVersionName = oldSource.description let newVersionName = newSource.description - // MARK: - Producing .swiftinterface files - let projectBuilder = ProjectBuilder( projectType: projectType, swiftInterfaceType: swiftInterfaceType, @@ -106,7 +101,7 @@ struct PublicApiDiff: AsyncParsableCommand { ) if let output { - try fileHandler.write(generatedOutput, to: output) + try FileManager.default.write(generatedOutput, to: output) } else { // We're not using a logger here as we always want to have it printed if no output was specified print(generatedOutput) @@ -121,10 +116,13 @@ struct PublicApiDiff: AsyncParsableCommand { private extension PublicApiDiff { - static func logger(with logLevel: LogLevel, logOutputFilePath: String?, fileHandler: any FileHandling) -> any Logging { + static func logger( + with logLevel: LogLevel, + logOutputFilePath: String? + ) -> any Logging { var loggers = [any Logging]() if let logOutputFilePath { - loggers += [LogFileLogger(fileHandler: fileHandler, outputFilePath: logOutputFilePath)] + loggers += [LogFileLogger(outputFilePath: logOutputFilePath)] } loggers += [SystemLogger().withLogLevel(logLevel)] diff --git a/Sources/FileHandlingModule/FileHandling+Convenience.swift b/Sources/FileHandlingModule/FileHandling+Convenience.swift index 7c7f691..a9141a4 100644 --- a/Sources/FileHandlingModule/FileHandling+Convenience.swift +++ b/Sources/FileHandlingModule/FileHandling+Convenience.swift @@ -5,7 +5,6 @@ // import Foundation -import CoreModule public enum FileHandlerError: LocalizedError, Equatable { /// Could not encode the output string into data diff --git a/Sources/FileHandlingModule/FileManager+FileHandling.swift b/Sources/FileHandlingModule/FileManager+FileHandling.swift index 27a0d22..3a3738f 100644 --- a/Sources/FileHandlingModule/FileManager+FileHandling.swift +++ b/Sources/FileHandlingModule/FileManager+FileHandling.swift @@ -5,7 +5,6 @@ // import Foundation -import CoreModule extension FileManager: FileHandling { diff --git a/Sources/LoggingModule/LogFileLogger.swift b/Sources/LoggingModule/LogFileLogger.swift index 0588db3..6f4674b 100644 --- a/Sources/LoggingModule/LogFileLogger.swift +++ b/Sources/LoggingModule/LogFileLogger.swift @@ -1,5 +1,4 @@ import Foundation -import CoreModule import FileHandlingModule public class LogFileLogger: Logging { @@ -14,7 +13,7 @@ public class LogFileLogger: Logging { } } - public init(fileHandler: any FileHandling, outputFilePath: String) { + public init(fileHandler: any FileHandling = FileManager.default, outputFilePath: String) { self.fileHandler = fileHandler self.outputFilePath = outputFilePath } diff --git a/Sources/LoggingModule/LogLevelLogger.swift b/Sources/LoggingModule/LogLevelLogger.swift index 15bcbfd..f7d7b21 100644 --- a/Sources/LoggingModule/LogLevelLogger.swift +++ b/Sources/LoggingModule/LogLevelLogger.swift @@ -1,6 +1,5 @@ import Foundation import OSLog -import CoreModule public enum LogLevel { /// No logs diff --git a/Sources/LoggingModule/LoggingGroup.swift b/Sources/LoggingModule/LoggingGroup.swift index 56150e6..1120a7f 100644 --- a/Sources/LoggingModule/LoggingGroup.swift +++ b/Sources/LoggingModule/LoggingGroup.swift @@ -1,5 +1,4 @@ import Foundation -import CoreModule public struct LoggingGroup: Logging { diff --git a/Sources/LoggingModule/SystemLogger.swift b/Sources/LoggingModule/SystemLogger.swift index 794be1c..b2fff37 100644 --- a/Sources/LoggingModule/SystemLogger.swift +++ b/Sources/LoggingModule/SystemLogger.swift @@ -1,6 +1,5 @@ import Foundation import OSLog -import CoreModule public struct SystemLogger: Logging { diff --git a/Sources/ProjectBuilderModule/ProjectBuilder.swift b/Sources/ProjectBuilderModule/ProjectBuilder.swift index e4fc0fc..7c15ed8 100644 --- a/Sources/ProjectBuilderModule/ProjectBuilder.swift +++ b/Sources/ProjectBuilderModule/ProjectBuilder.swift @@ -8,12 +8,9 @@ import Foundation import FileHandlingModule -import ProjectSetupModule import LoggingModule import CoreModule import ShellModule -import SwiftPackageFileAnalyzerModule -import SwiftInterfaceProducerModule public struct ProjectBuilder { diff --git a/Sources/GitModule/Git.swift b/Sources/ProjectBuilderModule/ProjectSetup/Git.swift similarity index 100% rename from Sources/GitModule/Git.swift rename to Sources/ProjectBuilderModule/ProjectSetup/Git.swift diff --git a/Sources/ProjectSetupModule/ProjectSetupHelper.swift b/Sources/ProjectBuilderModule/ProjectSetup/ProjectSetupHelper.swift similarity index 99% rename from Sources/ProjectSetupModule/ProjectSetupHelper.swift rename to Sources/ProjectBuilderModule/ProjectSetup/ProjectSetupHelper.swift index 2188e92..f27aeea 100644 --- a/Sources/ProjectSetupModule/ProjectSetupHelper.swift +++ b/Sources/ProjectBuilderModule/ProjectSetup/ProjectSetupHelper.swift @@ -4,7 +4,6 @@ import CoreModule import ShellModule import FileHandlingModule import LoggingModule -import GitModule public struct ProjectSetupHelper: ProjectSetupHelping { diff --git a/Sources/ProjectSetupModule/ProjectSetupHelping.swift b/Sources/ProjectBuilderModule/ProjectSetup/ProjectSetupHelping.swift similarity index 100% rename from Sources/ProjectSetupModule/ProjectSetupHelping.swift rename to Sources/ProjectBuilderModule/ProjectSetup/ProjectSetupHelping.swift diff --git a/Sources/ProjectSetupModule/ProjectSource.swift b/Sources/ProjectBuilderModule/ProjectSetup/ProjectSource.swift similarity index 96% rename from Sources/ProjectSetupModule/ProjectSource.swift rename to Sources/ProjectBuilderModule/ProjectSetup/ProjectSource.swift index 7b0e7db..9fdb92c 100644 --- a/Sources/ProjectSetupModule/ProjectSource.swift +++ b/Sources/ProjectBuilderModule/ProjectSetup/ProjectSource.swift @@ -26,7 +26,7 @@ public enum ProjectSource: Equatable { case local(path: String) case remote(branch: String, repository: String) - public static func from(_ rawValue: String, fileHandler: FileHandling) throws -> ProjectSource { + public static func from(_ rawValue: String, fileHandler: FileHandling = FileManager.default) throws -> ProjectSource { if fileHandler.fileExists(atPath: rawValue) { return .local(path: rawValue) } diff --git a/Sources/CoreModule/RandomStringGenerating.swift b/Sources/ProjectBuilderModule/ProjectSetup/RandomStringGenerating.swift similarity index 100% rename from Sources/CoreModule/RandomStringGenerating.swift rename to Sources/ProjectBuilderModule/ProjectSetup/RandomStringGenerating.swift diff --git a/Sources/CoreModule/ProjectType.swift b/Sources/ProjectBuilderModule/ProjectType.swift similarity index 100% rename from Sources/CoreModule/ProjectType.swift rename to Sources/ProjectBuilderModule/ProjectType.swift diff --git a/Sources/SwiftInterfaceProducerModule/SwiftInterfaceFileLocator.swift b/Sources/ProjectBuilderModule/SwiftInterfaceProducer/SwiftInterfaceFileLocator.swift similarity index 100% rename from Sources/SwiftInterfaceProducerModule/SwiftInterfaceFileLocator.swift rename to Sources/ProjectBuilderModule/SwiftInterfaceProducer/SwiftInterfaceFileLocator.swift diff --git a/Sources/SwiftInterfaceProducerModule/SwiftInterfaceProducer.swift b/Sources/ProjectBuilderModule/SwiftInterfaceProducer/SwiftInterfaceProducer.swift similarity index 99% rename from Sources/SwiftInterfaceProducerModule/SwiftInterfaceProducer.swift rename to Sources/ProjectBuilderModule/SwiftInterfaceProducer/SwiftInterfaceProducer.swift index 2310a3a..769e344 100644 --- a/Sources/SwiftInterfaceProducerModule/SwiftInterfaceProducer.swift +++ b/Sources/ProjectBuilderModule/SwiftInterfaceProducer/SwiftInterfaceProducer.swift @@ -4,7 +4,6 @@ import FileHandlingModule import ShellModule import LoggingModule import CoreModule -import SwiftPackageFileHelperModule /// Allows building of the old & new project and returns the `.swiftinterface` files public struct SwiftInterfaceProducer { diff --git a/Sources/SwiftInterfaceProducerModule/SwiftInterfaceProducerError.swift b/Sources/ProjectBuilderModule/SwiftInterfaceProducer/SwiftInterfaceProducerError.swift similarity index 100% rename from Sources/SwiftInterfaceProducerModule/SwiftInterfaceProducerError.swift rename to Sources/ProjectBuilderModule/SwiftInterfaceProducer/SwiftInterfaceProducerError.swift diff --git a/Sources/SwiftInterfaceProducerModule/SwiftInterfaceType.swift b/Sources/ProjectBuilderModule/SwiftInterfaceProducer/SwiftInterfaceType.swift similarity index 100% rename from Sources/SwiftInterfaceProducerModule/SwiftInterfaceType.swift rename to Sources/ProjectBuilderModule/SwiftInterfaceProducer/SwiftInterfaceType.swift diff --git a/Sources/SwiftInterfaceProducerModule/XcodeTools.swift b/Sources/ProjectBuilderModule/SwiftInterfaceProducer/XcodeTools.swift similarity index 100% rename from Sources/SwiftInterfaceProducerModule/XcodeTools.swift rename to Sources/ProjectBuilderModule/SwiftInterfaceProducer/XcodeTools.swift diff --git a/Sources/SwiftPackageFileAnalyzerModule/SwiftPackageFileAnalyzer.swift b/Sources/ProjectBuilderModule/SwiftPackageFileAnalyzer/SwiftPackageFileAnalyzer.swift similarity index 99% rename from Sources/SwiftPackageFileAnalyzerModule/SwiftPackageFileAnalyzer.swift rename to Sources/ProjectBuilderModule/SwiftPackageFileAnalyzer/SwiftPackageFileAnalyzer.swift index 816a893..dc3c1f0 100644 --- a/Sources/SwiftPackageFileAnalyzerModule/SwiftPackageFileAnalyzer.swift +++ b/Sources/ProjectBuilderModule/SwiftPackageFileAnalyzer/SwiftPackageFileAnalyzer.swift @@ -10,7 +10,6 @@ import CoreModule import FileHandlingModule import ShellModule import LoggingModule -import SwiftPackageFileHelperModule public struct SwiftPackageFileAnalyzer: SwiftPackageFileAnalyzing { diff --git a/Sources/SwiftPackageFileAnalyzerModule/SwiftPackageFileAnalyzing.swift b/Sources/ProjectBuilderModule/SwiftPackageFileAnalyzer/SwiftPackageFileAnalyzing.swift similarity index 100% rename from Sources/SwiftPackageFileAnalyzerModule/SwiftPackageFileAnalyzing.swift rename to Sources/ProjectBuilderModule/SwiftPackageFileAnalyzer/SwiftPackageFileAnalyzing.swift diff --git a/Sources/SwiftPackageFileHelperModule/SwiftPackageDescription.swift b/Sources/ProjectBuilderModule/SwiftPackageFileHelper/SwiftPackageDescription.swift similarity index 100% rename from Sources/SwiftPackageFileHelperModule/SwiftPackageDescription.swift rename to Sources/ProjectBuilderModule/SwiftPackageFileHelper/SwiftPackageDescription.swift diff --git a/Sources/SwiftPackageFileHelperModule/SwiftPackageFileHelper.swift b/Sources/ProjectBuilderModule/SwiftPackageFileHelper/SwiftPackageFileHelper.swift similarity index 100% rename from Sources/SwiftPackageFileHelperModule/SwiftPackageFileHelper.swift rename to Sources/ProjectBuilderModule/SwiftPackageFileHelper/SwiftPackageFileHelper.swift diff --git a/Tests/IntegrationTests/ReferencePackageTests.swift b/Tests/IntegrationTests/ReferencePackageTests.swift index e014c46..74c79fd 100644 --- a/Tests/IntegrationTests/ReferencePackageTests.swift +++ b/Tests/IntegrationTests/ReferencePackageTests.swift @@ -4,7 +4,11 @@ // This file is open source and available under the MIT license. See the LICENSE file for more info. // -@testable import public_api_diff +@testable import ProjectBuilderModule +@testable import OutputGeneratorModule +@testable import ProjectBuilderModule +@testable import SwiftInterfaceAnalyzerModule +@testable import CoreModule import XCTest class ReferencePackageTests: XCTestCase { diff --git a/Tests/UnitTests/FileHandlingTests.swift b/Tests/UnitTests/FileHandlingTests.swift index e9f3066..8a067ca 100644 --- a/Tests/UnitTests/FileHandlingTests.swift +++ b/Tests/UnitTests/FileHandlingTests.swift @@ -4,7 +4,7 @@ // This file is open source and available under the MIT license. See the LICENSE file for more info. // -@testable import public_api_diff +@testable import FileHandlingModule import XCTest class FileHandlingTests: XCTestCase { diff --git a/Tests/UnitTests/GitTests.swift b/Tests/UnitTests/GitTests.swift index 8dd852f..e7caa0c 100644 --- a/Tests/UnitTests/GitTests.swift +++ b/Tests/UnitTests/GitTests.swift @@ -4,7 +4,7 @@ // This file is open source and available under the MIT license. See the LICENSE file for more info. // -@testable import public_api_diff +@testable import ProjectBuilderModule import XCTest class GitTests: XCTestCase { diff --git a/Tests/UnitTests/LoggerTests.swift b/Tests/UnitTests/LoggerTests.swift index 5492153..c64187b 100644 --- a/Tests/UnitTests/LoggerTests.swift +++ b/Tests/UnitTests/LoggerTests.swift @@ -4,7 +4,7 @@ // This file is open source and available under the MIT license. See the LICENSE file for more info. // -@testable import public_api_diff +@testable import LoggingModule import XCTest class LoggerTests: XCTestCase { diff --git a/Tests/UnitTests/OutputGeneratorTests.swift b/Tests/UnitTests/OutputGeneratorTests.swift index f7a2692..f6e0162 100644 --- a/Tests/UnitTests/OutputGeneratorTests.swift +++ b/Tests/UnitTests/OutputGeneratorTests.swift @@ -4,7 +4,7 @@ // This file is open source and available under the MIT license. See the LICENSE file for more info. // -@testable import public_api_diff +@testable import OutputGeneratorModule import XCTest class OutputGeneratorTests: XCTestCase { @@ -23,8 +23,8 @@ class OutputGeneratorTests: XCTestCase { let output = outputGenerator.generate( from: [:], allTargets: ["Target_1"], - oldVersionName: ProjectSource.local(path: "old_source").description, - newVersionName: ProjectSource.local(path: "new_source").description, + oldVersionName: "old_source", + newVersionName: "new_source", warnings: [] ) XCTAssertEqual(output, expectedOutput) @@ -52,8 +52,8 @@ class OutputGeneratorTests: XCTestCase { let output = outputGenerator.generate( from: ["Target_1": [.init(changeType: .addition(description: "Some Addition"), parentPath: "")]], allTargets: ["Target_1"], - oldVersionName: ProjectSource.local(path: "old_source").description, - newVersionName: ProjectSource.local(path: "new_source").description, + oldVersionName: "old_source", + newVersionName: "new_source", warnings: [] ) XCTAssertEqual(output, expectedOutput) @@ -103,8 +103,8 @@ class OutputGeneratorTests: XCTestCase { ] ], allTargets: ["Target_1", "Target_2"], - oldVersionName: ProjectSource.remote(branch: "old_branch", repository: "old_repository").description, - newVersionName: ProjectSource.local(path: "new_source").description, + oldVersionName: "old_repository @ old_branch", + newVersionName: "new_source", warnings: [] ) XCTAssertEqual(output, expectedOutput) diff --git a/Tests/UnitTests/PipelineTests.swift b/Tests/UnitTests/PipelineTests.swift index df0ce05..b6610b8 100644 --- a/Tests/UnitTests/PipelineTests.swift +++ b/Tests/UnitTests/PipelineTests.swift @@ -4,7 +4,8 @@ // This file is open source and available under the MIT license. See the LICENSE file for more info. // -@testable import public_api_diff +@testable import SwiftInterfaceAnalyzerModule +@testable import CoreModule import XCTest class PipelineTests: XCTestCase { diff --git a/Tests/UnitTests/ProjectSourceTests.swift b/Tests/UnitTests/ProjectSourceTests.swift index 29dc050..0bfa18e 100644 --- a/Tests/UnitTests/ProjectSourceTests.swift +++ b/Tests/UnitTests/ProjectSourceTests.swift @@ -4,7 +4,7 @@ // This file is open source and available under the MIT license. See the LICENSE file for more info. // -@testable import public_api_diff +@testable import ProjectBuilderModule import XCTest class ProjectSourceTests: XCTestCase { diff --git a/Tests/UnitTests/SwiftPackageFileAnalyzerTests.swift b/Tests/UnitTests/SwiftPackageFileAnalyzerTests.swift index 53f3691..b237f2f 100644 --- a/Tests/UnitTests/SwiftPackageFileAnalyzerTests.swift +++ b/Tests/UnitTests/SwiftPackageFileAnalyzerTests.swift @@ -4,7 +4,8 @@ // This file is open source and available under the MIT license. See the LICENSE file for more info. // -@testable import public_api_diff +@testable import ProjectBuilderModule +@testable import CoreModule import XCTest class SwiftPackageFileAnalyzerTests: XCTestCase { diff --git a/Tests/UnitTests/Utilities/MockFileHandler.swift b/Tests/UnitTests/Utilities/MockFileHandler.swift index 4e347d2..c773d79 100644 --- a/Tests/UnitTests/Utilities/MockFileHandler.swift +++ b/Tests/UnitTests/Utilities/MockFileHandler.swift @@ -4,7 +4,7 @@ // This file is open source and available under the MIT license. See the LICENSE file for more info. // -@testable import public_api_diff +@testable import FileHandlingModule import XCTest struct MockFileHandler: FileHandling { diff --git a/Tests/UnitTests/Utilities/MockLogger.swift b/Tests/UnitTests/Utilities/MockLogger.swift index f75fe0b..a4053bd 100644 --- a/Tests/UnitTests/Utilities/MockLogger.swift +++ b/Tests/UnitTests/Utilities/MockLogger.swift @@ -4,7 +4,7 @@ // This file is open source and available under the MIT license. See the LICENSE file for more info. // -@testable import public_api_diff +@testable import LoggingModule import XCTest struct MockLogger: Logging { diff --git a/Tests/UnitTests/Utilities/MockPipelineModules/MockLibraryAnalyzer.swift b/Tests/UnitTests/Utilities/MockPipelineModules/MockLibraryAnalyzer.swift index 56c560b..d1c9860 100644 --- a/Tests/UnitTests/Utilities/MockPipelineModules/MockLibraryAnalyzer.swift +++ b/Tests/UnitTests/Utilities/MockPipelineModules/MockLibraryAnalyzer.swift @@ -4,14 +4,14 @@ // This file is open source and available under the MIT license. See the LICENSE file for more info. // -@testable import public_api_diff +@testable import ProjectBuilderModule import XCTest -struct MockProjectAnalyzer: ProjectAnalyzing { +struct MockSwiftPackageFileAnalyzer: SwiftPackageFileAnalyzing { - var onAnalyze: (URL, URL) throws -> ProjectAnalyzerResult + var onAnalyze: (URL, URL) throws -> SwiftPackageFileAnalyzingResult - func analyze(oldProjectUrl: URL, newProjectUrl: URL) throws -> ProjectAnalyzerResult { + func analyze(oldProjectUrl: URL, newProjectUrl: URL) throws -> SwiftPackageFileAnalyzingResult { try onAnalyze(oldProjectUrl, newProjectUrl) } } diff --git a/Tests/UnitTests/Utilities/MockPipelineModules/MockOutputGenerator.swift b/Tests/UnitTests/Utilities/MockPipelineModules/MockOutputGenerator.swift index 7a117e2..46f59f5 100644 --- a/Tests/UnitTests/Utilities/MockPipelineModules/MockOutputGenerator.swift +++ b/Tests/UnitTests/Utilities/MockPipelineModules/MockOutputGenerator.swift @@ -4,7 +4,8 @@ // This file is open source and available under the MIT license. See the LICENSE file for more info. // -@testable import public_api_diff +@testable import OutputGeneratorModule +@testable import CoreModule import XCTest struct MockOutputGenerator: OutputGenerating { diff --git a/Tests/UnitTests/Utilities/MockRandomStringGenerator.swift b/Tests/UnitTests/Utilities/MockRandomStringGenerator.swift index f71e25d..0ba0296 100644 --- a/Tests/UnitTests/Utilities/MockRandomStringGenerator.swift +++ b/Tests/UnitTests/Utilities/MockRandomStringGenerator.swift @@ -4,7 +4,7 @@ // This file is open source and available under the MIT license. See the LICENSE file for more info. // -@testable import public_api_diff +@testable import ProjectBuilderModule import XCTest struct MockRandomStringGenerator: RandomStringGenerating { diff --git a/Tests/UnitTests/Utilities/MockShell.swift b/Tests/UnitTests/Utilities/MockShell.swift index 80018a2..b2e102c 100644 --- a/Tests/UnitTests/Utilities/MockShell.swift +++ b/Tests/UnitTests/Utilities/MockShell.swift @@ -4,7 +4,7 @@ // This file is open source and available under the MIT license. See the LICENSE file for more info. // -@testable import public_api_diff +@testable import ShellModule import XCTest struct MockShell: ShellHandling { diff --git a/Tests/UnitTests/Utilities/MockSwiftInterfaceAnalyzer.swift b/Tests/UnitTests/Utilities/MockSwiftInterfaceAnalyzer.swift index 11574ee..0f507a0 100644 --- a/Tests/UnitTests/Utilities/MockSwiftInterfaceAnalyzer.swift +++ b/Tests/UnitTests/Utilities/MockSwiftInterfaceAnalyzer.swift @@ -4,7 +4,8 @@ // This file is open source and available under the MIT license. See the LICENSE file for more info. // -@testable import public_api_diff +@testable import SwiftInterfaceAnalyzerModule +@testable import CoreModule import XCTest struct MockSwiftInterfaceAnalyzer: SwiftInterfaceAnalyzing { diff --git a/Tests/UnitTests/Utilities/MockSwiftInterfaceParser.swift b/Tests/UnitTests/Utilities/MockSwiftInterfaceParser.swift index 4c12a95..a49a457 100644 --- a/Tests/UnitTests/Utilities/MockSwiftInterfaceParser.swift +++ b/Tests/UnitTests/Utilities/MockSwiftInterfaceParser.swift @@ -4,7 +4,7 @@ // This file is open source and available under the MIT license. See the LICENSE file for more info. // -@testable import public_api_diff +@testable import SwiftInterfaceAnalyzerModule import XCTest struct MockSwiftInterfaceParser: SwiftInterfaceParsing { diff --git a/Tests/UnitTests/XcodeToolsTests.swift b/Tests/UnitTests/XcodeToolsTests.swift index 437dcb8..e3994f0 100644 --- a/Tests/UnitTests/XcodeToolsTests.swift +++ b/Tests/UnitTests/XcodeToolsTests.swift @@ -4,7 +4,7 @@ // This file is open source and available under the MIT license. See the LICENSE file for more info. // -@testable import public_api_diff +@testable import ProjectBuilderModule import XCTest class XcodeToolsTests: XCTestCase { From 0375526560ef06b578266541c431316c7ca08057 Mon Sep 17 00:00:00 2001 From: Alex Guretzki Date: Thu, 10 Oct 2024 16:17:53 +0200 Subject: [PATCH 03/12] Removing unused code --- .../SwiftInterfaceProducer/SwiftInterfaceType.swift | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/Sources/ProjectBuilderModule/SwiftInterfaceProducer/SwiftInterfaceType.swift b/Sources/ProjectBuilderModule/SwiftInterfaceProducer/SwiftInterfaceType.swift index 39d1557..918cfc8 100644 --- a/Sources/ProjectBuilderModule/SwiftInterfaceProducer/SwiftInterfaceType.swift +++ b/Sources/ProjectBuilderModule/SwiftInterfaceProducer/SwiftInterfaceType.swift @@ -1,5 +1,4 @@ import Foundation -import ArgumentParser /// The type of the .swiftinterface to parse/generate public enum SwiftInterfaceType { @@ -13,13 +12,3 @@ public enum SwiftInterfaceType { } } } - -extension SwiftInterfaceType: ExpressibleByArgument { - public init?(argument: String) { - switch argument { - case "private": self = .private - case "public": self = .public - default: return nil - } - } -} From 4d8843743ccb6cb17f4f4c21b834aa8a9a08307f Mon Sep 17 00:00:00 2001 From: Alex Guretzki Date: Thu, 10 Oct 2024 16:30:32 +0200 Subject: [PATCH 04/12] More modularization --- .../{ => ExecutableTargets}/CommandLineTool/public-api-diff.swift | 0 .../OutputGeneratorModule/MarkdownOutputGenerator.swift | 0 .../OutputGeneratorModule/OutputGenerating.swift | 0 .../ProjectBuilderModule/ProjectBuilder.swift | 0 .../ProjectBuilderModule/ProjectSetup/Git.swift | 0 .../ProjectBuilderModule/ProjectSetup/ProjectSetupHelper.swift | 0 .../ProjectBuilderModule/ProjectSetup/ProjectSetupHelping.swift | 0 .../ProjectBuilderModule/ProjectSetup/ProjectSource.swift | 0 .../ProjectSetup/RandomStringGenerating.swift | 0 .../{ => PipelineModules}/ProjectBuilderModule/ProjectType.swift | 0 .../SwiftInterfaceProducer/SwiftInterfaceFileLocator.swift | 0 .../SwiftInterfaceProducer/SwiftInterfaceProducer.swift | 0 .../SwiftInterfaceProducer/SwiftInterfaceProducerError.swift | 0 .../SwiftInterfaceProducer/SwiftInterfaceType.swift | 0 .../ProjectBuilderModule/SwiftInterfaceProducer/XcodeTools.swift | 0 .../SwiftPackageFileAnalyzer/SwiftPackageFileAnalyzer.swift | 0 .../SwiftPackageFileAnalyzer/SwiftPackageFileAnalyzing.swift | 0 .../SwiftPackageFileHelper/SwiftPackageDescription.swift | 0 .../SwiftPackageFileHelper/SwiftPackageFileHelper.swift | 0 .../SwiftInterfaceAnalyzer/IndependentSwiftInterfaceChange.swift | 0 .../SwiftInterfaceAnalyzer/SwiftInterfaceAnalyzer.swift | 0 .../SwiftInterfaceAnalyzer/SwiftInterfaceAnalyzing.swift | 0 .../SwiftInterfaceAnalyzer/SwiftInterfaceChangeConsolidator.swift | 0 .../SwiftInterfaceElement+DiffHelper.swift | 0 .../SwiftInterfaceAnalyzerModule/SwiftInterfaceElement.swift | 0 .../SwiftInterfaceParser/DeclSyntax+Convenience.swift | 0 .../ActorDeclSyntax+SwiftInterface.swift | 0 .../AssociatedTypeDeclSyntax+SwiftInterface.swift | 0 .../ClassDeclSyntac+SwiftInterface.swift | 0 .../EnumCaseDeclSyntax+SwiftInterface.swift | 0 .../DeclSyntax+SwiftInterface/EnumDeclSyntax+SwiftInterface.swift | 0 .../ExtensionDeclSyntax+SwiftInterface.swift | 0 .../FunctionDeclSyntax+SwiftInterface.swift | 0 .../InitializerDeclSyntax+SwiftInterface.swift | 0 .../ProtocolDeclSyntax+SwiftInterface.swift | 0 .../StructDeclSyntax+SwiftInterface.swift | 0 .../SubscriptDeclSyntax+SwiftInterface.swift | 0 .../TypeAliasDeclSyntax+SwiftInterface.swift | 0 .../DeclSyntax+SwiftInterface/VarDeclSyntax+SwiftInterface.swift | 0 .../SwiftInterfaceElement+Actor.swift | 0 .../SwiftInterfaceElement+AssociatedType.swift | 0 .../SwiftInterfaceElement+Class.swift | 0 .../SwiftInterfaceElement+Enum.swift | 0 .../SwiftInterfaceElement+EnumCase.swift | 0 .../SwiftInterfaceElement+Extension.swift | 0 .../SwiftInterfaceElement+Function.swift | 0 .../SwiftInterfaceElement+Initializer.swift | 0 .../SwiftInterfaceElement+Protocol.swift | 0 .../SwiftInterfaceElement+Struct.swift | 0 .../SwiftInterfaceElement+Subscript.swift | 0 .../SwiftInterfaceElement+TypeAlias.swift | 0 .../SwiftInterfaceElement+Var.swift | 0 .../SwiftInterfaceParser/SwiftInterfaceParser+Root.swift | 0 .../SwiftInterfaceParser/SwiftInterfaceParser.swift | 0 .../SwiftInterfaceParser/SwiftInterfaceParsing.swift | 0 .../SwiftInterfaceAnalyzerModule/SwiftInterfacePipeline.swift | 0 Sources/{ => SharedHelperModules}/CoreModule/Change.swift | 0 .../{ => SharedHelperModules}/CoreModule/SwiftInterfaceFile.swift | 0 .../FileHandlingModule/FileHandling+Convenience.swift | 0 .../FileHandlingModule/FileHandling.swift | 0 .../FileHandlingModule/FileManager+FileHandling.swift | 0 .../{ => SharedHelperModules}/LoggingModule/LogFileLogger.swift | 0 .../{ => SharedHelperModules}/LoggingModule/LogLevelLogger.swift | 0 Sources/{ => SharedHelperModules}/LoggingModule/Logging.swift | 0 .../{ => SharedHelperModules}/LoggingModule/LoggingGroup.swift | 0 .../{ => SharedHelperModules}/LoggingModule/SystemLogger.swift | 0 Sources/{ => SharedHelperModules}/ShellModule/Shell.swift | 0 67 files changed, 0 insertions(+), 0 deletions(-) rename Sources/{ => ExecutableTargets}/CommandLineTool/public-api-diff.swift (100%) rename Sources/{ => PipelineModules}/OutputGeneratorModule/MarkdownOutputGenerator.swift (100%) rename Sources/{ => PipelineModules}/OutputGeneratorModule/OutputGenerating.swift (100%) rename Sources/{ => PipelineModules}/ProjectBuilderModule/ProjectBuilder.swift (100%) rename Sources/{ => PipelineModules}/ProjectBuilderModule/ProjectSetup/Git.swift (100%) rename Sources/{ => PipelineModules}/ProjectBuilderModule/ProjectSetup/ProjectSetupHelper.swift (100%) rename Sources/{ => PipelineModules}/ProjectBuilderModule/ProjectSetup/ProjectSetupHelping.swift (100%) rename Sources/{ => PipelineModules}/ProjectBuilderModule/ProjectSetup/ProjectSource.swift (100%) rename Sources/{ => PipelineModules}/ProjectBuilderModule/ProjectSetup/RandomStringGenerating.swift (100%) rename Sources/{ => PipelineModules}/ProjectBuilderModule/ProjectType.swift (100%) rename Sources/{ => PipelineModules}/ProjectBuilderModule/SwiftInterfaceProducer/SwiftInterfaceFileLocator.swift (100%) rename Sources/{ => PipelineModules}/ProjectBuilderModule/SwiftInterfaceProducer/SwiftInterfaceProducer.swift (100%) rename Sources/{ => PipelineModules}/ProjectBuilderModule/SwiftInterfaceProducer/SwiftInterfaceProducerError.swift (100%) rename Sources/{ => PipelineModules}/ProjectBuilderModule/SwiftInterfaceProducer/SwiftInterfaceType.swift (100%) rename Sources/{ => PipelineModules}/ProjectBuilderModule/SwiftInterfaceProducer/XcodeTools.swift (100%) rename Sources/{ => PipelineModules}/ProjectBuilderModule/SwiftPackageFileAnalyzer/SwiftPackageFileAnalyzer.swift (100%) rename Sources/{ => PipelineModules}/ProjectBuilderModule/SwiftPackageFileAnalyzer/SwiftPackageFileAnalyzing.swift (100%) rename Sources/{ => PipelineModules}/ProjectBuilderModule/SwiftPackageFileHelper/SwiftPackageDescription.swift (100%) rename Sources/{ => PipelineModules}/ProjectBuilderModule/SwiftPackageFileHelper/SwiftPackageFileHelper.swift (100%) rename Sources/{ => PipelineModules}/SwiftInterfaceAnalyzerModule/SwiftInterfaceAnalyzer/IndependentSwiftInterfaceChange.swift (100%) rename Sources/{ => PipelineModules}/SwiftInterfaceAnalyzerModule/SwiftInterfaceAnalyzer/SwiftInterfaceAnalyzer.swift (100%) rename Sources/{ => PipelineModules}/SwiftInterfaceAnalyzerModule/SwiftInterfaceAnalyzer/SwiftInterfaceAnalyzing.swift (100%) rename Sources/{ => PipelineModules}/SwiftInterfaceAnalyzerModule/SwiftInterfaceAnalyzer/SwiftInterfaceChangeConsolidator.swift (100%) rename Sources/{ => PipelineModules}/SwiftInterfaceAnalyzerModule/SwiftInterfaceElement+DiffHelper.swift (100%) rename Sources/{ => PipelineModules}/SwiftInterfaceAnalyzerModule/SwiftInterfaceElement.swift (100%) rename Sources/{ => PipelineModules}/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/DeclSyntax+Convenience.swift (100%) rename Sources/{ => PipelineModules}/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/DeclSyntax+SwiftInterface/ActorDeclSyntax+SwiftInterface.swift (100%) rename Sources/{ => PipelineModules}/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/DeclSyntax+SwiftInterface/AssociatedTypeDeclSyntax+SwiftInterface.swift (100%) rename Sources/{ => PipelineModules}/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/DeclSyntax+SwiftInterface/ClassDeclSyntac+SwiftInterface.swift (100%) rename Sources/{ => PipelineModules}/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/DeclSyntax+SwiftInterface/EnumCaseDeclSyntax+SwiftInterface.swift (100%) rename Sources/{ => PipelineModules}/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/DeclSyntax+SwiftInterface/EnumDeclSyntax+SwiftInterface.swift (100%) rename Sources/{ => PipelineModules}/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/DeclSyntax+SwiftInterface/ExtensionDeclSyntax+SwiftInterface.swift (100%) rename Sources/{ => PipelineModules}/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/DeclSyntax+SwiftInterface/FunctionDeclSyntax+SwiftInterface.swift (100%) rename Sources/{ => PipelineModules}/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/DeclSyntax+SwiftInterface/InitializerDeclSyntax+SwiftInterface.swift (100%) rename Sources/{ => PipelineModules}/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/DeclSyntax+SwiftInterface/ProtocolDeclSyntax+SwiftInterface.swift (100%) rename Sources/{ => PipelineModules}/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/DeclSyntax+SwiftInterface/StructDeclSyntax+SwiftInterface.swift (100%) rename Sources/{ => PipelineModules}/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/DeclSyntax+SwiftInterface/SubscriptDeclSyntax+SwiftInterface.swift (100%) rename Sources/{ => PipelineModules}/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/DeclSyntax+SwiftInterface/TypeAliasDeclSyntax+SwiftInterface.swift (100%) rename Sources/{ => PipelineModules}/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/DeclSyntax+SwiftInterface/VarDeclSyntax+SwiftInterface.swift (100%) rename Sources/{ => PipelineModules}/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+Actor.swift (100%) rename Sources/{ => PipelineModules}/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+AssociatedType.swift (100%) rename Sources/{ => PipelineModules}/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+Class.swift (100%) rename Sources/{ => PipelineModules}/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+Enum.swift (100%) rename Sources/{ => PipelineModules}/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+EnumCase.swift (100%) rename Sources/{ => PipelineModules}/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+Extension.swift (100%) rename Sources/{ => PipelineModules}/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+Function.swift (100%) rename Sources/{ => PipelineModules}/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+Initializer.swift (100%) rename Sources/{ => PipelineModules}/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+Protocol.swift (100%) rename Sources/{ => PipelineModules}/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+Struct.swift (100%) rename Sources/{ => PipelineModules}/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+Subscript.swift (100%) rename Sources/{ => PipelineModules}/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+TypeAlias.swift (100%) rename Sources/{ => PipelineModules}/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+Var.swift (100%) rename Sources/{ => PipelineModules}/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/SwiftInterfaceParser+Root.swift (100%) rename Sources/{ => PipelineModules}/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/SwiftInterfaceParser.swift (100%) rename Sources/{ => PipelineModules}/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/SwiftInterfaceParsing.swift (100%) rename Sources/{ => PipelineModules}/SwiftInterfaceAnalyzerModule/SwiftInterfacePipeline.swift (100%) rename Sources/{ => SharedHelperModules}/CoreModule/Change.swift (100%) rename Sources/{ => SharedHelperModules}/CoreModule/SwiftInterfaceFile.swift (100%) rename Sources/{ => SharedHelperModules}/FileHandlingModule/FileHandling+Convenience.swift (100%) rename Sources/{ => SharedHelperModules}/FileHandlingModule/FileHandling.swift (100%) rename Sources/{ => SharedHelperModules}/FileHandlingModule/FileManager+FileHandling.swift (100%) rename Sources/{ => SharedHelperModules}/LoggingModule/LogFileLogger.swift (100%) rename Sources/{ => SharedHelperModules}/LoggingModule/LogLevelLogger.swift (100%) rename Sources/{ => SharedHelperModules}/LoggingModule/Logging.swift (100%) rename Sources/{ => SharedHelperModules}/LoggingModule/LoggingGroup.swift (100%) rename Sources/{ => SharedHelperModules}/LoggingModule/SystemLogger.swift (100%) rename Sources/{ => SharedHelperModules}/ShellModule/Shell.swift (100%) diff --git a/Sources/CommandLineTool/public-api-diff.swift b/Sources/ExecutableTargets/CommandLineTool/public-api-diff.swift similarity index 100% rename from Sources/CommandLineTool/public-api-diff.swift rename to Sources/ExecutableTargets/CommandLineTool/public-api-diff.swift diff --git a/Sources/OutputGeneratorModule/MarkdownOutputGenerator.swift b/Sources/PipelineModules/OutputGeneratorModule/MarkdownOutputGenerator.swift similarity index 100% rename from Sources/OutputGeneratorModule/MarkdownOutputGenerator.swift rename to Sources/PipelineModules/OutputGeneratorModule/MarkdownOutputGenerator.swift diff --git a/Sources/OutputGeneratorModule/OutputGenerating.swift b/Sources/PipelineModules/OutputGeneratorModule/OutputGenerating.swift similarity index 100% rename from Sources/OutputGeneratorModule/OutputGenerating.swift rename to Sources/PipelineModules/OutputGeneratorModule/OutputGenerating.swift diff --git a/Sources/ProjectBuilderModule/ProjectBuilder.swift b/Sources/PipelineModules/ProjectBuilderModule/ProjectBuilder.swift similarity index 100% rename from Sources/ProjectBuilderModule/ProjectBuilder.swift rename to Sources/PipelineModules/ProjectBuilderModule/ProjectBuilder.swift diff --git a/Sources/ProjectBuilderModule/ProjectSetup/Git.swift b/Sources/PipelineModules/ProjectBuilderModule/ProjectSetup/Git.swift similarity index 100% rename from Sources/ProjectBuilderModule/ProjectSetup/Git.swift rename to Sources/PipelineModules/ProjectBuilderModule/ProjectSetup/Git.swift diff --git a/Sources/ProjectBuilderModule/ProjectSetup/ProjectSetupHelper.swift b/Sources/PipelineModules/ProjectBuilderModule/ProjectSetup/ProjectSetupHelper.swift similarity index 100% rename from Sources/ProjectBuilderModule/ProjectSetup/ProjectSetupHelper.swift rename to Sources/PipelineModules/ProjectBuilderModule/ProjectSetup/ProjectSetupHelper.swift diff --git a/Sources/ProjectBuilderModule/ProjectSetup/ProjectSetupHelping.swift b/Sources/PipelineModules/ProjectBuilderModule/ProjectSetup/ProjectSetupHelping.swift similarity index 100% rename from Sources/ProjectBuilderModule/ProjectSetup/ProjectSetupHelping.swift rename to Sources/PipelineModules/ProjectBuilderModule/ProjectSetup/ProjectSetupHelping.swift diff --git a/Sources/ProjectBuilderModule/ProjectSetup/ProjectSource.swift b/Sources/PipelineModules/ProjectBuilderModule/ProjectSetup/ProjectSource.swift similarity index 100% rename from Sources/ProjectBuilderModule/ProjectSetup/ProjectSource.swift rename to Sources/PipelineModules/ProjectBuilderModule/ProjectSetup/ProjectSource.swift diff --git a/Sources/ProjectBuilderModule/ProjectSetup/RandomStringGenerating.swift b/Sources/PipelineModules/ProjectBuilderModule/ProjectSetup/RandomStringGenerating.swift similarity index 100% rename from Sources/ProjectBuilderModule/ProjectSetup/RandomStringGenerating.swift rename to Sources/PipelineModules/ProjectBuilderModule/ProjectSetup/RandomStringGenerating.swift diff --git a/Sources/ProjectBuilderModule/ProjectType.swift b/Sources/PipelineModules/ProjectBuilderModule/ProjectType.swift similarity index 100% rename from Sources/ProjectBuilderModule/ProjectType.swift rename to Sources/PipelineModules/ProjectBuilderModule/ProjectType.swift diff --git a/Sources/ProjectBuilderModule/SwiftInterfaceProducer/SwiftInterfaceFileLocator.swift b/Sources/PipelineModules/ProjectBuilderModule/SwiftInterfaceProducer/SwiftInterfaceFileLocator.swift similarity index 100% rename from Sources/ProjectBuilderModule/SwiftInterfaceProducer/SwiftInterfaceFileLocator.swift rename to Sources/PipelineModules/ProjectBuilderModule/SwiftInterfaceProducer/SwiftInterfaceFileLocator.swift diff --git a/Sources/ProjectBuilderModule/SwiftInterfaceProducer/SwiftInterfaceProducer.swift b/Sources/PipelineModules/ProjectBuilderModule/SwiftInterfaceProducer/SwiftInterfaceProducer.swift similarity index 100% rename from Sources/ProjectBuilderModule/SwiftInterfaceProducer/SwiftInterfaceProducer.swift rename to Sources/PipelineModules/ProjectBuilderModule/SwiftInterfaceProducer/SwiftInterfaceProducer.swift diff --git a/Sources/ProjectBuilderModule/SwiftInterfaceProducer/SwiftInterfaceProducerError.swift b/Sources/PipelineModules/ProjectBuilderModule/SwiftInterfaceProducer/SwiftInterfaceProducerError.swift similarity index 100% rename from Sources/ProjectBuilderModule/SwiftInterfaceProducer/SwiftInterfaceProducerError.swift rename to Sources/PipelineModules/ProjectBuilderModule/SwiftInterfaceProducer/SwiftInterfaceProducerError.swift diff --git a/Sources/ProjectBuilderModule/SwiftInterfaceProducer/SwiftInterfaceType.swift b/Sources/PipelineModules/ProjectBuilderModule/SwiftInterfaceProducer/SwiftInterfaceType.swift similarity index 100% rename from Sources/ProjectBuilderModule/SwiftInterfaceProducer/SwiftInterfaceType.swift rename to Sources/PipelineModules/ProjectBuilderModule/SwiftInterfaceProducer/SwiftInterfaceType.swift diff --git a/Sources/ProjectBuilderModule/SwiftInterfaceProducer/XcodeTools.swift b/Sources/PipelineModules/ProjectBuilderModule/SwiftInterfaceProducer/XcodeTools.swift similarity index 100% rename from Sources/ProjectBuilderModule/SwiftInterfaceProducer/XcodeTools.swift rename to Sources/PipelineModules/ProjectBuilderModule/SwiftInterfaceProducer/XcodeTools.swift diff --git a/Sources/ProjectBuilderModule/SwiftPackageFileAnalyzer/SwiftPackageFileAnalyzer.swift b/Sources/PipelineModules/ProjectBuilderModule/SwiftPackageFileAnalyzer/SwiftPackageFileAnalyzer.swift similarity index 100% rename from Sources/ProjectBuilderModule/SwiftPackageFileAnalyzer/SwiftPackageFileAnalyzer.swift rename to Sources/PipelineModules/ProjectBuilderModule/SwiftPackageFileAnalyzer/SwiftPackageFileAnalyzer.swift diff --git a/Sources/ProjectBuilderModule/SwiftPackageFileAnalyzer/SwiftPackageFileAnalyzing.swift b/Sources/PipelineModules/ProjectBuilderModule/SwiftPackageFileAnalyzer/SwiftPackageFileAnalyzing.swift similarity index 100% rename from Sources/ProjectBuilderModule/SwiftPackageFileAnalyzer/SwiftPackageFileAnalyzing.swift rename to Sources/PipelineModules/ProjectBuilderModule/SwiftPackageFileAnalyzer/SwiftPackageFileAnalyzing.swift diff --git a/Sources/ProjectBuilderModule/SwiftPackageFileHelper/SwiftPackageDescription.swift b/Sources/PipelineModules/ProjectBuilderModule/SwiftPackageFileHelper/SwiftPackageDescription.swift similarity index 100% rename from Sources/ProjectBuilderModule/SwiftPackageFileHelper/SwiftPackageDescription.swift rename to Sources/PipelineModules/ProjectBuilderModule/SwiftPackageFileHelper/SwiftPackageDescription.swift diff --git a/Sources/ProjectBuilderModule/SwiftPackageFileHelper/SwiftPackageFileHelper.swift b/Sources/PipelineModules/ProjectBuilderModule/SwiftPackageFileHelper/SwiftPackageFileHelper.swift similarity index 100% rename from Sources/ProjectBuilderModule/SwiftPackageFileHelper/SwiftPackageFileHelper.swift rename to Sources/PipelineModules/ProjectBuilderModule/SwiftPackageFileHelper/SwiftPackageFileHelper.swift diff --git a/Sources/SwiftInterfaceAnalyzerModule/SwiftInterfaceAnalyzer/IndependentSwiftInterfaceChange.swift b/Sources/PipelineModules/SwiftInterfaceAnalyzerModule/SwiftInterfaceAnalyzer/IndependentSwiftInterfaceChange.swift similarity index 100% rename from Sources/SwiftInterfaceAnalyzerModule/SwiftInterfaceAnalyzer/IndependentSwiftInterfaceChange.swift rename to Sources/PipelineModules/SwiftInterfaceAnalyzerModule/SwiftInterfaceAnalyzer/IndependentSwiftInterfaceChange.swift diff --git a/Sources/SwiftInterfaceAnalyzerModule/SwiftInterfaceAnalyzer/SwiftInterfaceAnalyzer.swift b/Sources/PipelineModules/SwiftInterfaceAnalyzerModule/SwiftInterfaceAnalyzer/SwiftInterfaceAnalyzer.swift similarity index 100% rename from Sources/SwiftInterfaceAnalyzerModule/SwiftInterfaceAnalyzer/SwiftInterfaceAnalyzer.swift rename to Sources/PipelineModules/SwiftInterfaceAnalyzerModule/SwiftInterfaceAnalyzer/SwiftInterfaceAnalyzer.swift diff --git a/Sources/SwiftInterfaceAnalyzerModule/SwiftInterfaceAnalyzer/SwiftInterfaceAnalyzing.swift b/Sources/PipelineModules/SwiftInterfaceAnalyzerModule/SwiftInterfaceAnalyzer/SwiftInterfaceAnalyzing.swift similarity index 100% rename from Sources/SwiftInterfaceAnalyzerModule/SwiftInterfaceAnalyzer/SwiftInterfaceAnalyzing.swift rename to Sources/PipelineModules/SwiftInterfaceAnalyzerModule/SwiftInterfaceAnalyzer/SwiftInterfaceAnalyzing.swift diff --git a/Sources/SwiftInterfaceAnalyzerModule/SwiftInterfaceAnalyzer/SwiftInterfaceChangeConsolidator.swift b/Sources/PipelineModules/SwiftInterfaceAnalyzerModule/SwiftInterfaceAnalyzer/SwiftInterfaceChangeConsolidator.swift similarity index 100% rename from Sources/SwiftInterfaceAnalyzerModule/SwiftInterfaceAnalyzer/SwiftInterfaceChangeConsolidator.swift rename to Sources/PipelineModules/SwiftInterfaceAnalyzerModule/SwiftInterfaceAnalyzer/SwiftInterfaceChangeConsolidator.swift diff --git a/Sources/SwiftInterfaceAnalyzerModule/SwiftInterfaceElement+DiffHelper.swift b/Sources/PipelineModules/SwiftInterfaceAnalyzerModule/SwiftInterfaceElement+DiffHelper.swift similarity index 100% rename from Sources/SwiftInterfaceAnalyzerModule/SwiftInterfaceElement+DiffHelper.swift rename to Sources/PipelineModules/SwiftInterfaceAnalyzerModule/SwiftInterfaceElement+DiffHelper.swift diff --git a/Sources/SwiftInterfaceAnalyzerModule/SwiftInterfaceElement.swift b/Sources/PipelineModules/SwiftInterfaceAnalyzerModule/SwiftInterfaceElement.swift similarity index 100% rename from Sources/SwiftInterfaceAnalyzerModule/SwiftInterfaceElement.swift rename to Sources/PipelineModules/SwiftInterfaceAnalyzerModule/SwiftInterfaceElement.swift diff --git a/Sources/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/DeclSyntax+Convenience.swift b/Sources/PipelineModules/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/DeclSyntax+Convenience.swift similarity index 100% rename from Sources/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/DeclSyntax+Convenience.swift rename to Sources/PipelineModules/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/DeclSyntax+Convenience.swift diff --git a/Sources/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/DeclSyntax+SwiftInterface/ActorDeclSyntax+SwiftInterface.swift b/Sources/PipelineModules/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/DeclSyntax+SwiftInterface/ActorDeclSyntax+SwiftInterface.swift similarity index 100% rename from Sources/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/DeclSyntax+SwiftInterface/ActorDeclSyntax+SwiftInterface.swift rename to Sources/PipelineModules/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/DeclSyntax+SwiftInterface/ActorDeclSyntax+SwiftInterface.swift diff --git a/Sources/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/DeclSyntax+SwiftInterface/AssociatedTypeDeclSyntax+SwiftInterface.swift b/Sources/PipelineModules/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/DeclSyntax+SwiftInterface/AssociatedTypeDeclSyntax+SwiftInterface.swift similarity index 100% rename from Sources/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/DeclSyntax+SwiftInterface/AssociatedTypeDeclSyntax+SwiftInterface.swift rename to Sources/PipelineModules/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/DeclSyntax+SwiftInterface/AssociatedTypeDeclSyntax+SwiftInterface.swift diff --git a/Sources/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/DeclSyntax+SwiftInterface/ClassDeclSyntac+SwiftInterface.swift b/Sources/PipelineModules/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/DeclSyntax+SwiftInterface/ClassDeclSyntac+SwiftInterface.swift similarity index 100% rename from Sources/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/DeclSyntax+SwiftInterface/ClassDeclSyntac+SwiftInterface.swift rename to Sources/PipelineModules/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/DeclSyntax+SwiftInterface/ClassDeclSyntac+SwiftInterface.swift diff --git a/Sources/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/DeclSyntax+SwiftInterface/EnumCaseDeclSyntax+SwiftInterface.swift b/Sources/PipelineModules/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/DeclSyntax+SwiftInterface/EnumCaseDeclSyntax+SwiftInterface.swift similarity index 100% rename from Sources/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/DeclSyntax+SwiftInterface/EnumCaseDeclSyntax+SwiftInterface.swift rename to Sources/PipelineModules/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/DeclSyntax+SwiftInterface/EnumCaseDeclSyntax+SwiftInterface.swift diff --git a/Sources/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/DeclSyntax+SwiftInterface/EnumDeclSyntax+SwiftInterface.swift b/Sources/PipelineModules/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/DeclSyntax+SwiftInterface/EnumDeclSyntax+SwiftInterface.swift similarity index 100% rename from Sources/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/DeclSyntax+SwiftInterface/EnumDeclSyntax+SwiftInterface.swift rename to Sources/PipelineModules/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/DeclSyntax+SwiftInterface/EnumDeclSyntax+SwiftInterface.swift diff --git a/Sources/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/DeclSyntax+SwiftInterface/ExtensionDeclSyntax+SwiftInterface.swift b/Sources/PipelineModules/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/DeclSyntax+SwiftInterface/ExtensionDeclSyntax+SwiftInterface.swift similarity index 100% rename from Sources/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/DeclSyntax+SwiftInterface/ExtensionDeclSyntax+SwiftInterface.swift rename to Sources/PipelineModules/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/DeclSyntax+SwiftInterface/ExtensionDeclSyntax+SwiftInterface.swift diff --git a/Sources/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/DeclSyntax+SwiftInterface/FunctionDeclSyntax+SwiftInterface.swift b/Sources/PipelineModules/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/DeclSyntax+SwiftInterface/FunctionDeclSyntax+SwiftInterface.swift similarity index 100% rename from Sources/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/DeclSyntax+SwiftInterface/FunctionDeclSyntax+SwiftInterface.swift rename to Sources/PipelineModules/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/DeclSyntax+SwiftInterface/FunctionDeclSyntax+SwiftInterface.swift diff --git a/Sources/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/DeclSyntax+SwiftInterface/InitializerDeclSyntax+SwiftInterface.swift b/Sources/PipelineModules/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/DeclSyntax+SwiftInterface/InitializerDeclSyntax+SwiftInterface.swift similarity index 100% rename from Sources/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/DeclSyntax+SwiftInterface/InitializerDeclSyntax+SwiftInterface.swift rename to Sources/PipelineModules/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/DeclSyntax+SwiftInterface/InitializerDeclSyntax+SwiftInterface.swift diff --git a/Sources/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/DeclSyntax+SwiftInterface/ProtocolDeclSyntax+SwiftInterface.swift b/Sources/PipelineModules/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/DeclSyntax+SwiftInterface/ProtocolDeclSyntax+SwiftInterface.swift similarity index 100% rename from Sources/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/DeclSyntax+SwiftInterface/ProtocolDeclSyntax+SwiftInterface.swift rename to Sources/PipelineModules/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/DeclSyntax+SwiftInterface/ProtocolDeclSyntax+SwiftInterface.swift diff --git a/Sources/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/DeclSyntax+SwiftInterface/StructDeclSyntax+SwiftInterface.swift b/Sources/PipelineModules/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/DeclSyntax+SwiftInterface/StructDeclSyntax+SwiftInterface.swift similarity index 100% rename from Sources/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/DeclSyntax+SwiftInterface/StructDeclSyntax+SwiftInterface.swift rename to Sources/PipelineModules/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/DeclSyntax+SwiftInterface/StructDeclSyntax+SwiftInterface.swift diff --git a/Sources/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/DeclSyntax+SwiftInterface/SubscriptDeclSyntax+SwiftInterface.swift b/Sources/PipelineModules/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/DeclSyntax+SwiftInterface/SubscriptDeclSyntax+SwiftInterface.swift similarity index 100% rename from Sources/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/DeclSyntax+SwiftInterface/SubscriptDeclSyntax+SwiftInterface.swift rename to Sources/PipelineModules/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/DeclSyntax+SwiftInterface/SubscriptDeclSyntax+SwiftInterface.swift diff --git a/Sources/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/DeclSyntax+SwiftInterface/TypeAliasDeclSyntax+SwiftInterface.swift b/Sources/PipelineModules/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/DeclSyntax+SwiftInterface/TypeAliasDeclSyntax+SwiftInterface.swift similarity index 100% rename from Sources/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/DeclSyntax+SwiftInterface/TypeAliasDeclSyntax+SwiftInterface.swift rename to Sources/PipelineModules/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/DeclSyntax+SwiftInterface/TypeAliasDeclSyntax+SwiftInterface.swift diff --git a/Sources/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/DeclSyntax+SwiftInterface/VarDeclSyntax+SwiftInterface.swift b/Sources/PipelineModules/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/DeclSyntax+SwiftInterface/VarDeclSyntax+SwiftInterface.swift similarity index 100% rename from Sources/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/DeclSyntax+SwiftInterface/VarDeclSyntax+SwiftInterface.swift rename to Sources/PipelineModules/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/DeclSyntax+SwiftInterface/VarDeclSyntax+SwiftInterface.swift diff --git a/Sources/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+Actor.swift b/Sources/PipelineModules/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+Actor.swift similarity index 100% rename from Sources/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+Actor.swift rename to Sources/PipelineModules/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+Actor.swift diff --git a/Sources/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+AssociatedType.swift b/Sources/PipelineModules/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+AssociatedType.swift similarity index 100% rename from Sources/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+AssociatedType.swift rename to Sources/PipelineModules/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+AssociatedType.swift diff --git a/Sources/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+Class.swift b/Sources/PipelineModules/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+Class.swift similarity index 100% rename from Sources/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+Class.swift rename to Sources/PipelineModules/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+Class.swift diff --git a/Sources/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+Enum.swift b/Sources/PipelineModules/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+Enum.swift similarity index 100% rename from Sources/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+Enum.swift rename to Sources/PipelineModules/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+Enum.swift diff --git a/Sources/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+EnumCase.swift b/Sources/PipelineModules/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+EnumCase.swift similarity index 100% rename from Sources/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+EnumCase.swift rename to Sources/PipelineModules/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+EnumCase.swift diff --git a/Sources/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+Extension.swift b/Sources/PipelineModules/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+Extension.swift similarity index 100% rename from Sources/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+Extension.swift rename to Sources/PipelineModules/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+Extension.swift diff --git a/Sources/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+Function.swift b/Sources/PipelineModules/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+Function.swift similarity index 100% rename from Sources/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+Function.swift rename to Sources/PipelineModules/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+Function.swift diff --git a/Sources/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+Initializer.swift b/Sources/PipelineModules/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+Initializer.swift similarity index 100% rename from Sources/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+Initializer.swift rename to Sources/PipelineModules/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+Initializer.swift diff --git a/Sources/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+Protocol.swift b/Sources/PipelineModules/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+Protocol.swift similarity index 100% rename from Sources/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+Protocol.swift rename to Sources/PipelineModules/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+Protocol.swift diff --git a/Sources/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+Struct.swift b/Sources/PipelineModules/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+Struct.swift similarity index 100% rename from Sources/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+Struct.swift rename to Sources/PipelineModules/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+Struct.swift diff --git a/Sources/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+Subscript.swift b/Sources/PipelineModules/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+Subscript.swift similarity index 100% rename from Sources/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+Subscript.swift rename to Sources/PipelineModules/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+Subscript.swift diff --git a/Sources/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+TypeAlias.swift b/Sources/PipelineModules/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+TypeAlias.swift similarity index 100% rename from Sources/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+TypeAlias.swift rename to Sources/PipelineModules/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+TypeAlias.swift diff --git a/Sources/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+Var.swift b/Sources/PipelineModules/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+Var.swift similarity index 100% rename from Sources/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+Var.swift rename to Sources/PipelineModules/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+Var.swift diff --git a/Sources/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/SwiftInterfaceParser+Root.swift b/Sources/PipelineModules/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/SwiftInterfaceParser+Root.swift similarity index 100% rename from Sources/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/SwiftInterfaceParser+Root.swift rename to Sources/PipelineModules/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/SwiftInterfaceParser+Root.swift diff --git a/Sources/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/SwiftInterfaceParser.swift b/Sources/PipelineModules/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/SwiftInterfaceParser.swift similarity index 100% rename from Sources/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/SwiftInterfaceParser.swift rename to Sources/PipelineModules/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/SwiftInterfaceParser.swift diff --git a/Sources/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/SwiftInterfaceParsing.swift b/Sources/PipelineModules/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/SwiftInterfaceParsing.swift similarity index 100% rename from Sources/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/SwiftInterfaceParsing.swift rename to Sources/PipelineModules/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/SwiftInterfaceParsing.swift diff --git a/Sources/SwiftInterfaceAnalyzerModule/SwiftInterfacePipeline.swift b/Sources/PipelineModules/SwiftInterfaceAnalyzerModule/SwiftInterfacePipeline.swift similarity index 100% rename from Sources/SwiftInterfaceAnalyzerModule/SwiftInterfacePipeline.swift rename to Sources/PipelineModules/SwiftInterfaceAnalyzerModule/SwiftInterfacePipeline.swift diff --git a/Sources/CoreModule/Change.swift b/Sources/SharedHelperModules/CoreModule/Change.swift similarity index 100% rename from Sources/CoreModule/Change.swift rename to Sources/SharedHelperModules/CoreModule/Change.swift diff --git a/Sources/CoreModule/SwiftInterfaceFile.swift b/Sources/SharedHelperModules/CoreModule/SwiftInterfaceFile.swift similarity index 100% rename from Sources/CoreModule/SwiftInterfaceFile.swift rename to Sources/SharedHelperModules/CoreModule/SwiftInterfaceFile.swift diff --git a/Sources/FileHandlingModule/FileHandling+Convenience.swift b/Sources/SharedHelperModules/FileHandlingModule/FileHandling+Convenience.swift similarity index 100% rename from Sources/FileHandlingModule/FileHandling+Convenience.swift rename to Sources/SharedHelperModules/FileHandlingModule/FileHandling+Convenience.swift diff --git a/Sources/FileHandlingModule/FileHandling.swift b/Sources/SharedHelperModules/FileHandlingModule/FileHandling.swift similarity index 100% rename from Sources/FileHandlingModule/FileHandling.swift rename to Sources/SharedHelperModules/FileHandlingModule/FileHandling.swift diff --git a/Sources/FileHandlingModule/FileManager+FileHandling.swift b/Sources/SharedHelperModules/FileHandlingModule/FileManager+FileHandling.swift similarity index 100% rename from Sources/FileHandlingModule/FileManager+FileHandling.swift rename to Sources/SharedHelperModules/FileHandlingModule/FileManager+FileHandling.swift diff --git a/Sources/LoggingModule/LogFileLogger.swift b/Sources/SharedHelperModules/LoggingModule/LogFileLogger.swift similarity index 100% rename from Sources/LoggingModule/LogFileLogger.swift rename to Sources/SharedHelperModules/LoggingModule/LogFileLogger.swift diff --git a/Sources/LoggingModule/LogLevelLogger.swift b/Sources/SharedHelperModules/LoggingModule/LogLevelLogger.swift similarity index 100% rename from Sources/LoggingModule/LogLevelLogger.swift rename to Sources/SharedHelperModules/LoggingModule/LogLevelLogger.swift diff --git a/Sources/LoggingModule/Logging.swift b/Sources/SharedHelperModules/LoggingModule/Logging.swift similarity index 100% rename from Sources/LoggingModule/Logging.swift rename to Sources/SharedHelperModules/LoggingModule/Logging.swift diff --git a/Sources/LoggingModule/LoggingGroup.swift b/Sources/SharedHelperModules/LoggingModule/LoggingGroup.swift similarity index 100% rename from Sources/LoggingModule/LoggingGroup.swift rename to Sources/SharedHelperModules/LoggingModule/LoggingGroup.swift diff --git a/Sources/LoggingModule/SystemLogger.swift b/Sources/SharedHelperModules/LoggingModule/SystemLogger.swift similarity index 100% rename from Sources/LoggingModule/SystemLogger.swift rename to Sources/SharedHelperModules/LoggingModule/SystemLogger.swift diff --git a/Sources/ShellModule/Shell.swift b/Sources/SharedHelperModules/ShellModule/Shell.swift similarity index 100% rename from Sources/ShellModule/Shell.swift rename to Sources/SharedHelperModules/ShellModule/Shell.swift From 85d8fbcd57c02bdf7a4e6691ec65bc25ef19ead5 Mon Sep 17 00:00:00 2001 From: Alex Guretzki Date: Thu, 10 Oct 2024 16:30:59 +0200 Subject: [PATCH 05/12] fixing Package.swift file --- Package.swift | 73 ++++++++++++++++++++++++++++++++++----------------- 1 file changed, 49 insertions(+), 24 deletions(-) diff --git a/Package.swift b/Package.swift index 8f052cf..c3ca855 100644 --- a/Package.swift +++ b/Package.swift @@ -24,6 +24,9 @@ let package = Package( .package(url: "https://github.com/nicklockwood/SwiftFormat", from: "0.54.6") ], targets: [ + + // MARK: - Executable Targets + .executableTarget( name: "public-api-diff", dependencies: [ @@ -35,33 +38,55 @@ let package = Package( "SwiftInterfaceAnalyzerModule", .product(name: "ArgumentParser", package: "swift-argument-parser") ], - path: "Sources/CommandLineTool" + path: "Sources/ExecutableTargets/CommandLineTool" + ), + + // MARK: - Shared Helper Modules + + .target( + name: "CoreModule", + path: "Sources/SharedHelperModules/CoreModule" + ), + .target( + name: "FileHandlingModule", + path: "Sources/SharedHelperModules/FileHandlingModule" + ), + .target( + name: "ShellModule", + path: "Sources/SharedHelperModules/ShellModule" + ), + .target( + name: "LoggingModule", + dependencies: ["FileHandlingModule"], + path: "Sources/SharedHelperModules/LoggingModule" ), - // MARK: - Modules + // MARK: - Pipeline Modules - .target(name: "CoreModule"), - .target(name: "FileHandlingModule", dependencies: []), - .target(name: "ShellModule"), - .target(name: "LoggingModule", dependencies: [ - "FileHandlingModule" - ]), - .target(name: "OutputGeneratorModule", dependencies: [ - "CoreModule" - ]), - .target(name: "SwiftInterfaceAnalyzerModule", dependencies: [ - "CoreModule", - .product(name: "SwiftSyntax", package: "swift-syntax"), - .product(name: "SwiftParser", package: "swift-syntax"), - ]), - .target(name: "ProjectBuilderModule", dependencies: [ - "CoreModule", - "FileHandlingModule", - "LoggingModule", - "ShellModule", - .product(name: "SwiftSyntax", package: "swift-syntax"), - .product(name: "SwiftParser", package: "swift-syntax"), - ]), + .target( + name: "SwiftInterfaceAnalyzerModule", + dependencies: [ + "CoreModule", + .product(name: "SwiftSyntax", package: "swift-syntax"), + .product(name: "SwiftParser", package: "swift-syntax"), + ], + path: "Sources/PipelineModules/SwiftInterfaceAnalyzerModule" + ), + .target( + name: "ProjectBuilderModule", + dependencies: [ + "CoreModule", + "FileHandlingModule", + "LoggingModule", + "ShellModule" + ], + path: "Sources/PipelineModules/ProjectBuilderModule" + ), + .target( + name: "OutputGeneratorModule", + dependencies: ["CoreModule"], + path: "Sources/PipelineModules/OutputGeneratorModule" + ), // MARK: - Test Targets From 4b877c7c1814bee866273ddbdc316512df54d381 Mon Sep 17 00:00:00 2001 From: Alex Guretzki Date: Thu, 10 Oct 2024 18:10:02 +0200 Subject: [PATCH 06/12] some fixes --- Package.swift | 7 ++++++- .../SwiftPackageFileAnalyzer.swift | 2 +- .../DeclSyntax+Convenience.swift | 12 +++++++++++- .../FunctionDeclSyntax+SwiftInterface.swift | 2 +- .../InitializerDeclSyntax+SwiftInterface.swift | 2 +- .../SubscriptDeclSyntax+SwiftInterface.swift | 2 +- 6 files changed, 21 insertions(+), 6 deletions(-) diff --git a/Package.swift b/Package.swift index c3ca855..574ba82 100644 --- a/Package.swift +++ b/Package.swift @@ -15,7 +15,10 @@ let package = Package( ), .library( name: "SwiftInterfaceDiff", - targets: ["SwiftInterfaceAnalyzerModule"] + targets: [ + "SwiftInterfaceAnalyzerModule", + "OutputGeneratorModule" + ] ) ], dependencies: [ @@ -67,6 +70,8 @@ let package = Package( name: "SwiftInterfaceAnalyzerModule", dependencies: [ "CoreModule", + "FileHandlingModule", + "LoggingModule", .product(name: "SwiftSyntax", package: "swift-syntax"), .product(name: "SwiftParser", package: "swift-syntax"), ], diff --git a/Sources/PipelineModules/ProjectBuilderModule/SwiftPackageFileAnalyzer/SwiftPackageFileAnalyzer.swift b/Sources/PipelineModules/ProjectBuilderModule/SwiftPackageFileAnalyzer/SwiftPackageFileAnalyzer.swift index dc3c1f0..caa7e45 100644 --- a/Sources/PipelineModules/ProjectBuilderModule/SwiftPackageFileAnalyzer/SwiftPackageFileAnalyzer.swift +++ b/Sources/PipelineModules/ProjectBuilderModule/SwiftPackageFileAnalyzer/SwiftPackageFileAnalyzer.swift @@ -20,7 +20,7 @@ public struct SwiftPackageFileAnalyzer: SwiftPackageFileAnalyzing { private enum Constants { static let packageFileName = "Package.swift" static func packageFileName(child: String) -> String { - "\(packageFileName) / \(child)" + ".\(child)" } } diff --git a/Sources/PipelineModules/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/DeclSyntax+Convenience.swift b/Sources/PipelineModules/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/DeclSyntax+Convenience.swift index f44949e..248f032 100644 --- a/Sources/PipelineModules/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/DeclSyntax+Convenience.swift +++ b/Sources/PipelineModules/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/DeclSyntax+Convenience.swift @@ -22,6 +22,16 @@ extension AccessorBlockSyntax { /// /// e.g. "get\n set\n" -> "get set" var sanitizedDescription: String { - accessors.trimmedDescription.replacingOccurrences(of: "[\n ]+", with: " ", options: .regularExpression) + accessors.trimmedDescription.sanitizingNewlinesAndSpaces + } +} + +extension String { + + /// Produces a string where all newlines and spaces are replaced by a single space + /// + /// e.g. "get\n set\n" -> "get set" + var sanitizingNewlinesAndSpaces: String { + self.replacingOccurrences(of: "[\n ]+", with: " ", options: .regularExpression) } } diff --git a/Sources/PipelineModules/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/DeclSyntax+SwiftInterface/FunctionDeclSyntax+SwiftInterface.swift b/Sources/PipelineModules/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/DeclSyntax+SwiftInterface/FunctionDeclSyntax+SwiftInterface.swift index 0896027..9832c8b 100644 --- a/Sources/PipelineModules/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/DeclSyntax+SwiftInterface/FunctionDeclSyntax+SwiftInterface.swift +++ b/Sources/PipelineModules/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/DeclSyntax+SwiftInterface/FunctionDeclSyntax+SwiftInterface.swift @@ -22,7 +22,7 @@ extension FunctionDeclSyntax { firstName: $0.firstName.trimmedDescription, secondName: $0.secondName?.trimmedDescription, type: $0.type.trimmedDescription, - defaultValue: $0.defaultValue?.value.description + defaultValue: $0.defaultValue?.value.trimmedDescription.sanitizingNewlinesAndSpaces ) } diff --git a/Sources/PipelineModules/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/DeclSyntax+SwiftInterface/InitializerDeclSyntax+SwiftInterface.swift b/Sources/PipelineModules/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/DeclSyntax+SwiftInterface/InitializerDeclSyntax+SwiftInterface.swift index b4a3c73..5bc8e1c 100644 --- a/Sources/PipelineModules/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/DeclSyntax+SwiftInterface/InitializerDeclSyntax+SwiftInterface.swift +++ b/Sources/PipelineModules/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/DeclSyntax+SwiftInterface/InitializerDeclSyntax+SwiftInterface.swift @@ -22,7 +22,7 @@ extension InitializerDeclSyntax { firstName: $0.firstName.trimmedDescription, secondName: $0.secondName?.trimmedDescription, type: $0.type.trimmedDescription, - defaultValue: $0.defaultValue?.value.description + defaultValue: $0.defaultValue?.value.trimmedDescription.sanitizingNewlinesAndSpaces ) } diff --git a/Sources/PipelineModules/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/DeclSyntax+SwiftInterface/SubscriptDeclSyntax+SwiftInterface.swift b/Sources/PipelineModules/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/DeclSyntax+SwiftInterface/SubscriptDeclSyntax+SwiftInterface.swift index 1a26fe5..1551789 100644 --- a/Sources/PipelineModules/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/DeclSyntax+SwiftInterface/SubscriptDeclSyntax+SwiftInterface.swift +++ b/Sources/PipelineModules/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/DeclSyntax+SwiftInterface/SubscriptDeclSyntax+SwiftInterface.swift @@ -11,7 +11,7 @@ extension SubscriptDeclSyntax { firstName: $0.firstName.trimmedDescription, secondName: $0.secondName?.trimmedDescription, type: $0.type.trimmedDescription, - defaultValue: $0.defaultValue?.value.description + defaultValue: $0.defaultValue?.value.trimmedDescription.sanitizingNewlinesAndSpaces ) } From 98d2efe2bed065c5bbfc54ef10894a25c6518feb Mon Sep 17 00:00:00 2001 From: Alex Guretzki Date: Fri, 11 Oct 2024 10:29:36 +0200 Subject: [PATCH 07/12] Renaming --- Package.swift | 70 +++++++++++-------- .../CommandLineTool/public-api-diff.swift | 12 ++-- .../MarkdownOutputGenerator.swift | 2 +- .../OutputGenerating.swift | 2 +- .../ProjectBuilder.swift | 8 +-- .../ProjectSetup/Git.swift | 10 +-- .../ProjectSetup/ProjectSetupHelper.swift | 18 ++--- .../ProjectSetup/ProjectSetupHelping.swift | 4 +- .../ProjectSetup/ProjectSource.swift | 4 +- .../ProjectSetup/RandomStringGenerating.swift | 4 +- .../ProjectType.swift | 0 .../SwiftInterfaceFileLocator.swift | 6 +- .../SwiftInterfaceProducer.swift | 14 ++-- .../SwiftInterfaceProducerError.swift | 0 .../SwiftInterfaceType.swift | 0 .../SwiftInterfaceProducer/XcodeTools.swift | 14 ++-- .../SwiftPackageFileAnalyzer.swift | 14 ++-- .../SwiftPackageFileAnalyzing.swift | 6 +- .../SwiftPackageDescription.swift | 2 +- .../SwiftPackageFileHelper.swift | 8 +-- .../PADSwiftInterfaceDiff.swift} | 8 +-- .../IndependentSwiftInterfaceChange.swift | 6 +- .../SwiftInterfaceAnalyzer.swift | 10 +-- .../SwiftInterfaceAnalyzing.swift | 2 +- .../SwiftInterfaceChangeConsolidator.swift | 10 ++- .../SwiftInterfaceElement+DiffHelper.swift | 2 +- .../SwiftInterfaceElement.swift | 0 .../DeclSyntax+Convenience.swift | 0 .../ActorDeclSyntax+SwiftInterface.swift | 0 ...ociatedTypeDeclSyntax+SwiftInterface.swift | 0 .../ClassDeclSyntac+SwiftInterface.swift | 0 .../EnumCaseDeclSyntax+SwiftInterface.swift | 0 .../EnumDeclSyntax+SwiftInterface.swift | 0 .../ExtensionDeclSyntax+SwiftInterface.swift | 0 .../FunctionDeclSyntax+SwiftInterface.swift | 0 ...InitializerDeclSyntax+SwiftInterface.swift | 0 .../ProtocolDeclSyntax+SwiftInterface.swift | 0 .../StructDeclSyntax+SwiftInterface.swift | 0 .../SubscriptDeclSyntax+SwiftInterface.swift | 0 .../TypeAliasDeclSyntax+SwiftInterface.swift | 0 .../VarDeclSyntax+SwiftInterface.swift | 0 .../SwiftInterfaceElement+Actor.swift | 0 ...SwiftInterfaceElement+AssociatedType.swift | 0 .../SwiftInterfaceElement+Class.swift | 0 .../SwiftInterfaceElement+Enum.swift | 0 .../SwiftInterfaceElement+EnumCase.swift | 0 .../SwiftInterfaceElement+Extension.swift | 0 .../SwiftInterfaceElement+Function.swift | 0 .../SwiftInterfaceElement+Initializer.swift | 0 .../SwiftInterfaceElement+Protocol.swift | 0 .../SwiftInterfaceElement+Struct.swift | 0 .../SwiftInterfaceElement+Subscript.swift | 0 .../SwiftInterfaceElement+TypeAlias.swift | 0 .../SwiftInterfaceElement+Var.swift | 0 .../SwiftInterfaceParser+Root.swift | 0 .../SwiftInterfaceParser.swift | 0 .../SwiftInterfaceParsing.swift | 0 .../{CoreModule => PADCore}/Change.swift | 0 .../SwiftInterfaceFile.swift | 0 .../FileHandling+Convenience.swift | 0 .../FileHandling.swift | 0 .../FileManager+FileHandling.swift | 0 .../LogFileLogger.swift | 2 +- .../LogLevelLogger.swift | 0 .../Logging.swift | 0 .../LoggingGroup.swift | 0 .../SystemLogger.swift | 0 .../{ShellModule => PADShell}/Shell.swift | 0 .../ReferencePackageTests.swift | 12 ++-- Tests/UnitTests/FileHandlingTests.swift | 2 +- Tests/UnitTests/GitTests.swift | 2 +- Tests/UnitTests/LoggerTests.swift | 2 +- Tests/UnitTests/OutputGeneratorTests.swift | 2 +- Tests/UnitTests/PipelineTests.swift | 8 +-- Tests/UnitTests/ProjectSourceTests.swift | 2 +- .../SwiftPackageFileAnalyzerTests.swift | 16 ++--- .../UnitTests/Utilities/MockFileHandler.swift | 2 +- Tests/UnitTests/Utilities/MockLogger.swift | 2 +- .../MockLibraryAnalyzer.swift | 2 +- .../MockOutputGenerator.swift | 4 +- .../Utilities/MockRandomStringGenerator.swift | 2 +- Tests/UnitTests/Utilities/MockShell.swift | 2 +- .../MockSwiftInterfaceAnalyzer.swift | 4 +- .../Utilities/MockSwiftInterfaceParser.swift | 2 +- Tests/UnitTests/XcodeToolsTests.swift | 2 +- 85 files changed, 157 insertions(+), 149 deletions(-) rename Sources/PipelineModules/{OutputGeneratorModule => PADOutputGenerator}/MarkdownOutputGenerator.swift (99%) rename Sources/PipelineModules/{OutputGeneratorModule => PADOutputGenerator}/OutputGenerating.swift (95%) rename Sources/PipelineModules/{ProjectBuilderModule => PADProjectBuilder}/ProjectBuilder.swift (97%) rename Sources/PipelineModules/{ProjectBuilderModule => PADProjectBuilder}/ProjectSetup/Git.swift (93%) rename Sources/PipelineModules/{ProjectBuilderModule => PADProjectBuilder}/ProjectSetup/ProjectSetupHelper.swift (92%) rename Sources/PipelineModules/{ProjectBuilderModule => PADProjectBuilder}/ProjectSetup/ProjectSetupHelping.swift (67%) rename Sources/PipelineModules/{ProjectBuilderModule => PADProjectBuilder}/ProjectSetup/ProjectSource.swift (94%) rename Sources/PipelineModules/{ProjectBuilderModule => PADProjectBuilder}/ProjectSetup/RandomStringGenerating.swift (76%) rename Sources/PipelineModules/{ProjectBuilderModule => PADProjectBuilder}/ProjectType.swift (100%) rename Sources/PipelineModules/{ProjectBuilderModule => PADProjectBuilder}/SwiftInterfaceProducer/SwiftInterfaceFileLocator.swift (97%) rename Sources/PipelineModules/{ProjectBuilderModule => PADProjectBuilder}/SwiftInterfaceProducer/SwiftInterfaceProducer.swift (97%) rename Sources/PipelineModules/{ProjectBuilderModule => PADProjectBuilder}/SwiftInterfaceProducer/SwiftInterfaceProducerError.swift (100%) rename Sources/PipelineModules/{ProjectBuilderModule => PADProjectBuilder}/SwiftInterfaceProducer/SwiftInterfaceType.swift (100%) rename Sources/PipelineModules/{ProjectBuilderModule => PADProjectBuilder}/SwiftInterfaceProducer/XcodeTools.swift (94%) rename Sources/PipelineModules/{ProjectBuilderModule => PADProjectBuilder}/SwiftPackageFileAnalyzer/SwiftPackageFileAnalyzer.swift (98%) rename Sources/PipelineModules/{ProjectBuilderModule => PADProjectBuilder}/SwiftPackageFileAnalyzer/SwiftPackageFileAnalyzing.swift (73%) rename Sources/PipelineModules/{ProjectBuilderModule => PADProjectBuilder}/SwiftPackageFileHelper/SwiftPackageDescription.swift (99%) rename Sources/PipelineModules/{ProjectBuilderModule => PADProjectBuilder}/SwiftPackageFileHelper/SwiftPackageFileHelper.swift (98%) rename Sources/PipelineModules/{SwiftInterfaceAnalyzerModule/SwiftInterfacePipeline.swift => PADSwiftInterfaceDiff/PADSwiftInterfaceDiff.swift} (94%) rename Sources/PipelineModules/{SwiftInterfaceAnalyzerModule => PADSwiftInterfaceDiff}/SwiftInterfaceAnalyzer/IndependentSwiftInterfaceChange.swift (85%) rename Sources/PipelineModules/{SwiftInterfaceAnalyzerModule => PADSwiftInterfaceDiff}/SwiftInterfaceAnalyzer/SwiftInterfaceAnalyzer.swift (95%) rename Sources/PipelineModules/{SwiftInterfaceAnalyzerModule => PADSwiftInterfaceDiff}/SwiftInterfaceAnalyzer/SwiftInterfaceAnalyzing.swift (90%) rename Sources/PipelineModules/{SwiftInterfaceAnalyzerModule => PADSwiftInterfaceDiff}/SwiftInterfaceAnalyzer/SwiftInterfaceChangeConsolidator.swift (95%) rename Sources/PipelineModules/{SwiftInterfaceAnalyzerModule => PADSwiftInterfaceDiff}/SwiftInterfaceElement+DiffHelper.swift (99%) rename Sources/PipelineModules/{SwiftInterfaceAnalyzerModule => PADSwiftInterfaceDiff}/SwiftInterfaceElement.swift (100%) rename Sources/PipelineModules/{SwiftInterfaceAnalyzerModule => PADSwiftInterfaceDiff}/SwiftInterfaceParser/DeclSyntax+Convenience.swift (100%) rename Sources/PipelineModules/{SwiftInterfaceAnalyzerModule => PADSwiftInterfaceDiff}/SwiftInterfaceParser/DeclSyntax+SwiftInterface/ActorDeclSyntax+SwiftInterface.swift (100%) rename Sources/PipelineModules/{SwiftInterfaceAnalyzerModule => PADSwiftInterfaceDiff}/SwiftInterfaceParser/DeclSyntax+SwiftInterface/AssociatedTypeDeclSyntax+SwiftInterface.swift (100%) rename Sources/PipelineModules/{SwiftInterfaceAnalyzerModule => PADSwiftInterfaceDiff}/SwiftInterfaceParser/DeclSyntax+SwiftInterface/ClassDeclSyntac+SwiftInterface.swift (100%) rename Sources/PipelineModules/{SwiftInterfaceAnalyzerModule => PADSwiftInterfaceDiff}/SwiftInterfaceParser/DeclSyntax+SwiftInterface/EnumCaseDeclSyntax+SwiftInterface.swift (100%) rename Sources/PipelineModules/{SwiftInterfaceAnalyzerModule => PADSwiftInterfaceDiff}/SwiftInterfaceParser/DeclSyntax+SwiftInterface/EnumDeclSyntax+SwiftInterface.swift (100%) rename Sources/PipelineModules/{SwiftInterfaceAnalyzerModule => PADSwiftInterfaceDiff}/SwiftInterfaceParser/DeclSyntax+SwiftInterface/ExtensionDeclSyntax+SwiftInterface.swift (100%) rename Sources/PipelineModules/{SwiftInterfaceAnalyzerModule => PADSwiftInterfaceDiff}/SwiftInterfaceParser/DeclSyntax+SwiftInterface/FunctionDeclSyntax+SwiftInterface.swift (100%) rename Sources/PipelineModules/{SwiftInterfaceAnalyzerModule => PADSwiftInterfaceDiff}/SwiftInterfaceParser/DeclSyntax+SwiftInterface/InitializerDeclSyntax+SwiftInterface.swift (100%) rename Sources/PipelineModules/{SwiftInterfaceAnalyzerModule => PADSwiftInterfaceDiff}/SwiftInterfaceParser/DeclSyntax+SwiftInterface/ProtocolDeclSyntax+SwiftInterface.swift (100%) rename Sources/PipelineModules/{SwiftInterfaceAnalyzerModule => PADSwiftInterfaceDiff}/SwiftInterfaceParser/DeclSyntax+SwiftInterface/StructDeclSyntax+SwiftInterface.swift (100%) rename Sources/PipelineModules/{SwiftInterfaceAnalyzerModule => PADSwiftInterfaceDiff}/SwiftInterfaceParser/DeclSyntax+SwiftInterface/SubscriptDeclSyntax+SwiftInterface.swift (100%) rename Sources/PipelineModules/{SwiftInterfaceAnalyzerModule => PADSwiftInterfaceDiff}/SwiftInterfaceParser/DeclSyntax+SwiftInterface/TypeAliasDeclSyntax+SwiftInterface.swift (100%) rename Sources/PipelineModules/{SwiftInterfaceAnalyzerModule => PADSwiftInterfaceDiff}/SwiftInterfaceParser/DeclSyntax+SwiftInterface/VarDeclSyntax+SwiftInterface.swift (100%) rename Sources/PipelineModules/{SwiftInterfaceAnalyzerModule => PADSwiftInterfaceDiff}/SwiftInterfaceParser/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+Actor.swift (100%) rename Sources/PipelineModules/{SwiftInterfaceAnalyzerModule => PADSwiftInterfaceDiff}/SwiftInterfaceParser/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+AssociatedType.swift (100%) rename Sources/PipelineModules/{SwiftInterfaceAnalyzerModule => PADSwiftInterfaceDiff}/SwiftInterfaceParser/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+Class.swift (100%) rename Sources/PipelineModules/{SwiftInterfaceAnalyzerModule => PADSwiftInterfaceDiff}/SwiftInterfaceParser/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+Enum.swift (100%) rename Sources/PipelineModules/{SwiftInterfaceAnalyzerModule => PADSwiftInterfaceDiff}/SwiftInterfaceParser/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+EnumCase.swift (100%) rename Sources/PipelineModules/{SwiftInterfaceAnalyzerModule => PADSwiftInterfaceDiff}/SwiftInterfaceParser/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+Extension.swift (100%) rename Sources/PipelineModules/{SwiftInterfaceAnalyzerModule => PADSwiftInterfaceDiff}/SwiftInterfaceParser/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+Function.swift (100%) rename Sources/PipelineModules/{SwiftInterfaceAnalyzerModule => PADSwiftInterfaceDiff}/SwiftInterfaceParser/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+Initializer.swift (100%) rename Sources/PipelineModules/{SwiftInterfaceAnalyzerModule => PADSwiftInterfaceDiff}/SwiftInterfaceParser/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+Protocol.swift (100%) rename Sources/PipelineModules/{SwiftInterfaceAnalyzerModule => PADSwiftInterfaceDiff}/SwiftInterfaceParser/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+Struct.swift (100%) rename Sources/PipelineModules/{SwiftInterfaceAnalyzerModule => PADSwiftInterfaceDiff}/SwiftInterfaceParser/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+Subscript.swift (100%) rename Sources/PipelineModules/{SwiftInterfaceAnalyzerModule => PADSwiftInterfaceDiff}/SwiftInterfaceParser/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+TypeAlias.swift (100%) rename Sources/PipelineModules/{SwiftInterfaceAnalyzerModule => PADSwiftInterfaceDiff}/SwiftInterfaceParser/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+Var.swift (100%) rename Sources/PipelineModules/{SwiftInterfaceAnalyzerModule => PADSwiftInterfaceDiff}/SwiftInterfaceParser/SwiftInterfaceParser+Root.swift (100%) rename Sources/PipelineModules/{SwiftInterfaceAnalyzerModule => PADSwiftInterfaceDiff}/SwiftInterfaceParser/SwiftInterfaceParser.swift (100%) rename Sources/PipelineModules/{SwiftInterfaceAnalyzerModule => PADSwiftInterfaceDiff}/SwiftInterfaceParser/SwiftInterfaceParsing.swift (100%) rename Sources/SharedHelperModules/{CoreModule => PADCore}/Change.swift (100%) rename Sources/SharedHelperModules/{CoreModule => PADCore}/SwiftInterfaceFile.swift (100%) rename Sources/SharedHelperModules/{FileHandlingModule => PADFileHandling}/FileHandling+Convenience.swift (100%) rename Sources/SharedHelperModules/{FileHandlingModule => PADFileHandling}/FileHandling.swift (100%) rename Sources/SharedHelperModules/{FileHandlingModule => PADFileHandling}/FileManager+FileHandling.swift (100%) rename Sources/SharedHelperModules/{LoggingModule => PADLogging}/LogFileLogger.swift (97%) rename Sources/SharedHelperModules/{LoggingModule => PADLogging}/LogLevelLogger.swift (100%) rename Sources/SharedHelperModules/{LoggingModule => PADLogging}/Logging.swift (100%) rename Sources/SharedHelperModules/{LoggingModule => PADLogging}/LoggingGroup.swift (100%) rename Sources/SharedHelperModules/{LoggingModule => PADLogging}/SystemLogger.swift (100%) rename Sources/SharedHelperModules/{ShellModule => PADShell}/Shell.swift (100%) diff --git a/Package.swift b/Package.swift index 574ba82..84ff657 100644 --- a/Package.swift +++ b/Package.swift @@ -16,8 +16,16 @@ let package = Package( .library( name: "SwiftInterfaceDiff", targets: [ - "SwiftInterfaceAnalyzerModule", - "OutputGeneratorModule" + "PADSwiftInterfaceDiff", + "PADOutputGenerator" + ] + ), + .library( + name: "PublicApiDiff", + targets: [ + "PADProjectBuilder", + "PADSwiftInterfaceDiff", + "PADOutputGenerator" ] ) ], @@ -33,12 +41,12 @@ let package = Package( .executableTarget( name: "public-api-diff", dependencies: [ - "CoreModule", - "LoggingModule", - "OutputGeneratorModule", - "FileHandlingModule", - "ProjectBuilderModule", - "SwiftInterfaceAnalyzerModule", + "PADCore", + "PADLogging", + "PADOutputGenerator", + "PADFileHandling", + "PADProjectBuilder", + "PADSwiftInterfaceDiff", .product(name: "ArgumentParser", package: "swift-argument-parser") ], path: "Sources/ExecutableTargets/CommandLineTool" @@ -47,50 +55,50 @@ let package = Package( // MARK: - Shared Helper Modules .target( - name: "CoreModule", - path: "Sources/SharedHelperModules/CoreModule" + name: "PADCore", + path: "Sources/SharedHelperModules/PADCore" ), .target( - name: "FileHandlingModule", - path: "Sources/SharedHelperModules/FileHandlingModule" + name: "PADFileHandling", + path: "Sources/SharedHelperModules/PADFileHandling" ), .target( - name: "ShellModule", - path: "Sources/SharedHelperModules/ShellModule" + name: "PADShell", + path: "Sources/SharedHelperModules/PADShell" ), .target( - name: "LoggingModule", - dependencies: ["FileHandlingModule"], - path: "Sources/SharedHelperModules/LoggingModule" + name: "PADLogging", + dependencies: ["PADFileHandling"], + path: "Sources/SharedHelperModules/PADLogging" ), // MARK: - Pipeline Modules .target( - name: "SwiftInterfaceAnalyzerModule", + name: "PADSwiftInterfaceDiff", dependencies: [ - "CoreModule", - "FileHandlingModule", - "LoggingModule", + "PADCore", + "PADFileHandling", + "PADLogging", .product(name: "SwiftSyntax", package: "swift-syntax"), .product(name: "SwiftParser", package: "swift-syntax"), ], - path: "Sources/PipelineModules/SwiftInterfaceAnalyzerModule" + path: "Sources/PipelineModules/PADSwiftInterfaceDiff" ), .target( - name: "ProjectBuilderModule", + name: "PADProjectBuilder", dependencies: [ - "CoreModule", - "FileHandlingModule", - "LoggingModule", - "ShellModule" + "PADCore", + "PADFileHandling", + "PADLogging", + "PADShell" ], - path: "Sources/PipelineModules/ProjectBuilderModule" + path: "Sources/PipelineModules/PADProjectBuilder" ), .target( - name: "OutputGeneratorModule", - dependencies: ["CoreModule"], - path: "Sources/PipelineModules/OutputGeneratorModule" + name: "PADOutputGenerator", + dependencies: ["PADCore"], + path: "Sources/PipelineModules/PADOutputGenerator" ), // MARK: - Test Targets diff --git a/Sources/ExecutableTargets/CommandLineTool/public-api-diff.swift b/Sources/ExecutableTargets/CommandLineTool/public-api-diff.swift index 6ec3bc3..87c2a3a 100644 --- a/Sources/ExecutableTargets/CommandLineTool/public-api-diff.swift +++ b/Sources/ExecutableTargets/CommandLineTool/public-api-diff.swift @@ -7,12 +7,12 @@ import ArgumentParser import Foundation -import CoreModule -import LoggingModule +import PADCore +import PADLogging -import SwiftInterfaceAnalyzerModule -import ProjectBuilderModule -import OutputGeneratorModule +import PADSwiftInterfaceDiff +import PADProjectBuilder +import PADOutputGenerator @main struct PublicApiDiff: AsyncParsableCommand { @@ -73,7 +73,7 @@ struct PublicApiDiff: AsyncParsableCommand { // MARK: - Analyze .swiftinterface files - let pipeline = SwiftInterfacePipeline(logger: logger) + let pipeline = PADSwiftInterfaceDiff(logger: logger) let pipelineOutput = try await pipeline.run( with: projectBuilderResult.swiftInterfaceFiles diff --git a/Sources/PipelineModules/OutputGeneratorModule/MarkdownOutputGenerator.swift b/Sources/PipelineModules/PADOutputGenerator/MarkdownOutputGenerator.swift similarity index 99% rename from Sources/PipelineModules/OutputGeneratorModule/MarkdownOutputGenerator.swift rename to Sources/PipelineModules/PADOutputGenerator/MarkdownOutputGenerator.swift index d579792..9864f26 100644 --- a/Sources/PipelineModules/OutputGeneratorModule/MarkdownOutputGenerator.swift +++ b/Sources/PipelineModules/PADOutputGenerator/MarkdownOutputGenerator.swift @@ -5,7 +5,7 @@ // import Foundation -import CoreModule +import PADCore /// Allows generation of human readable output from the provided information public struct MarkdownOutputGenerator: OutputGenerating { diff --git a/Sources/PipelineModules/OutputGeneratorModule/OutputGenerating.swift b/Sources/PipelineModules/PADOutputGenerator/OutputGenerating.swift similarity index 95% rename from Sources/PipelineModules/OutputGeneratorModule/OutputGenerating.swift rename to Sources/PipelineModules/PADOutputGenerator/OutputGenerating.swift index 1e9e441..e02db86 100644 --- a/Sources/PipelineModules/OutputGeneratorModule/OutputGenerating.swift +++ b/Sources/PipelineModules/PADOutputGenerator/OutputGenerating.swift @@ -5,7 +5,7 @@ // import Foundation -import CoreModule +import PADCore public protocol OutputGenerating { func generate( diff --git a/Sources/PipelineModules/ProjectBuilderModule/ProjectBuilder.swift b/Sources/PipelineModules/PADProjectBuilder/ProjectBuilder.swift similarity index 97% rename from Sources/PipelineModules/ProjectBuilderModule/ProjectBuilder.swift rename to Sources/PipelineModules/PADProjectBuilder/ProjectBuilder.swift index 7c15ed8..79e4c8f 100644 --- a/Sources/PipelineModules/ProjectBuilderModule/ProjectBuilder.swift +++ b/Sources/PipelineModules/PADProjectBuilder/ProjectBuilder.swift @@ -7,10 +7,10 @@ import Foundation -import FileHandlingModule -import LoggingModule -import CoreModule -import ShellModule +import PADFileHandling +import PADLogging +import PADCore +import PADShell public struct ProjectBuilder { diff --git a/Sources/PipelineModules/ProjectBuilderModule/ProjectSetup/Git.swift b/Sources/PipelineModules/PADProjectBuilder/ProjectSetup/Git.swift similarity index 93% rename from Sources/PipelineModules/ProjectBuilderModule/ProjectSetup/Git.swift rename to Sources/PipelineModules/PADProjectBuilder/ProjectSetup/Git.swift index c7897d5..efc65b5 100644 --- a/Sources/PipelineModules/ProjectBuilderModule/ProjectSetup/Git.swift +++ b/Sources/PipelineModules/PADProjectBuilder/ProjectSetup/Git.swift @@ -1,9 +1,9 @@ import Foundation -import CoreModule -import ShellModule -import FileHandlingModule -import LoggingModule +import PADCore +import PADShell +import PADFileHandling +import PADLogging enum GitError: LocalizedError, Equatable { case couldNotClone(branchOrTag: String, repository: String) @@ -16,7 +16,7 @@ enum GitError: LocalizedError, Equatable { } } -public struct Git { +struct Git { private let shell: ShellHandling private let fileHandler: FileHandling diff --git a/Sources/PipelineModules/ProjectBuilderModule/ProjectSetup/ProjectSetupHelper.swift b/Sources/PipelineModules/PADProjectBuilder/ProjectSetup/ProjectSetupHelper.swift similarity index 92% rename from Sources/PipelineModules/ProjectBuilderModule/ProjectSetup/ProjectSetupHelper.swift rename to Sources/PipelineModules/PADProjectBuilder/ProjectSetup/ProjectSetupHelper.swift index f27aeea..0e3c742 100644 --- a/Sources/PipelineModules/ProjectBuilderModule/ProjectSetup/ProjectSetupHelper.swift +++ b/Sources/PipelineModules/PADProjectBuilder/ProjectSetup/ProjectSetupHelper.swift @@ -1,11 +1,11 @@ import Foundation -import CoreModule -import ShellModule -import FileHandlingModule -import LoggingModule +import PADCore +import PADShell +import PADFileHandling +import PADLogging -public struct ProjectSetupHelper: ProjectSetupHelping { +struct ProjectSetupHelper: ProjectSetupHelping { let workingDirectoryPath: String let shell: any ShellHandling @@ -13,7 +13,7 @@ public struct ProjectSetupHelper: ProjectSetupHelping { let fileHandler: any FileHandling let logger: (any Logging)? - public init( + init( workingDirectoryPath: String, randomStringGenerator: any RandomStringGenerating = RandomStringGenerator(), shell: any ShellHandling = Shell(), @@ -27,7 +27,7 @@ public struct ProjectSetupHelper: ProjectSetupHelping { self.logger = logger } - public func setup( + func setup( _ projectSource: ProjectSource, projectType: ProjectType ) async throws -> URL { @@ -57,12 +57,12 @@ public struct ProjectSetupHelper: ProjectSetupHelping { extension ProjectSetupHelper { - public struct ProjectDirectories { + struct ProjectDirectories { public let old: URL public let new: URL } - public func setupProjects( + func setupProjects( oldSource: ProjectSource, newSource: ProjectSource, projectType: ProjectType diff --git a/Sources/PipelineModules/ProjectBuilderModule/ProjectSetup/ProjectSetupHelping.swift b/Sources/PipelineModules/PADProjectBuilder/ProjectSetup/ProjectSetupHelping.swift similarity index 67% rename from Sources/PipelineModules/ProjectBuilderModule/ProjectSetup/ProjectSetupHelping.swift rename to Sources/PipelineModules/PADProjectBuilder/ProjectSetup/ProjectSetupHelping.swift index 8b0ff1e..0c0f0ce 100644 --- a/Sources/PipelineModules/ProjectBuilderModule/ProjectSetup/ProjectSetupHelping.swift +++ b/Sources/PipelineModules/PADProjectBuilder/ProjectSetup/ProjectSetupHelping.swift @@ -1,6 +1,6 @@ import Foundation -import CoreModule +import PADCore -public protocol ProjectSetupHelping { +protocol ProjectSetupHelping { func setup(_ projectSource: ProjectSource, projectType: ProjectType) async throws -> URL } diff --git a/Sources/PipelineModules/ProjectBuilderModule/ProjectSetup/ProjectSource.swift b/Sources/PipelineModules/PADProjectBuilder/ProjectSetup/ProjectSource.swift similarity index 94% rename from Sources/PipelineModules/ProjectBuilderModule/ProjectSetup/ProjectSource.swift rename to Sources/PipelineModules/PADProjectBuilder/ProjectSetup/ProjectSource.swift index 9fdb92c..0d7c10b 100644 --- a/Sources/PipelineModules/ProjectBuilderModule/ProjectSetup/ProjectSource.swift +++ b/Sources/PipelineModules/PADProjectBuilder/ProjectSetup/ProjectSource.swift @@ -5,7 +5,7 @@ // import Foundation -import FileHandlingModule +import PADFileHandling enum ProjectSourceError: LocalizedError, Equatable { case invalidSourceValue(value: String) @@ -18,7 +18,7 @@ enum ProjectSourceError: LocalizedError, Equatable { } } -public enum ProjectSource: Equatable { +public enum ProjectSource: Equatable, CustomStringConvertible { /// The separator used to join branch & repository static var gitSourceSeparator: String { "~" } diff --git a/Sources/PipelineModules/ProjectBuilderModule/ProjectSetup/RandomStringGenerating.swift b/Sources/PipelineModules/PADProjectBuilder/ProjectSetup/RandomStringGenerating.swift similarity index 76% rename from Sources/PipelineModules/ProjectBuilderModule/ProjectSetup/RandomStringGenerating.swift rename to Sources/PipelineModules/PADProjectBuilder/ProjectSetup/RandomStringGenerating.swift index a52e4d0..2428649 100644 --- a/Sources/PipelineModules/ProjectBuilderModule/ProjectSetup/RandomStringGenerating.swift +++ b/Sources/PipelineModules/PADProjectBuilder/ProjectSetup/RandomStringGenerating.swift @@ -6,12 +6,12 @@ import Foundation -public protocol RandomStringGenerating { +protocol RandomStringGenerating { func generateRandomString() -> String } -public struct RandomStringGenerator: RandomStringGenerating { +struct RandomStringGenerator: RandomStringGenerating { public init() {} diff --git a/Sources/PipelineModules/ProjectBuilderModule/ProjectType.swift b/Sources/PipelineModules/PADProjectBuilder/ProjectType.swift similarity index 100% rename from Sources/PipelineModules/ProjectBuilderModule/ProjectType.swift rename to Sources/PipelineModules/PADProjectBuilder/ProjectType.swift diff --git a/Sources/PipelineModules/ProjectBuilderModule/SwiftInterfaceProducer/SwiftInterfaceFileLocator.swift b/Sources/PipelineModules/PADProjectBuilder/SwiftInterfaceProducer/SwiftInterfaceFileLocator.swift similarity index 97% rename from Sources/PipelineModules/ProjectBuilderModule/SwiftInterfaceProducer/SwiftInterfaceFileLocator.swift rename to Sources/PipelineModules/PADProjectBuilder/SwiftInterfaceProducer/SwiftInterfaceFileLocator.swift index 6e5cef9..1958380 100644 --- a/Sources/PipelineModules/ProjectBuilderModule/SwiftInterfaceProducer/SwiftInterfaceFileLocator.swift +++ b/Sources/PipelineModules/PADProjectBuilder/SwiftInterfaceProducer/SwiftInterfaceFileLocator.swift @@ -1,8 +1,8 @@ import Foundation -import FileHandlingModule -import ShellModule -import LoggingModule +import PADFileHandling +import PADShell +import PADLogging /// A helper to locate `.swiftinterface` files struct SwiftInterfaceFileLocator { diff --git a/Sources/PipelineModules/ProjectBuilderModule/SwiftInterfaceProducer/SwiftInterfaceProducer.swift b/Sources/PipelineModules/PADProjectBuilder/SwiftInterfaceProducer/SwiftInterfaceProducer.swift similarity index 97% rename from Sources/PipelineModules/ProjectBuilderModule/SwiftInterfaceProducer/SwiftInterfaceProducer.swift rename to Sources/PipelineModules/PADProjectBuilder/SwiftInterfaceProducer/SwiftInterfaceProducer.swift index 769e344..97fbbc7 100644 --- a/Sources/PipelineModules/ProjectBuilderModule/SwiftInterfaceProducer/SwiftInterfaceProducer.swift +++ b/Sources/PipelineModules/PADProjectBuilder/SwiftInterfaceProducer/SwiftInterfaceProducer.swift @@ -1,12 +1,12 @@ import Foundation -import FileHandlingModule -import ShellModule -import LoggingModule -import CoreModule +import PADFileHandling +import PADShell +import PADLogging +import PADCore /// Allows building of the old & new project and returns the `.swiftinterface` files -public struct SwiftInterfaceProducer { +struct SwiftInterfaceProducer { private typealias ProjectPreparationResult = (archiveScheme: String, schemesToCompare: [String]) private typealias DerivedDataPaths = (new: String, old: String) @@ -18,7 +18,7 @@ public struct SwiftInterfaceProducer { let shell: any ShellHandling let logger: (any Logging)? - public init( + init( workingDirectoryPath: String, projectType: ProjectType, swiftInterfaceType: SwiftInterfaceType, @@ -35,7 +35,7 @@ public struct SwiftInterfaceProducer { } /// Builds the projects and returns the `.swiftinterface` files - public func produceInterfaceFiles( + func produceInterfaceFiles( oldProjectDirectory: URL, newProjectDirectory: URL ) async throws -> [SwiftInterfaceFile] { diff --git a/Sources/PipelineModules/ProjectBuilderModule/SwiftInterfaceProducer/SwiftInterfaceProducerError.swift b/Sources/PipelineModules/PADProjectBuilder/SwiftInterfaceProducer/SwiftInterfaceProducerError.swift similarity index 100% rename from Sources/PipelineModules/ProjectBuilderModule/SwiftInterfaceProducer/SwiftInterfaceProducerError.swift rename to Sources/PipelineModules/PADProjectBuilder/SwiftInterfaceProducer/SwiftInterfaceProducerError.swift diff --git a/Sources/PipelineModules/ProjectBuilderModule/SwiftInterfaceProducer/SwiftInterfaceType.swift b/Sources/PipelineModules/PADProjectBuilder/SwiftInterfaceProducer/SwiftInterfaceType.swift similarity index 100% rename from Sources/PipelineModules/ProjectBuilderModule/SwiftInterfaceProducer/SwiftInterfaceType.swift rename to Sources/PipelineModules/PADProjectBuilder/SwiftInterfaceProducer/SwiftInterfaceType.swift diff --git a/Sources/PipelineModules/ProjectBuilderModule/SwiftInterfaceProducer/XcodeTools.swift b/Sources/PipelineModules/PADProjectBuilder/SwiftInterfaceProducer/XcodeTools.swift similarity index 94% rename from Sources/PipelineModules/ProjectBuilderModule/SwiftInterfaceProducer/XcodeTools.swift rename to Sources/PipelineModules/PADProjectBuilder/SwiftInterfaceProducer/XcodeTools.swift index 1d32168..97593b3 100644 --- a/Sources/PipelineModules/ProjectBuilderModule/SwiftInterfaceProducer/XcodeTools.swift +++ b/Sources/PipelineModules/PADProjectBuilder/SwiftInterfaceProducer/XcodeTools.swift @@ -6,10 +6,10 @@ import Foundation -import CoreModule -import ShellModule -import FileHandlingModule -import LoggingModule +import PADCore +import PADShell +import PADFileHandling +import PADLogging struct XcodeToolsError: LocalizedError, CustomDebugStringConvertible { var errorDescription: String @@ -18,7 +18,7 @@ struct XcodeToolsError: LocalizedError, CustomDebugStringConvertible { var debugDescription: String { errorDescription } } -public struct XcodeTools { +struct XcodeTools { internal enum Constants { static let derivedDataPath: String = ".build" @@ -29,7 +29,7 @@ public struct XcodeTools { private let fileHandler: FileHandling private let logger: Logging? - public init( + init( shell: ShellHandling = Shell(), fileHandler: FileHandling = FileManager.default, logger: Logging? @@ -39,7 +39,7 @@ public struct XcodeTools { self.logger = logger } - public func archive( + func archive( projectDirectoryPath: String, scheme: String, projectType: ProjectType diff --git a/Sources/PipelineModules/ProjectBuilderModule/SwiftPackageFileAnalyzer/SwiftPackageFileAnalyzer.swift b/Sources/PipelineModules/PADProjectBuilder/SwiftPackageFileAnalyzer/SwiftPackageFileAnalyzer.swift similarity index 98% rename from Sources/PipelineModules/ProjectBuilderModule/SwiftPackageFileAnalyzer/SwiftPackageFileAnalyzer.swift rename to Sources/PipelineModules/PADProjectBuilder/SwiftPackageFileAnalyzer/SwiftPackageFileAnalyzer.swift index caa7e45..585e127 100644 --- a/Sources/PipelineModules/ProjectBuilderModule/SwiftPackageFileAnalyzer/SwiftPackageFileAnalyzer.swift +++ b/Sources/PipelineModules/PADProjectBuilder/SwiftPackageFileAnalyzer/SwiftPackageFileAnalyzer.swift @@ -6,12 +6,12 @@ import Foundation -import CoreModule -import FileHandlingModule -import ShellModule -import LoggingModule +import PADCore +import PADFileHandling +import PADShell +import PADLogging -public struct SwiftPackageFileAnalyzer: SwiftPackageFileAnalyzing { +struct SwiftPackageFileAnalyzer: SwiftPackageFileAnalyzing { private let fileHandler: any FileHandling private let shell: any ShellHandling @@ -24,7 +24,7 @@ public struct SwiftPackageFileAnalyzer: SwiftPackageFileAnalyzing { } } - public init( + init( fileHandler: FileHandling = FileManager.default, shell: ShellHandling = Shell(), logger: (any Logging)? @@ -34,7 +34,7 @@ public struct SwiftPackageFileAnalyzer: SwiftPackageFileAnalyzing { self.shell = shell } - public func analyze(oldProjectUrl: URL, newProjectUrl: URL) throws -> SwiftPackageFileAnalyzingResult { + func analyze(oldProjectUrl: URL, newProjectUrl: URL) throws -> SwiftPackageFileAnalyzingResult { let oldProjectPath = oldProjectUrl.path() let newProjectPath = newProjectUrl.path() diff --git a/Sources/PipelineModules/ProjectBuilderModule/SwiftPackageFileAnalyzer/SwiftPackageFileAnalyzing.swift b/Sources/PipelineModules/PADProjectBuilder/SwiftPackageFileAnalyzer/SwiftPackageFileAnalyzing.swift similarity index 73% rename from Sources/PipelineModules/ProjectBuilderModule/SwiftPackageFileAnalyzer/SwiftPackageFileAnalyzing.swift rename to Sources/PipelineModules/PADProjectBuilder/SwiftPackageFileAnalyzer/SwiftPackageFileAnalyzing.swift index 36896fc..d13881f 100644 --- a/Sources/PipelineModules/ProjectBuilderModule/SwiftPackageFileAnalyzer/SwiftPackageFileAnalyzing.swift +++ b/Sources/PipelineModules/PADProjectBuilder/SwiftPackageFileAnalyzer/SwiftPackageFileAnalyzing.swift @@ -1,12 +1,12 @@ import Foundation -import CoreModule +import PADCore -public struct SwiftPackageFileAnalyzingResult { +struct SwiftPackageFileAnalyzingResult { public let changes: [Change] public let warnings: [String] } -public protocol SwiftPackageFileAnalyzing { +protocol SwiftPackageFileAnalyzing { /// Analyzes whether or not the available libraries changed between the old and new version func analyze( oldProjectUrl: URL, diff --git a/Sources/PipelineModules/ProjectBuilderModule/SwiftPackageFileHelper/SwiftPackageDescription.swift b/Sources/PipelineModules/PADProjectBuilder/SwiftPackageFileHelper/SwiftPackageDescription.swift similarity index 99% rename from Sources/PipelineModules/ProjectBuilderModule/SwiftPackageFileHelper/SwiftPackageDescription.swift rename to Sources/PipelineModules/PADProjectBuilder/SwiftPackageFileHelper/SwiftPackageDescription.swift index 2d15628..ac49f60 100644 --- a/Sources/PipelineModules/ProjectBuilderModule/SwiftPackageFileHelper/SwiftPackageDescription.swift +++ b/Sources/PipelineModules/PADProjectBuilder/SwiftPackageFileHelper/SwiftPackageDescription.swift @@ -9,7 +9,7 @@ import Foundation // See: https://docs.swift.org/package-manager/PackageDescription/index.html // See: https://github.com/swiftlang/swift-package-manager/blob/main/Sources/PackageDescription/PackageDescriptionSerialization.swift -public struct SwiftPackageDescription: Codable, Equatable { +struct SwiftPackageDescription: Codable, Equatable { public let name: String public let platforms: [Platform] diff --git a/Sources/PipelineModules/ProjectBuilderModule/SwiftPackageFileHelper/SwiftPackageFileHelper.swift b/Sources/PipelineModules/PADProjectBuilder/SwiftPackageFileHelper/SwiftPackageFileHelper.swift similarity index 98% rename from Sources/PipelineModules/ProjectBuilderModule/SwiftPackageFileHelper/SwiftPackageFileHelper.swift rename to Sources/PipelineModules/PADProjectBuilder/SwiftPackageFileHelper/SwiftPackageFileHelper.swift index b46da1a..3975ba0 100644 --- a/Sources/PipelineModules/ProjectBuilderModule/SwiftPackageFileHelper/SwiftPackageFileHelper.swift +++ b/Sources/PipelineModules/PADProjectBuilder/SwiftPackageFileHelper/SwiftPackageFileHelper.swift @@ -5,9 +5,9 @@ // import Foundation -import FileHandlingModule -import ShellModule -import LoggingModule +import PADFileHandling +import PADShell +import PADLogging enum SwiftPackageFileHelperError: LocalizedError { case packageDescriptionError(_ description: String) @@ -26,7 +26,7 @@ enum SwiftPackageFileHelperError: LocalizedError { } } -public struct SwiftPackageFileHelper { +struct SwiftPackageFileHelper { private let fileHandler: FileHandling private let shell: any ShellHandling diff --git a/Sources/PipelineModules/SwiftInterfaceAnalyzerModule/SwiftInterfacePipeline.swift b/Sources/PipelineModules/PADSwiftInterfaceDiff/PADSwiftInterfaceDiff.swift similarity index 94% rename from Sources/PipelineModules/SwiftInterfaceAnalyzerModule/SwiftInterfacePipeline.swift rename to Sources/PipelineModules/PADSwiftInterfaceDiff/PADSwiftInterfaceDiff.swift index 02b9299..73fa42b 100644 --- a/Sources/PipelineModules/SwiftInterfaceAnalyzerModule/SwiftInterfacePipeline.swift +++ b/Sources/PipelineModules/PADSwiftInterfaceDiff/PADSwiftInterfaceDiff.swift @@ -1,11 +1,11 @@ import Foundation -import CoreModule -import FileHandlingModule -import LoggingModule +import PADCore +import PADFileHandling +import PADLogging /// Takes a list of ``SwiftInterfaceFile`` and detects changes between the old and new version -public struct SwiftInterfacePipeline { +public struct PADSwiftInterfaceDiff { let fileHandler: any FileHandling let swiftInterfaceParser: any SwiftInterfaceParsing diff --git a/Sources/PipelineModules/SwiftInterfaceAnalyzerModule/SwiftInterfaceAnalyzer/IndependentSwiftInterfaceChange.swift b/Sources/PipelineModules/PADSwiftInterfaceDiff/SwiftInterfaceAnalyzer/IndependentSwiftInterfaceChange.swift similarity index 85% rename from Sources/PipelineModules/SwiftInterfaceAnalyzerModule/SwiftInterfaceAnalyzer/IndependentSwiftInterfaceChange.swift rename to Sources/PipelineModules/PADSwiftInterfaceDiff/SwiftInterfaceAnalyzer/IndependentSwiftInterfaceChange.swift index 0c84b7a..0035555 100644 --- a/Sources/PipelineModules/SwiftInterfaceAnalyzerModule/SwiftInterfaceAnalyzer/IndependentSwiftInterfaceChange.swift +++ b/Sources/PipelineModules/PADSwiftInterfaceDiff/SwiftInterfaceAnalyzer/IndependentSwiftInterfaceChange.swift @@ -1,11 +1,11 @@ import Foundation -import CoreModule +import PADCore /// A change indicating an `addition` or `removal` of an element /// /// This intermediate structure helps gathering a list of additions and removals /// that are later consolidated to a ``Change`` -public struct IndependentSwiftInterfaceChange: Equatable { +struct IndependentSwiftInterfaceChange: Equatable { enum ChangeType: Equatable { case addition(_ description: String) @@ -25,7 +25,7 @@ public struct IndependentSwiftInterfaceChange: Equatable { let oldFirst: Bool var parentPath: String? { element.parentPath } - public static func == (lhs: IndependentSwiftInterfaceChange, rhs: IndependentSwiftInterfaceChange) -> Bool { + static func == (lhs: IndependentSwiftInterfaceChange, rhs: IndependentSwiftInterfaceChange) -> Bool { lhs.changeType == rhs.changeType && lhs.element.description == rhs.element.description && lhs.oldFirst == rhs.oldFirst && diff --git a/Sources/PipelineModules/SwiftInterfaceAnalyzerModule/SwiftInterfaceAnalyzer/SwiftInterfaceAnalyzer.swift b/Sources/PipelineModules/PADSwiftInterfaceDiff/SwiftInterfaceAnalyzer/SwiftInterfaceAnalyzer.swift similarity index 95% rename from Sources/PipelineModules/SwiftInterfaceAnalyzerModule/SwiftInterfaceAnalyzer/SwiftInterfaceAnalyzer.swift rename to Sources/PipelineModules/PADSwiftInterfaceDiff/SwiftInterfaceAnalyzer/SwiftInterfaceAnalyzer.swift index 8d59232..d261cf5 100644 --- a/Sources/PipelineModules/SwiftInterfaceAnalyzerModule/SwiftInterfaceAnalyzer/SwiftInterfaceAnalyzer.swift +++ b/Sources/PipelineModules/PADSwiftInterfaceDiff/SwiftInterfaceAnalyzer/SwiftInterfaceAnalyzer.swift @@ -5,15 +5,17 @@ // import Foundation -import CoreModule +import PADCore public struct SwiftInterfaceAnalyzer: SwiftInterfaceAnalyzing { let changeConsolidator: SwiftInterfaceChangeConsolidating - public init( - changeConsolidator: SwiftInterfaceChangeConsolidating = SwiftInterfaceChangeConsolidator() - ) { + public init() { + self.init(changeConsolidator: SwiftInterfaceChangeConsolidator()) + } + + init(changeConsolidator: SwiftInterfaceChangeConsolidating) { self.changeConsolidator = changeConsolidator } diff --git a/Sources/PipelineModules/SwiftInterfaceAnalyzerModule/SwiftInterfaceAnalyzer/SwiftInterfaceAnalyzing.swift b/Sources/PipelineModules/PADSwiftInterfaceDiff/SwiftInterfaceAnalyzer/SwiftInterfaceAnalyzing.swift similarity index 90% rename from Sources/PipelineModules/SwiftInterfaceAnalyzerModule/SwiftInterfaceAnalyzer/SwiftInterfaceAnalyzing.swift rename to Sources/PipelineModules/PADSwiftInterfaceDiff/SwiftInterfaceAnalyzer/SwiftInterfaceAnalyzing.swift index 4239736..0898c14 100644 --- a/Sources/PipelineModules/SwiftInterfaceAnalyzerModule/SwiftInterfaceAnalyzer/SwiftInterfaceAnalyzing.swift +++ b/Sources/PipelineModules/PADSwiftInterfaceDiff/SwiftInterfaceAnalyzer/SwiftInterfaceAnalyzing.swift @@ -1,5 +1,5 @@ import Foundation -import CoreModule +import PADCore public protocol SwiftInterfaceAnalyzing { func analyze(old: some SwiftInterfaceElement, new: some SwiftInterfaceElement) throws -> [Change] diff --git a/Sources/PipelineModules/SwiftInterfaceAnalyzerModule/SwiftInterfaceAnalyzer/SwiftInterfaceChangeConsolidator.swift b/Sources/PipelineModules/PADSwiftInterfaceDiff/SwiftInterfaceAnalyzer/SwiftInterfaceChangeConsolidator.swift similarity index 95% rename from Sources/PipelineModules/SwiftInterfaceAnalyzerModule/SwiftInterfaceAnalyzer/SwiftInterfaceChangeConsolidator.swift rename to Sources/PipelineModules/PADSwiftInterfaceDiff/SwiftInterfaceAnalyzer/SwiftInterfaceChangeConsolidator.swift index 7100ea1..44d89f6 100644 --- a/Sources/PipelineModules/SwiftInterfaceAnalyzerModule/SwiftInterfaceAnalyzer/SwiftInterfaceChangeConsolidator.swift +++ b/Sources/PipelineModules/PADSwiftInterfaceDiff/SwiftInterfaceAnalyzer/SwiftInterfaceChangeConsolidator.swift @@ -5,10 +5,10 @@ // import Foundation -import CoreModule +import PADCore /// A helper to consolidate a `removal` and `addition` to `change` -public protocol SwiftInterfaceChangeConsolidating { +protocol SwiftInterfaceChangeConsolidating { /// Tries to match a `removal` and `addition` to a `change` /// @@ -17,9 +17,7 @@ public protocol SwiftInterfaceChangeConsolidating { func consolidate(_ changes: [IndependentSwiftInterfaceChange]) -> [Change] } -public struct SwiftInterfaceChangeConsolidator: SwiftInterfaceChangeConsolidating { - - public init() {} +struct SwiftInterfaceChangeConsolidator: SwiftInterfaceChangeConsolidating { /// Tries to match a `removal` and `addition` to a `change` /// @@ -34,7 +32,7 @@ public struct SwiftInterfaceChangeConsolidator: SwiftInterfaceChangeConsolidatin /// e.g. a second `addition` `init(unrelated: String)` might be matched as a change of `init(foo: Int, bar: Int)` /// as they share the same comparison features but might not be an actual change but a genuine addition. /// This is acceptable for now but might be improved in the future (e.g. calculating a matching-percentage) - public func consolidate(_ changes: [IndependentSwiftInterfaceChange]) -> [Change] { + func consolidate(_ changes: [IndependentSwiftInterfaceChange]) -> [Change] { var independentChanges = changes var consolidatedChanges = [Change]() diff --git a/Sources/PipelineModules/SwiftInterfaceAnalyzerModule/SwiftInterfaceElement+DiffHelper.swift b/Sources/PipelineModules/PADSwiftInterfaceDiff/SwiftInterfaceElement+DiffHelper.swift similarity index 99% rename from Sources/PipelineModules/SwiftInterfaceAnalyzerModule/SwiftInterfaceElement+DiffHelper.swift rename to Sources/PipelineModules/PADSwiftInterfaceDiff/SwiftInterfaceElement+DiffHelper.swift index f722b54..a5960de 100644 --- a/Sources/PipelineModules/SwiftInterfaceAnalyzerModule/SwiftInterfaceElement+DiffHelper.swift +++ b/Sources/PipelineModules/PADSwiftInterfaceDiff/SwiftInterfaceElement+DiffHelper.swift @@ -1,5 +1,5 @@ import Foundation -import CoreModule +import PADCore extension SwiftInterfaceElement { diff --git a/Sources/PipelineModules/SwiftInterfaceAnalyzerModule/SwiftInterfaceElement.swift b/Sources/PipelineModules/PADSwiftInterfaceDiff/SwiftInterfaceElement.swift similarity index 100% rename from Sources/PipelineModules/SwiftInterfaceAnalyzerModule/SwiftInterfaceElement.swift rename to Sources/PipelineModules/PADSwiftInterfaceDiff/SwiftInterfaceElement.swift diff --git a/Sources/PipelineModules/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/DeclSyntax+Convenience.swift b/Sources/PipelineModules/PADSwiftInterfaceDiff/SwiftInterfaceParser/DeclSyntax+Convenience.swift similarity index 100% rename from Sources/PipelineModules/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/DeclSyntax+Convenience.swift rename to Sources/PipelineModules/PADSwiftInterfaceDiff/SwiftInterfaceParser/DeclSyntax+Convenience.swift diff --git a/Sources/PipelineModules/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/DeclSyntax+SwiftInterface/ActorDeclSyntax+SwiftInterface.swift b/Sources/PipelineModules/PADSwiftInterfaceDiff/SwiftInterfaceParser/DeclSyntax+SwiftInterface/ActorDeclSyntax+SwiftInterface.swift similarity index 100% rename from Sources/PipelineModules/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/DeclSyntax+SwiftInterface/ActorDeclSyntax+SwiftInterface.swift rename to Sources/PipelineModules/PADSwiftInterfaceDiff/SwiftInterfaceParser/DeclSyntax+SwiftInterface/ActorDeclSyntax+SwiftInterface.swift diff --git a/Sources/PipelineModules/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/DeclSyntax+SwiftInterface/AssociatedTypeDeclSyntax+SwiftInterface.swift b/Sources/PipelineModules/PADSwiftInterfaceDiff/SwiftInterfaceParser/DeclSyntax+SwiftInterface/AssociatedTypeDeclSyntax+SwiftInterface.swift similarity index 100% rename from Sources/PipelineModules/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/DeclSyntax+SwiftInterface/AssociatedTypeDeclSyntax+SwiftInterface.swift rename to Sources/PipelineModules/PADSwiftInterfaceDiff/SwiftInterfaceParser/DeclSyntax+SwiftInterface/AssociatedTypeDeclSyntax+SwiftInterface.swift diff --git a/Sources/PipelineModules/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/DeclSyntax+SwiftInterface/ClassDeclSyntac+SwiftInterface.swift b/Sources/PipelineModules/PADSwiftInterfaceDiff/SwiftInterfaceParser/DeclSyntax+SwiftInterface/ClassDeclSyntac+SwiftInterface.swift similarity index 100% rename from Sources/PipelineModules/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/DeclSyntax+SwiftInterface/ClassDeclSyntac+SwiftInterface.swift rename to Sources/PipelineModules/PADSwiftInterfaceDiff/SwiftInterfaceParser/DeclSyntax+SwiftInterface/ClassDeclSyntac+SwiftInterface.swift diff --git a/Sources/PipelineModules/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/DeclSyntax+SwiftInterface/EnumCaseDeclSyntax+SwiftInterface.swift b/Sources/PipelineModules/PADSwiftInterfaceDiff/SwiftInterfaceParser/DeclSyntax+SwiftInterface/EnumCaseDeclSyntax+SwiftInterface.swift similarity index 100% rename from Sources/PipelineModules/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/DeclSyntax+SwiftInterface/EnumCaseDeclSyntax+SwiftInterface.swift rename to Sources/PipelineModules/PADSwiftInterfaceDiff/SwiftInterfaceParser/DeclSyntax+SwiftInterface/EnumCaseDeclSyntax+SwiftInterface.swift diff --git a/Sources/PipelineModules/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/DeclSyntax+SwiftInterface/EnumDeclSyntax+SwiftInterface.swift b/Sources/PipelineModules/PADSwiftInterfaceDiff/SwiftInterfaceParser/DeclSyntax+SwiftInterface/EnumDeclSyntax+SwiftInterface.swift similarity index 100% rename from Sources/PipelineModules/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/DeclSyntax+SwiftInterface/EnumDeclSyntax+SwiftInterface.swift rename to Sources/PipelineModules/PADSwiftInterfaceDiff/SwiftInterfaceParser/DeclSyntax+SwiftInterface/EnumDeclSyntax+SwiftInterface.swift diff --git a/Sources/PipelineModules/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/DeclSyntax+SwiftInterface/ExtensionDeclSyntax+SwiftInterface.swift b/Sources/PipelineModules/PADSwiftInterfaceDiff/SwiftInterfaceParser/DeclSyntax+SwiftInterface/ExtensionDeclSyntax+SwiftInterface.swift similarity index 100% rename from Sources/PipelineModules/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/DeclSyntax+SwiftInterface/ExtensionDeclSyntax+SwiftInterface.swift rename to Sources/PipelineModules/PADSwiftInterfaceDiff/SwiftInterfaceParser/DeclSyntax+SwiftInterface/ExtensionDeclSyntax+SwiftInterface.swift diff --git a/Sources/PipelineModules/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/DeclSyntax+SwiftInterface/FunctionDeclSyntax+SwiftInterface.swift b/Sources/PipelineModules/PADSwiftInterfaceDiff/SwiftInterfaceParser/DeclSyntax+SwiftInterface/FunctionDeclSyntax+SwiftInterface.swift similarity index 100% rename from Sources/PipelineModules/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/DeclSyntax+SwiftInterface/FunctionDeclSyntax+SwiftInterface.swift rename to Sources/PipelineModules/PADSwiftInterfaceDiff/SwiftInterfaceParser/DeclSyntax+SwiftInterface/FunctionDeclSyntax+SwiftInterface.swift diff --git a/Sources/PipelineModules/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/DeclSyntax+SwiftInterface/InitializerDeclSyntax+SwiftInterface.swift b/Sources/PipelineModules/PADSwiftInterfaceDiff/SwiftInterfaceParser/DeclSyntax+SwiftInterface/InitializerDeclSyntax+SwiftInterface.swift similarity index 100% rename from Sources/PipelineModules/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/DeclSyntax+SwiftInterface/InitializerDeclSyntax+SwiftInterface.swift rename to Sources/PipelineModules/PADSwiftInterfaceDiff/SwiftInterfaceParser/DeclSyntax+SwiftInterface/InitializerDeclSyntax+SwiftInterface.swift diff --git a/Sources/PipelineModules/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/DeclSyntax+SwiftInterface/ProtocolDeclSyntax+SwiftInterface.swift b/Sources/PipelineModules/PADSwiftInterfaceDiff/SwiftInterfaceParser/DeclSyntax+SwiftInterface/ProtocolDeclSyntax+SwiftInterface.swift similarity index 100% rename from Sources/PipelineModules/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/DeclSyntax+SwiftInterface/ProtocolDeclSyntax+SwiftInterface.swift rename to Sources/PipelineModules/PADSwiftInterfaceDiff/SwiftInterfaceParser/DeclSyntax+SwiftInterface/ProtocolDeclSyntax+SwiftInterface.swift diff --git a/Sources/PipelineModules/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/DeclSyntax+SwiftInterface/StructDeclSyntax+SwiftInterface.swift b/Sources/PipelineModules/PADSwiftInterfaceDiff/SwiftInterfaceParser/DeclSyntax+SwiftInterface/StructDeclSyntax+SwiftInterface.swift similarity index 100% rename from Sources/PipelineModules/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/DeclSyntax+SwiftInterface/StructDeclSyntax+SwiftInterface.swift rename to Sources/PipelineModules/PADSwiftInterfaceDiff/SwiftInterfaceParser/DeclSyntax+SwiftInterface/StructDeclSyntax+SwiftInterface.swift diff --git a/Sources/PipelineModules/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/DeclSyntax+SwiftInterface/SubscriptDeclSyntax+SwiftInterface.swift b/Sources/PipelineModules/PADSwiftInterfaceDiff/SwiftInterfaceParser/DeclSyntax+SwiftInterface/SubscriptDeclSyntax+SwiftInterface.swift similarity index 100% rename from Sources/PipelineModules/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/DeclSyntax+SwiftInterface/SubscriptDeclSyntax+SwiftInterface.swift rename to Sources/PipelineModules/PADSwiftInterfaceDiff/SwiftInterfaceParser/DeclSyntax+SwiftInterface/SubscriptDeclSyntax+SwiftInterface.swift diff --git a/Sources/PipelineModules/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/DeclSyntax+SwiftInterface/TypeAliasDeclSyntax+SwiftInterface.swift b/Sources/PipelineModules/PADSwiftInterfaceDiff/SwiftInterfaceParser/DeclSyntax+SwiftInterface/TypeAliasDeclSyntax+SwiftInterface.swift similarity index 100% rename from Sources/PipelineModules/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/DeclSyntax+SwiftInterface/TypeAliasDeclSyntax+SwiftInterface.swift rename to Sources/PipelineModules/PADSwiftInterfaceDiff/SwiftInterfaceParser/DeclSyntax+SwiftInterface/TypeAliasDeclSyntax+SwiftInterface.swift diff --git a/Sources/PipelineModules/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/DeclSyntax+SwiftInterface/VarDeclSyntax+SwiftInterface.swift b/Sources/PipelineModules/PADSwiftInterfaceDiff/SwiftInterfaceParser/DeclSyntax+SwiftInterface/VarDeclSyntax+SwiftInterface.swift similarity index 100% rename from Sources/PipelineModules/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/DeclSyntax+SwiftInterface/VarDeclSyntax+SwiftInterface.swift rename to Sources/PipelineModules/PADSwiftInterfaceDiff/SwiftInterfaceParser/DeclSyntax+SwiftInterface/VarDeclSyntax+SwiftInterface.swift diff --git a/Sources/PipelineModules/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+Actor.swift b/Sources/PipelineModules/PADSwiftInterfaceDiff/SwiftInterfaceParser/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+Actor.swift similarity index 100% rename from Sources/PipelineModules/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+Actor.swift rename to Sources/PipelineModules/PADSwiftInterfaceDiff/SwiftInterfaceParser/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+Actor.swift diff --git a/Sources/PipelineModules/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+AssociatedType.swift b/Sources/PipelineModules/PADSwiftInterfaceDiff/SwiftInterfaceParser/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+AssociatedType.swift similarity index 100% rename from Sources/PipelineModules/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+AssociatedType.swift rename to Sources/PipelineModules/PADSwiftInterfaceDiff/SwiftInterfaceParser/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+AssociatedType.swift diff --git a/Sources/PipelineModules/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+Class.swift b/Sources/PipelineModules/PADSwiftInterfaceDiff/SwiftInterfaceParser/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+Class.swift similarity index 100% rename from Sources/PipelineModules/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+Class.swift rename to Sources/PipelineModules/PADSwiftInterfaceDiff/SwiftInterfaceParser/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+Class.swift diff --git a/Sources/PipelineModules/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+Enum.swift b/Sources/PipelineModules/PADSwiftInterfaceDiff/SwiftInterfaceParser/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+Enum.swift similarity index 100% rename from Sources/PipelineModules/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+Enum.swift rename to Sources/PipelineModules/PADSwiftInterfaceDiff/SwiftInterfaceParser/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+Enum.swift diff --git a/Sources/PipelineModules/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+EnumCase.swift b/Sources/PipelineModules/PADSwiftInterfaceDiff/SwiftInterfaceParser/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+EnumCase.swift similarity index 100% rename from Sources/PipelineModules/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+EnumCase.swift rename to Sources/PipelineModules/PADSwiftInterfaceDiff/SwiftInterfaceParser/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+EnumCase.swift diff --git a/Sources/PipelineModules/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+Extension.swift b/Sources/PipelineModules/PADSwiftInterfaceDiff/SwiftInterfaceParser/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+Extension.swift similarity index 100% rename from Sources/PipelineModules/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+Extension.swift rename to Sources/PipelineModules/PADSwiftInterfaceDiff/SwiftInterfaceParser/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+Extension.swift diff --git a/Sources/PipelineModules/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+Function.swift b/Sources/PipelineModules/PADSwiftInterfaceDiff/SwiftInterfaceParser/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+Function.swift similarity index 100% rename from Sources/PipelineModules/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+Function.swift rename to Sources/PipelineModules/PADSwiftInterfaceDiff/SwiftInterfaceParser/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+Function.swift diff --git a/Sources/PipelineModules/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+Initializer.swift b/Sources/PipelineModules/PADSwiftInterfaceDiff/SwiftInterfaceParser/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+Initializer.swift similarity index 100% rename from Sources/PipelineModules/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+Initializer.swift rename to Sources/PipelineModules/PADSwiftInterfaceDiff/SwiftInterfaceParser/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+Initializer.swift diff --git a/Sources/PipelineModules/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+Protocol.swift b/Sources/PipelineModules/PADSwiftInterfaceDiff/SwiftInterfaceParser/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+Protocol.swift similarity index 100% rename from Sources/PipelineModules/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+Protocol.swift rename to Sources/PipelineModules/PADSwiftInterfaceDiff/SwiftInterfaceParser/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+Protocol.swift diff --git a/Sources/PipelineModules/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+Struct.swift b/Sources/PipelineModules/PADSwiftInterfaceDiff/SwiftInterfaceParser/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+Struct.swift similarity index 100% rename from Sources/PipelineModules/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+Struct.swift rename to Sources/PipelineModules/PADSwiftInterfaceDiff/SwiftInterfaceParser/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+Struct.swift diff --git a/Sources/PipelineModules/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+Subscript.swift b/Sources/PipelineModules/PADSwiftInterfaceDiff/SwiftInterfaceParser/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+Subscript.swift similarity index 100% rename from Sources/PipelineModules/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+Subscript.swift rename to Sources/PipelineModules/PADSwiftInterfaceDiff/SwiftInterfaceParser/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+Subscript.swift diff --git a/Sources/PipelineModules/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+TypeAlias.swift b/Sources/PipelineModules/PADSwiftInterfaceDiff/SwiftInterfaceParser/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+TypeAlias.swift similarity index 100% rename from Sources/PipelineModules/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+TypeAlias.swift rename to Sources/PipelineModules/PADSwiftInterfaceDiff/SwiftInterfaceParser/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+TypeAlias.swift diff --git a/Sources/PipelineModules/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+Var.swift b/Sources/PipelineModules/PADSwiftInterfaceDiff/SwiftInterfaceParser/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+Var.swift similarity index 100% rename from Sources/PipelineModules/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+Var.swift rename to Sources/PipelineModules/PADSwiftInterfaceDiff/SwiftInterfaceParser/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+Var.swift diff --git a/Sources/PipelineModules/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/SwiftInterfaceParser+Root.swift b/Sources/PipelineModules/PADSwiftInterfaceDiff/SwiftInterfaceParser/SwiftInterfaceParser+Root.swift similarity index 100% rename from Sources/PipelineModules/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/SwiftInterfaceParser+Root.swift rename to Sources/PipelineModules/PADSwiftInterfaceDiff/SwiftInterfaceParser/SwiftInterfaceParser+Root.swift diff --git a/Sources/PipelineModules/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/SwiftInterfaceParser.swift b/Sources/PipelineModules/PADSwiftInterfaceDiff/SwiftInterfaceParser/SwiftInterfaceParser.swift similarity index 100% rename from Sources/PipelineModules/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/SwiftInterfaceParser.swift rename to Sources/PipelineModules/PADSwiftInterfaceDiff/SwiftInterfaceParser/SwiftInterfaceParser.swift diff --git a/Sources/PipelineModules/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/SwiftInterfaceParsing.swift b/Sources/PipelineModules/PADSwiftInterfaceDiff/SwiftInterfaceParser/SwiftInterfaceParsing.swift similarity index 100% rename from Sources/PipelineModules/SwiftInterfaceAnalyzerModule/SwiftInterfaceParser/SwiftInterfaceParsing.swift rename to Sources/PipelineModules/PADSwiftInterfaceDiff/SwiftInterfaceParser/SwiftInterfaceParsing.swift diff --git a/Sources/SharedHelperModules/CoreModule/Change.swift b/Sources/SharedHelperModules/PADCore/Change.swift similarity index 100% rename from Sources/SharedHelperModules/CoreModule/Change.swift rename to Sources/SharedHelperModules/PADCore/Change.swift diff --git a/Sources/SharedHelperModules/CoreModule/SwiftInterfaceFile.swift b/Sources/SharedHelperModules/PADCore/SwiftInterfaceFile.swift similarity index 100% rename from Sources/SharedHelperModules/CoreModule/SwiftInterfaceFile.swift rename to Sources/SharedHelperModules/PADCore/SwiftInterfaceFile.swift diff --git a/Sources/SharedHelperModules/FileHandlingModule/FileHandling+Convenience.swift b/Sources/SharedHelperModules/PADFileHandling/FileHandling+Convenience.swift similarity index 100% rename from Sources/SharedHelperModules/FileHandlingModule/FileHandling+Convenience.swift rename to Sources/SharedHelperModules/PADFileHandling/FileHandling+Convenience.swift diff --git a/Sources/SharedHelperModules/FileHandlingModule/FileHandling.swift b/Sources/SharedHelperModules/PADFileHandling/FileHandling.swift similarity index 100% rename from Sources/SharedHelperModules/FileHandlingModule/FileHandling.swift rename to Sources/SharedHelperModules/PADFileHandling/FileHandling.swift diff --git a/Sources/SharedHelperModules/FileHandlingModule/FileManager+FileHandling.swift b/Sources/SharedHelperModules/PADFileHandling/FileManager+FileHandling.swift similarity index 100% rename from Sources/SharedHelperModules/FileHandlingModule/FileManager+FileHandling.swift rename to Sources/SharedHelperModules/PADFileHandling/FileManager+FileHandling.swift diff --git a/Sources/SharedHelperModules/LoggingModule/LogFileLogger.swift b/Sources/SharedHelperModules/PADLogging/LogFileLogger.swift similarity index 97% rename from Sources/SharedHelperModules/LoggingModule/LogFileLogger.swift rename to Sources/SharedHelperModules/PADLogging/LogFileLogger.swift index 6f4674b..4f8fc07 100644 --- a/Sources/SharedHelperModules/LoggingModule/LogFileLogger.swift +++ b/Sources/SharedHelperModules/PADLogging/LogFileLogger.swift @@ -1,5 +1,5 @@ import Foundation -import FileHandlingModule +import PADFileHandling public class LogFileLogger: Logging { diff --git a/Sources/SharedHelperModules/LoggingModule/LogLevelLogger.swift b/Sources/SharedHelperModules/PADLogging/LogLevelLogger.swift similarity index 100% rename from Sources/SharedHelperModules/LoggingModule/LogLevelLogger.swift rename to Sources/SharedHelperModules/PADLogging/LogLevelLogger.swift diff --git a/Sources/SharedHelperModules/LoggingModule/Logging.swift b/Sources/SharedHelperModules/PADLogging/Logging.swift similarity index 100% rename from Sources/SharedHelperModules/LoggingModule/Logging.swift rename to Sources/SharedHelperModules/PADLogging/Logging.swift diff --git a/Sources/SharedHelperModules/LoggingModule/LoggingGroup.swift b/Sources/SharedHelperModules/PADLogging/LoggingGroup.swift similarity index 100% rename from Sources/SharedHelperModules/LoggingModule/LoggingGroup.swift rename to Sources/SharedHelperModules/PADLogging/LoggingGroup.swift diff --git a/Sources/SharedHelperModules/LoggingModule/SystemLogger.swift b/Sources/SharedHelperModules/PADLogging/SystemLogger.swift similarity index 100% rename from Sources/SharedHelperModules/LoggingModule/SystemLogger.swift rename to Sources/SharedHelperModules/PADLogging/SystemLogger.swift diff --git a/Sources/SharedHelperModules/ShellModule/Shell.swift b/Sources/SharedHelperModules/PADShell/Shell.swift similarity index 100% rename from Sources/SharedHelperModules/ShellModule/Shell.swift rename to Sources/SharedHelperModules/PADShell/Shell.swift diff --git a/Tests/IntegrationTests/ReferencePackageTests.swift b/Tests/IntegrationTests/ReferencePackageTests.swift index 74c79fd..b7cd997 100644 --- a/Tests/IntegrationTests/ReferencePackageTests.swift +++ b/Tests/IntegrationTests/ReferencePackageTests.swift @@ -4,11 +4,11 @@ // This file is open source and available under the MIT license. See the LICENSE file for more info. // -@testable import ProjectBuilderModule -@testable import OutputGeneratorModule -@testable import ProjectBuilderModule -@testable import SwiftInterfaceAnalyzerModule -@testable import CoreModule +@testable import PADProjectBuilder +@testable import PADOutputGenerator +@testable import PADProjectBuilder +@testable import PADSwiftInterfaceDiff +@testable import PADCore import XCTest class ReferencePackageTests: XCTestCase { @@ -165,7 +165,7 @@ private extension ReferencePackageTests { ) ] - return try await SwiftInterfacePipeline( + return try await PADSwiftInterfaceDiff( fileHandler: FileManager.default, swiftInterfaceParser: SwiftInterfaceParser(), swiftInterfaceAnalyzer: SwiftInterfaceAnalyzer(), diff --git a/Tests/UnitTests/FileHandlingTests.swift b/Tests/UnitTests/FileHandlingTests.swift index 8a067ca..9199f56 100644 --- a/Tests/UnitTests/FileHandlingTests.swift +++ b/Tests/UnitTests/FileHandlingTests.swift @@ -4,7 +4,7 @@ // This file is open source and available under the MIT license. See the LICENSE file for more info. // -@testable import FileHandlingModule +@testable import PADFileHandling import XCTest class FileHandlingTests: XCTestCase { diff --git a/Tests/UnitTests/GitTests.swift b/Tests/UnitTests/GitTests.swift index e7caa0c..4fda4d8 100644 --- a/Tests/UnitTests/GitTests.swift +++ b/Tests/UnitTests/GitTests.swift @@ -4,7 +4,7 @@ // This file is open source and available under the MIT license. See the LICENSE file for more info. // -@testable import ProjectBuilderModule +@testable import PADProjectBuilder import XCTest class GitTests: XCTestCase { diff --git a/Tests/UnitTests/LoggerTests.swift b/Tests/UnitTests/LoggerTests.swift index c64187b..b997ca7 100644 --- a/Tests/UnitTests/LoggerTests.swift +++ b/Tests/UnitTests/LoggerTests.swift @@ -4,7 +4,7 @@ // This file is open source and available under the MIT license. See the LICENSE file for more info. // -@testable import LoggingModule +@testable import PADLogging import XCTest class LoggerTests: XCTestCase { diff --git a/Tests/UnitTests/OutputGeneratorTests.swift b/Tests/UnitTests/OutputGeneratorTests.swift index f6e0162..26e8bc4 100644 --- a/Tests/UnitTests/OutputGeneratorTests.swift +++ b/Tests/UnitTests/OutputGeneratorTests.swift @@ -4,7 +4,7 @@ // This file is open source and available under the MIT license. See the LICENSE file for more info. // -@testable import OutputGeneratorModule +@testable import PADOutputGenerator import XCTest class OutputGeneratorTests: XCTestCase { diff --git a/Tests/UnitTests/PipelineTests.swift b/Tests/UnitTests/PipelineTests.swift index b6610b8..7b408ea 100644 --- a/Tests/UnitTests/PipelineTests.swift +++ b/Tests/UnitTests/PipelineTests.swift @@ -4,8 +4,8 @@ // This file is open source and available under the MIT license. See the LICENSE file for more info. // -@testable import SwiftInterfaceAnalyzerModule -@testable import CoreModule +@testable import PADSwiftInterfaceDiff +@testable import PADCore import XCTest class PipelineTests: XCTestCase { @@ -28,7 +28,7 @@ class PipelineTests: XCTestCase { (.init(moduleName: "MODULE_NAME", elements: []), .init(moduleName: "MODULE_NAME", elements: [])) ] var expectedHandleLogCalls: [(message: String, subsystem: String)] = [ - ("🧑‍🔬 Analyzing MODULE_NAME", "SwiftInterfacePipeline") + ("🧑‍🔬 Analyzing MODULE_NAME", "PADSwiftInterfaceDiff") ] let expectedPipelineOutput: [String: [Change]] = ["MODULE_NAME": expectedChanges] @@ -66,7 +66,7 @@ class PipelineTests: XCTestCase { // Pipeline run - let pipeline = SwiftInterfacePipeline( + let pipeline = PADSwiftInterfaceDiff( fileHandler: fileHandler, swiftInterfaceParser: swiftInterfaceParser, swiftInterfaceAnalyzer: swiftInterfaceAnalyzer, diff --git a/Tests/UnitTests/ProjectSourceTests.swift b/Tests/UnitTests/ProjectSourceTests.swift index 0bfa18e..da4557c 100644 --- a/Tests/UnitTests/ProjectSourceTests.swift +++ b/Tests/UnitTests/ProjectSourceTests.swift @@ -4,7 +4,7 @@ // This file is open source and available under the MIT license. See the LICENSE file for more info. // -@testable import ProjectBuilderModule +@testable import PADProjectBuilder import XCTest class ProjectSourceTests: XCTestCase { diff --git a/Tests/UnitTests/SwiftPackageFileAnalyzerTests.swift b/Tests/UnitTests/SwiftPackageFileAnalyzerTests.swift index b237f2f..64ad7aa 100644 --- a/Tests/UnitTests/SwiftPackageFileAnalyzerTests.swift +++ b/Tests/UnitTests/SwiftPackageFileAnalyzerTests.swift @@ -4,8 +4,8 @@ // This file is open source and available under the MIT license. See the LICENSE file for more info. // -@testable import ProjectBuilderModule -@testable import CoreModule +@testable import PADProjectBuilder +@testable import PADCore import XCTest class SwiftPackageFileAnalyzerTests: XCTestCase { @@ -165,7 +165,7 @@ class SwiftPackageFileAnalyzerTests: XCTestCase { changeType: .addition( description: ".library(name: \"New Library\", targets: [\"New Target\"])" ), - parentPath: "Package.swift / products", + parentPath: ".products", listOfChanges: [] ), .init( @@ -173,7 +173,7 @@ class SwiftPackageFileAnalyzerTests: XCTestCase { oldDescription: ".library(name: \"Some Library\", targets: [\"Some Target\", \"Old Target\"])", newDescription: ".library(name: \"Some Library\", targets: [\"Some Target\", \"New Target\"])" ), - parentPath: "Package.swift / products", + parentPath: ".products", listOfChanges: [ "Added target \"New Target\"", "Removed target \"Old Target\"" @@ -183,14 +183,14 @@ class SwiftPackageFileAnalyzerTests: XCTestCase { changeType: .removal( description: ".library(name: \"Old Library\", targets: [\"Old Target\"])" ), - parentPath: "Package.swift / products", + parentPath: ".products", listOfChanges: [] ), .init( changeType: .addition( description: ".binaryTarget(name: \"New Target\", path: \"new/path\")" ), - parentPath: "Package.swift / targets", + parentPath: ".targets", listOfChanges: [] ), .init( @@ -198,7 +198,7 @@ class SwiftPackageFileAnalyzerTests: XCTestCase { oldDescription: ".binaryTarget(name: \"Some Target\", dependencies: [.target(name: \"Some Target Dependency\"), .target(name: \"Old Target Dependency\"), .product(name: \"Some Product Dependency\", ...), .product(name: \"Old Product Dependency\", ...)], path: \"some/old/path\")", newDescription: ".target(name: \"Some Target\", dependencies: [.target(name: \"Some Target Dependency\"), .target(name: \"New Target Dependency\"), .product(name: \"Some Product Dependency\", ...), .product(name: \"New Product Dependency\", ...)], path: \"some/new/path\")" ), - parentPath: "Package.swift / targets", + parentPath: ".targets", listOfChanges: [ "Added dependency .target(name: \"New Target Dependency\")", "Added dependency .product(name: \"New Product Dependency\", ...)", @@ -212,7 +212,7 @@ class SwiftPackageFileAnalyzerTests: XCTestCase { changeType: .removal( description: ".testTarget(name: \"Old Target\", path: \"old/path\")" ), - parentPath: "Package.swift / targets", + parentPath: ".targets", listOfChanges: [] ) ] diff --git a/Tests/UnitTests/Utilities/MockFileHandler.swift b/Tests/UnitTests/Utilities/MockFileHandler.swift index c773d79..5eaadc2 100644 --- a/Tests/UnitTests/Utilities/MockFileHandler.swift +++ b/Tests/UnitTests/Utilities/MockFileHandler.swift @@ -4,7 +4,7 @@ // This file is open source and available under the MIT license. See the LICENSE file for more info. // -@testable import FileHandlingModule +@testable import PADFileHandling import XCTest struct MockFileHandler: FileHandling { diff --git a/Tests/UnitTests/Utilities/MockLogger.swift b/Tests/UnitTests/Utilities/MockLogger.swift index a4053bd..f82c362 100644 --- a/Tests/UnitTests/Utilities/MockLogger.swift +++ b/Tests/UnitTests/Utilities/MockLogger.swift @@ -4,7 +4,7 @@ // This file is open source and available under the MIT license. See the LICENSE file for more info. // -@testable import LoggingModule +@testable import PADLogging import XCTest struct MockLogger: Logging { diff --git a/Tests/UnitTests/Utilities/MockPipelineModules/MockLibraryAnalyzer.swift b/Tests/UnitTests/Utilities/MockPipelineModules/MockLibraryAnalyzer.swift index d1c9860..af27dce 100644 --- a/Tests/UnitTests/Utilities/MockPipelineModules/MockLibraryAnalyzer.swift +++ b/Tests/UnitTests/Utilities/MockPipelineModules/MockLibraryAnalyzer.swift @@ -4,7 +4,7 @@ // This file is open source and available under the MIT license. See the LICENSE file for more info. // -@testable import ProjectBuilderModule +@testable import PADProjectBuilder import XCTest struct MockSwiftPackageFileAnalyzer: SwiftPackageFileAnalyzing { diff --git a/Tests/UnitTests/Utilities/MockPipelineModules/MockOutputGenerator.swift b/Tests/UnitTests/Utilities/MockPipelineModules/MockOutputGenerator.swift index 46f59f5..dd9ba64 100644 --- a/Tests/UnitTests/Utilities/MockPipelineModules/MockOutputGenerator.swift +++ b/Tests/UnitTests/Utilities/MockPipelineModules/MockOutputGenerator.swift @@ -4,8 +4,8 @@ // This file is open source and available under the MIT license. See the LICENSE file for more info. // -@testable import OutputGeneratorModule -@testable import CoreModule +@testable import PADOutputGenerator +@testable import PADCore import XCTest struct MockOutputGenerator: OutputGenerating { diff --git a/Tests/UnitTests/Utilities/MockRandomStringGenerator.swift b/Tests/UnitTests/Utilities/MockRandomStringGenerator.swift index 0ba0296..0d0173c 100644 --- a/Tests/UnitTests/Utilities/MockRandomStringGenerator.swift +++ b/Tests/UnitTests/Utilities/MockRandomStringGenerator.swift @@ -4,7 +4,7 @@ // This file is open source and available under the MIT license. See the LICENSE file for more info. // -@testable import ProjectBuilderModule +@testable import PADProjectBuilder import XCTest struct MockRandomStringGenerator: RandomStringGenerating { diff --git a/Tests/UnitTests/Utilities/MockShell.swift b/Tests/UnitTests/Utilities/MockShell.swift index b2e102c..0e8753d 100644 --- a/Tests/UnitTests/Utilities/MockShell.swift +++ b/Tests/UnitTests/Utilities/MockShell.swift @@ -4,7 +4,7 @@ // This file is open source and available under the MIT license. See the LICENSE file for more info. // -@testable import ShellModule +@testable import PADShell import XCTest struct MockShell: ShellHandling { diff --git a/Tests/UnitTests/Utilities/MockSwiftInterfaceAnalyzer.swift b/Tests/UnitTests/Utilities/MockSwiftInterfaceAnalyzer.swift index 0f507a0..8b217f7 100644 --- a/Tests/UnitTests/Utilities/MockSwiftInterfaceAnalyzer.swift +++ b/Tests/UnitTests/Utilities/MockSwiftInterfaceAnalyzer.swift @@ -4,8 +4,8 @@ // This file is open source and available under the MIT license. See the LICENSE file for more info. // -@testable import SwiftInterfaceAnalyzerModule -@testable import CoreModule +@testable import PADSwiftInterfaceDiff +@testable import PADCore import XCTest struct MockSwiftInterfaceAnalyzer: SwiftInterfaceAnalyzing { diff --git a/Tests/UnitTests/Utilities/MockSwiftInterfaceParser.swift b/Tests/UnitTests/Utilities/MockSwiftInterfaceParser.swift index a49a457..27485a8 100644 --- a/Tests/UnitTests/Utilities/MockSwiftInterfaceParser.swift +++ b/Tests/UnitTests/Utilities/MockSwiftInterfaceParser.swift @@ -4,7 +4,7 @@ // This file is open source and available under the MIT license. See the LICENSE file for more info. // -@testable import SwiftInterfaceAnalyzerModule +@testable import PADSwiftInterfaceDiff import XCTest struct MockSwiftInterfaceParser: SwiftInterfaceParsing { diff --git a/Tests/UnitTests/XcodeToolsTests.swift b/Tests/UnitTests/XcodeToolsTests.swift index e3994f0..6eb7125 100644 --- a/Tests/UnitTests/XcodeToolsTests.swift +++ b/Tests/UnitTests/XcodeToolsTests.swift @@ -4,7 +4,7 @@ // This file is open source and available under the MIT license. See the LICENSE file for more info. // -@testable import ProjectBuilderModule +@testable import PADProjectBuilder import XCTest class XcodeToolsTests: XCTestCase { From 62d69da24cd0e3f86778d0c572afe5278451c932 Mon Sep 17 00:00:00 2001 From: Alex Guretzki Date: Fri, 11 Oct 2024 10:31:25 +0200 Subject: [PATCH 08/12] Renaming --- Sources/ExecutableTargets/CommandLineTool/public-api-diff.swift | 2 +- Sources/PipelineModules/PADProjectBuilder/ProjectBuilder.swift | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Sources/ExecutableTargets/CommandLineTool/public-api-diff.swift b/Sources/ExecutableTargets/CommandLineTool/public-api-diff.swift index 87c2a3a..9da4d46 100644 --- a/Sources/ExecutableTargets/CommandLineTool/public-api-diff.swift +++ b/Sources/ExecutableTargets/CommandLineTool/public-api-diff.swift @@ -55,7 +55,7 @@ struct PublicApiDiff: AsyncParsableCommand { let oldVersionName = oldSource.description let newVersionName = newSource.description - let projectBuilder = ProjectBuilder( + let projectBuilder = PADProjectBuilder( projectType: projectType, swiftInterfaceType: swiftInterfaceType, logger: logger diff --git a/Sources/PipelineModules/PADProjectBuilder/ProjectBuilder.swift b/Sources/PipelineModules/PADProjectBuilder/ProjectBuilder.swift index 79e4c8f..84c2c75 100644 --- a/Sources/PipelineModules/PADProjectBuilder/ProjectBuilder.swift +++ b/Sources/PipelineModules/PADProjectBuilder/ProjectBuilder.swift @@ -12,7 +12,7 @@ import PADLogging import PADCore import PADShell -public struct ProjectBuilder { +public struct PADProjectBuilder { public struct Result { public let packageFileChanges: [Change] From 61f4b89012e6d00bb30a035af12352d458d4834d Mon Sep 17 00:00:00 2001 From: Alex Guretzki Date: Fri, 11 Oct 2024 10:50:44 +0200 Subject: [PATCH 09/12] Renaming --- .../CommandLineTool/public-api-diff.swift | 6 ++--- ...tBuilder.swift => PADProjectBuilder.swift} | 22 +++++++++++++++---- ...ProjectType.swift => PADProjectType.swift} | 2 +- .../ProjectSetup/ProjectSetupHelper.swift | 14 ++++++------ .../ProjectSetup/ProjectSetupHelping.swift | 2 +- .../ProjectSetup/ProjectSource.swift | 6 ++--- .../SwiftInterfaceProducer.swift | 4 ++-- .../SwiftInterfaceProducer/XcodeTools.swift | 2 +- .../SwiftPackageDescription.swift | 12 +++++----- .../PADSwiftInterfaceDiff.swift | 11 ++++++++++ .../SwiftInterfaceAnalyzer.swift | 10 +++------ .../SwiftInterfaceParser.swift | 4 ++-- .../SwiftInterfaceParsing.swift | 2 +- .../SharedHelperModules/PADShell/Shell.swift | 4 ++-- .../ReferencePackageTests.swift | 8 +++---- Tests/UnitTests/ProjectSourceTests.swift | 14 ++++++------ Tests/UnitTests/XcodeToolsTests.swift | 2 +- 17 files changed, 73 insertions(+), 52 deletions(-) rename Sources/PipelineModules/PADProjectBuilder/{ProjectBuilder.swift => PADProjectBuilder.swift} (86%) rename Sources/PipelineModules/PADProjectBuilder/{ProjectType.swift => PADProjectType.swift} (73%) diff --git a/Sources/ExecutableTargets/CommandLineTool/public-api-diff.swift b/Sources/ExecutableTargets/CommandLineTool/public-api-diff.swift index 9da4d46..460cffa 100644 --- a/Sources/ExecutableTargets/CommandLineTool/public-api-diff.swift +++ b/Sources/ExecutableTargets/CommandLineTool/public-api-diff.swift @@ -35,7 +35,7 @@ struct PublicApiDiff: AsyncParsableCommand { public func run() async throws { let logLevel: LogLevel = .debug - let projectType: ProjectType = { // Only needed when we have to produce the .swiftinterface files + let projectType: PADProjectType = { // Only needed when we have to produce the .swiftinterface files if let scheme { return .xcodeProject(scheme: scheme) } return .swiftPackage }() @@ -49,8 +49,8 @@ struct PublicApiDiff: AsyncParsableCommand { // MARK: - Producing .swiftinterface files - let oldSource: ProjectSource = try ProjectSource.from(old) - let newSource: ProjectSource = try ProjectSource.from(new) + let oldSource: PADProjectSource = try .from(old) + let newSource: PADProjectSource = try .from(new) let oldVersionName = oldSource.description let newVersionName = newSource.description diff --git a/Sources/PipelineModules/PADProjectBuilder/ProjectBuilder.swift b/Sources/PipelineModules/PADProjectBuilder/PADProjectBuilder.swift similarity index 86% rename from Sources/PipelineModules/PADProjectBuilder/ProjectBuilder.swift rename to Sources/PipelineModules/PADProjectBuilder/PADProjectBuilder.swift index 84c2c75..c3a6926 100644 --- a/Sources/PipelineModules/PADProjectBuilder/ProjectBuilder.swift +++ b/Sources/PipelineModules/PADProjectBuilder/PADProjectBuilder.swift @@ -20,14 +20,28 @@ public struct PADProjectBuilder { public let swiftInterfaceFiles: [SwiftInterfaceFile] } - private let projectType: ProjectType + private let projectType: PADProjectType private let swiftInterfaceType: SwiftInterfaceType private let fileHandler: any FileHandling private let shell: any ShellHandling private let logger: (any Logging)? public init( - projectType: ProjectType, + projectType: PADProjectType, + swiftInterfaceType: SwiftInterfaceType, + logger: (any Logging)? = nil + ) { + self.init( + projectType: projectType, + swiftInterfaceType: swiftInterfaceType, + fileHandler: FileManager.default, + shell: Shell(), + logger: logger + ) + } + + init( + projectType: PADProjectType, swiftInterfaceType: SwiftInterfaceType, fileHandler: any FileHandling = FileManager.default, shell: any ShellHandling = Shell(), @@ -41,8 +55,8 @@ public struct PADProjectBuilder { } public func build( - oldSource: ProjectSource, - newSource: ProjectSource + oldSource: PADProjectSource, + newSource: PADProjectSource ) async throws -> Result { let oldVersionName = oldSource.description diff --git a/Sources/PipelineModules/PADProjectBuilder/ProjectType.swift b/Sources/PipelineModules/PADProjectBuilder/PADProjectType.swift similarity index 73% rename from Sources/PipelineModules/PADProjectBuilder/ProjectType.swift rename to Sources/PipelineModules/PADProjectBuilder/PADProjectType.swift index e79dcd7..3b83826 100644 --- a/Sources/PipelineModules/PADProjectBuilder/ProjectType.swift +++ b/Sources/PipelineModules/PADProjectBuilder/PADProjectType.swift @@ -1,6 +1,6 @@ import Foundation -public enum ProjectType { +public enum PADProjectType { case swiftPackage case xcodeProject(scheme: String) } diff --git a/Sources/PipelineModules/PADProjectBuilder/ProjectSetup/ProjectSetupHelper.swift b/Sources/PipelineModules/PADProjectBuilder/ProjectSetup/ProjectSetupHelper.swift index 0e3c742..3c6dda1 100644 --- a/Sources/PipelineModules/PADProjectBuilder/ProjectSetup/ProjectSetupHelper.swift +++ b/Sources/PipelineModules/PADProjectBuilder/ProjectSetup/ProjectSetupHelper.swift @@ -28,8 +28,8 @@ struct ProjectSetupHelper: ProjectSetupHelping { } func setup( - _ projectSource: ProjectSource, - projectType: ProjectType + _ projectSource: PADProjectSource, + projectType: PADProjectType ) async throws -> URL { try await Task { let checkoutPath = workingDirectoryPath + "\(randomStringGenerator.generateRandomString())" @@ -46,7 +46,7 @@ struct ProjectSetupHelper: ProjectSetupHelping { }.value } - func filterProjectFiles(at checkoutPath: String, for projectType: ProjectType) { + func filterProjectFiles(at checkoutPath: String, for projectType: PADProjectType) { try? fileHandler.contentsOfDirectory(atPath: checkoutPath) .filter { !projectType.fileIsIncluded(filePath: $0) } .forEach { filePath in @@ -63,9 +63,9 @@ extension ProjectSetupHelper { } func setupProjects( - oldSource: ProjectSource, - newSource: ProjectSource, - projectType: ProjectType + oldSource: PADProjectSource, + newSource: PADProjectSource, + projectType: PADProjectType ) async throws -> ProjectDirectories { let projectSetupHelper = ProjectSetupHelper( workingDirectoryPath: workingDirectoryPath, @@ -80,7 +80,7 @@ extension ProjectSetupHelper { } } -private extension ProjectType { +private extension PADProjectType { var excludedFileSuffixes: [String] { switch self { diff --git a/Sources/PipelineModules/PADProjectBuilder/ProjectSetup/ProjectSetupHelping.swift b/Sources/PipelineModules/PADProjectBuilder/ProjectSetup/ProjectSetupHelping.swift index 0c0f0ce..cd34c57 100644 --- a/Sources/PipelineModules/PADProjectBuilder/ProjectSetup/ProjectSetupHelping.swift +++ b/Sources/PipelineModules/PADProjectBuilder/ProjectSetup/ProjectSetupHelping.swift @@ -2,5 +2,5 @@ import Foundation import PADCore protocol ProjectSetupHelping { - func setup(_ projectSource: ProjectSource, projectType: ProjectType) async throws -> URL + func setup(_ projectSource: PADProjectSource, projectType: PADProjectType) async throws -> URL } diff --git a/Sources/PipelineModules/PADProjectBuilder/ProjectSetup/ProjectSource.swift b/Sources/PipelineModules/PADProjectBuilder/ProjectSetup/ProjectSource.swift index 0d7c10b..7f8711d 100644 --- a/Sources/PipelineModules/PADProjectBuilder/ProjectSetup/ProjectSource.swift +++ b/Sources/PipelineModules/PADProjectBuilder/ProjectSetup/ProjectSource.swift @@ -13,12 +13,12 @@ enum ProjectSourceError: LocalizedError, Equatable { var errorDescription: String? { switch self { case let .invalidSourceValue(value): - "Invalid source parameter `\(value)`. It needs to either be a local file path or a repository in the format `[BRANCH_OR_TAG]\(ProjectSource.gitSourceSeparator)[REPOSITORY_URL]" + "Invalid source parameter `\(value)`. It needs to either be a local file path or a repository in the format `[BRANCH_OR_TAG]\(PADProjectSource.gitSourceSeparator)[REPOSITORY_URL]" } } } -public enum ProjectSource: Equatable, CustomStringConvertible { +public enum PADProjectSource: Equatable, CustomStringConvertible { /// The separator used to join branch & repository static var gitSourceSeparator: String { "~" } @@ -26,7 +26,7 @@ public enum ProjectSource: Equatable, CustomStringConvertible { case local(path: String) case remote(branch: String, repository: String) - public static func from(_ rawValue: String, fileHandler: FileHandling = FileManager.default) throws -> ProjectSource { + public static func from(_ rawValue: String, fileHandler: FileHandling = FileManager.default) throws -> Self { if fileHandler.fileExists(atPath: rawValue) { return .local(path: rawValue) } diff --git a/Sources/PipelineModules/PADProjectBuilder/SwiftInterfaceProducer/SwiftInterfaceProducer.swift b/Sources/PipelineModules/PADProjectBuilder/SwiftInterfaceProducer/SwiftInterfaceProducer.swift index 97fbbc7..e99358d 100644 --- a/Sources/PipelineModules/PADProjectBuilder/SwiftInterfaceProducer/SwiftInterfaceProducer.swift +++ b/Sources/PipelineModules/PADProjectBuilder/SwiftInterfaceProducer/SwiftInterfaceProducer.swift @@ -12,7 +12,7 @@ struct SwiftInterfaceProducer { private typealias DerivedDataPaths = (new: String, old: String) let workingDirectoryPath: String - let projectType: ProjectType + let projectType: PADProjectType let swiftInterfaceType: SwiftInterfaceType let fileHandler: any FileHandling let shell: any ShellHandling @@ -20,7 +20,7 @@ struct SwiftInterfaceProducer { init( workingDirectoryPath: String, - projectType: ProjectType, + projectType: PADProjectType, swiftInterfaceType: SwiftInterfaceType, fileHandler: any FileHandling, shell: any ShellHandling, diff --git a/Sources/PipelineModules/PADProjectBuilder/SwiftInterfaceProducer/XcodeTools.swift b/Sources/PipelineModules/PADProjectBuilder/SwiftInterfaceProducer/XcodeTools.swift index 97593b3..0f6ee8f 100644 --- a/Sources/PipelineModules/PADProjectBuilder/SwiftInterfaceProducer/XcodeTools.swift +++ b/Sources/PipelineModules/PADProjectBuilder/SwiftInterfaceProducer/XcodeTools.swift @@ -42,7 +42,7 @@ struct XcodeTools { func archive( projectDirectoryPath: String, scheme: String, - projectType: ProjectType + projectType: PADProjectType ) async throws -> String { var commandComponents = [ "cd \(projectDirectoryPath);", diff --git a/Sources/PipelineModules/PADProjectBuilder/SwiftPackageFileHelper/SwiftPackageDescription.swift b/Sources/PipelineModules/PADProjectBuilder/SwiftPackageFileHelper/SwiftPackageDescription.swift index ac49f60..ba110ba 100644 --- a/Sources/PipelineModules/PADProjectBuilder/SwiftPackageFileHelper/SwiftPackageDescription.swift +++ b/Sources/PipelineModules/PADProjectBuilder/SwiftPackageFileHelper/SwiftPackageDescription.swift @@ -11,13 +11,13 @@ import Foundation struct SwiftPackageDescription: Codable, Equatable { - public let name: String - public let platforms: [Platform] - public let defaultLocalization: String? + let name: String + let platforms: [Platform] + let defaultLocalization: String? - public let targets: [Target] - public let products: [Product] - public let dependencies: [Dependency] + let targets: [Target] + let products: [Product] + let dependencies: [Dependency] public let toolsVersion: String diff --git a/Sources/PipelineModules/PADSwiftInterfaceDiff/PADSwiftInterfaceDiff.swift b/Sources/PipelineModules/PADSwiftInterfaceDiff/PADSwiftInterfaceDiff.swift index 73fa42b..dea13d3 100644 --- a/Sources/PipelineModules/PADSwiftInterfaceDiff/PADSwiftInterfaceDiff.swift +++ b/Sources/PipelineModules/PADSwiftInterfaceDiff/PADSwiftInterfaceDiff.swift @@ -13,6 +13,17 @@ public struct PADSwiftInterfaceDiff { let logger: (any Logging)? public init( + logger: (any Logging)? = nil + ) { + self.init( + fileHandler: FileManager.default, + swiftInterfaceParser: SwiftInterfaceParser(), + swiftInterfaceAnalyzer: SwiftInterfaceAnalyzer(), + logger: logger + ) + } + + init( fileHandler: FileHandling = FileManager.default, swiftInterfaceParser: any SwiftInterfaceParsing = SwiftInterfaceParser(), swiftInterfaceAnalyzer: any SwiftInterfaceAnalyzing = SwiftInterfaceAnalyzer(), diff --git a/Sources/PipelineModules/PADSwiftInterfaceDiff/SwiftInterfaceAnalyzer/SwiftInterfaceAnalyzer.swift b/Sources/PipelineModules/PADSwiftInterfaceDiff/SwiftInterfaceAnalyzer/SwiftInterfaceAnalyzer.swift index d261cf5..4a6a67f 100644 --- a/Sources/PipelineModules/PADSwiftInterfaceDiff/SwiftInterfaceAnalyzer/SwiftInterfaceAnalyzer.swift +++ b/Sources/PipelineModules/PADSwiftInterfaceDiff/SwiftInterfaceAnalyzer/SwiftInterfaceAnalyzer.swift @@ -7,19 +7,15 @@ import Foundation import PADCore -public struct SwiftInterfaceAnalyzer: SwiftInterfaceAnalyzing { +struct SwiftInterfaceAnalyzer: SwiftInterfaceAnalyzing { let changeConsolidator: SwiftInterfaceChangeConsolidating - public init() { - self.init(changeConsolidator: SwiftInterfaceChangeConsolidator()) - } - - init(changeConsolidator: SwiftInterfaceChangeConsolidating) { + init(changeConsolidator: SwiftInterfaceChangeConsolidating = SwiftInterfaceChangeConsolidator()) { self.changeConsolidator = changeConsolidator } - public func analyze( + func analyze( old: some SwiftInterfaceElement, new: some SwiftInterfaceElement ) -> [Change] { diff --git a/Sources/PipelineModules/PADSwiftInterfaceDiff/SwiftInterfaceParser/SwiftInterfaceParser.swift b/Sources/PipelineModules/PADSwiftInterfaceDiff/SwiftInterfaceParser/SwiftInterfaceParser.swift index 88bf37d..3020a69 100644 --- a/Sources/PipelineModules/PADSwiftInterfaceDiff/SwiftInterfaceParser/SwiftInterfaceParser.swift +++ b/Sources/PipelineModules/PADSwiftInterfaceDiff/SwiftInterfaceParser/SwiftInterfaceParser.swift @@ -6,7 +6,7 @@ import SwiftParser Documentation about DeclSyntax: - https://swiftpackageindex.com/swiftlang/swift-syntax/600.0.1/documentation/swiftsyntax/declsyntax */ -public class SwiftInterfaceParser: SyntaxVisitor, SwiftInterfaceParsing { +class SwiftInterfaceParser: SyntaxVisitor, SwiftInterfaceParsing { // TODO: Handle (Nice to have) // - DeinitializerDeclSyntax @@ -17,7 +17,7 @@ public class SwiftInterfaceParser: SyntaxVisitor, SwiftInterfaceParsing { private var scope: Scope = .root(elements: []) - public func parse(source: String, moduleName: String) -> any SwiftInterfaceElement { + func parse(source: String, moduleName: String) -> any SwiftInterfaceElement { let visitor = Self() visitor.walk(Parser.parse(source: source)) return Root( diff --git a/Sources/PipelineModules/PADSwiftInterfaceDiff/SwiftInterfaceParser/SwiftInterfaceParsing.swift b/Sources/PipelineModules/PADSwiftInterfaceDiff/SwiftInterfaceParser/SwiftInterfaceParsing.swift index 0788442..02489ea 100644 --- a/Sources/PipelineModules/PADSwiftInterfaceDiff/SwiftInterfaceParser/SwiftInterfaceParsing.swift +++ b/Sources/PipelineModules/PADSwiftInterfaceDiff/SwiftInterfaceParser/SwiftInterfaceParsing.swift @@ -1,5 +1,5 @@ import Foundation -public protocol SwiftInterfaceParsing { +protocol SwiftInterfaceParsing { func parse(source: String, moduleName: String) -> any SwiftInterfaceElement } diff --git a/Sources/SharedHelperModules/PADShell/Shell.swift b/Sources/SharedHelperModules/PADShell/Shell.swift index 2aa3674..14723e6 100644 --- a/Sources/SharedHelperModules/PADShell/Shell.swift +++ b/Sources/SharedHelperModules/PADShell/Shell.swift @@ -6,13 +6,13 @@ import Foundation -public protocol ShellHandling { +package protocol ShellHandling { @discardableResult func execute(_ command: String) -> String } -public struct Shell: ShellHandling { +package struct Shell: ShellHandling { public init() {} diff --git a/Tests/IntegrationTests/ReferencePackageTests.swift b/Tests/IntegrationTests/ReferencePackageTests.swift index b7cd997..8fe3d08 100644 --- a/Tests/IntegrationTests/ReferencePackageTests.swift +++ b/Tests/IntegrationTests/ReferencePackageTests.swift @@ -51,8 +51,8 @@ class ReferencePackageTests: XCTestCase { let markdownOutput = MarkdownOutputGenerator().generate( from: pipelineOutput, allTargets: ["ReferencePackage"], - oldVersionName: ProjectSource.local(path: "old_public").description, - newVersionName: ProjectSource.local(path: "new_public").description, + oldVersionName: "old_public", + newVersionName: "new_public", warnings: [] ) @@ -77,8 +77,8 @@ class ReferencePackageTests: XCTestCase { let markdownOutput = MarkdownOutputGenerator().generate( from: pipelineOutput, allTargets: ["ReferencePackage"], - oldVersionName: ProjectSource.local(path: "old_private").description, - newVersionName: ProjectSource.local(path: "new_private").description, + oldVersionName: "old_private", + newVersionName: "new_private", warnings: [] ) diff --git a/Tests/UnitTests/ProjectSourceTests.swift b/Tests/UnitTests/ProjectSourceTests.swift index da4557c..f258c95 100644 --- a/Tests/UnitTests/ProjectSourceTests.swift +++ b/Tests/UnitTests/ProjectSourceTests.swift @@ -13,7 +13,7 @@ class ProjectSourceTests: XCTestCase { func test_remote_validSource() throws { let repositoryUrl = "https://github.com/Adyen/adyen-ios.git" - let separator = ProjectSource.gitSourceSeparator + let separator = PADProjectSource.gitSourceSeparator let branch = "develop" let rawProjectSourceValue = "\(branch)\(separator)\(repositoryUrl)" @@ -22,7 +22,7 @@ class ProjectSourceTests: XCTestCase { return false }) - let projectSource = try ProjectSource.from( + let projectSource = try PADProjectSource.from( "\(branch)\(separator)\(repositoryUrl)", fileHandler: mockFileHandler ) @@ -35,7 +35,7 @@ class ProjectSourceTests: XCTestCase { func test_remote_invalidRepoUrl() throws { let repositoryUrl = "" - let separator = ProjectSource.gitSourceSeparator + let separator = PADProjectSource.gitSourceSeparator let branch = "develop" let rawProjectSourceValue = "\(branch)\(separator)\(repositoryUrl)" @@ -45,7 +45,7 @@ class ProjectSourceTests: XCTestCase { }) do { - let source = try ProjectSource.from( + let source = try PADProjectSource.from( rawProjectSourceValue, fileHandler: mockFileHandler ) @@ -72,7 +72,7 @@ class ProjectSourceTests: XCTestCase { }) do { - let source = try ProjectSource.from( + let source = try PADProjectSource.from( rawProjectSourceValue, fileHandler: mockFileHandler ) @@ -96,7 +96,7 @@ class ProjectSourceTests: XCTestCase { return true }) - let projectSource = try ProjectSource.from( + let projectSource = try PADProjectSource.from( repositoryDirectoryPath, fileHandler: mockFileHandler ) @@ -114,7 +114,7 @@ class ProjectSourceTests: XCTestCase { return false }) - let projectSource = try? ProjectSource.from( + let projectSource = try? PADProjectSource.from( repositoryDirectoryPath, fileHandler: mockFileHandler ) diff --git a/Tests/UnitTests/XcodeToolsTests.swift b/Tests/UnitTests/XcodeToolsTests.swift index 6eb7125..6ef6d26 100644 --- a/Tests/UnitTests/XcodeToolsTests.swift +++ b/Tests/UnitTests/XcodeToolsTests.swift @@ -39,7 +39,7 @@ private extension XcodeToolsTests { func testArchiving( projectDirectoryPath: String, scheme: String, - projectType: ProjectType + projectType: PADProjectType ) async throws { let archiveResult = "ARCHIVE_RESULT" From 843972e429520ecaea70e39d7c34da06a169ffd6 Mon Sep 17 00:00:00 2001 From: Alex Guretzki Date: Fri, 11 Oct 2024 11:50:10 +0200 Subject: [PATCH 10/12] More renaming --- Package.swift | 21 +++---- README.md | 2 +- .../CommandLineTool/public-api-diff.swift | 20 +++--- .../MarkdownOutputGenerator.swift | 18 +++--- .../PADOutputGenerator/OutputGenerating.swift | 4 +- .../PADProjectBuilder/PADProjectBuilder.swift | 30 ++++----- .../PADProjectBuilder/ProjectSetup/Git.swift | 13 ++-- .../ProjectSetup/ProjectSetupHelper.swift | 13 ++-- .../ProjectSetup/ProjectSource.swift | 8 ++- .../ProjectSetup/RandomStringGenerating.swift | 8 +-- .../SwiftInterfaceFileLocator.swift | 10 +-- .../SwiftInterfaceProducer.swift | 16 ++--- .../SwiftInterfaceType.swift | 2 +- .../SwiftInterfaceProducer/XcodeTools.swift | 8 +-- .../SwiftPackageFileAnalyzer.swift | 36 +++++------ .../SwiftPackageFileAnalyzing.swift | 4 +- .../SwiftPackageDescription.swift | 62 +++++++++---------- .../SwiftPackageFileHelper.swift | 8 +-- .../PADSwiftInterfaceDiff.swift | 12 ++-- .../SwiftInterfaceAnalyzer.swift | 2 +- .../SwiftInterfaceAnalyzing.swift | 4 +- .../SwiftInterfaceChangeConsolidator.swift | 10 +-- .../SwiftInterfaceElement.swift | 10 +-- .../SwiftInterfaceParser.swift | 14 ++--- .../FileHandling+Convenience.swift | 4 +- .../FileHandling.swift | 2 +- .../FileManager+FileHandling.swift | 0 .../PADCore/{Change.swift => PADChange.swift} | 6 +- ...File.swift => PADSwiftInterfaceFile.swift} | 2 +- ...ileLogger.swift => PADLogFileLogger.swift} | 13 +++- ...elLogger.swift => PADLogLevelLogger.swift} | 12 ++-- .../{Logging.swift => PADLogging.swift} | 2 +- ...ggingGroup.swift => PADLoggingGroup.swift} | 6 +- ...stemLogger.swift => PADSystemLogger.swift} | 4 +- .../{PADShell => ShellModule}/Shell.swift | 4 +- .../ReferencePackageTests.swift | 8 +-- Tests/UnitTests/FileHandlingTests.swift | 2 +- Tests/UnitTests/LoggerTests.swift | 2 +- Tests/UnitTests/OutputGeneratorTests.swift | 6 +- Tests/UnitTests/PipelineTests.swift | 6 +- .../SwiftPackageFileAnalyzerTests.swift | 6 +- .../UnitTests/Utilities/MockFileHandler.swift | 2 +- Tests/UnitTests/Utilities/MockLogger.swift | 2 +- .../MockOutputGenerator.swift | 6 +- Tests/UnitTests/Utilities/MockShell.swift | 2 +- .../MockSwiftInterfaceAnalyzer.swift | 4 +- 46 files changed, 220 insertions(+), 216 deletions(-) rename Sources/SharedHelperModules/{PADFileHandling => FileHandlingModule}/FileHandling+Convenience.swift (96%) rename Sources/SharedHelperModules/{PADFileHandling => FileHandlingModule}/FileHandling.swift (93%) rename Sources/SharedHelperModules/{PADFileHandling => FileHandlingModule}/FileManager+FileHandling.swift (100%) rename Sources/SharedHelperModules/PADCore/{Change.swift => PADChange.swift} (93%) rename Sources/SharedHelperModules/PADCore/{SwiftInterfaceFile.swift => PADSwiftInterfaceFile.swift} (88%) rename Sources/SharedHelperModules/PADLogging/{LogFileLogger.swift => PADLogFileLogger.swift} (70%) rename Sources/SharedHelperModules/PADLogging/{LogLevelLogger.swift => PADLogLevelLogger.swift} (80%) rename Sources/SharedHelperModules/PADLogging/{Logging.swift => PADLogging.swift} (82%) rename Sources/SharedHelperModules/PADLogging/{LoggingGroup.swift => PADLoggingGroup.swift} (73%) rename Sources/SharedHelperModules/PADLogging/{SystemLogger.swift => PADSystemLogger.swift} (86%) rename Sources/SharedHelperModules/{PADShell => ShellModule}/Shell.swift (90%) diff --git a/Package.swift b/Package.swift index 84ff657..916a7d5 100644 --- a/Package.swift +++ b/Package.swift @@ -41,12 +41,9 @@ let package = Package( .executableTarget( name: "public-api-diff", dependencies: [ - "PADCore", - "PADLogging", - "PADOutputGenerator", - "PADFileHandling", "PADProjectBuilder", "PADSwiftInterfaceDiff", + "PADOutputGenerator", .product(name: "ArgumentParser", package: "swift-argument-parser") ], path: "Sources/ExecutableTargets/CommandLineTool" @@ -59,16 +56,16 @@ let package = Package( path: "Sources/SharedHelperModules/PADCore" ), .target( - name: "PADFileHandling", - path: "Sources/SharedHelperModules/PADFileHandling" + name: "FileHandlingModule", + path: "Sources/SharedHelperModules/FileHandlingModule" ), .target( - name: "PADShell", - path: "Sources/SharedHelperModules/PADShell" + name: "ShellModule", + path: "Sources/SharedHelperModules/ShellModule" ), .target( name: "PADLogging", - dependencies: ["PADFileHandling"], + dependencies: ["FileHandlingModule"], path: "Sources/SharedHelperModules/PADLogging" ), @@ -78,7 +75,7 @@ let package = Package( name: "PADSwiftInterfaceDiff", dependencies: [ "PADCore", - "PADFileHandling", + "FileHandlingModule", "PADLogging", .product(name: "SwiftSyntax", package: "swift-syntax"), .product(name: "SwiftParser", package: "swift-syntax"), @@ -89,9 +86,9 @@ let package = Package( name: "PADProjectBuilder", dependencies: [ "PADCore", - "PADFileHandling", + "FileHandlingModule", "PADLogging", - "PADShell" + "ShellModule" ], path: "Sources/PipelineModules/PADProjectBuilder" ), diff --git a/README.md b/README.md index e194e6a..2da6682 100644 --- a/README.md +++ b/README.md @@ -47,7 +47,7 @@ The `ChangeConsolidator` takes 2 independent changes (`addition` & `removal`) an ### OutputGenerator -Receives a dictionary of `[{SCOPE_NAME}: [Change]]` and processes them into a human readable format. +Receives a dictionary of `[{SCOPE_NAME}: [PADChange]]` and processes them into a human readable format. # Alternatives - `xcrun swift-api-digester -dump-sdk` & `xcrun swift-api-digester -diagnose-sdk` diff --git a/Sources/ExecutableTargets/CommandLineTool/public-api-diff.swift b/Sources/ExecutableTargets/CommandLineTool/public-api-diff.swift index 460cffa..de214b6 100644 --- a/Sources/ExecutableTargets/CommandLineTool/public-api-diff.swift +++ b/Sources/ExecutableTargets/CommandLineTool/public-api-diff.swift @@ -34,18 +34,18 @@ struct PublicApiDiff: AsyncParsableCommand { public func run() async throws { - let logLevel: LogLevel = .debug + let logLevel: PADLogLevel = .debug let projectType: PADProjectType = { // Only needed when we have to produce the .swiftinterface files if let scheme { return .xcodeProject(scheme: scheme) } return .swiftPackage }() - let swiftInterfaceType: SwiftInterfaceType = .public // Only needed when we have to produce the .swiftinterface files + let swiftInterfaceType: PADSwiftInterfaceType = .public // Only needed when we have to produce the .swiftinterface files let logger = Self.logger(with: logLevel, logOutputFilePath: logOutput) do { var warnings = [String]() - var changes = [String: [Change]]() + var changes = [String: [PADChange]]() // MARK: - Producing .swiftinterface files @@ -90,7 +90,7 @@ struct PublicApiDiff: AsyncParsableCommand { // MARK: - Generate Output - let outputGenerator: any OutputGenerating = MarkdownOutputGenerator() + let outputGenerator: any PADOutputGenerating = PADMarkdownOutputGenerator() let generatedOutput = try outputGenerator.generate( from: changes, @@ -117,15 +117,15 @@ struct PublicApiDiff: AsyncParsableCommand { private extension PublicApiDiff { static func logger( - with logLevel: LogLevel, + with logLevel: PADLogLevel, logOutputFilePath: String? - ) -> any Logging { - var loggers = [any Logging]() + ) -> any PADLogging { + var loggers = [any PADLogging]() if let logOutputFilePath { - loggers += [LogFileLogger(outputFilePath: logOutputFilePath)] + loggers += [PADLogFileLogger(outputFilePath: logOutputFilePath)] } - loggers += [SystemLogger().withLogLevel(logLevel)] + loggers += [PADSystemLogger().withLogLevel(logLevel)] - return LoggingGroup(with: loggers) + return PADLoggingGroup(with: loggers) } } diff --git a/Sources/PipelineModules/PADOutputGenerator/MarkdownOutputGenerator.swift b/Sources/PipelineModules/PADOutputGenerator/MarkdownOutputGenerator.swift index 9864f26..9a89cc9 100644 --- a/Sources/PipelineModules/PADOutputGenerator/MarkdownOutputGenerator.swift +++ b/Sources/PipelineModules/PADOutputGenerator/MarkdownOutputGenerator.swift @@ -8,13 +8,13 @@ import Foundation import PADCore /// Allows generation of human readable output from the provided information -public struct MarkdownOutputGenerator: OutputGenerating { +public struct PADMarkdownOutputGenerator: PADOutputGenerating { public init() {} /// Generates human readable output from the provided information public func generate( - from changesPerTarget: [String: [Change]], + from changesPerTarget: [String: [PADChange]], allTargets: [String], oldVersionName: String, newVersionName: String, @@ -48,9 +48,9 @@ public struct MarkdownOutputGenerator: OutputGenerating { // MARK: - Privates -private extension MarkdownOutputGenerator { +private extension PADMarkdownOutputGenerator { - static func title(changesPerTarget: [String: [Change]]) -> String { + static func title(changesPerTarget: [String: [PADChange]]) -> String { if changesPerTarget.keys.isEmpty { return "# ✅ No changes detected" @@ -72,7 +72,7 @@ private extension MarkdownOutputGenerator { warnings.map { "> [!WARNING]\n> \($0)" } } - static func changeLines(changesPerModule: [String: [Change]]) -> [String] { + static func changeLines(changesPerModule: [String: [PADChange]]) -> [String] { var lines = [String]() changesPerModule.keys.sorted().forEach { targetName in @@ -82,7 +82,7 @@ private extension MarkdownOutputGenerator { lines.append("## `\(targetName)`") } - var groupedChanges = [String: [Change]]() + var groupedChanges = [String: [PADChange]]() changesForTarget.forEach { groupedChanges[$0.parentPath ?? ""] = (groupedChanges[$0.parentPath ?? ""] ?? []) + [$0] @@ -118,9 +118,9 @@ private extension MarkdownOutputGenerator { } } -private extension MarkdownOutputGenerator { +private extension PADMarkdownOutputGenerator { - static func changeSectionLines(title: String, changes: [Change]) -> [String] { + static func changeSectionLines(title: String, changes: [PADChange]) -> [String] { if changes.isEmpty { return [] } var lines = [title] @@ -145,7 +145,7 @@ private extension MarkdownOutputGenerator { return lines } - static func description(for change: Change) -> String { + static func description(for change: PADChange) -> String { switch change.changeType { case let .addition(description): return description diff --git a/Sources/PipelineModules/PADOutputGenerator/OutputGenerating.swift b/Sources/PipelineModules/PADOutputGenerator/OutputGenerating.swift index e02db86..d09d0ab 100644 --- a/Sources/PipelineModules/PADOutputGenerator/OutputGenerating.swift +++ b/Sources/PipelineModules/PADOutputGenerator/OutputGenerating.swift @@ -7,9 +7,9 @@ import Foundation import PADCore -public protocol OutputGenerating { +public protocol PADOutputGenerating { func generate( - from changesPerTarget: [String: [Change]], + from changesPerTarget: [String: [PADChange]], allTargets: [String], oldVersionName: String, newVersionName: String, diff --git a/Sources/PipelineModules/PADProjectBuilder/PADProjectBuilder.swift b/Sources/PipelineModules/PADProjectBuilder/PADProjectBuilder.swift index c3a6926..9be36e7 100644 --- a/Sources/PipelineModules/PADProjectBuilder/PADProjectBuilder.swift +++ b/Sources/PipelineModules/PADProjectBuilder/PADProjectBuilder.swift @@ -1,35 +1,29 @@ -// -// File.swift -// -// -// Created by Alexander Guretzki on 10/10/2024. -// - import Foundation -import PADFileHandling import PADLogging import PADCore -import PADShell + +import ShellModule +import FileHandlingModule public struct PADProjectBuilder { public struct Result { - public let packageFileChanges: [Change] + public let packageFileChanges: [PADChange] public let warnings: [String] - public let swiftInterfaceFiles: [SwiftInterfaceFile] + public let swiftInterfaceFiles: [PADSwiftInterfaceFile] } private let projectType: PADProjectType - private let swiftInterfaceType: SwiftInterfaceType + private let swiftInterfaceType: PADSwiftInterfaceType private let fileHandler: any FileHandling private let shell: any ShellHandling - private let logger: (any Logging)? + private let logger: (any PADLogging)? public init( projectType: PADProjectType, - swiftInterfaceType: SwiftInterfaceType, - logger: (any Logging)? = nil + swiftInterfaceType: PADSwiftInterfaceType, + logger: (any PADLogging)? = nil ) { self.init( projectType: projectType, @@ -42,10 +36,10 @@ public struct PADProjectBuilder { init( projectType: PADProjectType, - swiftInterfaceType: SwiftInterfaceType, + swiftInterfaceType: PADSwiftInterfaceType, fileHandler: any FileHandling = FileManager.default, shell: any ShellHandling = Shell(), - logger: (any Logging)? + logger: (any PADLogging)? ) { self.projectType = projectType self.swiftInterfaceType = swiftInterfaceType @@ -85,7 +79,7 @@ public struct PADProjectBuilder { // MARK: - Analyze Package.swift (optional) let warnings: [String] - let packageFileChanges: [Change] + let packageFileChanges: [PADChange] switch projectType { case .swiftPackage: diff --git a/Sources/PipelineModules/PADProjectBuilder/ProjectSetup/Git.swift b/Sources/PipelineModules/PADProjectBuilder/ProjectSetup/Git.swift index efc65b5..8a6f164 100644 --- a/Sources/PipelineModules/PADProjectBuilder/ProjectSetup/Git.swift +++ b/Sources/PipelineModules/PADProjectBuilder/ProjectSetup/Git.swift @@ -1,10 +1,11 @@ import Foundation import PADCore -import PADShell -import PADFileHandling import PADLogging +import FileHandlingModule +import ShellModule + enum GitError: LocalizedError, Equatable { case couldNotClone(branchOrTag: String, repository: String) @@ -20,12 +21,12 @@ struct Git { private let shell: ShellHandling private let fileHandler: FileHandling - private let logger: Logging? + private let logger: PADLogging? - public init( + init( shell: ShellHandling, fileHandler: FileHandling, - logger: Logging? + logger: PADLogging? ) { self.shell = shell self.fileHandler = fileHandler @@ -40,7 +41,7 @@ struct Git { /// - targetDirectoryPath: The directory to clone into /// /// - Returns: The local directory path where to find the cloned repository - public func clone(_ repository: String, at branchOrTag: String, targetDirectoryPath: String) throws { + func clone(_ repository: String, at branchOrTag: String, targetDirectoryPath: String) throws { logger?.log("🐱 Cloning \(repository) @ \(branchOrTag) into \(targetDirectoryPath)", from: String(describing: Self.self)) let command = "git clone -b \(branchOrTag) \(repository) \(targetDirectoryPath)" shell.execute(command) diff --git a/Sources/PipelineModules/PADProjectBuilder/ProjectSetup/ProjectSetupHelper.swift b/Sources/PipelineModules/PADProjectBuilder/ProjectSetup/ProjectSetupHelper.swift index 3c6dda1..245fb3e 100644 --- a/Sources/PipelineModules/PADProjectBuilder/ProjectSetup/ProjectSetupHelper.swift +++ b/Sources/PipelineModules/PADProjectBuilder/ProjectSetup/ProjectSetupHelper.swift @@ -1,24 +1,25 @@ import Foundation import PADCore -import PADShell -import PADFileHandling import PADLogging +import ShellModule +import FileHandlingModule + struct ProjectSetupHelper: ProjectSetupHelping { let workingDirectoryPath: String let shell: any ShellHandling let randomStringGenerator: any RandomStringGenerating let fileHandler: any FileHandling - let logger: (any Logging)? + let logger: (any PADLogging)? init( workingDirectoryPath: String, randomStringGenerator: any RandomStringGenerating = RandomStringGenerator(), shell: any ShellHandling = Shell(), fileHandler: any FileHandling = FileManager.default, - logger: (any Logging)? + logger: (any PADLogging)? ) { self.workingDirectoryPath = workingDirectoryPath self.randomStringGenerator = randomStringGenerator @@ -58,8 +59,8 @@ struct ProjectSetupHelper: ProjectSetupHelping { extension ProjectSetupHelper { struct ProjectDirectories { - public let old: URL - public let new: URL + let old: URL + let new: URL } func setupProjects( diff --git a/Sources/PipelineModules/PADProjectBuilder/ProjectSetup/ProjectSource.swift b/Sources/PipelineModules/PADProjectBuilder/ProjectSetup/ProjectSource.swift index 7f8711d..510f374 100644 --- a/Sources/PipelineModules/PADProjectBuilder/ProjectSetup/ProjectSource.swift +++ b/Sources/PipelineModules/PADProjectBuilder/ProjectSetup/ProjectSource.swift @@ -5,7 +5,7 @@ // import Foundation -import PADFileHandling +import FileHandlingModule enum ProjectSourceError: LocalizedError, Equatable { case invalidSourceValue(value: String) @@ -26,7 +26,11 @@ public enum PADProjectSource: Equatable, CustomStringConvertible { case local(path: String) case remote(branch: String, repository: String) - public static func from(_ rawValue: String, fileHandler: FileHandling = FileManager.default) throws -> Self { + public static func from(_ rawValue: String) throws -> Self { + try from(rawValue, fileHandler: FileManager.default) + } + + package static func from(_ rawValue: String, fileHandler: FileHandling) throws -> Self { if fileHandler.fileExists(atPath: rawValue) { return .local(path: rawValue) } diff --git a/Sources/PipelineModules/PADProjectBuilder/ProjectSetup/RandomStringGenerating.swift b/Sources/PipelineModules/PADProjectBuilder/ProjectSetup/RandomStringGenerating.swift index 2428649..81dc358 100644 --- a/Sources/PipelineModules/PADProjectBuilder/ProjectSetup/RandomStringGenerating.swift +++ b/Sources/PipelineModules/PADProjectBuilder/ProjectSetup/RandomStringGenerating.swift @@ -6,16 +6,16 @@ import Foundation -protocol RandomStringGenerating { +package protocol RandomStringGenerating { func generateRandomString() -> String } -struct RandomStringGenerator: RandomStringGenerating { +package struct RandomStringGenerator: RandomStringGenerating { - public init() {} + package init() {} - public func generateRandomString() -> String { + package func generateRandomString() -> String { UUID().uuidString } } diff --git a/Sources/PipelineModules/PADProjectBuilder/SwiftInterfaceProducer/SwiftInterfaceFileLocator.swift b/Sources/PipelineModules/PADProjectBuilder/SwiftInterfaceProducer/SwiftInterfaceFileLocator.swift index 1958380..21d8dbd 100644 --- a/Sources/PipelineModules/PADProjectBuilder/SwiftInterfaceProducer/SwiftInterfaceFileLocator.swift +++ b/Sources/PipelineModules/PADProjectBuilder/SwiftInterfaceProducer/SwiftInterfaceFileLocator.swift @@ -1,7 +1,7 @@ import Foundation -import PADFileHandling -import PADShell +import FileHandlingModule +import ShellModule import PADLogging /// A helper to locate `.swiftinterface` files @@ -9,12 +9,12 @@ struct SwiftInterfaceFileLocator { let fileHandler: any FileHandling let shell: any ShellHandling - let logger: (any Logging)? + let logger: (any PADLogging)? init( fileHandler: any FileHandling = FileManager.default, shell: any ShellHandling = Shell(), - logger: (any Logging)? + logger: (any PADLogging)? ) { self.fileHandler = fileHandler self.shell = shell @@ -29,7 +29,7 @@ struct SwiftInterfaceFileLocator { /// - type: The swift interface type (.public, .private) to look for /// - Returns: The file url to the found `.swiftinterface` /// - Throws: An error if no `.swiftinterface` file can be found for the given scheme + derived data path - func locate(for scheme: String, derivedDataPath: String, type: SwiftInterfaceType) throws -> URL { + func locate(for scheme: String, derivedDataPath: String, type: PADSwiftInterfaceType) throws -> URL { let schemeSwiftModuleName = "\(scheme).swiftmodule" let swiftModulePathsForScheme = shell.execute("cd '\(derivedDataPath)'; find . -type d -name '\(schemeSwiftModuleName)'") diff --git a/Sources/PipelineModules/PADProjectBuilder/SwiftInterfaceProducer/SwiftInterfaceProducer.swift b/Sources/PipelineModules/PADProjectBuilder/SwiftInterfaceProducer/SwiftInterfaceProducer.swift index e99358d..e912063 100644 --- a/Sources/PipelineModules/PADProjectBuilder/SwiftInterfaceProducer/SwiftInterfaceProducer.swift +++ b/Sources/PipelineModules/PADProjectBuilder/SwiftInterfaceProducer/SwiftInterfaceProducer.swift @@ -1,7 +1,7 @@ import Foundation -import PADFileHandling -import PADShell +import FileHandlingModule +import ShellModule import PADLogging import PADCore @@ -13,18 +13,18 @@ struct SwiftInterfaceProducer { let workingDirectoryPath: String let projectType: PADProjectType - let swiftInterfaceType: SwiftInterfaceType + let swiftInterfaceType: PADSwiftInterfaceType let fileHandler: any FileHandling let shell: any ShellHandling - let logger: (any Logging)? + let logger: (any PADLogging)? init( workingDirectoryPath: String, projectType: PADProjectType, - swiftInterfaceType: SwiftInterfaceType, + swiftInterfaceType: PADSwiftInterfaceType, fileHandler: any FileHandling, shell: any ShellHandling, - logger: (any Logging)? + logger: (any PADLogging)? ) { self.workingDirectoryPath = workingDirectoryPath self.projectType = projectType @@ -38,7 +38,7 @@ struct SwiftInterfaceProducer { func produceInterfaceFiles( oldProjectDirectory: URL, newProjectDirectory: URL - ) async throws -> [SwiftInterfaceFile] { + ) async throws -> [PADSwiftInterfaceFile] { let newProjectDirectoryPath = newProjectDirectory.path() let oldProjectDirectoryPath = oldProjectDirectory.path() @@ -151,7 +151,7 @@ extension SwiftInterfaceProducer { newDerivedDataPath: String, oldDerivedDataPath: String, schemes schemesToCompare: [String] - ) throws -> [SwiftInterfaceFile] { + ) throws -> [PADSwiftInterfaceFile] { logger?.log("🔎 Locating interface files for \(schemesToCompare.joined(separator: ", "))", from: String(describing: Self.self)) let interfaceFileLocator = SwiftInterfaceFileLocator(fileHandler: fileHandler, shell: shell, logger: logger) diff --git a/Sources/PipelineModules/PADProjectBuilder/SwiftInterfaceProducer/SwiftInterfaceType.swift b/Sources/PipelineModules/PADProjectBuilder/SwiftInterfaceProducer/SwiftInterfaceType.swift index 918cfc8..4c1fd94 100644 --- a/Sources/PipelineModules/PADProjectBuilder/SwiftInterfaceProducer/SwiftInterfaceType.swift +++ b/Sources/PipelineModules/PADProjectBuilder/SwiftInterfaceProducer/SwiftInterfaceType.swift @@ -1,7 +1,7 @@ import Foundation /// The type of the .swiftinterface to parse/generate -public enum SwiftInterfaceType { +public enum PADSwiftInterfaceType { case `private` case `public` diff --git a/Sources/PipelineModules/PADProjectBuilder/SwiftInterfaceProducer/XcodeTools.swift b/Sources/PipelineModules/PADProjectBuilder/SwiftInterfaceProducer/XcodeTools.swift index 0f6ee8f..eecdfe5 100644 --- a/Sources/PipelineModules/PADProjectBuilder/SwiftInterfaceProducer/XcodeTools.swift +++ b/Sources/PipelineModules/PADProjectBuilder/SwiftInterfaceProducer/XcodeTools.swift @@ -7,8 +7,8 @@ import Foundation import PADCore -import PADShell -import PADFileHandling +import ShellModule +import FileHandlingModule import PADLogging struct XcodeToolsError: LocalizedError, CustomDebugStringConvertible { @@ -27,12 +27,12 @@ struct XcodeTools { private let shell: ShellHandling private let fileHandler: FileHandling - private let logger: Logging? + private let logger: PADLogging? init( shell: ShellHandling = Shell(), fileHandler: FileHandling = FileManager.default, - logger: Logging? + logger: PADLogging? ) { self.shell = shell self.fileHandler = fileHandler diff --git a/Sources/PipelineModules/PADProjectBuilder/SwiftPackageFileAnalyzer/SwiftPackageFileAnalyzer.swift b/Sources/PipelineModules/PADProjectBuilder/SwiftPackageFileAnalyzer/SwiftPackageFileAnalyzer.swift index 585e127..37eeef5 100644 --- a/Sources/PipelineModules/PADProjectBuilder/SwiftPackageFileAnalyzer/SwiftPackageFileAnalyzer.swift +++ b/Sources/PipelineModules/PADProjectBuilder/SwiftPackageFileAnalyzer/SwiftPackageFileAnalyzer.swift @@ -7,15 +7,15 @@ import Foundation import PADCore -import PADFileHandling -import PADShell +import FileHandlingModule +import ShellModule import PADLogging struct SwiftPackageFileAnalyzer: SwiftPackageFileAnalyzing { private let fileHandler: any FileHandling private let shell: any ShellHandling - private let logger: (any Logging)? + private let logger: (any PADLogging)? private enum Constants { static let packageFileName = "Package.swift" @@ -27,7 +27,7 @@ struct SwiftPackageFileAnalyzer: SwiftPackageFileAnalyzing { init( fileHandler: FileHandling = FileManager.default, shell: ShellHandling = Shell(), - logger: (any Logging)? + logger: (any PADLogging)? ) { self.fileHandler = fileHandler self.logger = logger @@ -68,7 +68,7 @@ private extension SwiftPackageFileAnalyzer { guard old != new else { return .init(changes: [], warnings: []) } - var changes = [Change]() + var changes = [PADChange]() changes += try analyzeToolsVersion(old: old.toolsVersion, new: new.toolsVersion) changes += try analyzeDefaultLocalization(old: old.defaultLocalization, new: new.defaultLocalization) @@ -87,7 +87,7 @@ private extension SwiftPackageFileAnalyzer { private func analyzeDefaultLocalization( old: String?, new: String? - ) throws -> [Change] { + ) throws -> [PADChange] { guard old != new else { return [] } let keyName = "defaultLocalization" @@ -122,7 +122,7 @@ private extension SwiftPackageFileAnalyzer { private func analyzeName( old: String, new: String - ) throws -> [Change] { + ) throws -> [PADChange] { guard old != new else { return [] } let keyName = "name" @@ -141,7 +141,7 @@ private extension SwiftPackageFileAnalyzer { private func analyzePlatforms( old: [SwiftPackageDescription.Platform], new: [SwiftPackageDescription.Platform] - ) throws -> [Change] { + ) throws -> [PADChange] { guard old != new else { return [] } let oldPlatformNames = Set(old.map(\.name)) @@ -190,7 +190,7 @@ private extension SwiftPackageFileAnalyzer { private func analyzeProducts( old: [SwiftPackageDescription.Product], new: [SwiftPackageDescription.Product] - ) throws -> [Change] { + ) throws -> [PADChange] { guard old != new else { return [] } let oldProductNames = Set(old.map(\.name)).filter { $0 != "_AllTargets" } @@ -200,7 +200,7 @@ private extension SwiftPackageFileAnalyzer { let removed = oldProductNames.subtracting(newProductNames) let consistent = Set(oldProductNames).intersection(Set(newProductNames)) - var changes = [Change]() + var changes = [PADChange]() changes += added.compactMap { addition in guard let addedProduct = new.first(where: { $0.name == addition }) else { return nil } @@ -236,7 +236,7 @@ private extension SwiftPackageFileAnalyzer { private func analyzeProduct( old oldProduct: SwiftPackageDescription.Product, new newProduct: SwiftPackageDescription.Product - ) throws -> [Change] { + ) throws -> [PADChange] { guard oldProduct != newProduct else { return [] } let oldTargetNames = Set(oldProduct.targets) @@ -264,7 +264,7 @@ private extension SwiftPackageFileAnalyzer { private func analyzeTargets( old: [SwiftPackageDescription.Target], new: [SwiftPackageDescription.Target] - ) throws -> [Change] { + ) throws -> [PADChange] { guard old != new else { return [] } let oldTargetNames = Set(old.map(\.name)) @@ -274,7 +274,7 @@ private extension SwiftPackageFileAnalyzer { let removed = oldTargetNames.subtracting(newTargetNames) let consistent = Set(oldTargetNames).intersection(Set(newTargetNames)) - var changes = [Change]() + var changes = [PADChange]() changes += added.compactMap { addition in guard let addedTarget = new.first(where: { $0.name == addition }) else { return nil } @@ -310,7 +310,7 @@ private extension SwiftPackageFileAnalyzer { private func analyzeTarget( oldTarget: SwiftPackageDescription.Target, newTarget: SwiftPackageDescription.Target - ) throws -> [Change] { + ) throws -> [PADChange] { guard oldTarget != newTarget else { return [] } // MARK: Target Dependencies @@ -360,7 +360,7 @@ private extension SwiftPackageFileAnalyzer { private func analyzeDependencies( old: [SwiftPackageDescription.Dependency], new: [SwiftPackageDescription.Dependency] - ) throws -> [Change] { + ) throws -> [PADChange] { guard old != new else { return [] } let oldDependencies = Set(old.map(\.identity)) @@ -370,7 +370,7 @@ private extension SwiftPackageFileAnalyzer { let removedDependencies = oldDependencies.subtracting(newDependencies) let consistentDependencies = oldDependencies.intersection(newDependencies) - var changes = [Change]() + var changes = [PADChange]() changes += addedDependencies.compactMap { addition in guard let addedDependency = new.first(where: { $0.identity == addition }) else { return nil } @@ -406,7 +406,7 @@ private extension SwiftPackageFileAnalyzer { private func analyzeDependency( oldDependency: SwiftPackageDescription.Dependency, newDependency: SwiftPackageDescription.Dependency - ) throws -> [Change] { + ) throws -> [PADChange] { guard oldDependency != newDependency else { return [] } return [.init( @@ -424,7 +424,7 @@ private extension SwiftPackageFileAnalyzer { private func analyzeToolsVersion( old: String, new: String - ) throws -> [Change] { + ) throws -> [PADChange] { guard old != new else { return [] } return [.init( diff --git a/Sources/PipelineModules/PADProjectBuilder/SwiftPackageFileAnalyzer/SwiftPackageFileAnalyzing.swift b/Sources/PipelineModules/PADProjectBuilder/SwiftPackageFileAnalyzer/SwiftPackageFileAnalyzing.swift index d13881f..b53d120 100644 --- a/Sources/PipelineModules/PADProjectBuilder/SwiftPackageFileAnalyzer/SwiftPackageFileAnalyzing.swift +++ b/Sources/PipelineModules/PADProjectBuilder/SwiftPackageFileAnalyzer/SwiftPackageFileAnalyzing.swift @@ -2,8 +2,8 @@ import Foundation import PADCore struct SwiftPackageFileAnalyzingResult { - public let changes: [Change] - public let warnings: [String] + let changes: [PADChange] + let warnings: [String] } protocol SwiftPackageFileAnalyzing { diff --git a/Sources/PipelineModules/PADProjectBuilder/SwiftPackageFileHelper/SwiftPackageDescription.swift b/Sources/PipelineModules/PADProjectBuilder/SwiftPackageFileHelper/SwiftPackageDescription.swift index ba110ba..1700bd7 100644 --- a/Sources/PipelineModules/PADProjectBuilder/SwiftPackageFileHelper/SwiftPackageDescription.swift +++ b/Sources/PipelineModules/PADProjectBuilder/SwiftPackageFileHelper/SwiftPackageDescription.swift @@ -19,9 +19,9 @@ struct SwiftPackageDescription: Codable, Equatable { let products: [Product] let dependencies: [Dependency] - public let toolsVersion: String + let toolsVersion: String - public var warnings = [String]() + var warnings = [String]() init( defaultLocalization: String?, @@ -56,34 +56,34 @@ struct SwiftPackageDescription: Codable, Equatable { extension SwiftPackageDescription { - public struct Platform: Codable, Equatable, Hashable { + struct Platform: Codable, Equatable, Hashable { - public let name: String - public let version: String + let name: String + let version: String } } extension SwiftPackageDescription.Platform: CustomStringConvertible { - public var description: String { + var description: String { "\(name)(\(version))" } } extension SwiftPackageDescription { - public struct Product: Codable, Equatable, Hashable { + struct Product: Codable, Equatable, Hashable { // TODO: Add `rule` property - public let name: String - public let targets: [String] + let name: String + let targets: [String] } } extension SwiftPackageDescription.Product: CustomStringConvertible { - public var description: String { + var description: String { let targetsDescription = targets.map { "\"\($0)\"" }.joined(separator: ", ") return ".library(name: \"\(name)\", targets: [\(targetsDescription)])" } @@ -91,18 +91,18 @@ extension SwiftPackageDescription.Product: CustomStringConvertible { extension SwiftPackageDescription { - public struct Dependency: Codable, Equatable { + struct Dependency: Codable, Equatable { - public let identity: String - public let requirement: Requirement - public let type: String - public let url: String? + let identity: String + let requirement: Requirement + let type: String + let url: String? } } extension SwiftPackageDescription.Dependency: CustomStringConvertible { - public var description: String { + var description: String { var description = ".package(" var fields = [String]() @@ -122,17 +122,17 @@ extension SwiftPackageDescription.Dependency: CustomStringConvertible { extension SwiftPackageDescription.Dependency { - public struct Requirement: Codable, Equatable { + struct Requirement: Codable, Equatable { // TODO: Which other requirements exist? - public let exact: [String]? + let exact: [String]? } } extension SwiftPackageDescription.Dependency.Requirement: CustomStringConvertible { - public var description: String { + var description: String { if let exactVersion = exact?.first { return "exact: \"\(exactVersion)\"" } @@ -143,29 +143,29 @@ extension SwiftPackageDescription.Dependency.Requirement: CustomStringConvertibl extension SwiftPackageDescription { - public struct Target: Codable, Equatable { + struct Target: Codable, Equatable { - public enum ModuleType: String, Codable, Equatable { + enum ModuleType: String, Codable, Equatable { case swiftTarget = "SwiftTarget" case binaryTarget = "BinaryTarget" case clangTarget = "ClangTarget" } - public enum TargetType: String, Codable, Equatable { + enum TargetType: String, Codable, Equatable { case library = "library" case binary = "binary" case test = "test" } - public let name: String - public let type: TargetType - public let path: String - public let moduleType: ModuleType + let name: String + let type: TargetType + let path: String + let moduleType: ModuleType /// `.product(name: ...)` dependency - public let productDependencies: [String]? + let productDependencies: [String]? /// `.target(name: ...) dependency - public let targetDependencies: [String]? + let targetDependencies: [String]? // Ignoring following properties for now as they are not handled in the `PackageAnalyzer` // and thus would produce changes that are not visible @@ -174,7 +174,7 @@ extension SwiftPackageDescription { // let sources: [String] // let resources: [Resource]? - public init( + init( name: String, type: TargetType, path: String, @@ -203,7 +203,7 @@ extension SwiftPackageDescription { extension SwiftPackageDescription.Target.TargetType: CustomStringConvertible { - public var description: String { + var description: String { switch self { case .binary: "binaryTarget" case .library: "target" @@ -214,7 +214,7 @@ extension SwiftPackageDescription.Target.TargetType: CustomStringConvertible { extension SwiftPackageDescription.Target: CustomStringConvertible { - public var description: String { + var description: String { var description = ".\(type.description)(name: \"\(name)\"" var dependencyDescriptions = [String]() diff --git a/Sources/PipelineModules/PADProjectBuilder/SwiftPackageFileHelper/SwiftPackageFileHelper.swift b/Sources/PipelineModules/PADProjectBuilder/SwiftPackageFileHelper/SwiftPackageFileHelper.swift index 3975ba0..dc43e3c 100644 --- a/Sources/PipelineModules/PADProjectBuilder/SwiftPackageFileHelper/SwiftPackageFileHelper.swift +++ b/Sources/PipelineModules/PADProjectBuilder/SwiftPackageFileHelper/SwiftPackageFileHelper.swift @@ -5,8 +5,8 @@ // import Foundation -import PADFileHandling -import PADShell +import FileHandlingModule +import ShellModule import PADLogging enum SwiftPackageFileHelperError: LocalizedError { @@ -30,12 +30,12 @@ struct SwiftPackageFileHelper { private let fileHandler: FileHandling private let shell: any ShellHandling - private let logger: (any Logging)? + private let logger: (any PADLogging)? public init( fileHandler: FileHandling, shell: any ShellHandling, - logger: (any Logging)? + logger: (any PADLogging)? ) { self.fileHandler = fileHandler self.shell = shell diff --git a/Sources/PipelineModules/PADSwiftInterfaceDiff/PADSwiftInterfaceDiff.swift b/Sources/PipelineModules/PADSwiftInterfaceDiff/PADSwiftInterfaceDiff.swift index dea13d3..ba114db 100644 --- a/Sources/PipelineModules/PADSwiftInterfaceDiff/PADSwiftInterfaceDiff.swift +++ b/Sources/PipelineModules/PADSwiftInterfaceDiff/PADSwiftInterfaceDiff.swift @@ -1,8 +1,8 @@ import Foundation import PADCore -import PADFileHandling import PADLogging +import FileHandlingModule /// Takes a list of ``SwiftInterfaceFile`` and detects changes between the old and new version public struct PADSwiftInterfaceDiff { @@ -10,10 +10,10 @@ public struct PADSwiftInterfaceDiff { let fileHandler: any FileHandling let swiftInterfaceParser: any SwiftInterfaceParsing let swiftInterfaceAnalyzer: any SwiftInterfaceAnalyzing - let logger: (any Logging)? + let logger: (any PADLogging)? public init( - logger: (any Logging)? = nil + logger: (any PADLogging)? = nil ) { self.init( fileHandler: FileManager.default, @@ -27,7 +27,7 @@ public struct PADSwiftInterfaceDiff { fileHandler: FileHandling = FileManager.default, swiftInterfaceParser: any SwiftInterfaceParsing = SwiftInterfaceParser(), swiftInterfaceAnalyzer: any SwiftInterfaceAnalyzing = SwiftInterfaceAnalyzer(), - logger: (any Logging)? = nil + logger: (any PADLogging)? = nil ) { self.fileHandler = fileHandler self.swiftInterfaceParser = swiftInterfaceParser @@ -35,9 +35,9 @@ public struct PADSwiftInterfaceDiff { self.logger = logger } - public func run(with swiftInterfaceFiles: [SwiftInterfaceFile]) async throws -> [String: [Change]] { + public func run(with swiftInterfaceFiles: [PADSwiftInterfaceFile]) async throws -> [String: [PADChange]] { - var changes = [String: [Change]]() + var changes = [String: [PADChange]]() try swiftInterfaceFiles.forEach { file in logger?.log("🧑‍🔬 Analyzing \(file.name)", from: String(describing: Self.self)) diff --git a/Sources/PipelineModules/PADSwiftInterfaceDiff/SwiftInterfaceAnalyzer/SwiftInterfaceAnalyzer.swift b/Sources/PipelineModules/PADSwiftInterfaceDiff/SwiftInterfaceAnalyzer/SwiftInterfaceAnalyzer.swift index 4a6a67f..8eb56fc 100644 --- a/Sources/PipelineModules/PADSwiftInterfaceDiff/SwiftInterfaceAnalyzer/SwiftInterfaceAnalyzer.swift +++ b/Sources/PipelineModules/PADSwiftInterfaceDiff/SwiftInterfaceAnalyzer/SwiftInterfaceAnalyzer.swift @@ -18,7 +18,7 @@ struct SwiftInterfaceAnalyzer: SwiftInterfaceAnalyzing { func analyze( old: some SwiftInterfaceElement, new: some SwiftInterfaceElement - ) -> [Change] { + ) -> [PADChange] { // Very naive diff from both sides // There is room for improvement here but it's "performant enough" for now diff --git a/Sources/PipelineModules/PADSwiftInterfaceDiff/SwiftInterfaceAnalyzer/SwiftInterfaceAnalyzing.swift b/Sources/PipelineModules/PADSwiftInterfaceDiff/SwiftInterfaceAnalyzer/SwiftInterfaceAnalyzing.swift index 0898c14..b5e1905 100644 --- a/Sources/PipelineModules/PADSwiftInterfaceDiff/SwiftInterfaceAnalyzer/SwiftInterfaceAnalyzing.swift +++ b/Sources/PipelineModules/PADSwiftInterfaceDiff/SwiftInterfaceAnalyzer/SwiftInterfaceAnalyzing.swift @@ -1,6 +1,6 @@ import Foundation import PADCore -public protocol SwiftInterfaceAnalyzing { - func analyze(old: some SwiftInterfaceElement, new: some SwiftInterfaceElement) throws -> [Change] +protocol SwiftInterfaceAnalyzing { + func analyze(old: some SwiftInterfaceElement, new: some SwiftInterfaceElement) throws -> [PADChange] } diff --git a/Sources/PipelineModules/PADSwiftInterfaceDiff/SwiftInterfaceAnalyzer/SwiftInterfaceChangeConsolidator.swift b/Sources/PipelineModules/PADSwiftInterfaceDiff/SwiftInterfaceAnalyzer/SwiftInterfaceChangeConsolidator.swift index 44d89f6..784a058 100644 --- a/Sources/PipelineModules/PADSwiftInterfaceDiff/SwiftInterfaceAnalyzer/SwiftInterfaceChangeConsolidator.swift +++ b/Sources/PipelineModules/PADSwiftInterfaceDiff/SwiftInterfaceAnalyzer/SwiftInterfaceChangeConsolidator.swift @@ -14,7 +14,7 @@ protocol SwiftInterfaceChangeConsolidating { /// /// - Parameters: /// - changes: The independent changes (`addition`/`removal`) to try to match - func consolidate(_ changes: [IndependentSwiftInterfaceChange]) -> [Change] + func consolidate(_ changes: [IndependentSwiftInterfaceChange]) -> [PADChange] } struct SwiftInterfaceChangeConsolidator: SwiftInterfaceChangeConsolidating { @@ -32,10 +32,10 @@ struct SwiftInterfaceChangeConsolidator: SwiftInterfaceChangeConsolidating { /// e.g. a second `addition` `init(unrelated: String)` might be matched as a change of `init(foo: Int, bar: Int)` /// as they share the same comparison features but might not be an actual change but a genuine addition. /// This is acceptable for now but might be improved in the future (e.g. calculating a matching-percentage) - func consolidate(_ changes: [IndependentSwiftInterfaceChange]) -> [Change] { + func consolidate(_ changes: [IndependentSwiftInterfaceChange]) -> [PADChange] { var independentChanges = changes - var consolidatedChanges = [Change]() + var consolidatedChanges = [PADChange]() while !independentChanges.isEmpty { let change = independentChanges.removeFirst() @@ -83,8 +83,8 @@ struct SwiftInterfaceChangeConsolidator: SwiftInterfaceChangeConsolidating { extension IndependentSwiftInterfaceChange { - var toConsolidatedChange: Change { - let changeType: Change.ChangeType = { + var toConsolidatedChange: PADChange { + let changeType: PADChange.ChangeType = { switch self.changeType { case let .addition(description): .addition(description: description) diff --git a/Sources/PipelineModules/PADSwiftInterfaceDiff/SwiftInterfaceElement.swift b/Sources/PipelineModules/PADSwiftInterfaceDiff/SwiftInterfaceElement.swift index 2d89b5e..73fb803 100644 --- a/Sources/PipelineModules/PADSwiftInterfaceDiff/SwiftInterfaceElement.swift +++ b/Sources/PipelineModules/PADSwiftInterfaceDiff/SwiftInterfaceElement.swift @@ -1,6 +1,6 @@ import Foundation -public protocol SwiftInterfaceExtendableElement: SwiftInterfaceElement { +protocol SwiftInterfaceExtendableElement: SwiftInterfaceElement { /// Name of the type /// @@ -13,7 +13,7 @@ public protocol SwiftInterfaceExtendableElement: SwiftInterfaceElement { var children: [any SwiftInterfaceElement] { get set } } -public protocol SwiftInterfaceElement: CustomStringConvertible, AnyObject { +protocol SwiftInterfaceElement: CustomStringConvertible, AnyObject { /// The name of the element used to construct the parent path for its children var pathComponentName: String { get } @@ -42,7 +42,7 @@ public protocol SwiftInterfaceElement: CustomStringConvertible, AnyObject { func differences(to otherElement: T) -> [String] } -public extension SwiftInterfaceElement { +extension SwiftInterfaceElement { func setupParentRelationships(parent: (any SwiftInterfaceElement)? = nil) { self.parent = parent @@ -94,7 +94,7 @@ public extension SwiftInterfaceElement { } } -public extension SwiftInterfaceElement { +extension SwiftInterfaceElement { /// Checks whether or not 2 elements can be compared based on their `printedName`, `type` and `parentPath` /// /// If the `printedName`, `type` + `parentPath` is the same we can assume that it's the same element but altered @@ -109,7 +109,7 @@ public extension SwiftInterfaceElement { } } -public extension SwiftInterfaceElement { +extension SwiftInterfaceElement { /// Produces the complete recursive description of the element func recursiveDescription(indentation: Int = 0) -> String { diff --git a/Sources/PipelineModules/PADSwiftInterfaceDiff/SwiftInterfaceParser/SwiftInterfaceParser.swift b/Sources/PipelineModules/PADSwiftInterfaceDiff/SwiftInterfaceParser/SwiftInterfaceParser.swift index 3020a69..21b9dd5 100644 --- a/Sources/PipelineModules/PADSwiftInterfaceDiff/SwiftInterfaceParser/SwiftInterfaceParser.swift +++ b/Sources/PipelineModules/PADSwiftInterfaceDiff/SwiftInterfaceParser/SwiftInterfaceParser.swift @@ -2,10 +2,10 @@ import Foundation import SwiftSyntax import SwiftParser -/** - Documentation about DeclSyntax: - - https://swiftpackageindex.com/swiftlang/swift-syntax/600.0.1/documentation/swiftsyntax/declsyntax - */ +/// Parses the source content of a swift file into intermediate objects for further processing +/// +/// See: +/// - [DeclSyntax](https://swiftpackageindex.com/swiftlang/swift-syntax/documentation/swiftsyntax/declsyntax) class SwiftInterfaceParser: SyntaxVisitor, SwiftInterfaceParsing { // TODO: Handle (Nice to have) @@ -27,12 +27,12 @@ class SwiftInterfaceParser: SyntaxVisitor, SwiftInterfaceParsing { } /// Designated initializer - required public init() { + required init() { super.init(viewMode: .sourceAccurate) } /// Starts a new scope which can contain zero or more nested symbols - public func startScope() -> SyntaxVisitorContinueKind { + func startScope() -> SyntaxVisitorContinueKind { scope.start() return .visitChildren } @@ -41,7 +41,7 @@ class SwiftInterfaceParser: SyntaxVisitor, SwiftInterfaceParsing { /// - Parameter makeSymbolWithChildrenInScope: Closure that return a new ``Symbol`` /// /// Call in `visitPost(_ node:)` methods - public func endScopeAndAddSymbol(makeElementsWithChildrenInScope: (_ children: [any SwiftInterfaceElement]) -> [any SwiftInterfaceElement]) { + func endScopeAndAddSymbol(makeElementsWithChildrenInScope: (_ children: [any SwiftInterfaceElement]) -> [any SwiftInterfaceElement]) { scope.end(makeElementsWithChildrenInScope: makeElementsWithChildrenInScope) } diff --git a/Sources/SharedHelperModules/PADFileHandling/FileHandling+Convenience.swift b/Sources/SharedHelperModules/FileHandlingModule/FileHandling+Convenience.swift similarity index 96% rename from Sources/SharedHelperModules/PADFileHandling/FileHandling+Convenience.swift rename to Sources/SharedHelperModules/FileHandlingModule/FileHandling+Convenience.swift index a9141a4..634e0d3 100644 --- a/Sources/SharedHelperModules/PADFileHandling/FileHandling+Convenience.swift +++ b/Sources/SharedHelperModules/FileHandlingModule/FileHandling+Convenience.swift @@ -6,7 +6,7 @@ import Foundation -public enum FileHandlerError: LocalizedError, Equatable { +package enum FileHandlerError: LocalizedError, Equatable { /// Could not encode the output string into data case couldNotEncodeOutput /// Could not persist output at the specified `outputFilePath` @@ -32,7 +32,7 @@ public enum FileHandlerError: LocalizedError, Equatable { // MARK: - Convenience -public extension FileHandling { +package extension FileHandling { /// Creates a directory at the specified path and deletes any old directory if existing /// diff --git a/Sources/SharedHelperModules/PADFileHandling/FileHandling.swift b/Sources/SharedHelperModules/FileHandlingModule/FileHandling.swift similarity index 93% rename from Sources/SharedHelperModules/PADFileHandling/FileHandling.swift rename to Sources/SharedHelperModules/FileHandlingModule/FileHandling.swift index 23c3de7..87d6e6b 100644 --- a/Sources/SharedHelperModules/PADFileHandling/FileHandling.swift +++ b/Sources/SharedHelperModules/FileHandlingModule/FileHandling.swift @@ -1,6 +1,6 @@ import Foundation -public protocol FileHandling { +package protocol FileHandling { var currentDirectoryPath: String { get } diff --git a/Sources/SharedHelperModules/PADFileHandling/FileManager+FileHandling.swift b/Sources/SharedHelperModules/FileHandlingModule/FileManager+FileHandling.swift similarity index 100% rename from Sources/SharedHelperModules/PADFileHandling/FileManager+FileHandling.swift rename to Sources/SharedHelperModules/FileHandlingModule/FileManager+FileHandling.swift diff --git a/Sources/SharedHelperModules/PADCore/Change.swift b/Sources/SharedHelperModules/PADCore/PADChange.swift similarity index 93% rename from Sources/SharedHelperModules/PADCore/Change.swift rename to Sources/SharedHelperModules/PADCore/PADChange.swift index bf09763..afb5111 100644 --- a/Sources/SharedHelperModules/PADCore/Change.swift +++ b/Sources/SharedHelperModules/PADCore/PADChange.swift @@ -7,7 +7,7 @@ import Foundation /// A change indicating an `addition`, `removal` or genuine `change` of an element -public struct Change: Equatable { +public struct PADChange: Equatable { public enum ChangeType: Equatable { case addition(description: String) case removal(description: String) @@ -30,7 +30,7 @@ public struct Change: Equatable { } } -extension Change.ChangeType { +extension PADChange.ChangeType { public var isAddition: Bool { switch self { @@ -66,7 +66,7 @@ extension Change.ChangeType { } } -public extension [String: [Change]] { +public extension [String: [PADChange]] { var totalChangeCount: Int { var totalChangeCount = 0 diff --git a/Sources/SharedHelperModules/PADCore/SwiftInterfaceFile.swift b/Sources/SharedHelperModules/PADCore/PADSwiftInterfaceFile.swift similarity index 88% rename from Sources/SharedHelperModules/PADCore/SwiftInterfaceFile.swift rename to Sources/SharedHelperModules/PADCore/PADSwiftInterfaceFile.swift index 8d88ee0..b8e635c 100644 --- a/Sources/SharedHelperModules/PADCore/SwiftInterfaceFile.swift +++ b/Sources/SharedHelperModules/PADCore/PADSwiftInterfaceFile.swift @@ -1,6 +1,6 @@ import Foundation -public struct SwiftInterfaceFile { +public struct PADSwiftInterfaceFile { public let name: String public let oldFilePath: String public let newFilePath: String diff --git a/Sources/SharedHelperModules/PADLogging/LogFileLogger.swift b/Sources/SharedHelperModules/PADLogging/PADLogFileLogger.swift similarity index 70% rename from Sources/SharedHelperModules/PADLogging/LogFileLogger.swift rename to Sources/SharedHelperModules/PADLogging/PADLogFileLogger.swift index 4f8fc07..ef3c7b0 100644 --- a/Sources/SharedHelperModules/PADLogging/LogFileLogger.swift +++ b/Sources/SharedHelperModules/PADLogging/PADLogFileLogger.swift @@ -1,7 +1,7 @@ import Foundation -import PADFileHandling +import FileHandlingModule -public class LogFileLogger: Logging { +public class PADLogFileLogger: PADLogging { private let fileHandler: any FileHandling private let outputFilePath: String @@ -13,7 +13,14 @@ public class LogFileLogger: Logging { } } - public init(fileHandler: any FileHandling = FileManager.default, outputFilePath: String) { + public convenience init(outputFilePath: String) { + self.init(fileHandler: FileManager.default, outputFilePath: outputFilePath) + } + + init( + fileHandler: any FileHandling, + outputFilePath: String + ) { self.fileHandler = fileHandler self.outputFilePath = outputFilePath } diff --git a/Sources/SharedHelperModules/PADLogging/LogLevelLogger.swift b/Sources/SharedHelperModules/PADLogging/PADLogLevelLogger.swift similarity index 80% rename from Sources/SharedHelperModules/PADLogging/LogLevelLogger.swift rename to Sources/SharedHelperModules/PADLogging/PADLogLevelLogger.swift index f7d7b21..1472aab 100644 --- a/Sources/SharedHelperModules/PADLogging/LogLevelLogger.swift +++ b/Sources/SharedHelperModules/PADLogging/PADLogLevelLogger.swift @@ -1,7 +1,7 @@ import Foundation import OSLog -public enum LogLevel { +public enum PADLogLevel { /// No logs case quiet /// All logs except `debug` @@ -35,12 +35,12 @@ public enum LogLevel { // MARK: - LogLevelLogger /// Logger that respects a ``LogLevel`` -public struct LogLevelLogger: Logging { +public struct PADLogLevelLogger: PADLogging { - private let logLevel: LogLevel + private let logLevel: PADLogLevel internal let wrappedLogger: LoggerType - init(with logger: LoggerType, logLevel: LogLevel) { + init(with logger: LoggerType, logLevel: PADLogLevel) { self.wrappedLogger = logger self.logLevel = logLevel } @@ -58,8 +58,8 @@ public struct LogLevelLogger: Logging { // MARK: - Logging Extension -extension Logging { - public func withLogLevel(_ logLevel: LogLevel) -> LogLevelLogger { +extension PADLogging { + public func withLogLevel(_ logLevel: PADLogLevel) -> PADLogLevelLogger { .init(with: self, logLevel: logLevel) } } diff --git a/Sources/SharedHelperModules/PADLogging/Logging.swift b/Sources/SharedHelperModules/PADLogging/PADLogging.swift similarity index 82% rename from Sources/SharedHelperModules/PADLogging/Logging.swift rename to Sources/SharedHelperModules/PADLogging/PADLogging.swift index 1ea2af8..e174a00 100644 --- a/Sources/SharedHelperModules/PADLogging/Logging.swift +++ b/Sources/SharedHelperModules/PADLogging/PADLogging.swift @@ -1,6 +1,6 @@ import Foundation -public protocol Logging { +public protocol PADLogging { func log(_ message: String, from subsystem: String) func debug(_ message: String, from subsystem: String) diff --git a/Sources/SharedHelperModules/PADLogging/LoggingGroup.swift b/Sources/SharedHelperModules/PADLogging/PADLoggingGroup.swift similarity index 73% rename from Sources/SharedHelperModules/PADLogging/LoggingGroup.swift rename to Sources/SharedHelperModules/PADLogging/PADLoggingGroup.swift index 1120a7f..880bb6e 100644 --- a/Sources/SharedHelperModules/PADLogging/LoggingGroup.swift +++ b/Sources/SharedHelperModules/PADLogging/PADLoggingGroup.swift @@ -1,10 +1,10 @@ import Foundation -public struct LoggingGroup: Logging { +public struct PADLoggingGroup: PADLogging { - let logger: [any Logging] + let logger: [any PADLogging] - public init(with logger: [any Logging]) { + public init(with logger: [any PADLogging]) { self.logger = logger } diff --git a/Sources/SharedHelperModules/PADLogging/SystemLogger.swift b/Sources/SharedHelperModules/PADLogging/PADSystemLogger.swift similarity index 86% rename from Sources/SharedHelperModules/PADLogging/SystemLogger.swift rename to Sources/SharedHelperModules/PADLogging/PADSystemLogger.swift index b2fff37..2a6f7a4 100644 --- a/Sources/SharedHelperModules/PADLogging/SystemLogger.swift +++ b/Sources/SharedHelperModules/PADLogging/PADSystemLogger.swift @@ -1,7 +1,7 @@ import Foundation import OSLog -public struct SystemLogger: Logging { +public struct PADSystemLogger: PADLogging { public init() {} @@ -14,7 +14,7 @@ public struct SystemLogger: Logging { } } -private extension SystemLogger { +private extension PADSystemLogger { func logger(for subsystem: String) -> Logger { Logger( diff --git a/Sources/SharedHelperModules/PADShell/Shell.swift b/Sources/SharedHelperModules/ShellModule/Shell.swift similarity index 90% rename from Sources/SharedHelperModules/PADShell/Shell.swift rename to Sources/SharedHelperModules/ShellModule/Shell.swift index 14723e6..0217380 100644 --- a/Sources/SharedHelperModules/PADShell/Shell.swift +++ b/Sources/SharedHelperModules/ShellModule/Shell.swift @@ -14,10 +14,10 @@ package protocol ShellHandling { package struct Shell: ShellHandling { - public init() {} + package init() {} @discardableResult - public func execute(_ command: String) -> String { + package func execute(_ command: String) -> String { let task = Process() let pipe = Pipe() diff --git a/Tests/IntegrationTests/ReferencePackageTests.swift b/Tests/IntegrationTests/ReferencePackageTests.swift index 8fe3d08..e01a058 100644 --- a/Tests/IntegrationTests/ReferencePackageTests.swift +++ b/Tests/IntegrationTests/ReferencePackageTests.swift @@ -48,7 +48,7 @@ class ReferencePackageTests: XCTestCase { let expectedOutput = try expectedOutput(for: interfaceType) let pipelineOutput = try await runPipeline(for: interfaceType) - let markdownOutput = MarkdownOutputGenerator().generate( + let markdownOutput = PADMarkdownOutputGenerator().generate( from: pipelineOutput, allTargets: ["ReferencePackage"], oldVersionName: "old_public", @@ -74,7 +74,7 @@ class ReferencePackageTests: XCTestCase { let expectedOutput = try expectedOutput(for: interfaceType) let pipelineOutput = try await runPipeline(for: interfaceType) - let markdownOutput = MarkdownOutputGenerator().generate( + let markdownOutput = PADMarkdownOutputGenerator().generate( from: pipelineOutput, allTargets: ["ReferencePackage"], oldVersionName: "old_private", @@ -141,7 +141,7 @@ private extension ReferencePackageTests { return interfaceFilePath.path() } - func runPipeline(for interfaceType: InterfaceType) async throws -> [String: [Change]] { + func runPipeline(for interfaceType: InterfaceType) async throws -> [String: [PADChange]] { let referencePackagesRoot = try Self.referencePackagesPath() @@ -158,7 +158,7 @@ private extension ReferencePackageTests { ) let interfaceFiles = [ - SwiftInterfaceFile( + PADSwiftInterfaceFile( name: "ReferencePackage", oldFilePath: oldPrivateSwiftInterfaceFilePath, newFilePath: newPrivateSwiftInterfaceFilePath diff --git a/Tests/UnitTests/FileHandlingTests.swift b/Tests/UnitTests/FileHandlingTests.swift index 9199f56..8a067ca 100644 --- a/Tests/UnitTests/FileHandlingTests.swift +++ b/Tests/UnitTests/FileHandlingTests.swift @@ -4,7 +4,7 @@ // This file is open source and available under the MIT license. See the LICENSE file for more info. // -@testable import PADFileHandling +@testable import FileHandlingModule import XCTest class FileHandlingTests: XCTestCase { diff --git a/Tests/UnitTests/LoggerTests.swift b/Tests/UnitTests/LoggerTests.swift index b997ca7..e7d914e 100644 --- a/Tests/UnitTests/LoggerTests.swift +++ b/Tests/UnitTests/LoggerTests.swift @@ -68,7 +68,7 @@ class LoggerTests: XCTestCase { return true } - let logFileLogger = LogFileLogger(fileHandler: fileHandler, outputFilePath: outputFilePath) + let logFileLogger = PADLogFileLogger(fileHandler: fileHandler, outputFilePath: outputFilePath) logFileLogger.log("log", from: "test") // Small sleep because the file manager calls are done on a detached Task and we want to guarantee the order diff --git a/Tests/UnitTests/OutputGeneratorTests.swift b/Tests/UnitTests/OutputGeneratorTests.swift index 26e8bc4..66f6430 100644 --- a/Tests/UnitTests/OutputGeneratorTests.swift +++ b/Tests/UnitTests/OutputGeneratorTests.swift @@ -19,7 +19,7 @@ class OutputGeneratorTests: XCTestCase { **Analyzed targets:** Target_1 """ - let outputGenerator = MarkdownOutputGenerator() + let outputGenerator = PADMarkdownOutputGenerator() let output = outputGenerator.generate( from: [:], allTargets: ["Target_1"], @@ -47,7 +47,7 @@ class OutputGeneratorTests: XCTestCase { **Analyzed targets:** Target_1 """ - let outputGenerator = MarkdownOutputGenerator() + let outputGenerator = PADMarkdownOutputGenerator() let output = outputGenerator.generate( from: ["Target_1": [.init(changeType: .addition(description: "Some Addition"), parentPath: "")]], @@ -89,7 +89,7 @@ class OutputGeneratorTests: XCTestCase { **Analyzed targets:** Target_1, Target_2 """ - let outputGenerator = MarkdownOutputGenerator() + let outputGenerator = PADMarkdownOutputGenerator() let output = outputGenerator.generate( from: [ diff --git a/Tests/UnitTests/PipelineTests.swift b/Tests/UnitTests/PipelineTests.swift index 7b408ea..c6fcc2a 100644 --- a/Tests/UnitTests/PipelineTests.swift +++ b/Tests/UnitTests/PipelineTests.swift @@ -12,13 +12,13 @@ class PipelineTests: XCTestCase { func test_pipeline() async throws { - let swiftInterfaceFile = SwiftInterfaceFile( + let swiftInterfaceFile = PADSwiftInterfaceFile( name: "MODULE_NAME", oldFilePath: "old_file_path", newFilePath: "new_file_path" ) - let expectedChanges: [Change] = [.init(changeType: .addition(description: "addition"))] + let expectedChanges: [PADChange] = [.init(changeType: .addition(description: "addition"))] var expectedHandleLoadDataCalls = ["new_file_path", "old_file_path"] var expectedHandleParseSourceCalls: [(source: String, moduleName: String)] = [ ("content_for_new_file_path", "MODULE_NAME"), @@ -30,7 +30,7 @@ class PipelineTests: XCTestCase { var expectedHandleLogCalls: [(message: String, subsystem: String)] = [ ("🧑‍🔬 Analyzing MODULE_NAME", "PADSwiftInterfaceDiff") ] - let expectedPipelineOutput: [String: [Change]] = ["MODULE_NAME": expectedChanges] + let expectedPipelineOutput: [String: [PADChange]] = ["MODULE_NAME": expectedChanges] // Mock Setup diff --git a/Tests/UnitTests/SwiftPackageFileAnalyzerTests.swift b/Tests/UnitTests/SwiftPackageFileAnalyzerTests.swift index 64ad7aa..520b01e 100644 --- a/Tests/UnitTests/SwiftPackageFileAnalyzerTests.swift +++ b/Tests/UnitTests/SwiftPackageFileAnalyzerTests.swift @@ -42,7 +42,7 @@ class SwiftPackageFileAnalyzerTests: XCTestCase { newProjectUrl: URL(filePath: "NewPackage") ) - let expectedChanges: [Change] = [] + let expectedChanges: [PADChange] = [] XCTAssertEqual(changes.changes, expectedChanges) waitForExpectations(timeout: 1) @@ -124,7 +124,7 @@ class SwiftPackageFileAnalyzerTests: XCTestCase { newProjectUrl: URL(filePath: "NewPackage") ) - let expectedChanges: [Change] = [ + let expectedChanges: [PADChange] = [ .init( changeType: .change( oldDescription: "// swift-tools-version: 2.0", @@ -241,7 +241,7 @@ class SwiftPackageFileAnalyzerTests: XCTestCase { newProjectUrl: URL(filePath: "NewProject") ) - let expectedChanges: [Change] = [] + let expectedChanges: [PADChange] = [] XCTAssertEqual(changes.changes, expectedChanges) waitForExpectations(timeout: 1) diff --git a/Tests/UnitTests/Utilities/MockFileHandler.swift b/Tests/UnitTests/Utilities/MockFileHandler.swift index 5eaadc2..c773d79 100644 --- a/Tests/UnitTests/Utilities/MockFileHandler.swift +++ b/Tests/UnitTests/Utilities/MockFileHandler.swift @@ -4,7 +4,7 @@ // This file is open source and available under the MIT license. See the LICENSE file for more info. // -@testable import PADFileHandling +@testable import FileHandlingModule import XCTest struct MockFileHandler: FileHandling { diff --git a/Tests/UnitTests/Utilities/MockLogger.swift b/Tests/UnitTests/Utilities/MockLogger.swift index f82c362..3b41ed1 100644 --- a/Tests/UnitTests/Utilities/MockLogger.swift +++ b/Tests/UnitTests/Utilities/MockLogger.swift @@ -7,7 +7,7 @@ @testable import PADLogging import XCTest -struct MockLogger: Logging { +struct MockLogger: PADLogging { var handleLog: (String, String) -> Void = { _, _ in XCTFail("Unexpectedly called `\(#function)`") diff --git a/Tests/UnitTests/Utilities/MockPipelineModules/MockOutputGenerator.swift b/Tests/UnitTests/Utilities/MockPipelineModules/MockOutputGenerator.swift index dd9ba64..b8dd451 100644 --- a/Tests/UnitTests/Utilities/MockPipelineModules/MockOutputGenerator.swift +++ b/Tests/UnitTests/Utilities/MockPipelineModules/MockOutputGenerator.swift @@ -8,12 +8,12 @@ @testable import PADCore import XCTest -struct MockOutputGenerator: OutputGenerating { +struct MockOutputGenerator: PADOutputGenerating { - var onGenerate: ([String: [Change]], [String], String, String, [String]) throws -> String + var onGenerate: ([String: [PADChange]], [String], String, String, [String]) throws -> String func generate( - from changesPerTarget: [String: [Change]], + from changesPerTarget: [String: [PADChange]], allTargets: [String], oldVersionName: String, newVersionName: String, diff --git a/Tests/UnitTests/Utilities/MockShell.swift b/Tests/UnitTests/Utilities/MockShell.swift index 0e8753d..b2e102c 100644 --- a/Tests/UnitTests/Utilities/MockShell.swift +++ b/Tests/UnitTests/Utilities/MockShell.swift @@ -4,7 +4,7 @@ // This file is open source and available under the MIT license. See the LICENSE file for more info. // -@testable import PADShell +@testable import ShellModule import XCTest struct MockShell: ShellHandling { diff --git a/Tests/UnitTests/Utilities/MockSwiftInterfaceAnalyzer.swift b/Tests/UnitTests/Utilities/MockSwiftInterfaceAnalyzer.swift index 8b217f7..9347784 100644 --- a/Tests/UnitTests/Utilities/MockSwiftInterfaceAnalyzer.swift +++ b/Tests/UnitTests/Utilities/MockSwiftInterfaceAnalyzer.swift @@ -10,12 +10,12 @@ import XCTest struct MockSwiftInterfaceAnalyzer: SwiftInterfaceAnalyzing { - var handleAnalyze: (any SwiftInterfaceElement, any SwiftInterfaceElement) -> [Change] = { _, _ in + var handleAnalyze: (any SwiftInterfaceElement, any SwiftInterfaceElement) -> [PADChange] = { _, _ in XCTFail("Unexpectedly called `\(#function)`") return [] } - func analyze(old: some SwiftInterfaceElement, new: some SwiftInterfaceElement) throws -> [Change] { + func analyze(old: some SwiftInterfaceElement, new: some SwiftInterfaceElement) throws -> [PADChange] { handleAnalyze(old, new) } } From 25ddbf3015900995a7730018d2b755dc501483bb Mon Sep 17 00:00:00 2001 From: Alex Guretzki Date: Fri, 11 Oct 2024 11:55:22 +0200 Subject: [PATCH 11/12] Restructuring --- Package.swift | 51 ++++++++++--------- .../MarkdownOutputGenerator.swift | 0 .../PADOutputGenerator/OutputGenerating.swift | 0 .../PADProjectBuilder/PADProjectBuilder.swift | 0 .../PADProjectBuilder/PADProjectType.swift | 0 .../PADProjectBuilder/ProjectSetup/Git.swift | 0 .../ProjectSetup/ProjectSetupHelper.swift | 0 .../ProjectSetup/ProjectSetupHelping.swift | 0 .../ProjectSetup/ProjectSource.swift | 0 .../ProjectSetup/RandomStringGenerating.swift | 0 .../SwiftInterfaceFileLocator.swift | 0 .../SwiftInterfaceProducer.swift | 0 .../SwiftInterfaceProducerError.swift | 0 .../SwiftInterfaceType.swift | 0 .../SwiftInterfaceProducer/XcodeTools.swift | 0 .../SwiftPackageFileAnalyzer.swift | 0 .../SwiftPackageFileAnalyzing.swift | 0 .../SwiftPackageDescription.swift | 0 .../SwiftPackageFileHelper.swift | 0 .../PADSwiftInterfaceDiff.swift | 0 .../IndependentSwiftInterfaceChange.swift | 0 .../SwiftInterfaceAnalyzer.swift | 0 .../SwiftInterfaceAnalyzing.swift | 0 .../SwiftInterfaceChangeConsolidator.swift | 0 .../SwiftInterfaceElement+DiffHelper.swift | 0 .../SwiftInterfaceElement.swift | 0 .../DeclSyntax+Convenience.swift | 0 .../ActorDeclSyntax+SwiftInterface.swift | 0 ...ociatedTypeDeclSyntax+SwiftInterface.swift | 0 .../ClassDeclSyntac+SwiftInterface.swift | 0 .../EnumCaseDeclSyntax+SwiftInterface.swift | 0 .../EnumDeclSyntax+SwiftInterface.swift | 0 .../ExtensionDeclSyntax+SwiftInterface.swift | 0 .../FunctionDeclSyntax+SwiftInterface.swift | 0 ...InitializerDeclSyntax+SwiftInterface.swift | 0 .../ProtocolDeclSyntax+SwiftInterface.swift | 0 .../StructDeclSyntax+SwiftInterface.swift | 0 .../SubscriptDeclSyntax+SwiftInterface.swift | 0 .../TypeAliasDeclSyntax+SwiftInterface.swift | 0 .../VarDeclSyntax+SwiftInterface.swift | 0 .../SwiftInterfaceElement+Actor.swift | 0 ...SwiftInterfaceElement+AssociatedType.swift | 0 .../SwiftInterfaceElement+Class.swift | 0 .../SwiftInterfaceElement+Enum.swift | 0 .../SwiftInterfaceElement+EnumCase.swift | 0 .../SwiftInterfaceElement+Extension.swift | 0 .../SwiftInterfaceElement+Function.swift | 0 .../SwiftInterfaceElement+Initializer.swift | 0 .../SwiftInterfaceElement+Protocol.swift | 0 .../SwiftInterfaceElement+Struct.swift | 0 .../SwiftInterfaceElement+Subscript.swift | 0 .../SwiftInterfaceElement+TypeAlias.swift | 0 .../SwiftInterfaceElement+Var.swift | 0 .../SwiftInterfaceParser+Root.swift | 0 .../SwiftInterfaceParser.swift | 0 .../SwiftInterfaceParsing.swift | 0 .../FileHandling+Convenience.swift | 0 .../FileHandlingModule/FileHandling.swift | 0 .../FileManager+FileHandling.swift | 0 .../Package}/ShellModule/Shell.swift | 0 .../Public}/PADCore/PADChange.swift | 0 .../PADCore/PADSwiftInterfaceFile.swift | 0 .../Public}/PADLogging/PADLogFileLogger.swift | 0 .../PADLogging/PADLogLevelLogger.swift | 0 .../Public}/PADLogging/PADLogging.swift | 0 .../Public}/PADLogging/PADLoggingGroup.swift | 0 .../Public}/PADLogging/PADSystemLogger.swift | 0 67 files changed, 27 insertions(+), 24 deletions(-) rename Sources/{PipelineModules => PublicModules}/PADOutputGenerator/MarkdownOutputGenerator.swift (100%) rename Sources/{PipelineModules => PublicModules}/PADOutputGenerator/OutputGenerating.swift (100%) rename Sources/{PipelineModules => PublicModules}/PADProjectBuilder/PADProjectBuilder.swift (100%) rename Sources/{PipelineModules => PublicModules}/PADProjectBuilder/PADProjectType.swift (100%) rename Sources/{PipelineModules => PublicModules}/PADProjectBuilder/ProjectSetup/Git.swift (100%) rename Sources/{PipelineModules => PublicModules}/PADProjectBuilder/ProjectSetup/ProjectSetupHelper.swift (100%) rename Sources/{PipelineModules => PublicModules}/PADProjectBuilder/ProjectSetup/ProjectSetupHelping.swift (100%) rename Sources/{PipelineModules => PublicModules}/PADProjectBuilder/ProjectSetup/ProjectSource.swift (100%) rename Sources/{PipelineModules => PublicModules}/PADProjectBuilder/ProjectSetup/RandomStringGenerating.swift (100%) rename Sources/{PipelineModules => PublicModules}/PADProjectBuilder/SwiftInterfaceProducer/SwiftInterfaceFileLocator.swift (100%) rename Sources/{PipelineModules => PublicModules}/PADProjectBuilder/SwiftInterfaceProducer/SwiftInterfaceProducer.swift (100%) rename Sources/{PipelineModules => PublicModules}/PADProjectBuilder/SwiftInterfaceProducer/SwiftInterfaceProducerError.swift (100%) rename Sources/{PipelineModules => PublicModules}/PADProjectBuilder/SwiftInterfaceProducer/SwiftInterfaceType.swift (100%) rename Sources/{PipelineModules => PublicModules}/PADProjectBuilder/SwiftInterfaceProducer/XcodeTools.swift (100%) rename Sources/{PipelineModules => PublicModules}/PADProjectBuilder/SwiftPackageFileAnalyzer/SwiftPackageFileAnalyzer.swift (100%) rename Sources/{PipelineModules => PublicModules}/PADProjectBuilder/SwiftPackageFileAnalyzer/SwiftPackageFileAnalyzing.swift (100%) rename Sources/{PipelineModules => PublicModules}/PADProjectBuilder/SwiftPackageFileHelper/SwiftPackageDescription.swift (100%) rename Sources/{PipelineModules => PublicModules}/PADProjectBuilder/SwiftPackageFileHelper/SwiftPackageFileHelper.swift (100%) rename Sources/{PipelineModules => PublicModules}/PADSwiftInterfaceDiff/PADSwiftInterfaceDiff.swift (100%) rename Sources/{PipelineModules => PublicModules}/PADSwiftInterfaceDiff/SwiftInterfaceAnalyzer/IndependentSwiftInterfaceChange.swift (100%) rename Sources/{PipelineModules => PublicModules}/PADSwiftInterfaceDiff/SwiftInterfaceAnalyzer/SwiftInterfaceAnalyzer.swift (100%) rename Sources/{PipelineModules => PublicModules}/PADSwiftInterfaceDiff/SwiftInterfaceAnalyzer/SwiftInterfaceAnalyzing.swift (100%) rename Sources/{PipelineModules => PublicModules}/PADSwiftInterfaceDiff/SwiftInterfaceAnalyzer/SwiftInterfaceChangeConsolidator.swift (100%) rename Sources/{PipelineModules => PublicModules}/PADSwiftInterfaceDiff/SwiftInterfaceElement+DiffHelper.swift (100%) rename Sources/{PipelineModules => PublicModules}/PADSwiftInterfaceDiff/SwiftInterfaceElement.swift (100%) rename Sources/{PipelineModules => PublicModules}/PADSwiftInterfaceDiff/SwiftInterfaceParser/DeclSyntax+Convenience.swift (100%) rename Sources/{PipelineModules => PublicModules}/PADSwiftInterfaceDiff/SwiftInterfaceParser/DeclSyntax+SwiftInterface/ActorDeclSyntax+SwiftInterface.swift (100%) rename Sources/{PipelineModules => PublicModules}/PADSwiftInterfaceDiff/SwiftInterfaceParser/DeclSyntax+SwiftInterface/AssociatedTypeDeclSyntax+SwiftInterface.swift (100%) rename Sources/{PipelineModules => PublicModules}/PADSwiftInterfaceDiff/SwiftInterfaceParser/DeclSyntax+SwiftInterface/ClassDeclSyntac+SwiftInterface.swift (100%) rename Sources/{PipelineModules => PublicModules}/PADSwiftInterfaceDiff/SwiftInterfaceParser/DeclSyntax+SwiftInterface/EnumCaseDeclSyntax+SwiftInterface.swift (100%) rename Sources/{PipelineModules => PublicModules}/PADSwiftInterfaceDiff/SwiftInterfaceParser/DeclSyntax+SwiftInterface/EnumDeclSyntax+SwiftInterface.swift (100%) rename Sources/{PipelineModules => PublicModules}/PADSwiftInterfaceDiff/SwiftInterfaceParser/DeclSyntax+SwiftInterface/ExtensionDeclSyntax+SwiftInterface.swift (100%) rename Sources/{PipelineModules => PublicModules}/PADSwiftInterfaceDiff/SwiftInterfaceParser/DeclSyntax+SwiftInterface/FunctionDeclSyntax+SwiftInterface.swift (100%) rename Sources/{PipelineModules => PublicModules}/PADSwiftInterfaceDiff/SwiftInterfaceParser/DeclSyntax+SwiftInterface/InitializerDeclSyntax+SwiftInterface.swift (100%) rename Sources/{PipelineModules => PublicModules}/PADSwiftInterfaceDiff/SwiftInterfaceParser/DeclSyntax+SwiftInterface/ProtocolDeclSyntax+SwiftInterface.swift (100%) rename Sources/{PipelineModules => PublicModules}/PADSwiftInterfaceDiff/SwiftInterfaceParser/DeclSyntax+SwiftInterface/StructDeclSyntax+SwiftInterface.swift (100%) rename Sources/{PipelineModules => PublicModules}/PADSwiftInterfaceDiff/SwiftInterfaceParser/DeclSyntax+SwiftInterface/SubscriptDeclSyntax+SwiftInterface.swift (100%) rename Sources/{PipelineModules => PublicModules}/PADSwiftInterfaceDiff/SwiftInterfaceParser/DeclSyntax+SwiftInterface/TypeAliasDeclSyntax+SwiftInterface.swift (100%) rename Sources/{PipelineModules => PublicModules}/PADSwiftInterfaceDiff/SwiftInterfaceParser/DeclSyntax+SwiftInterface/VarDeclSyntax+SwiftInterface.swift (100%) rename Sources/{PipelineModules => PublicModules}/PADSwiftInterfaceDiff/SwiftInterfaceParser/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+Actor.swift (100%) rename Sources/{PipelineModules => PublicModules}/PADSwiftInterfaceDiff/SwiftInterfaceParser/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+AssociatedType.swift (100%) rename Sources/{PipelineModules => PublicModules}/PADSwiftInterfaceDiff/SwiftInterfaceParser/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+Class.swift (100%) rename Sources/{PipelineModules => PublicModules}/PADSwiftInterfaceDiff/SwiftInterfaceParser/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+Enum.swift (100%) rename Sources/{PipelineModules => PublicModules}/PADSwiftInterfaceDiff/SwiftInterfaceParser/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+EnumCase.swift (100%) rename Sources/{PipelineModules => PublicModules}/PADSwiftInterfaceDiff/SwiftInterfaceParser/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+Extension.swift (100%) rename Sources/{PipelineModules => PublicModules}/PADSwiftInterfaceDiff/SwiftInterfaceParser/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+Function.swift (100%) rename Sources/{PipelineModules => PublicModules}/PADSwiftInterfaceDiff/SwiftInterfaceParser/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+Initializer.swift (100%) rename Sources/{PipelineModules => PublicModules}/PADSwiftInterfaceDiff/SwiftInterfaceParser/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+Protocol.swift (100%) rename Sources/{PipelineModules => PublicModules}/PADSwiftInterfaceDiff/SwiftInterfaceParser/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+Struct.swift (100%) rename Sources/{PipelineModules => PublicModules}/PADSwiftInterfaceDiff/SwiftInterfaceParser/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+Subscript.swift (100%) rename Sources/{PipelineModules => PublicModules}/PADSwiftInterfaceDiff/SwiftInterfaceParser/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+TypeAlias.swift (100%) rename Sources/{PipelineModules => PublicModules}/PADSwiftInterfaceDiff/SwiftInterfaceParser/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+Var.swift (100%) rename Sources/{PipelineModules => PublicModules}/PADSwiftInterfaceDiff/SwiftInterfaceParser/SwiftInterfaceParser+Root.swift (100%) rename Sources/{PipelineModules => PublicModules}/PADSwiftInterfaceDiff/SwiftInterfaceParser/SwiftInterfaceParser.swift (100%) rename Sources/{PipelineModules => PublicModules}/PADSwiftInterfaceDiff/SwiftInterfaceParser/SwiftInterfaceParsing.swift (100%) rename Sources/{SharedHelperModules => Shared/Package}/FileHandlingModule/FileHandling+Convenience.swift (100%) rename Sources/{SharedHelperModules => Shared/Package}/FileHandlingModule/FileHandling.swift (100%) rename Sources/{SharedHelperModules => Shared/Package}/FileHandlingModule/FileManager+FileHandling.swift (100%) rename Sources/{SharedHelperModules => Shared/Package}/ShellModule/Shell.swift (100%) rename Sources/{SharedHelperModules => Shared/Public}/PADCore/PADChange.swift (100%) rename Sources/{SharedHelperModules => Shared/Public}/PADCore/PADSwiftInterfaceFile.swift (100%) rename Sources/{SharedHelperModules => Shared/Public}/PADLogging/PADLogFileLogger.swift (100%) rename Sources/{SharedHelperModules => Shared/Public}/PADLogging/PADLogLevelLogger.swift (100%) rename Sources/{SharedHelperModules => Shared/Public}/PADLogging/PADLogging.swift (100%) rename Sources/{SharedHelperModules => Shared/Public}/PADLogging/PADLoggingGroup.swift (100%) rename Sources/{SharedHelperModules => Shared/Public}/PADLogging/PADSystemLogger.swift (100%) diff --git a/Package.swift b/Package.swift index 916a7d5..6431451 100644 --- a/Package.swift +++ b/Package.swift @@ -49,27 +49,7 @@ let package = Package( path: "Sources/ExecutableTargets/CommandLineTool" ), - // MARK: - Shared Helper Modules - - .target( - name: "PADCore", - path: "Sources/SharedHelperModules/PADCore" - ), - .target( - name: "FileHandlingModule", - path: "Sources/SharedHelperModules/FileHandlingModule" - ), - .target( - name: "ShellModule", - path: "Sources/SharedHelperModules/ShellModule" - ), - .target( - name: "PADLogging", - dependencies: ["FileHandlingModule"], - path: "Sources/SharedHelperModules/PADLogging" - ), - - // MARK: - Pipeline Modules + // MARK: - Public Modules .target( name: "PADSwiftInterfaceDiff", @@ -80,7 +60,7 @@ let package = Package( .product(name: "SwiftSyntax", package: "swift-syntax"), .product(name: "SwiftParser", package: "swift-syntax"), ], - path: "Sources/PipelineModules/PADSwiftInterfaceDiff" + path: "Sources/PublicModules/PADSwiftInterfaceDiff" ), .target( name: "PADProjectBuilder", @@ -90,12 +70,35 @@ let package = Package( "PADLogging", "ShellModule" ], - path: "Sources/PipelineModules/PADProjectBuilder" + path: "Sources/PublicModules/PADProjectBuilder" ), .target( name: "PADOutputGenerator", dependencies: ["PADCore"], - path: "Sources/PipelineModules/PADOutputGenerator" + path: "Sources/PublicModules/PADOutputGenerator" + ), + + // MARK: - Shared/Public + + .target( + name: "PADCore", + path: "Sources/Shared/Public/PADCore" + ), + .target( + name: "PADLogging", + dependencies: ["FileHandlingModule"], + path: "Sources/Shared/Public/PADLogging" + ), + + // MARK: - Shared/Package + + .target( + name: "FileHandlingModule", + path: "Sources/Shared/Package/FileHandlingModule" + ), + .target( + name: "ShellModule", + path: "Sources/Shared/Package/ShellModule" ), // MARK: - Test Targets diff --git a/Sources/PipelineModules/PADOutputGenerator/MarkdownOutputGenerator.swift b/Sources/PublicModules/PADOutputGenerator/MarkdownOutputGenerator.swift similarity index 100% rename from Sources/PipelineModules/PADOutputGenerator/MarkdownOutputGenerator.swift rename to Sources/PublicModules/PADOutputGenerator/MarkdownOutputGenerator.swift diff --git a/Sources/PipelineModules/PADOutputGenerator/OutputGenerating.swift b/Sources/PublicModules/PADOutputGenerator/OutputGenerating.swift similarity index 100% rename from Sources/PipelineModules/PADOutputGenerator/OutputGenerating.swift rename to Sources/PublicModules/PADOutputGenerator/OutputGenerating.swift diff --git a/Sources/PipelineModules/PADProjectBuilder/PADProjectBuilder.swift b/Sources/PublicModules/PADProjectBuilder/PADProjectBuilder.swift similarity index 100% rename from Sources/PipelineModules/PADProjectBuilder/PADProjectBuilder.swift rename to Sources/PublicModules/PADProjectBuilder/PADProjectBuilder.swift diff --git a/Sources/PipelineModules/PADProjectBuilder/PADProjectType.swift b/Sources/PublicModules/PADProjectBuilder/PADProjectType.swift similarity index 100% rename from Sources/PipelineModules/PADProjectBuilder/PADProjectType.swift rename to Sources/PublicModules/PADProjectBuilder/PADProjectType.swift diff --git a/Sources/PipelineModules/PADProjectBuilder/ProjectSetup/Git.swift b/Sources/PublicModules/PADProjectBuilder/ProjectSetup/Git.swift similarity index 100% rename from Sources/PipelineModules/PADProjectBuilder/ProjectSetup/Git.swift rename to Sources/PublicModules/PADProjectBuilder/ProjectSetup/Git.swift diff --git a/Sources/PipelineModules/PADProjectBuilder/ProjectSetup/ProjectSetupHelper.swift b/Sources/PublicModules/PADProjectBuilder/ProjectSetup/ProjectSetupHelper.swift similarity index 100% rename from Sources/PipelineModules/PADProjectBuilder/ProjectSetup/ProjectSetupHelper.swift rename to Sources/PublicModules/PADProjectBuilder/ProjectSetup/ProjectSetupHelper.swift diff --git a/Sources/PipelineModules/PADProjectBuilder/ProjectSetup/ProjectSetupHelping.swift b/Sources/PublicModules/PADProjectBuilder/ProjectSetup/ProjectSetupHelping.swift similarity index 100% rename from Sources/PipelineModules/PADProjectBuilder/ProjectSetup/ProjectSetupHelping.swift rename to Sources/PublicModules/PADProjectBuilder/ProjectSetup/ProjectSetupHelping.swift diff --git a/Sources/PipelineModules/PADProjectBuilder/ProjectSetup/ProjectSource.swift b/Sources/PublicModules/PADProjectBuilder/ProjectSetup/ProjectSource.swift similarity index 100% rename from Sources/PipelineModules/PADProjectBuilder/ProjectSetup/ProjectSource.swift rename to Sources/PublicModules/PADProjectBuilder/ProjectSetup/ProjectSource.swift diff --git a/Sources/PipelineModules/PADProjectBuilder/ProjectSetup/RandomStringGenerating.swift b/Sources/PublicModules/PADProjectBuilder/ProjectSetup/RandomStringGenerating.swift similarity index 100% rename from Sources/PipelineModules/PADProjectBuilder/ProjectSetup/RandomStringGenerating.swift rename to Sources/PublicModules/PADProjectBuilder/ProjectSetup/RandomStringGenerating.swift diff --git a/Sources/PipelineModules/PADProjectBuilder/SwiftInterfaceProducer/SwiftInterfaceFileLocator.swift b/Sources/PublicModules/PADProjectBuilder/SwiftInterfaceProducer/SwiftInterfaceFileLocator.swift similarity index 100% rename from Sources/PipelineModules/PADProjectBuilder/SwiftInterfaceProducer/SwiftInterfaceFileLocator.swift rename to Sources/PublicModules/PADProjectBuilder/SwiftInterfaceProducer/SwiftInterfaceFileLocator.swift diff --git a/Sources/PipelineModules/PADProjectBuilder/SwiftInterfaceProducer/SwiftInterfaceProducer.swift b/Sources/PublicModules/PADProjectBuilder/SwiftInterfaceProducer/SwiftInterfaceProducer.swift similarity index 100% rename from Sources/PipelineModules/PADProjectBuilder/SwiftInterfaceProducer/SwiftInterfaceProducer.swift rename to Sources/PublicModules/PADProjectBuilder/SwiftInterfaceProducer/SwiftInterfaceProducer.swift diff --git a/Sources/PipelineModules/PADProjectBuilder/SwiftInterfaceProducer/SwiftInterfaceProducerError.swift b/Sources/PublicModules/PADProjectBuilder/SwiftInterfaceProducer/SwiftInterfaceProducerError.swift similarity index 100% rename from Sources/PipelineModules/PADProjectBuilder/SwiftInterfaceProducer/SwiftInterfaceProducerError.swift rename to Sources/PublicModules/PADProjectBuilder/SwiftInterfaceProducer/SwiftInterfaceProducerError.swift diff --git a/Sources/PipelineModules/PADProjectBuilder/SwiftInterfaceProducer/SwiftInterfaceType.swift b/Sources/PublicModules/PADProjectBuilder/SwiftInterfaceProducer/SwiftInterfaceType.swift similarity index 100% rename from Sources/PipelineModules/PADProjectBuilder/SwiftInterfaceProducer/SwiftInterfaceType.swift rename to Sources/PublicModules/PADProjectBuilder/SwiftInterfaceProducer/SwiftInterfaceType.swift diff --git a/Sources/PipelineModules/PADProjectBuilder/SwiftInterfaceProducer/XcodeTools.swift b/Sources/PublicModules/PADProjectBuilder/SwiftInterfaceProducer/XcodeTools.swift similarity index 100% rename from Sources/PipelineModules/PADProjectBuilder/SwiftInterfaceProducer/XcodeTools.swift rename to Sources/PublicModules/PADProjectBuilder/SwiftInterfaceProducer/XcodeTools.swift diff --git a/Sources/PipelineModules/PADProjectBuilder/SwiftPackageFileAnalyzer/SwiftPackageFileAnalyzer.swift b/Sources/PublicModules/PADProjectBuilder/SwiftPackageFileAnalyzer/SwiftPackageFileAnalyzer.swift similarity index 100% rename from Sources/PipelineModules/PADProjectBuilder/SwiftPackageFileAnalyzer/SwiftPackageFileAnalyzer.swift rename to Sources/PublicModules/PADProjectBuilder/SwiftPackageFileAnalyzer/SwiftPackageFileAnalyzer.swift diff --git a/Sources/PipelineModules/PADProjectBuilder/SwiftPackageFileAnalyzer/SwiftPackageFileAnalyzing.swift b/Sources/PublicModules/PADProjectBuilder/SwiftPackageFileAnalyzer/SwiftPackageFileAnalyzing.swift similarity index 100% rename from Sources/PipelineModules/PADProjectBuilder/SwiftPackageFileAnalyzer/SwiftPackageFileAnalyzing.swift rename to Sources/PublicModules/PADProjectBuilder/SwiftPackageFileAnalyzer/SwiftPackageFileAnalyzing.swift diff --git a/Sources/PipelineModules/PADProjectBuilder/SwiftPackageFileHelper/SwiftPackageDescription.swift b/Sources/PublicModules/PADProjectBuilder/SwiftPackageFileHelper/SwiftPackageDescription.swift similarity index 100% rename from Sources/PipelineModules/PADProjectBuilder/SwiftPackageFileHelper/SwiftPackageDescription.swift rename to Sources/PublicModules/PADProjectBuilder/SwiftPackageFileHelper/SwiftPackageDescription.swift diff --git a/Sources/PipelineModules/PADProjectBuilder/SwiftPackageFileHelper/SwiftPackageFileHelper.swift b/Sources/PublicModules/PADProjectBuilder/SwiftPackageFileHelper/SwiftPackageFileHelper.swift similarity index 100% rename from Sources/PipelineModules/PADProjectBuilder/SwiftPackageFileHelper/SwiftPackageFileHelper.swift rename to Sources/PublicModules/PADProjectBuilder/SwiftPackageFileHelper/SwiftPackageFileHelper.swift diff --git a/Sources/PipelineModules/PADSwiftInterfaceDiff/PADSwiftInterfaceDiff.swift b/Sources/PublicModules/PADSwiftInterfaceDiff/PADSwiftInterfaceDiff.swift similarity index 100% rename from Sources/PipelineModules/PADSwiftInterfaceDiff/PADSwiftInterfaceDiff.swift rename to Sources/PublicModules/PADSwiftInterfaceDiff/PADSwiftInterfaceDiff.swift diff --git a/Sources/PipelineModules/PADSwiftInterfaceDiff/SwiftInterfaceAnalyzer/IndependentSwiftInterfaceChange.swift b/Sources/PublicModules/PADSwiftInterfaceDiff/SwiftInterfaceAnalyzer/IndependentSwiftInterfaceChange.swift similarity index 100% rename from Sources/PipelineModules/PADSwiftInterfaceDiff/SwiftInterfaceAnalyzer/IndependentSwiftInterfaceChange.swift rename to Sources/PublicModules/PADSwiftInterfaceDiff/SwiftInterfaceAnalyzer/IndependentSwiftInterfaceChange.swift diff --git a/Sources/PipelineModules/PADSwiftInterfaceDiff/SwiftInterfaceAnalyzer/SwiftInterfaceAnalyzer.swift b/Sources/PublicModules/PADSwiftInterfaceDiff/SwiftInterfaceAnalyzer/SwiftInterfaceAnalyzer.swift similarity index 100% rename from Sources/PipelineModules/PADSwiftInterfaceDiff/SwiftInterfaceAnalyzer/SwiftInterfaceAnalyzer.swift rename to Sources/PublicModules/PADSwiftInterfaceDiff/SwiftInterfaceAnalyzer/SwiftInterfaceAnalyzer.swift diff --git a/Sources/PipelineModules/PADSwiftInterfaceDiff/SwiftInterfaceAnalyzer/SwiftInterfaceAnalyzing.swift b/Sources/PublicModules/PADSwiftInterfaceDiff/SwiftInterfaceAnalyzer/SwiftInterfaceAnalyzing.swift similarity index 100% rename from Sources/PipelineModules/PADSwiftInterfaceDiff/SwiftInterfaceAnalyzer/SwiftInterfaceAnalyzing.swift rename to Sources/PublicModules/PADSwiftInterfaceDiff/SwiftInterfaceAnalyzer/SwiftInterfaceAnalyzing.swift diff --git a/Sources/PipelineModules/PADSwiftInterfaceDiff/SwiftInterfaceAnalyzer/SwiftInterfaceChangeConsolidator.swift b/Sources/PublicModules/PADSwiftInterfaceDiff/SwiftInterfaceAnalyzer/SwiftInterfaceChangeConsolidator.swift similarity index 100% rename from Sources/PipelineModules/PADSwiftInterfaceDiff/SwiftInterfaceAnalyzer/SwiftInterfaceChangeConsolidator.swift rename to Sources/PublicModules/PADSwiftInterfaceDiff/SwiftInterfaceAnalyzer/SwiftInterfaceChangeConsolidator.swift diff --git a/Sources/PipelineModules/PADSwiftInterfaceDiff/SwiftInterfaceElement+DiffHelper.swift b/Sources/PublicModules/PADSwiftInterfaceDiff/SwiftInterfaceElement+DiffHelper.swift similarity index 100% rename from Sources/PipelineModules/PADSwiftInterfaceDiff/SwiftInterfaceElement+DiffHelper.swift rename to Sources/PublicModules/PADSwiftInterfaceDiff/SwiftInterfaceElement+DiffHelper.swift diff --git a/Sources/PipelineModules/PADSwiftInterfaceDiff/SwiftInterfaceElement.swift b/Sources/PublicModules/PADSwiftInterfaceDiff/SwiftInterfaceElement.swift similarity index 100% rename from Sources/PipelineModules/PADSwiftInterfaceDiff/SwiftInterfaceElement.swift rename to Sources/PublicModules/PADSwiftInterfaceDiff/SwiftInterfaceElement.swift diff --git a/Sources/PipelineModules/PADSwiftInterfaceDiff/SwiftInterfaceParser/DeclSyntax+Convenience.swift b/Sources/PublicModules/PADSwiftInterfaceDiff/SwiftInterfaceParser/DeclSyntax+Convenience.swift similarity index 100% rename from Sources/PipelineModules/PADSwiftInterfaceDiff/SwiftInterfaceParser/DeclSyntax+Convenience.swift rename to Sources/PublicModules/PADSwiftInterfaceDiff/SwiftInterfaceParser/DeclSyntax+Convenience.swift diff --git a/Sources/PipelineModules/PADSwiftInterfaceDiff/SwiftInterfaceParser/DeclSyntax+SwiftInterface/ActorDeclSyntax+SwiftInterface.swift b/Sources/PublicModules/PADSwiftInterfaceDiff/SwiftInterfaceParser/DeclSyntax+SwiftInterface/ActorDeclSyntax+SwiftInterface.swift similarity index 100% rename from Sources/PipelineModules/PADSwiftInterfaceDiff/SwiftInterfaceParser/DeclSyntax+SwiftInterface/ActorDeclSyntax+SwiftInterface.swift rename to Sources/PublicModules/PADSwiftInterfaceDiff/SwiftInterfaceParser/DeclSyntax+SwiftInterface/ActorDeclSyntax+SwiftInterface.swift diff --git a/Sources/PipelineModules/PADSwiftInterfaceDiff/SwiftInterfaceParser/DeclSyntax+SwiftInterface/AssociatedTypeDeclSyntax+SwiftInterface.swift b/Sources/PublicModules/PADSwiftInterfaceDiff/SwiftInterfaceParser/DeclSyntax+SwiftInterface/AssociatedTypeDeclSyntax+SwiftInterface.swift similarity index 100% rename from Sources/PipelineModules/PADSwiftInterfaceDiff/SwiftInterfaceParser/DeclSyntax+SwiftInterface/AssociatedTypeDeclSyntax+SwiftInterface.swift rename to Sources/PublicModules/PADSwiftInterfaceDiff/SwiftInterfaceParser/DeclSyntax+SwiftInterface/AssociatedTypeDeclSyntax+SwiftInterface.swift diff --git a/Sources/PipelineModules/PADSwiftInterfaceDiff/SwiftInterfaceParser/DeclSyntax+SwiftInterface/ClassDeclSyntac+SwiftInterface.swift b/Sources/PublicModules/PADSwiftInterfaceDiff/SwiftInterfaceParser/DeclSyntax+SwiftInterface/ClassDeclSyntac+SwiftInterface.swift similarity index 100% rename from Sources/PipelineModules/PADSwiftInterfaceDiff/SwiftInterfaceParser/DeclSyntax+SwiftInterface/ClassDeclSyntac+SwiftInterface.swift rename to Sources/PublicModules/PADSwiftInterfaceDiff/SwiftInterfaceParser/DeclSyntax+SwiftInterface/ClassDeclSyntac+SwiftInterface.swift diff --git a/Sources/PipelineModules/PADSwiftInterfaceDiff/SwiftInterfaceParser/DeclSyntax+SwiftInterface/EnumCaseDeclSyntax+SwiftInterface.swift b/Sources/PublicModules/PADSwiftInterfaceDiff/SwiftInterfaceParser/DeclSyntax+SwiftInterface/EnumCaseDeclSyntax+SwiftInterface.swift similarity index 100% rename from Sources/PipelineModules/PADSwiftInterfaceDiff/SwiftInterfaceParser/DeclSyntax+SwiftInterface/EnumCaseDeclSyntax+SwiftInterface.swift rename to Sources/PublicModules/PADSwiftInterfaceDiff/SwiftInterfaceParser/DeclSyntax+SwiftInterface/EnumCaseDeclSyntax+SwiftInterface.swift diff --git a/Sources/PipelineModules/PADSwiftInterfaceDiff/SwiftInterfaceParser/DeclSyntax+SwiftInterface/EnumDeclSyntax+SwiftInterface.swift b/Sources/PublicModules/PADSwiftInterfaceDiff/SwiftInterfaceParser/DeclSyntax+SwiftInterface/EnumDeclSyntax+SwiftInterface.swift similarity index 100% rename from Sources/PipelineModules/PADSwiftInterfaceDiff/SwiftInterfaceParser/DeclSyntax+SwiftInterface/EnumDeclSyntax+SwiftInterface.swift rename to Sources/PublicModules/PADSwiftInterfaceDiff/SwiftInterfaceParser/DeclSyntax+SwiftInterface/EnumDeclSyntax+SwiftInterface.swift diff --git a/Sources/PipelineModules/PADSwiftInterfaceDiff/SwiftInterfaceParser/DeclSyntax+SwiftInterface/ExtensionDeclSyntax+SwiftInterface.swift b/Sources/PublicModules/PADSwiftInterfaceDiff/SwiftInterfaceParser/DeclSyntax+SwiftInterface/ExtensionDeclSyntax+SwiftInterface.swift similarity index 100% rename from Sources/PipelineModules/PADSwiftInterfaceDiff/SwiftInterfaceParser/DeclSyntax+SwiftInterface/ExtensionDeclSyntax+SwiftInterface.swift rename to Sources/PublicModules/PADSwiftInterfaceDiff/SwiftInterfaceParser/DeclSyntax+SwiftInterface/ExtensionDeclSyntax+SwiftInterface.swift diff --git a/Sources/PipelineModules/PADSwiftInterfaceDiff/SwiftInterfaceParser/DeclSyntax+SwiftInterface/FunctionDeclSyntax+SwiftInterface.swift b/Sources/PublicModules/PADSwiftInterfaceDiff/SwiftInterfaceParser/DeclSyntax+SwiftInterface/FunctionDeclSyntax+SwiftInterface.swift similarity index 100% rename from Sources/PipelineModules/PADSwiftInterfaceDiff/SwiftInterfaceParser/DeclSyntax+SwiftInterface/FunctionDeclSyntax+SwiftInterface.swift rename to Sources/PublicModules/PADSwiftInterfaceDiff/SwiftInterfaceParser/DeclSyntax+SwiftInterface/FunctionDeclSyntax+SwiftInterface.swift diff --git a/Sources/PipelineModules/PADSwiftInterfaceDiff/SwiftInterfaceParser/DeclSyntax+SwiftInterface/InitializerDeclSyntax+SwiftInterface.swift b/Sources/PublicModules/PADSwiftInterfaceDiff/SwiftInterfaceParser/DeclSyntax+SwiftInterface/InitializerDeclSyntax+SwiftInterface.swift similarity index 100% rename from Sources/PipelineModules/PADSwiftInterfaceDiff/SwiftInterfaceParser/DeclSyntax+SwiftInterface/InitializerDeclSyntax+SwiftInterface.swift rename to Sources/PublicModules/PADSwiftInterfaceDiff/SwiftInterfaceParser/DeclSyntax+SwiftInterface/InitializerDeclSyntax+SwiftInterface.swift diff --git a/Sources/PipelineModules/PADSwiftInterfaceDiff/SwiftInterfaceParser/DeclSyntax+SwiftInterface/ProtocolDeclSyntax+SwiftInterface.swift b/Sources/PublicModules/PADSwiftInterfaceDiff/SwiftInterfaceParser/DeclSyntax+SwiftInterface/ProtocolDeclSyntax+SwiftInterface.swift similarity index 100% rename from Sources/PipelineModules/PADSwiftInterfaceDiff/SwiftInterfaceParser/DeclSyntax+SwiftInterface/ProtocolDeclSyntax+SwiftInterface.swift rename to Sources/PublicModules/PADSwiftInterfaceDiff/SwiftInterfaceParser/DeclSyntax+SwiftInterface/ProtocolDeclSyntax+SwiftInterface.swift diff --git a/Sources/PipelineModules/PADSwiftInterfaceDiff/SwiftInterfaceParser/DeclSyntax+SwiftInterface/StructDeclSyntax+SwiftInterface.swift b/Sources/PublicModules/PADSwiftInterfaceDiff/SwiftInterfaceParser/DeclSyntax+SwiftInterface/StructDeclSyntax+SwiftInterface.swift similarity index 100% rename from Sources/PipelineModules/PADSwiftInterfaceDiff/SwiftInterfaceParser/DeclSyntax+SwiftInterface/StructDeclSyntax+SwiftInterface.swift rename to Sources/PublicModules/PADSwiftInterfaceDiff/SwiftInterfaceParser/DeclSyntax+SwiftInterface/StructDeclSyntax+SwiftInterface.swift diff --git a/Sources/PipelineModules/PADSwiftInterfaceDiff/SwiftInterfaceParser/DeclSyntax+SwiftInterface/SubscriptDeclSyntax+SwiftInterface.swift b/Sources/PublicModules/PADSwiftInterfaceDiff/SwiftInterfaceParser/DeclSyntax+SwiftInterface/SubscriptDeclSyntax+SwiftInterface.swift similarity index 100% rename from Sources/PipelineModules/PADSwiftInterfaceDiff/SwiftInterfaceParser/DeclSyntax+SwiftInterface/SubscriptDeclSyntax+SwiftInterface.swift rename to Sources/PublicModules/PADSwiftInterfaceDiff/SwiftInterfaceParser/DeclSyntax+SwiftInterface/SubscriptDeclSyntax+SwiftInterface.swift diff --git a/Sources/PipelineModules/PADSwiftInterfaceDiff/SwiftInterfaceParser/DeclSyntax+SwiftInterface/TypeAliasDeclSyntax+SwiftInterface.swift b/Sources/PublicModules/PADSwiftInterfaceDiff/SwiftInterfaceParser/DeclSyntax+SwiftInterface/TypeAliasDeclSyntax+SwiftInterface.swift similarity index 100% rename from Sources/PipelineModules/PADSwiftInterfaceDiff/SwiftInterfaceParser/DeclSyntax+SwiftInterface/TypeAliasDeclSyntax+SwiftInterface.swift rename to Sources/PublicModules/PADSwiftInterfaceDiff/SwiftInterfaceParser/DeclSyntax+SwiftInterface/TypeAliasDeclSyntax+SwiftInterface.swift diff --git a/Sources/PipelineModules/PADSwiftInterfaceDiff/SwiftInterfaceParser/DeclSyntax+SwiftInterface/VarDeclSyntax+SwiftInterface.swift b/Sources/PublicModules/PADSwiftInterfaceDiff/SwiftInterfaceParser/DeclSyntax+SwiftInterface/VarDeclSyntax+SwiftInterface.swift similarity index 100% rename from Sources/PipelineModules/PADSwiftInterfaceDiff/SwiftInterfaceParser/DeclSyntax+SwiftInterface/VarDeclSyntax+SwiftInterface.swift rename to Sources/PublicModules/PADSwiftInterfaceDiff/SwiftInterfaceParser/DeclSyntax+SwiftInterface/VarDeclSyntax+SwiftInterface.swift diff --git a/Sources/PipelineModules/PADSwiftInterfaceDiff/SwiftInterfaceParser/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+Actor.swift b/Sources/PublicModules/PADSwiftInterfaceDiff/SwiftInterfaceParser/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+Actor.swift similarity index 100% rename from Sources/PipelineModules/PADSwiftInterfaceDiff/SwiftInterfaceParser/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+Actor.swift rename to Sources/PublicModules/PADSwiftInterfaceDiff/SwiftInterfaceParser/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+Actor.swift diff --git a/Sources/PipelineModules/PADSwiftInterfaceDiff/SwiftInterfaceParser/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+AssociatedType.swift b/Sources/PublicModules/PADSwiftInterfaceDiff/SwiftInterfaceParser/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+AssociatedType.swift similarity index 100% rename from Sources/PipelineModules/PADSwiftInterfaceDiff/SwiftInterfaceParser/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+AssociatedType.swift rename to Sources/PublicModules/PADSwiftInterfaceDiff/SwiftInterfaceParser/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+AssociatedType.swift diff --git a/Sources/PipelineModules/PADSwiftInterfaceDiff/SwiftInterfaceParser/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+Class.swift b/Sources/PublicModules/PADSwiftInterfaceDiff/SwiftInterfaceParser/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+Class.swift similarity index 100% rename from Sources/PipelineModules/PADSwiftInterfaceDiff/SwiftInterfaceParser/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+Class.swift rename to Sources/PublicModules/PADSwiftInterfaceDiff/SwiftInterfaceParser/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+Class.swift diff --git a/Sources/PipelineModules/PADSwiftInterfaceDiff/SwiftInterfaceParser/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+Enum.swift b/Sources/PublicModules/PADSwiftInterfaceDiff/SwiftInterfaceParser/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+Enum.swift similarity index 100% rename from Sources/PipelineModules/PADSwiftInterfaceDiff/SwiftInterfaceParser/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+Enum.swift rename to Sources/PublicModules/PADSwiftInterfaceDiff/SwiftInterfaceParser/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+Enum.swift diff --git a/Sources/PipelineModules/PADSwiftInterfaceDiff/SwiftInterfaceParser/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+EnumCase.swift b/Sources/PublicModules/PADSwiftInterfaceDiff/SwiftInterfaceParser/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+EnumCase.swift similarity index 100% rename from Sources/PipelineModules/PADSwiftInterfaceDiff/SwiftInterfaceParser/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+EnumCase.swift rename to Sources/PublicModules/PADSwiftInterfaceDiff/SwiftInterfaceParser/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+EnumCase.swift diff --git a/Sources/PipelineModules/PADSwiftInterfaceDiff/SwiftInterfaceParser/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+Extension.swift b/Sources/PublicModules/PADSwiftInterfaceDiff/SwiftInterfaceParser/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+Extension.swift similarity index 100% rename from Sources/PipelineModules/PADSwiftInterfaceDiff/SwiftInterfaceParser/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+Extension.swift rename to Sources/PublicModules/PADSwiftInterfaceDiff/SwiftInterfaceParser/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+Extension.swift diff --git a/Sources/PipelineModules/PADSwiftInterfaceDiff/SwiftInterfaceParser/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+Function.swift b/Sources/PublicModules/PADSwiftInterfaceDiff/SwiftInterfaceParser/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+Function.swift similarity index 100% rename from Sources/PipelineModules/PADSwiftInterfaceDiff/SwiftInterfaceParser/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+Function.swift rename to Sources/PublicModules/PADSwiftInterfaceDiff/SwiftInterfaceParser/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+Function.swift diff --git a/Sources/PipelineModules/PADSwiftInterfaceDiff/SwiftInterfaceParser/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+Initializer.swift b/Sources/PublicModules/PADSwiftInterfaceDiff/SwiftInterfaceParser/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+Initializer.swift similarity index 100% rename from Sources/PipelineModules/PADSwiftInterfaceDiff/SwiftInterfaceParser/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+Initializer.swift rename to Sources/PublicModules/PADSwiftInterfaceDiff/SwiftInterfaceParser/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+Initializer.swift diff --git a/Sources/PipelineModules/PADSwiftInterfaceDiff/SwiftInterfaceParser/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+Protocol.swift b/Sources/PublicModules/PADSwiftInterfaceDiff/SwiftInterfaceParser/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+Protocol.swift similarity index 100% rename from Sources/PipelineModules/PADSwiftInterfaceDiff/SwiftInterfaceParser/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+Protocol.swift rename to Sources/PublicModules/PADSwiftInterfaceDiff/SwiftInterfaceParser/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+Protocol.swift diff --git a/Sources/PipelineModules/PADSwiftInterfaceDiff/SwiftInterfaceParser/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+Struct.swift b/Sources/PublicModules/PADSwiftInterfaceDiff/SwiftInterfaceParser/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+Struct.swift similarity index 100% rename from Sources/PipelineModules/PADSwiftInterfaceDiff/SwiftInterfaceParser/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+Struct.swift rename to Sources/PublicModules/PADSwiftInterfaceDiff/SwiftInterfaceParser/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+Struct.swift diff --git a/Sources/PipelineModules/PADSwiftInterfaceDiff/SwiftInterfaceParser/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+Subscript.swift b/Sources/PublicModules/PADSwiftInterfaceDiff/SwiftInterfaceParser/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+Subscript.swift similarity index 100% rename from Sources/PipelineModules/PADSwiftInterfaceDiff/SwiftInterfaceParser/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+Subscript.swift rename to Sources/PublicModules/PADSwiftInterfaceDiff/SwiftInterfaceParser/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+Subscript.swift diff --git a/Sources/PipelineModules/PADSwiftInterfaceDiff/SwiftInterfaceParser/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+TypeAlias.swift b/Sources/PublicModules/PADSwiftInterfaceDiff/SwiftInterfaceParser/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+TypeAlias.swift similarity index 100% rename from Sources/PipelineModules/PADSwiftInterfaceDiff/SwiftInterfaceParser/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+TypeAlias.swift rename to Sources/PublicModules/PADSwiftInterfaceDiff/SwiftInterfaceParser/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+TypeAlias.swift diff --git a/Sources/PipelineModules/PADSwiftInterfaceDiff/SwiftInterfaceParser/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+Var.swift b/Sources/PublicModules/PADSwiftInterfaceDiff/SwiftInterfaceParser/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+Var.swift similarity index 100% rename from Sources/PipelineModules/PADSwiftInterfaceDiff/SwiftInterfaceParser/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+Var.swift rename to Sources/PublicModules/PADSwiftInterfaceDiff/SwiftInterfaceParser/SwiftInterfaceElement+Declaration/SwiftInterfaceElement+Var.swift diff --git a/Sources/PipelineModules/PADSwiftInterfaceDiff/SwiftInterfaceParser/SwiftInterfaceParser+Root.swift b/Sources/PublicModules/PADSwiftInterfaceDiff/SwiftInterfaceParser/SwiftInterfaceParser+Root.swift similarity index 100% rename from Sources/PipelineModules/PADSwiftInterfaceDiff/SwiftInterfaceParser/SwiftInterfaceParser+Root.swift rename to Sources/PublicModules/PADSwiftInterfaceDiff/SwiftInterfaceParser/SwiftInterfaceParser+Root.swift diff --git a/Sources/PipelineModules/PADSwiftInterfaceDiff/SwiftInterfaceParser/SwiftInterfaceParser.swift b/Sources/PublicModules/PADSwiftInterfaceDiff/SwiftInterfaceParser/SwiftInterfaceParser.swift similarity index 100% rename from Sources/PipelineModules/PADSwiftInterfaceDiff/SwiftInterfaceParser/SwiftInterfaceParser.swift rename to Sources/PublicModules/PADSwiftInterfaceDiff/SwiftInterfaceParser/SwiftInterfaceParser.swift diff --git a/Sources/PipelineModules/PADSwiftInterfaceDiff/SwiftInterfaceParser/SwiftInterfaceParsing.swift b/Sources/PublicModules/PADSwiftInterfaceDiff/SwiftInterfaceParser/SwiftInterfaceParsing.swift similarity index 100% rename from Sources/PipelineModules/PADSwiftInterfaceDiff/SwiftInterfaceParser/SwiftInterfaceParsing.swift rename to Sources/PublicModules/PADSwiftInterfaceDiff/SwiftInterfaceParser/SwiftInterfaceParsing.swift diff --git a/Sources/SharedHelperModules/FileHandlingModule/FileHandling+Convenience.swift b/Sources/Shared/Package/FileHandlingModule/FileHandling+Convenience.swift similarity index 100% rename from Sources/SharedHelperModules/FileHandlingModule/FileHandling+Convenience.swift rename to Sources/Shared/Package/FileHandlingModule/FileHandling+Convenience.swift diff --git a/Sources/SharedHelperModules/FileHandlingModule/FileHandling.swift b/Sources/Shared/Package/FileHandlingModule/FileHandling.swift similarity index 100% rename from Sources/SharedHelperModules/FileHandlingModule/FileHandling.swift rename to Sources/Shared/Package/FileHandlingModule/FileHandling.swift diff --git a/Sources/SharedHelperModules/FileHandlingModule/FileManager+FileHandling.swift b/Sources/Shared/Package/FileHandlingModule/FileManager+FileHandling.swift similarity index 100% rename from Sources/SharedHelperModules/FileHandlingModule/FileManager+FileHandling.swift rename to Sources/Shared/Package/FileHandlingModule/FileManager+FileHandling.swift diff --git a/Sources/SharedHelperModules/ShellModule/Shell.swift b/Sources/Shared/Package/ShellModule/Shell.swift similarity index 100% rename from Sources/SharedHelperModules/ShellModule/Shell.swift rename to Sources/Shared/Package/ShellModule/Shell.swift diff --git a/Sources/SharedHelperModules/PADCore/PADChange.swift b/Sources/Shared/Public/PADCore/PADChange.swift similarity index 100% rename from Sources/SharedHelperModules/PADCore/PADChange.swift rename to Sources/Shared/Public/PADCore/PADChange.swift diff --git a/Sources/SharedHelperModules/PADCore/PADSwiftInterfaceFile.swift b/Sources/Shared/Public/PADCore/PADSwiftInterfaceFile.swift similarity index 100% rename from Sources/SharedHelperModules/PADCore/PADSwiftInterfaceFile.swift rename to Sources/Shared/Public/PADCore/PADSwiftInterfaceFile.swift diff --git a/Sources/SharedHelperModules/PADLogging/PADLogFileLogger.swift b/Sources/Shared/Public/PADLogging/PADLogFileLogger.swift similarity index 100% rename from Sources/SharedHelperModules/PADLogging/PADLogFileLogger.swift rename to Sources/Shared/Public/PADLogging/PADLogFileLogger.swift diff --git a/Sources/SharedHelperModules/PADLogging/PADLogLevelLogger.swift b/Sources/Shared/Public/PADLogging/PADLogLevelLogger.swift similarity index 100% rename from Sources/SharedHelperModules/PADLogging/PADLogLevelLogger.swift rename to Sources/Shared/Public/PADLogging/PADLogLevelLogger.swift diff --git a/Sources/SharedHelperModules/PADLogging/PADLogging.swift b/Sources/Shared/Public/PADLogging/PADLogging.swift similarity index 100% rename from Sources/SharedHelperModules/PADLogging/PADLogging.swift rename to Sources/Shared/Public/PADLogging/PADLogging.swift diff --git a/Sources/SharedHelperModules/PADLogging/PADLoggingGroup.swift b/Sources/Shared/Public/PADLogging/PADLoggingGroup.swift similarity index 100% rename from Sources/SharedHelperModules/PADLogging/PADLoggingGroup.swift rename to Sources/Shared/Public/PADLogging/PADLoggingGroup.swift diff --git a/Sources/SharedHelperModules/PADLogging/PADSystemLogger.swift b/Sources/Shared/Public/PADLogging/PADSystemLogger.swift similarity index 100% rename from Sources/SharedHelperModules/PADLogging/PADSystemLogger.swift rename to Sources/Shared/Public/PADLogging/PADSystemLogger.swift From bcf5b111e989c9ad05cbc8ff180c6df9a0848011 Mon Sep 17 00:00:00 2001 From: Alex Guretzki Date: Fri, 11 Oct 2024 12:35:48 +0200 Subject: [PATCH 12/12] Adding swift-docc plugin --- Package.resolved | 18 ++++++++++++++++++ Package.swift | 3 ++- .../PADSwiftInterfaceDiff.swift | 2 +- .../Public/PADLogging/PADLogLevelLogger.swift | 4 ++-- 4 files changed, 23 insertions(+), 4 deletions(-) diff --git a/Package.resolved b/Package.resolved index 5b1fc27..5e1196d 100644 --- a/Package.resolved +++ b/Package.resolved @@ -9,6 +9,24 @@ "version" : "1.5.0" } }, + { + "identity" : "swift-docc-plugin", + "kind" : "remoteSourceControl", + "location" : "https://github.com/apple/swift-docc-plugin", + "state" : { + "revision" : "85e4bb4e1cd62cec64a4b8e769dcefdf0c5b9d64", + "version" : "1.4.3" + } + }, + { + "identity" : "swift-docc-symbolkit", + "kind" : "remoteSourceControl", + "location" : "https://github.com/swiftlang/swift-docc-symbolkit", + "state" : { + "revision" : "b45d1f2ed151d057b54504d653e0da5552844e34", + "version" : "1.0.0" + } + }, { "identity" : "swift-syntax", "kind" : "remoteSourceControl", diff --git a/Package.swift b/Package.swift index 6431451..a3a702f 100644 --- a/Package.swift +++ b/Package.swift @@ -32,7 +32,8 @@ let package = Package( dependencies: [ .package(url: "https://github.com/apple/swift-argument-parser", from: "1.5.0"), .package(url: "https://github.com/swiftlang/swift-syntax", from: "600.0.0"), - .package(url: "https://github.com/nicklockwood/SwiftFormat", from: "0.54.6") + .package(url: "https://github.com/nicklockwood/SwiftFormat", from: "0.54.6"), + .package(url: "https://github.com/apple/swift-docc-plugin", from: "1.0.0") ], targets: [ diff --git a/Sources/PublicModules/PADSwiftInterfaceDiff/PADSwiftInterfaceDiff.swift b/Sources/PublicModules/PADSwiftInterfaceDiff/PADSwiftInterfaceDiff.swift index ba114db..5e8f54d 100644 --- a/Sources/PublicModules/PADSwiftInterfaceDiff/PADSwiftInterfaceDiff.swift +++ b/Sources/PublicModules/PADSwiftInterfaceDiff/PADSwiftInterfaceDiff.swift @@ -4,7 +4,7 @@ import PADCore import PADLogging import FileHandlingModule -/// Takes a list of ``SwiftInterfaceFile`` and detects changes between the old and new version +/// Takes a list of ``PADSwiftInterfaceFile`` and detects changes between the old and new version public struct PADSwiftInterfaceDiff { let fileHandler: any FileHandling diff --git a/Sources/Shared/Public/PADLogging/PADLogLevelLogger.swift b/Sources/Shared/Public/PADLogging/PADLogLevelLogger.swift index 1472aab..643b218 100644 --- a/Sources/Shared/Public/PADLogging/PADLogLevelLogger.swift +++ b/Sources/Shared/Public/PADLogging/PADLogLevelLogger.swift @@ -32,9 +32,9 @@ public enum PADLogLevel { } } -// MARK: - LogLevelLogger +// MARK: - PADLogLevelLogger -/// Logger that respects a ``LogLevel`` +/// Logger that respects a ``PADLogLevel`` public struct PADLogLevelLogger: PADLogging { private let logLevel: PADLogLevel