Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
66 commits
Select commit Hold shift + click to select a range
115f2b0
Added public api
rofle100lvl Sep 30, 2024
1424b59
Fixed periphery scan
rofle100lvl Sep 30, 2024
a8d6264
Update deps
ileitch Nov 1, 2024
a39f097
Update changelog
ileitch Nov 1, 2024
194aa2d
Improve Bazel integration (#833)
ileitch Dec 13, 2024
b210f12
Fix help handling
ileitch Dec 13, 2024
50dbc43
Disable external override bug workaround in >= 6.1
ileitch Dec 14, 2024
6c42ee1
Update linters
ileitch Dec 14, 2024
2978b8e
Migrate some tasks to Mise
ileitch Dec 14, 2024
29fd326
Ensure Bazel rules are updated (#835)
ileitch Dec 14, 2024
87fc6e9
Add Linux baseline (#836)
ileitch Dec 14, 2024
f04b575
Remove support for Swift 5.9 (#837)
ileitch Dec 14, 2024
9e116cc
Update Bazel deps
ileitch Dec 14, 2024
1fb8984
Create bazel archive in release script
ileitch Dec 14, 2024
a9eeaf9
Release 3.0.0.beta5
ileitch Dec 14, 2024
81bc8b9
Bazel tweaks
ileitch Dec 14, 2024
48cbbaa
Release 3.0.0.beta6
ileitch Dec 14, 2024
1afe5a4
Fix Bazel bin path
ileitch Dec 15, 2024
accd674
Improve handling of working directory for Bazel (#838)
ileitch Dec 15, 2024
d61eecf
Release 3.0.0.beta7
ileitch Dec 15, 2024
623d149
Bazel ignore .release
ileitch Dec 16, 2024
5dfd43f
Fix generated Bazel repo naming (#843)
ileitch Dec 16, 2024
1390d13
Release 3.0.0.beta8
ileitch Dec 16, 2024
1f9a5e0
Remove pristine shell env (#844)
ileitch Dec 16, 2024
a75b243
Simplify Bazel support
ileitch Dec 17, 2024
3e120ac
Specify periphery binary location as target
ileitch Dec 17, 2024
408b546
Release 3.0.0.beta9
ileitch Dec 17, 2024
b45fc8f
Output stderr for failed commands. Closes #629 #840 (#847)
ileitch Dec 18, 2024
a46a253
Add support for Swift Testing (#848)
ileitch Dec 18, 2024
ed0a874
Add Bazel support to guided setup (#851)
ileitch Dec 19, 2024
7a265ed
Add option to select --retain-objc-annotated to setup guide
ileitch Dec 19, 2024
4b190d8
Sponsor plug
ileitch Dec 19, 2024
aa5594d
Update Linux baseline (#853)
ileitch Dec 21, 2024
f02459d
Add Xcode 16.2 to test matrix (#834)
ileitch Dec 21, 2024
bbc67cb
Update to actions/cache@v4 (#854)
ileitch Dec 21, 2024
5009ad4
Invoke all commands in Bash (#855)
ileitch Dec 22, 2024
eb2b39f
Add Linux docker setup (#852)
ileitch Dec 26, 2024
9f07403
Migrate release script to mise
ileitch Dec 26, 2024
c7661fd
v3 README (#857)
ileitch Dec 27, 2024
2c970b2
Release 3.0.0
ileitch Dec 27, 2024
d5feabd
Don't throw an error when a source file does not exist, closes #858 (…
ileitch Dec 28, 2024
7a7fa35
Release 3.0.1
ileitch Dec 28, 2024
870dfea
Improve Bazel setup instructions (#861)
ileitch Dec 30, 2024
174afcb
Move Bazel instructions to their own section
ileitch Dec 30, 2024
f2ddb6a
Add dev_dependency attr to Bazel usage
ileitch Jan 3, 2025
6ebc6ff
Mark prefix, postfix, and infix operators as function results (#878)
jszumski Feb 14, 2025
933c8c5
Fix warnings in Xcode 16.2 (#879)
jszumski Feb 14, 2025
adfd9ea
Fixes issue where comment commands are ignored for import statements …
jszumski Feb 14, 2025
48063c3
Add the ability to add comment commands on the same line as an import…
jszumski Feb 14, 2025
2c3e535
Update deps (#884)
ileitch Mar 3, 2025
ff14772
Update changelog
ileitch Mar 3, 2025
69555c1
Release 3.0.2
ileitch Mar 3, 2025
fba769b
Modified folder structure of artifact bundle (#886)
coffmark Mar 15, 2025
1fc094d
Test release binary during release
ileitch Mar 15, 2025
b916cd9
Release 3.0.3
ileitch Mar 15, 2025
5c77476
Allow inline comment commands on most declarations (#891)
jszumski Mar 26, 2025
81d2fb5
Ignore unused parameters in universally unavailable functions. Closes…
ileitch Mar 29, 2025
f7d52a0
Enable Bazel cache (#897)
ileitch Mar 29, 2025
e6bf1e4
Add task to write Linux baseline
ileitch Mar 30, 2025
6aeae1d
Fix handling of Xcode projects with quotes in their path and scheme n…
ileitch Mar 30, 2025
0d42e0f
Retain '@_dynamicReplacement' members. Closes #874 (#899)
ileitch Mar 30, 2025
3318436
Apply Linux baseline
ileitch Mar 30, 2025
fdc0489
Merge pull request #2 from peripheryapp/master
rofle100lvl Aug 18, 2025
0906552
Merge master
rofle100lvl Aug 18, 2025
12a37d0
Fix build
rofle100lvl Aug 18, 2025
a7177fb
Merge master
rofle100lvl Aug 18, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 19 additions & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ var targets: [PackageDescription.Target] = [
.executableTarget(
name: "Frontend",
dependencies: [
.target(name: "Scan"),
.target(name: "Shared"),
.target(name: "Configuration"),
.target(name: "SourceGraph"),
Expand Down Expand Up @@ -115,6 +116,18 @@ var targets: [PackageDescription.Target] = [
.product(name: "FilenameMatcher", package: "swift-filename-matcher"),
]
),
.target(
name: "Scan",
dependencies: [
.target(name: "Configuration"),
.target(name: "Indexer"),
.target(name: "PeripheryKit"),
.target(name: "ProjectDrivers"),
.target(name: "Shared"),
.target(name: "SourceGraph"),
.target(name: "Logger"),
]
),
.target(
name: "TestShared",
dependencies: [
Expand Down Expand Up @@ -178,7 +191,12 @@ let package = Package(
platforms: [.macOS(.v13)],
products: [
.executable(name: "periphery", targets: ["Frontend"]),
.library(name: "PeripheryKit", targets: ["PeripheryKit"]),
.library(name: "PeripheryKit", targets: [
"SourceGraph",
"Configuration",
"ProjectDrivers",
"Scan",
]),
],
dependencies: dependencies,
targets: targets,
Expand Down
2 changes: 2 additions & 0 deletions Sources/Frontend/Commands/ScanCommand.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ import Configuration
import Foundation
import Logger
import PeripheryKit
import ProjectDrivers
import Scan
import Shared
import SystemPackage

Expand Down
1 change: 1 addition & 0 deletions Sources/Frontend/GuidedSetup.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import Configuration
import Foundation
import Logger
import ProjectDrivers
import Shared

#if canImport(XcodeSupport)
Expand Down
4 changes: 2 additions & 2 deletions Sources/ProjectDrivers/GenericProjectDriver.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import Shared
import SwiftIndexStore
import SystemPackage

public final class GenericProjectDriver {
final class GenericProjectDriver {
struct GenericConfig: Decodable {
let indexstores: Set<String>
let plists: Set<String>
Expand All @@ -24,7 +24,7 @@ public final class GenericProjectDriver {
private let testTargets: Set<String>
private let configuration: Configuration

public convenience init(genericProjectConfig: FilePath, configuration: Configuration) throws {
convenience init(genericProjectConfig: FilePath, configuration: Configuration) throws {
guard genericProjectConfig.exists else {
throw PeripheryError.pathDoesNotExist(path: genericProjectConfig.string)
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,22 +1,50 @@
import Configuration
import Foundation
import Logger
import ProjectDrivers
import Shared
import SystemPackage

final class Project {
public final class Project {
let kind: ProjectKind

private let configuration: Configuration
private let shell: Shell
private let logger: Logger

convenience init(
public convenience init(
configuration: Configuration,
shell: Shell,
logger: Logger
) throws {
try self.init(
kind: Self.detectKind(configuration: configuration),
configuration: configuration,
shell: shell,
logger: logger
)
}

// periphery:ignore
public init(configuration: Configuration) throws {
self.configuration = configuration
logger = Logger()
shell = Shell(logger: logger)
kind = try Self.detectKind(configuration: configuration)
}

public init(
kind: ProjectKind,
configuration: Configuration,
shell: Shell,
logger: Logger
) {
self.kind = kind
self.configuration = configuration
self.shell = shell
self.logger = logger
}

static func detectKind(configuration: Configuration) throws -> ProjectKind {
var kind: ProjectKind?

if let path = configuration.project {
Expand All @@ -33,22 +61,10 @@ final class Project {
throw PeripheryError.usageError("Failed to identify project in the current directory. For Xcode projects use the '--project' option, and for SPM projects change to the directory containing the Package.swift.")
}

self.init(kind: kind, configuration: configuration, shell: shell, logger: logger)
}

init(
kind: ProjectKind,
configuration: Configuration,
shell: Shell,
logger: Logger
) {
self.kind = kind
self.configuration = configuration
self.shell = shell
self.logger = logger
return kind
}

func driver() throws -> ProjectDriver {
public func driver() throws -> ProjectDriver {
switch kind {
case let .xcode(projectPath):
#if canImport(XcodeSupport)
Expand Down
17 changes: 14 additions & 3 deletions Sources/Frontend/Scan.swift → Sources/Scan/Scan.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,31 @@ import ProjectDrivers
import Shared
import SourceGraph

final class Scan {
public final class Scan {
private let configuration: Configuration
private let logger: Logger
private let graph: SourceGraph
private let swiftVersion: SwiftVersion

required init(configuration: Configuration, logger: Logger, swiftVersion: SwiftVersion) {
public required init(configuration: Configuration, logger: Logger, swiftVersion: SwiftVersion) {
self.configuration = configuration
self.logger = logger
self.swiftVersion = swiftVersion
graph = SourceGraph(configuration: configuration, logger: logger)
}

func perform(project: Project) throws -> [ScanResult] {
// periphery:ignore
public init(
configuration: Configuration,
sourceGraph: SourceGraph
) {
self.configuration = configuration
logger = Logger()
swiftVersion = .init(shell: Shell(logger: logger))
graph = sourceGraph
}

public func perform(project: Project) throws -> [ScanResult] {
if !configuration.indexStorePath.isEmpty {
logger.warn("When using the '--index-store-path' option please ensure that Xcode is not running. False-positives can occur if Xcode writes to the index store while Periphery is running.")

Expand Down
2 changes: 1 addition & 1 deletion Sources/SourceGraph/SourceGraph.swift
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public final class SourceGraph {
private var indexedModules: Set<String> = []
private var unindexedExportedModules: Set<String> = []
private var allDeclarationsByKind: [Declaration.Kind: Set<Declaration>] = [:]
private var allDeclarationsByUsr: [String: Declaration] = [:]
public private(set) var allDeclarationsByUsr: [String: Declaration] = [:]
private var moduleToExportingModules: [String: Set<String>] = [:]

private let configuration: Configuration
Expand Down
Loading