From 115f2b0af5b4090fa67bde8a928dd7dadce8d8e7 Mon Sep 17 00:00:00 2001 From: Gorbenko Roman <45801227+rofle100lvl@users.noreply.github.com> Date: Mon, 30 Sep 2024 17:11:59 +0200 Subject: [PATCH 01/63] Added public api --- Package.swift | 20 +++++++- Sources/Frontend/Commands/ScanCommand.swift | 2 + Sources/Frontend/GuidedSetup.swift | 1 + .../Project.swift | 49 ++++++++++++------- Sources/{Frontend => Scan}/Scan.swift | 16 ++++-- Sources/SourceGraph/SourceGraph.swift | 2 +- 6 files changed, 68 insertions(+), 22 deletions(-) rename Sources/{Frontend => ProjectDrivers}/Project.swift (77%) rename Sources/{Frontend => Scan}/Scan.swift (88%) diff --git a/Package.swift b/Package.swift index 3f4c684e51..2a74ece865 100644 --- a/Package.swift +++ b/Package.swift @@ -34,6 +34,7 @@ var targets: [PackageDescription.Target] = [ .executableTarget( name: "Frontend", dependencies: [ + .target(name: "Scan"), .target(name: "Shared"), .target(name: "Configuration"), .target(name: "SourceGraph"), @@ -114,6 +115,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: [ @@ -176,7 +189,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, diff --git a/Sources/Frontend/Commands/ScanCommand.swift b/Sources/Frontend/Commands/ScanCommand.swift index f0468b8883..8dc85d65d7 100644 --- a/Sources/Frontend/Commands/ScanCommand.swift +++ b/Sources/Frontend/Commands/ScanCommand.swift @@ -3,6 +3,8 @@ import Configuration import Foundation import Logger import PeripheryKit +import ProjectDrivers +import Scan import Shared import SystemPackage diff --git a/Sources/Frontend/GuidedSetup.swift b/Sources/Frontend/GuidedSetup.swift index 7a1ead2e1b..ebdeeeee5e 100644 --- a/Sources/Frontend/GuidedSetup.swift +++ b/Sources/Frontend/GuidedSetup.swift @@ -1,6 +1,7 @@ import Configuration import Foundation import Logger +import ProjectDrivers import Shared #if canImport(XcodeSupport) diff --git a/Sources/Frontend/Project.swift b/Sources/ProjectDrivers/Project.swift similarity index 77% rename from Sources/Frontend/Project.swift rename to Sources/ProjectDrivers/Project.swift index 1f4ba1b0b0..dd69e9d286 100644 --- a/Sources/Frontend/Project.swift +++ b/Sources/ProjectDrivers/Project.swift @@ -1,22 +1,49 @@ 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 + ) + } + + 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 { @@ -33,22 +60,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) diff --git a/Sources/Frontend/Scan.swift b/Sources/Scan/Scan.swift similarity index 88% rename from Sources/Frontend/Scan.swift rename to Sources/Scan/Scan.swift index cfeee64f8b..9cfe06fdf5 100644 --- a/Sources/Frontend/Scan.swift +++ b/Sources/Scan/Scan.swift @@ -7,20 +7,30 @@ 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) } - func perform(project: Project) throws -> [ScanResult] { + 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.") diff --git a/Sources/SourceGraph/SourceGraph.swift b/Sources/SourceGraph/SourceGraph.swift index 65ecd535d6..2f5b5654a6 100644 --- a/Sources/SourceGraph/SourceGraph.swift +++ b/Sources/SourceGraph/SourceGraph.swift @@ -22,7 +22,7 @@ public final class SourceGraph { public private(set) var extensions: [Declaration: Set] = [:] private var allDeclarationsByKind: [Declaration.Kind: Set] = [:] - private var allExplicitDeclarationsByUsr: [String: Declaration] = [:] + public private(set) var allExplicitDeclarationsByUsr: [String: Declaration] = [:] private var moduleToExportingModules: [String: Set] = [:] private let configuration: Configuration From 1424b59317cee32fdf4d8002e54f31430c57a216 Mon Sep 17 00:00:00 2001 From: Gorbenko Roman <45801227+rofle100lvl@users.noreply.github.com> Date: Mon, 30 Sep 2024 17:24:13 +0200 Subject: [PATCH 02/63] Fixed periphery scan --- Sources/ProjectDrivers/BazelProjectDriver.swift | 10 +++++----- Sources/ProjectDrivers/GenericProjectDriver.swift | 4 ++-- Sources/ProjectDrivers/Project.swift | 1 + Sources/Scan/Scan.swift | 1 + 4 files changed, 9 insertions(+), 7 deletions(-) diff --git a/Sources/ProjectDrivers/BazelProjectDriver.swift b/Sources/ProjectDrivers/BazelProjectDriver.swift index 640eab1de8..161cc3f154 100644 --- a/Sources/ProjectDrivers/BazelProjectDriver.swift +++ b/Sources/ProjectDrivers/BazelProjectDriver.swift @@ -4,18 +4,18 @@ import Logger import Shared import SystemPackage -public class BazelProjectDriver: ProjectDriver { - public static var isSupported: Bool { +class BazelProjectDriver: ProjectDriver { + static var isSupported: Bool { FilePath("MODULE.bazel").exists || FilePath("WORKSPACE").exists } - public static func build(configuration: Configuration, shell: Shell, logger: Logger) throws -> Self { + static func build(configuration: Configuration, shell: Shell, logger: Logger) throws -> Self { configuration.bazel = false // Generic project mode is used for the actual scan. configuration.reportExclude.append("**/bazel-out/**/*") return self.init(configuration: configuration, shell: shell, logger: logger) } - private static let topLevelKinds = [ + static let topLevelKinds = [ // rules_apple, iOS "ios_app_clip", "ios_application", @@ -81,7 +81,7 @@ public class BazelProjectDriver: ProjectDriver { self.fileManager = fileManager } - public func build() throws { + func build() throws { guard let executablePath = Bundle.main.executablePath else { fatalError("Expected executable path.") } diff --git a/Sources/ProjectDrivers/GenericProjectDriver.swift b/Sources/ProjectDrivers/GenericProjectDriver.swift index 6807e36434..1ab4be2188 100644 --- a/Sources/ProjectDrivers/GenericProjectDriver.swift +++ b/Sources/ProjectDrivers/GenericProjectDriver.swift @@ -6,7 +6,7 @@ import Shared import SwiftIndexStore import SystemPackage -public final class GenericProjectDriver { +final class GenericProjectDriver { struct GenericConfig: Decodable { let indexstores: Set let plists: Set @@ -24,7 +24,7 @@ public final class GenericProjectDriver { private let testTargets: Set 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) } diff --git a/Sources/ProjectDrivers/Project.swift b/Sources/ProjectDrivers/Project.swift index dd69e9d286..c7610dce61 100644 --- a/Sources/ProjectDrivers/Project.swift +++ b/Sources/ProjectDrivers/Project.swift @@ -24,6 +24,7 @@ public final class Project { ) } + // periphery:ignore public init(configuration: Configuration) throws { self.configuration = configuration logger = Logger() diff --git a/Sources/Scan/Scan.swift b/Sources/Scan/Scan.swift index 9cfe06fdf5..9d6376abf6 100644 --- a/Sources/Scan/Scan.swift +++ b/Sources/Scan/Scan.swift @@ -20,6 +20,7 @@ public final class Scan { graph = SourceGraph(configuration: configuration) } + // periphery:ignore public init( configuration: Configuration, sourceGraph: SourceGraph From a8d6264c828905bd85a349cc5222a6da22ea7265 Mon Sep 17 00:00:00 2001 From: Ian Leitch Date: Fri, 1 Nov 2024 09:24:20 +0100 Subject: [PATCH 03/63] Update deps --- Package.resolved | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Package.resolved b/Package.resolved index e7d665baeb..bd0bb3d720 100644 --- a/Package.resolved +++ b/Package.resolved @@ -68,8 +68,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/apple/swift-system", "state" : { - "revision" : "d2ba781702a1d8285419c15ee62fd734a9437ff5", - "version" : "1.3.2" + "revision" : "c8a44d836fe7913603e246acab7c528c2e780168", + "version" : "1.4.0" } }, { @@ -77,8 +77,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/tuist/xcodeproj", "state" : { - "revision" : "babd2491ea34777bec9d33381a60cd782559b4b3", - "version" : "8.24.1" + "revision" : "2c495492fb6e01de5e718a0fd94e0fb28a307d4d", + "version" : "8.24.7" } }, { From a39f097381dae4b64ef402a1394685de0936a4e8 Mon Sep 17 00:00:00 2001 From: Ian Leitch Date: Fri, 1 Nov 2024 09:46:10 +0100 Subject: [PATCH 04/63] Update changelog --- CHANGELOG.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index b63631d2c4..965f0c7d9a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,20 @@ - None. +## 2.21.2 (2024-11-01) + +##### Breaking + +- None. + +##### Enhancements + +- None. + +##### Bug Fixes + +- Fix parsing of Xcode 16 projects. + ## 2.21.1 (2024-09-28) ##### Breaking From 194aa2ddebd1985d589f3294b4b2c3bb492dbad9 Mon Sep 17 00:00:00 2001 From: Ian Leitch Date: Fri, 13 Dec 2024 11:05:16 +0100 Subject: [PATCH 05/63] Improve Bazel integration (#833) --- .bazelignore | 2 + .bazelversion | 2 +- .github/workflows/test.yml | 24 +- .mise/tasks/benchmark | 20 + .mise/tasks/lint | 1 + .mise/tasks/lint-ci | 1 + BUILD.bazel | 10 +- MODULE.bazel | 27 +- MODULE.bazel.lock | 2001 +++-------------- Package.swift | 3 +- Sources/BUILD.bazel | 277 +++ Sources/Configuration/Configuration.swift | 3 +- Sources/Frontend/Commands/ScanCommand.swift | 10 +- .../ProjectDrivers/BazelProjectDriver.swift | 16 +- Sources/ProjectDrivers/Project.swift | 2 +- .../ProjectDrivers/XcodeProjectDriver.swift | 5 + Sources/Scan/Scan.swift | 6 - Sources/Shared/Shell.swift | 4 +- bazel/extensions.bzl | 4 + bazel/internal/BUILD.bazel | 25 + bazel/internal/bazel_baseline.json | 1 + bazel/internal/extensions.bzl | 10 + bazel/internal/opt.bzl | 47 + bazel/internal/repositories.bzl | 93 + bazel/internal/run.sh | 11 + bazel/internal/scan/BUILD.bazel | 3 + bazel/{ => internal}/scan/scan.bzl | 43 +- bazel/{ => internal}/scan/scan_template.sh | 1 + bazel/rules.bzl | 10 + bazel/scan/BUILD.bazel | 3 - scripts/benchmark | 6 - scripts/gen_bazel_rules.rb | 117 + 32 files changed, 1086 insertions(+), 1702 deletions(-) create mode 100644 .bazelignore create mode 100755 .mise/tasks/benchmark create mode 100644 Sources/BUILD.bazel create mode 100644 bazel/internal/BUILD.bazel create mode 100644 bazel/internal/bazel_baseline.json create mode 100644 bazel/internal/extensions.bzl create mode 100644 bazel/internal/opt.bzl create mode 100644 bazel/internal/repositories.bzl create mode 100755 bazel/internal/run.sh create mode 100644 bazel/internal/scan/BUILD.bazel rename bazel/{ => internal}/scan/scan.bzl (85%) rename bazel/{ => internal}/scan/scan_template.sh (99%) create mode 100644 bazel/rules.bzl delete mode 100644 bazel/scan/BUILD.bazel delete mode 100755 scripts/benchmark create mode 100644 scripts/gen_bazel_rules.rb diff --git a/.bazelignore b/.bazelignore new file mode 100644 index 0000000000..4e05543ca7 --- /dev/null +++ b/.bazelignore @@ -0,0 +1,2 @@ +.build +.git diff --git a/.bazelversion b/.bazelversion index 1502020768..ae9a76b924 100644 --- a/.bazelversion +++ b/.bazelversion @@ -1 +1 @@ -7.3.0 +8.0.0 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index d0708c7ba7..a916470362 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -13,20 +13,29 @@ env: cache_version: 1 jobs: lint: - runs-on: macos-14 + runs-on: macos-15 name: Lint steps: - uses: actions/checkout@master - uses: jdx/mise-action@v2 - run: mise run lint-ci + bazel: + runs-on: macos-15 + name: Bazel + steps: + - uses: actions/checkout@master + - name: Scan + run: bazel run //:periphery -- scan --bazel --quiet --strict --baseline bazel/internal/bazel_baseline.json macOS: strategy: fail-fast: false matrix: - xcode: ["16.0", "15.4", "15.2"] + xcode: ["16.1", "16.0", "15.4", "15.2"] include: + - xcode: "16.1" + macos: macos-15 - xcode: "16.0" - macos: macos-14 + macos: macos-15 - xcode: "15.4" macos: macos-14 - xcode: "15.2" @@ -69,23 +78,20 @@ jobs: include: - swift: "6.0" container: "swift:6.0" - cache-version: 1 - swift: "5.10" container: "swift:5.10" - cache-version: 1 - swift: "5.9" container: "swift:5.9" - cache-version: 1 runs-on: ubuntu-20.04 container: ${{ matrix.container }} name: Linux steps: + - uses: actions/checkout@master - name: Get Swift Version id: get-swift-version run: | echo "::set-output name=version::$(swift -version | head -n 1 | sed s/,// )" shell: bash - - uses: actions/checkout@master - name: Cache resolved dependencies id: cache-resolved-dependencies uses: actions/cache@v2 @@ -93,9 +99,9 @@ jobs: path: | .build Package.resolved - key: ${{ matrix.cache-version }}-${{ runner.os }}-${{ steps.get-swift-version.outputs.version }}-${{ env.cache_version }}-spm-deps-${{ hashFiles('Package.swift', 'Package.resolved') }} + key: ${{ runner.os }}-${{ steps.get-swift-version.outputs.version }}-${{ env.cache_version }}-spm-deps-${{ hashFiles('Package.swift', 'Package.resolved') }} restore-keys: | - ${{ matrix.cache-version }}-${{ runner.os }}-${{ steps.get-swift-version.outputs.version }}-${{ env.cache_version }}-spm-deps- + ${{ runner.os }}-${{ steps.get-swift-version.outputs.version }}-${{ env.cache_version }}-spm-deps- - name: Resolve dependencies if: steps.cache-resolved-dependencies.outputs.cache-hit != 'true' run: ${{ env.swift_package_resolve }} diff --git a/.mise/tasks/benchmark b/.mise/tasks/benchmark new file mode 100755 index 0000000000..5d1d6d798e --- /dev/null +++ b/.mise/tasks/benchmark @@ -0,0 +1,20 @@ +#!/bin/bash +# mise description="Run scan benchmark" +set -eo pipefail + +#USAGE flag "-b --bazel" help="Use binary built by Bazel" + +cmd="" + +if [ "$usage_bazel" = "true" ]; then + echo "INFO: Using Bazel" + bazel build //:periphery + cmd='bazel-bin/Sources/Frontend scan --config /var/tmp/periphery_bazel/periphery.yml --generic-project-config bazel-bin/external/+generated+periphery_generated/rule/project_config.json' +else + make build_arm64 + ./.build/release/periphery scan --quiet + cmd='./.build/release/periphery scan --quiet --skip-build' +fi + +echo $cmd +hyperfine --warmup 3 "${cmd}" diff --git a/.mise/tasks/lint b/.mise/tasks/lint index fbfd782070..25ba893395 100755 --- a/.mise/tasks/lint +++ b/.mise/tasks/lint @@ -4,5 +4,6 @@ set -euo pipefail cd $MISE_PROJECT_ROOT +bazel run //bazel/internal:buildifier.fix swiftformat . swiftlint lint --quiet diff --git a/.mise/tasks/lint-ci b/.mise/tasks/lint-ci index a7cc42efd7..2081dad207 100755 --- a/.mise/tasks/lint-ci +++ b/.mise/tasks/lint-ci @@ -4,5 +4,6 @@ set -euo pipefail cd $MISE_PROJECT_ROOT +bazel run //bazel/internal:buildifier.check swiftformat --quiet --strict . swiftlint lint --quiet --strict diff --git a/BUILD.bazel b/BUILD.bazel index 8b4fc0750d..89742929a3 100644 --- a/BUILD.bazel +++ b/BUILD.bazel @@ -1,7 +1,7 @@ package_group( name = "generated", includes = [ - "@periphery_generated//:package_group" + "@periphery_generated//:package_group", ], ) @@ -10,4 +10,10 @@ package_group( packages = ["//..."], ) -alias(actual = "@periphery_generated//rule:scan", name = "scan") +sh_binary( + name = "periphery", + srcs = ["//bazel/internal:run.sh"], + data = [ + "//Sources:Frontend_opt", + ], +) diff --git a/MODULE.bazel b/MODULE.bazel index 6e52fe13a7..c685528cc6 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -4,9 +4,32 @@ module( compatibility_level = 1, ) -bazel_dep(name = "rules_swift", version = "2.1.1") -bazel_dep(name = "rules_apple", version = "3.8.0") +# Bazel dependencies +bazel_dep(name = "rules_swift", version = "2.3.0") +bazel_dep(name = "rules_apple", version = "3.16.0") bazel_dep(name = "bazel_skylib", version = "1.7.1") +bazel_dep(name = "apple_support", version = "1.17.1") +bazel_dep(name = "platforms", version = "0.0.10") +# Bazel dev dependencies +bazel_dep(name = "buildifier_prebuilt", version = "7.3.1", dev_dependency = True) + +# Swift dependencies +bazel_dep(name = "swift-syntax", version = "600.0.1") +bazel_dep(name = "yams", version = "5.1.3") +bazel_dep(name = "aexml", version = "4.7.0") +bazel_dep(name = "swift_argument_parser", version = "1.5.0") +bazel_dep(name = "swift-indexstore", version = "0.3.0") +bazel_dep(name = "swift-filename-matcher", version = "0.1.2") + +# Extensions generated = use_extension("//bazel:extensions.bzl", "generated") use_repo(generated, "periphery_generated") + +non_module_deps = use_extension("//bazel/internal:extensions.bzl", "non_module_deps") +use_repo( + non_module_deps, + "com_github_apple_swift-system", + "com_github_kylef_pathkit", + "com_github_tuist_xcodeproj", +) diff --git a/MODULE.bazel.lock b/MODULE.bazel.lock index d62726ff7e..62fb25df8d 100644 --- a/MODULE.bazel.lock +++ b/MODULE.bazel.lock @@ -1,1931 +1,656 @@ { - "lockFileVersion": 11, + "lockFileVersion": 16, "registryFileHashes": { "https://bcr.bazel.build/bazel_registry.json": "8a28e4aff06ee60aed2a8c281907fb8bcbf3b753c91fb5a5c57da3215d5b3497", "https://bcr.bazel.build/modules/abseil-cpp/20210324.2/MODULE.bazel": "7cd0312e064fde87c8d1cd79ba06c876bd23630c83466e9500321be55c96ace2", "https://bcr.bazel.build/modules/abseil-cpp/20211102.0/MODULE.bazel": "70390338f7a5106231d20620712f7cccb659cd0e9d073d1991c038eb9fc57589", - "https://bcr.bazel.build/modules/abseil-cpp/20211102.0/source.json": "7e3a9adf473e9af076ae485ed649d5641ad50ec5c11718103f34de03170d94ad", + "https://bcr.bazel.build/modules/abseil-cpp/20230125.1/MODULE.bazel": "89047429cb0207707b2dface14ba7f8df85273d484c2572755be4bab7ce9c3a0", + "https://bcr.bazel.build/modules/abseil-cpp/20230802.0.bcr.1/MODULE.bazel": "1c8cec495288dccd14fdae6e3f95f772c1c91857047a098fad772034264cc8cb", + "https://bcr.bazel.build/modules/abseil-cpp/20230802.0/MODULE.bazel": "d253ae36a8bd9ee3c5955384096ccb6baf16a1b1e93e858370da0a3b94f77c16", + "https://bcr.bazel.build/modules/abseil-cpp/20230802.1/MODULE.bazel": "fa92e2eb41a04df73cdabeec37107316f7e5272650f81d6cc096418fe647b915", + "https://bcr.bazel.build/modules/abseil-cpp/20240116.1/MODULE.bazel": "37bcdb4440fbb61df6a1c296ae01b327f19e9bb521f9b8e26ec854b6f97309ed", + "https://bcr.bazel.build/modules/abseil-cpp/20240116.1/source.json": "9be551b8d4e3ef76875c0d744b5d6a504a27e3ae67bc6b28f46415fd2d2957da", + "https://bcr.bazel.build/modules/aexml/4.7.0/MODULE.bazel": "4030ff1555ade0956c08c74722851fcca0dc02ec7b8e7c61d0bbc4806ec4b2de", + "https://bcr.bazel.build/modules/aexml/4.7.0/source.json": "641c9de95dc10b8bf3685b5de9f9a84e7470ec3e40a09d7ddc9e3c9f2289a931", "https://bcr.bazel.build/modules/apple_support/1.11.1/MODULE.bazel": "1843d7cd8a58369a444fc6000e7304425fba600ff641592161d9f15b179fb896", + "https://bcr.bazel.build/modules/apple_support/1.13.0/MODULE.bazel": "7c8cdea7e031b7f9f67f0b497adf6d2c6a2675e9304ca93a9af6ed84eef5a524", "https://bcr.bazel.build/modules/apple_support/1.15.1/MODULE.bazel": "a0556fefca0b1bb2de8567b8827518f94db6a6e7e7d632b4c48dc5f865bc7c85", - "https://bcr.bazel.build/modules/apple_support/1.15.1/source.json": "517f2b77430084c541bc9be2db63fdcbb7102938c5f64c17ee60ffda2e5cf07b", - "https://bcr.bazel.build/modules/apple_support/1.5.0/MODULE.bazel": "50341a62efbc483e8a2a6aec30994a58749bd7b885e18dd96aa8c33031e558ef", + "https://bcr.bazel.build/modules/apple_support/1.16.0/MODULE.bazel": "e785295d21ccab339c3af131752bfbe50fc33dd8215b357492d05bfad0232400", + "https://bcr.bazel.build/modules/apple_support/1.17.1/MODULE.bazel": "655c922ab1209978a94ef6ca7d9d43e940cd97d9c172fb55f94d91ac53f8610b", + "https://bcr.bazel.build/modules/apple_support/1.17.1/source.json": "6b2b8c74d14e8d485528a938e44bdb72a5ba17632b9e14ef6e68a5ee96c8347f", + "https://bcr.bazel.build/modules/bazel_features/1.1.1/MODULE.bazel": "27b8c79ef57efe08efccbd9dd6ef70d61b4798320b8d3c134fd571f78963dbcd", + "https://bcr.bazel.build/modules/bazel_features/1.10.0/MODULE.bazel": "f75e8807570484a99be90abcd52b5e1f390362c258bcb73106f4544957a48101", "https://bcr.bazel.build/modules/bazel_features/1.11.0/MODULE.bazel": "f9382337dd5a474c3b7d334c2f83e50b6eaedc284253334cf823044a26de03e8", - "https://bcr.bazel.build/modules/bazel_features/1.11.0/source.json": "c9320aa53cd1c441d24bd6b716da087ad7e4ff0d9742a9884587596edfe53015", + "https://bcr.bazel.build/modules/bazel_features/1.15.0/MODULE.bazel": "d38ff6e517149dc509406aca0db3ad1efdd890a85e049585b7234d04238e2a4d", + "https://bcr.bazel.build/modules/bazel_features/1.17.0/MODULE.bazel": "039de32d21b816b47bd42c778e0454217e9c9caac4a3cf8e15c7231ee3ddee4d", + "https://bcr.bazel.build/modules/bazel_features/1.18.0/MODULE.bazel": "1be0ae2557ab3a72a57aeb31b29be347bcdc5d2b1eb1e70f39e3851a7e97041a", + "https://bcr.bazel.build/modules/bazel_features/1.19.0/MODULE.bazel": "59adcdf28230d220f0067b1f435b8537dd033bfff8db21335ef9217919c7fb58", + "https://bcr.bazel.build/modules/bazel_features/1.21.0/MODULE.bazel": "675642261665d8eea09989aa3b8afb5c37627f1be178382c320d1b46afba5e3b", + "https://bcr.bazel.build/modules/bazel_features/1.21.0/source.json": "3e8379efaaef53ce35b7b8ba419df829315a880cb0a030e5bb45c96d6d5ecb5f", "https://bcr.bazel.build/modules/bazel_features/1.3.0/MODULE.bazel": "cdcafe83ec318cda34e02948e81d790aab8df7a929cec6f6969f13a489ccecd9", + "https://bcr.bazel.build/modules/bazel_features/1.4.1/MODULE.bazel": "e45b6bb2350aff3e442ae1111c555e27eac1d915e77775f6fdc4b351b758b5d7", + "https://bcr.bazel.build/modules/bazel_features/1.9.1/MODULE.bazel": "8f679097876a9b609ad1f60249c49d68bfab783dd9be012faf9d82547b14815a", "https://bcr.bazel.build/modules/bazel_skylib/1.0.3/MODULE.bazel": "bcb0fd896384802d1ad283b4e4eb4d718eebd8cb820b0a2c3a347fb971afd9d8", + "https://bcr.bazel.build/modules/bazel_skylib/1.1.1/MODULE.bazel": "1add3e7d93ff2e6998f9e118022c84d163917d912f5afafb3058e3d2f1545b5e", + "https://bcr.bazel.build/modules/bazel_skylib/1.2.0/MODULE.bazel": "44fe84260e454ed94ad326352a698422dbe372b21a1ac9f3eab76eb531223686", "https://bcr.bazel.build/modules/bazel_skylib/1.2.1/MODULE.bazel": "f35baf9da0efe45fa3da1696ae906eea3d615ad41e2e3def4aeb4e8bc0ef9a7a", "https://bcr.bazel.build/modules/bazel_skylib/1.3.0/MODULE.bazel": "20228b92868bf5cfc41bda7afc8a8ba2a543201851de39d990ec957b513579c5", + "https://bcr.bazel.build/modules/bazel_skylib/1.4.1/MODULE.bazel": "a0dcb779424be33100dcae821e9e27e4f2901d9dfd5333efe5ac6a8d7ab75e1d", + "https://bcr.bazel.build/modules/bazel_skylib/1.4.2/MODULE.bazel": "3bd40978e7a1fac911d5989e6b09d8f64921865a45822d8b09e815eaa726a651", + "https://bcr.bazel.build/modules/bazel_skylib/1.5.0/MODULE.bazel": "32880f5e2945ce6a03d1fbd588e9198c0a959bb42297b2cfaf1685b7bc32e138", "https://bcr.bazel.build/modules/bazel_skylib/1.6.1/MODULE.bazel": "8fdee2dbaace6c252131c00e1de4b165dc65af02ea278476187765e1a617b917", + "https://bcr.bazel.build/modules/bazel_skylib/1.7.0/MODULE.bazel": "0db596f4563de7938de764cc8deeabec291f55e8ec15299718b93c4423e9796d", "https://bcr.bazel.build/modules/bazel_skylib/1.7.1/MODULE.bazel": "3120d80c5861aa616222ec015332e5f8d3171e062e3e804a2a0253e1be26e59b", "https://bcr.bazel.build/modules/bazel_skylib/1.7.1/source.json": "f121b43eeefc7c29efbd51b83d08631e2347297c95aac9764a701f2a6a2bb953", + "https://bcr.bazel.build/modules/buildifier_prebuilt/7.3.1/MODULE.bazel": "537faf0ad9f5892910074b8e43b4c91c96f1d5d86b6ed04bdbe40cf68aa48b68", + "https://bcr.bazel.build/modules/buildifier_prebuilt/7.3.1/source.json": "55153a5e6ca9c8a7e266c4b46b951e8a010d25ec6062bc35d5d4f89925796bad", "https://bcr.bazel.build/modules/buildozer/7.1.2/MODULE.bazel": "2e8dd40ede9c454042645fd8d8d0cd1527966aa5c919de86661e62953cd73d84", "https://bcr.bazel.build/modules/buildozer/7.1.2/source.json": "c9028a501d2db85793a6996205c8de120944f50a0d570438fcae0457a5f9d1f8", + "https://bcr.bazel.build/modules/google_benchmark/1.8.2/MODULE.bazel": "a70cf1bba851000ba93b58ae2f6d76490a9feb74192e57ab8e8ff13c34ec50cb", "https://bcr.bazel.build/modules/googletest/1.11.0/MODULE.bazel": "3a83f095183f66345ca86aa13c58b59f9f94a2f81999c093d4eeaa2d262d12f4", - "https://bcr.bazel.build/modules/googletest/1.11.0/source.json": "c73d9ef4268c91bd0c1cd88f1f9dfa08e814b1dbe89b5f594a9f08ba0244d206", + "https://bcr.bazel.build/modules/googletest/1.14.0.bcr.1/MODULE.bazel": "22c31a561553727960057361aa33bf20fb2e98584bc4fec007906e27053f80c6", + "https://bcr.bazel.build/modules/googletest/1.14.0.bcr.1/source.json": "41e9e129f80d8c8bf103a7acc337b76e54fad1214ac0a7084bf24f4cd924b8b4", + "https://bcr.bazel.build/modules/googletest/1.14.0/MODULE.bazel": "cfbcbf3e6eac06ef9d85900f64424708cc08687d1b527f0ef65aa7517af8118f", + "https://bcr.bazel.build/modules/jsoncpp/1.9.5/MODULE.bazel": "31271aedc59e815656f5736f282bb7509a97c7ecb43e927ac1a37966e0578075", + "https://bcr.bazel.build/modules/jsoncpp/1.9.5/source.json": "4108ee5085dd2885a341c7fab149429db457b3169b86eb081fa245eadf69169d", + "https://bcr.bazel.build/modules/libpfm/4.11.0/MODULE.bazel": "45061ff025b301940f1e30d2c16bea596c25b176c8b6b3087e92615adbd52902", "https://bcr.bazel.build/modules/nlohmann_json/3.6.1/MODULE.bazel": "6f7b417dcc794d9add9e556673ad25cb3ba835224290f4f848f8e2db1e1fca74", "https://bcr.bazel.build/modules/nlohmann_json/3.6.1/source.json": "f448c6e8963fdfa7eb831457df83ad63d3d6355018f6574fb017e8169deb43a9", + "https://bcr.bazel.build/modules/platforms/0.0.10/MODULE.bazel": "8cb8efaf200bdeb2150d93e162c40f388529a25852b332cec879373771e48ed5", + "https://bcr.bazel.build/modules/platforms/0.0.10/source.json": "f22828ff4cf021a6b577f1bf6341cb9dcd7965092a439f64fc1bb3b7a5ae4bd5", "https://bcr.bazel.build/modules/platforms/0.0.4/MODULE.bazel": "9b328e31ee156f53f3c416a64f8491f7eb731742655a47c9eec4703a71644aee", "https://bcr.bazel.build/modules/platforms/0.0.5/MODULE.bazel": "5733b54ea419d5eaf7997054bb55f6a1d0b5ff8aedf0176fef9eea44f3acda37", "https://bcr.bazel.build/modules/platforms/0.0.6/MODULE.bazel": "ad6eeef431dc52aefd2d77ed20a4b353f8ebf0f4ecdd26a807d2da5aa8cd0615", "https://bcr.bazel.build/modules/platforms/0.0.7/MODULE.bazel": "72fd4a0ede9ee5c021f6a8dd92b503e089f46c227ba2813ff183b71616034814", + "https://bcr.bazel.build/modules/platforms/0.0.8/MODULE.bazel": "9f142c03e348f6d263719f5074b21ef3adf0b139ee4c5133e2aa35664da9eb2d", "https://bcr.bazel.build/modules/platforms/0.0.9/MODULE.bazel": "4a87a60c927b56ddd67db50c89acaa62f4ce2a1d2149ccb63ffd871d5ce29ebc", - "https://bcr.bazel.build/modules/platforms/0.0.9/source.json": "cd74d854bf16a9e002fb2ca7b1a421f4403cda29f824a765acd3a8c56f8d43e6", "https://bcr.bazel.build/modules/protobuf/21.7/MODULE.bazel": "a5a29bb89544f9b97edce05642fac225a808b5b7be74038ea3640fae2f8e66a7", - "https://bcr.bazel.build/modules/protobuf/21.7/source.json": "bbe500720421e582ff2d18b0802464205138c06056f443184de39fbb8187b09b", + "https://bcr.bazel.build/modules/protobuf/27.0/MODULE.bazel": "7873b60be88844a0a1d8f80b9d5d20cfbd8495a689b8763e76c6372998d3f64c", + "https://bcr.bazel.build/modules/protobuf/27.1/MODULE.bazel": "703a7b614728bb06647f965264967a8ef1c39e09e8f167b3ca0bb1fd80449c0d", + "https://bcr.bazel.build/modules/protobuf/29.0-rc2/MODULE.bazel": "6241d35983510143049943fc0d57937937122baf1b287862f9dc8590fc4c37df", + "https://bcr.bazel.build/modules/protobuf/29.0/MODULE.bazel": "319dc8bf4c679ff87e71b1ccfb5a6e90a6dbc4693501d471f48662ac46d04e4e", + "https://bcr.bazel.build/modules/protobuf/29.0/source.json": "b857f93c796750eef95f0d61ee378f3420d00ee1dd38627b27193aa482f4f981", "https://bcr.bazel.build/modules/protobuf/3.19.0/MODULE.bazel": "6b5fbb433f760a99a22b18b6850ed5784ef0e9928a72668b66e4d7ccd47db9b0", - "https://bcr.bazel.build/modules/protobuf/3.19.6/MODULE.bazel": "9233edc5e1f2ee276a60de3eaa47ac4132302ef9643238f23128fea53ea12858", - "https://bcr.bazel.build/modules/rules_apple/3.8.0/MODULE.bazel": "b0ecef90c460f956e67d36ae42d1879e46ec8f182fa87683b0e53a8f3982dd37", - "https://bcr.bazel.build/modules/rules_apple/3.8.0/source.json": "32d89098572a1f0c77eeb8a24dce8d8a2cae301633f99e3942d580b4b1523724", + "https://bcr.bazel.build/modules/pybind11_bazel/2.11.1/MODULE.bazel": "88af1c246226d87e65be78ed49ecd1e6f5e98648558c14ce99176da041dc378e", + "https://bcr.bazel.build/modules/pybind11_bazel/2.11.1/source.json": "be4789e951dd5301282729fe3d4938995dc4c1a81c2ff150afc9f1b0504c6022", + "https://bcr.bazel.build/modules/re2/2023-09-01/MODULE.bazel": "cb3d511531b16cfc78a225a9e2136007a48cf8a677e4264baeab57fe78a80206", + "https://bcr.bazel.build/modules/re2/2023-09-01/source.json": "e044ce89c2883cd957a2969a43e79f7752f9656f6b20050b62f90ede21ec6eb4", + "https://bcr.bazel.build/modules/rules_android/0.1.1/MODULE.bazel": "48809ab0091b07ad0182defb787c4c5328bd3a278938415c00a7b69b50c4d3a8", + "https://bcr.bazel.build/modules/rules_android/0.1.1/source.json": "e6986b41626ee10bdc864937ffb6d6bf275bb5b9c65120e6137d56e6331f089e", + "https://bcr.bazel.build/modules/rules_apple/3.16.0/MODULE.bazel": "0d1caf0b8375942ce98ea944be754a18874041e4e0459401d925577624d3a54a", + "https://bcr.bazel.build/modules/rules_apple/3.16.0/source.json": "d8b5fe461272018cc07cfafce11fe369c7525330804c37eec5a82f84cd475366", + "https://bcr.bazel.build/modules/rules_apple/3.3.0/MODULE.bazel": "7497a6e08c439493b863de42653868f78207bd26d32a0267423260ae2a1d861a", "https://bcr.bazel.build/modules/rules_cc/0.0.1/MODULE.bazel": "cb2aa0747f84c6c3a78dad4e2049c154f08ab9d166b1273835a8174940365647", + "https://bcr.bazel.build/modules/rules_cc/0.0.10/MODULE.bazel": "ec1705118f7eaedd6e118508d3d26deba2a4e76476ada7e0e3965211be012002", + "https://bcr.bazel.build/modules/rules_cc/0.0.13/MODULE.bazel": "0e8529ed7b323dad0775ff924d2ae5af7640b23553dfcd4d34344c7e7a867191", + "https://bcr.bazel.build/modules/rules_cc/0.0.14/MODULE.bazel": "5e343a3aac88b8d7af3b1b6d2093b55c347b8eefc2e7d1442f7a02dc8fea48ac", + "https://bcr.bazel.build/modules/rules_cc/0.0.15/MODULE.bazel": "6704c35f7b4a72502ee81f61bf88706b54f06b3cbe5558ac17e2e14666cd5dcc", + "https://bcr.bazel.build/modules/rules_cc/0.0.16/MODULE.bazel": "7661303b8fc1b4d7f532e54e9d6565771fea666fbdf839e0a86affcd02defe87", + "https://bcr.bazel.build/modules/rules_cc/0.0.16/source.json": "227e83737046aa4f50015da48e98e0d8ab42fd0ec74d8d653b6cc9f9a357f200", "https://bcr.bazel.build/modules/rules_cc/0.0.2/MODULE.bazel": "6915987c90970493ab97393024c156ea8fb9f3bea953b2f3ec05c34f19b5695c", + "https://bcr.bazel.build/modules/rules_cc/0.0.6/MODULE.bazel": "abf360251023dfe3efcef65ab9d56beefa8394d4176dd29529750e1c57eaa33f", "https://bcr.bazel.build/modules/rules_cc/0.0.8/MODULE.bazel": "964c85c82cfeb6f3855e6a07054fdb159aced38e99a5eecf7bce9d53990afa3e", "https://bcr.bazel.build/modules/rules_cc/0.0.9/MODULE.bazel": "836e76439f354b89afe6a911a7adf59a6b2518fafb174483ad78a2a2fde7b1c5", - "https://bcr.bazel.build/modules/rules_cc/0.0.9/source.json": "1f1ba6fea244b616de4a554a0f4983c91a9301640c8fe0dd1d410254115c8430", + "https://bcr.bazel.build/modules/rules_foreign_cc/0.9.0/MODULE.bazel": "c9e8c682bf75b0e7c704166d79b599f93b72cfca5ad7477df596947891feeef6", + "https://bcr.bazel.build/modules/rules_fuzzing/0.5.2/MODULE.bazel": "40c97d1144356f52905566c55811f13b299453a14ac7769dfba2ac38192337a8", + "https://bcr.bazel.build/modules/rules_fuzzing/0.5.2/source.json": "c8b1e2c717646f1702290959a3302a178fb639d987ab61d548105019f11e527e", "https://bcr.bazel.build/modules/rules_java/4.0.0/MODULE.bazel": "5a78a7ae82cd1a33cef56dc578c7d2a46ed0dca12643ee45edbb8417899e6f74", - "https://bcr.bazel.build/modules/rules_java/7.6.5/MODULE.bazel": "481164be5e02e4cab6e77a36927683263be56b7e36fef918b458d7a8a1ebadb1", - "https://bcr.bazel.build/modules/rules_java/7.6.5/source.json": "a805b889531d1690e3c72a7a7e47a870d00323186a9904b36af83aa3d053ee8d", + "https://bcr.bazel.build/modules/rules_java/5.3.5/MODULE.bazel": "a4ec4f2db570171e3e5eb753276ee4b389bae16b96207e9d3230895c99644b86", + "https://bcr.bazel.build/modules/rules_java/6.0.0/MODULE.bazel": "8a43b7df601a7ec1af61d79345c17b31ea1fedc6711fd4abfd013ea612978e39", + "https://bcr.bazel.build/modules/rules_java/6.4.0/MODULE.bazel": "e986a9fe25aeaa84ac17ca093ef13a4637f6107375f64667a15999f77db6c8f6", + "https://bcr.bazel.build/modules/rules_java/6.5.2/MODULE.bazel": "1d440d262d0e08453fa0c4d8f699ba81609ed0e9a9a0f02cd10b3e7942e61e31", + "https://bcr.bazel.build/modules/rules_java/7.10.0/MODULE.bazel": "530c3beb3067e870561739f1144329a21c851ff771cd752a49e06e3dc9c2e71a", + "https://bcr.bazel.build/modules/rules_java/7.12.2/MODULE.bazel": "579c505165ee757a4280ef83cda0150eea193eed3bef50b1004ba88b99da6de6", + "https://bcr.bazel.build/modules/rules_java/7.2.0/MODULE.bazel": "06c0334c9be61e6cef2c8c84a7800cef502063269a5af25ceb100b192453d4ab", + "https://bcr.bazel.build/modules/rules_java/7.3.2/MODULE.bazel": "50dece891cfdf1741ea230d001aa9c14398062f2b7c066470accace78e412bc2", + "https://bcr.bazel.build/modules/rules_java/7.6.1/MODULE.bazel": "2f14b7e8a1aa2f67ae92bc69d1ec0fa8d9f827c4e17ff5e5f02e91caa3b2d0fe", + "https://bcr.bazel.build/modules/rules_java/8.6.1/MODULE.bazel": "f4808e2ab5b0197f094cabce9f4b006a27766beb6a9975931da07099560ca9c2", + "https://bcr.bazel.build/modules/rules_java/8.6.1/source.json": "f18d9ad3c4c54945bf422ad584fa6c5ca5b3116ff55a5b1bc77e5c1210be5960", "https://bcr.bazel.build/modules/rules_jvm_external/4.4.2/MODULE.bazel": "a56b85e418c83eb1839819f0b515c431010160383306d13ec21959ac412d2fe7", - "https://bcr.bazel.build/modules/rules_jvm_external/4.4.2/source.json": "a075731e1b46bc8425098512d038d416e966ab19684a10a34f4741295642fc35", + "https://bcr.bazel.build/modules/rules_jvm_external/5.1/MODULE.bazel": "33f6f999e03183f7d088c9be518a63467dfd0be94a11d0055fe2d210f89aa909", + "https://bcr.bazel.build/modules/rules_jvm_external/5.2/MODULE.bazel": "d9351ba35217ad0de03816ef3ed63f89d411349353077348a45348b096615036", + "https://bcr.bazel.build/modules/rules_jvm_external/5.3/MODULE.bazel": "bf93870767689637164657731849fb887ad086739bd5d360d90007a581d5527d", + "https://bcr.bazel.build/modules/rules_jvm_external/6.1/MODULE.bazel": "75b5fec090dbd46cf9b7d8ea08cf84a0472d92ba3585b476f44c326eda8059c4", + "https://bcr.bazel.build/modules/rules_jvm_external/6.3/MODULE.bazel": "c998e060b85f71e00de5ec552019347c8bca255062c990ac02d051bb80a38df0", + "https://bcr.bazel.build/modules/rules_jvm_external/6.3/source.json": "6f5f5a5a4419ae4e37c35a5bb0a6ae657ed40b7abc5a5189111b47fcebe43197", + "https://bcr.bazel.build/modules/rules_kotlin/1.9.0/MODULE.bazel": "ef85697305025e5a61f395d4eaede272a5393cee479ace6686dba707de804d59", + "https://bcr.bazel.build/modules/rules_kotlin/1.9.6/MODULE.bazel": "d269a01a18ee74d0335450b10f62c9ed81f2321d7958a2934e44272fe82dcef3", + "https://bcr.bazel.build/modules/rules_kotlin/1.9.6/source.json": "2faa4794364282db7c06600b7e5e34867a564ae91bda7cae7c29c64e9466b7d5", "https://bcr.bazel.build/modules/rules_license/0.0.3/MODULE.bazel": "627e9ab0247f7d1e05736b59dbb1b6871373de5ad31c3011880b4133cafd4bd0", "https://bcr.bazel.build/modules/rules_license/0.0.7/MODULE.bazel": "088fbeb0b6a419005b89cf93fe62d9517c0a2b8bb56af3244af65ecfe37e7d5d", - "https://bcr.bazel.build/modules/rules_license/0.0.7/source.json": "355cc5737a0f294e560d52b1b7a6492d4fff2caf0bef1a315df5a298fca2d34a", + "https://bcr.bazel.build/modules/rules_license/1.0.0/MODULE.bazel": "a7fda60eefdf3d8c827262ba499957e4df06f659330bbe6cdbdb975b768bb65c", + "https://bcr.bazel.build/modules/rules_license/1.0.0/source.json": "a52c89e54cc311196e478f8382df91c15f7a2bfdf4c6cd0e2675cc2ff0b56efb", "https://bcr.bazel.build/modules/rules_pkg/0.7.0/MODULE.bazel": "df99f03fc7934a4737122518bb87e667e62d780b610910f0447665a7e2be62dc", - "https://bcr.bazel.build/modules/rules_pkg/0.7.0/source.json": "c2557066e0c0342223ba592510ad3d812d4963b9024831f7f66fd0584dd8c66c", + "https://bcr.bazel.build/modules/rules_pkg/1.0.1/MODULE.bazel": "5b1df97dbc29623bccdf2b0dcd0f5cb08e2f2c9050aab1092fd39a41e82686ff", + "https://bcr.bazel.build/modules/rules_pkg/1.0.1/source.json": "bd82e5d7b9ce2d31e380dd9f50c111d678c3bdaca190cb76b0e1c71b05e1ba8a", "https://bcr.bazel.build/modules/rules_proto/4.0.0/MODULE.bazel": "a7a7b6ce9bee418c1a760b3d84f83a299ad6952f9903c67f19e4edd964894e06", "https://bcr.bazel.build/modules/rules_proto/5.3.0-21.7/MODULE.bazel": "e8dff86b0971688790ae75528fe1813f71809b5afd57facb44dad9e8eca631b7", - "https://bcr.bazel.build/modules/rules_proto/5.3.0-21.7/source.json": "d57902c052424dfda0e71646cb12668d39c4620ee0544294d9d941e7d12bc3a9", + "https://bcr.bazel.build/modules/rules_proto/6.0.2/MODULE.bazel": "ce916b775a62b90b61888052a416ccdda405212b6aaeb39522f7dc53431a5e73", + "https://bcr.bazel.build/modules/rules_proto/7.0.2/MODULE.bazel": "bf81793bd6d2ad89a37a40693e56c61b0ee30f7a7fdbaf3eabbf5f39de47dea2", + "https://bcr.bazel.build/modules/rules_proto/7.0.2/source.json": "1e5e7260ae32ef4f2b52fd1d0de8d03b606a44c91b694d2f1afb1d3b28a48ce1", "https://bcr.bazel.build/modules/rules_python/0.10.2/MODULE.bazel": "cc82bc96f2997baa545ab3ce73f196d040ffb8756fd2d66125a530031cd90e5f", - "https://bcr.bazel.build/modules/rules_python/0.22.1/MODULE.bazel": "26114f0c0b5e93018c0c066d6673f1a2c3737c7e90af95eff30cfee38d0bbac7", - "https://bcr.bazel.build/modules/rules_python/0.22.1/source.json": "57226905e783bae7c37c2dd662be078728e48fa28ee4324a7eabcafb5a43d014", + "https://bcr.bazel.build/modules/rules_python/0.23.1/MODULE.bazel": "49ffccf0511cb8414de28321f5fcf2a31312b47c40cc21577144b7447f2bf300", + "https://bcr.bazel.build/modules/rules_python/0.25.0/MODULE.bazel": "72f1506841c920a1afec76975b35312410eea3aa7b63267436bfb1dd91d2d382", + "https://bcr.bazel.build/modules/rules_python/0.28.0/MODULE.bazel": "cba2573d870babc976664a912539b320cbaa7114cd3e8f053c720171cde331ed", + "https://bcr.bazel.build/modules/rules_python/0.31.0/MODULE.bazel": "93a43dc47ee570e6ec9f5779b2e64c1476a6ce921c48cc9a1678a91dd5f8fd58", "https://bcr.bazel.build/modules/rules_python/0.4.0/MODULE.bazel": "9208ee05fd48bf09ac60ed269791cf17fb343db56c8226a720fbb1cdf467166c", + "https://bcr.bazel.build/modules/rules_python/0.40.0/MODULE.bazel": "9d1a3cd88ed7d8e39583d9ffe56ae8a244f67783ae89b60caafc9f5cf318ada7", + "https://bcr.bazel.build/modules/rules_python/0.40.0/source.json": "939d4bd2e3110f27bfb360292986bb79fd8dcefb874358ccd6cdaa7bda029320", + "https://bcr.bazel.build/modules/rules_shell/0.2.0/MODULE.bazel": "fda8a652ab3c7d8fee214de05e7a9916d8b28082234e8d2c0094505c5268ed3c", + "https://bcr.bazel.build/modules/rules_shell/0.2.0/source.json": "7f27af3c28037d9701487c4744b5448d26537cc66cdef0d8df7ae85411f8de95", "https://bcr.bazel.build/modules/rules_swift/1.16.0/MODULE.bazel": "4a09f199545a60d09895e8281362b1ff3bb08bbde69c6fc87aff5b92fcc916ca", + "https://bcr.bazel.build/modules/rules_swift/1.18.0/MODULE.bazel": "a6aba73625d0dc64c7b4a1e831549b6e375fbddb9d2dde9d80c9de6ec45b24c9", "https://bcr.bazel.build/modules/rules_swift/2.1.1/MODULE.bazel": "494900a80f944fc7aa61500c2073d9729dff0b764f0e89b824eb746959bc1046", - "https://bcr.bazel.build/modules/rules_swift/2.1.1/source.json": "40fc69dfaac64deddbb75bd99cdac55f4427d9ca0afbe408576a65428427a186", + "https://bcr.bazel.build/modules/rules_swift/2.3.0/MODULE.bazel": "6a7c7cc230b67acc7c19361db13cb8d8e5795f7d5c8a7091d6ac41a279f253fc", + "https://bcr.bazel.build/modules/rules_swift/2.3.0/source.json": "4c39d74e7a2aeecbbf8acdc9a7f81cefab90b1fcfcb92e22c16b8b645c52d0f9", "https://bcr.bazel.build/modules/stardoc/0.5.1/MODULE.bazel": "1a05d92974d0c122f5ccf09291442580317cdd859f07a8655f1db9a60374f9f8", - "https://bcr.bazel.build/modules/stardoc/0.5.1/source.json": "a96f95e02123320aa015b956f29c00cb818fa891ef823d55148e1a362caacf29", + "https://bcr.bazel.build/modules/stardoc/0.5.3/MODULE.bazel": "c7f6948dae6999bf0db32c1858ae345f112cacf98f174c7a8bb707e41b974f1c", + "https://bcr.bazel.build/modules/stardoc/0.5.6/MODULE.bazel": "c43dabc564990eeab55e25ed61c07a1aadafe9ece96a4efabb3f8bf9063b71ef", + "https://bcr.bazel.build/modules/stardoc/0.7.0/MODULE.bazel": "05e3d6d30c099b6770e97da986c53bd31844d7f13d41412480ea265ac9e8079c", + "https://bcr.bazel.build/modules/stardoc/0.7.1/MODULE.bazel": "3548faea4ee5dda5580f9af150e79d0f6aea934fc60c1cc50f4efdd9420759e7", + "https://bcr.bazel.build/modules/stardoc/0.7.1/source.json": "b6500ffcd7b48cd72c29bb67bcac781e12701cc0d6d55d266a652583cfcdab01", + "https://bcr.bazel.build/modules/swift-filename-matcher/0.1.2/MODULE.bazel": "b93f54411684faafe3f5d7139d1895f1d6129ee36d211c1525935ff54c66776c", + "https://bcr.bazel.build/modules/swift-filename-matcher/0.1.2/source.json": "6309dcb0d2c002cd36645202c6de85be77a52c67b68b76ad901bc63ef72820ac", + "https://bcr.bazel.build/modules/swift-indexstore/0.3.0/MODULE.bazel": "e1fcf17160d69cca7636f0f03eca99902577e0299d6f74843fdf2d0c272972ce", + "https://bcr.bazel.build/modules/swift-indexstore/0.3.0/source.json": "0d13a7935be16621f918e68fb7def45100f153df93b7027ad06a7e633c029fab", + "https://bcr.bazel.build/modules/swift-syntax/600.0.1/MODULE.bazel": "f6c886571884e56f979e2d08e27830fb20aea34cb5e518a5a9e47dbf230c6745", + "https://bcr.bazel.build/modules/swift-syntax/600.0.1/source.json": "2256d164120b8ff1dfe39e93dff88be482eb2f665867ed6e99e1ad6be3c9dc49", "https://bcr.bazel.build/modules/swift_argument_parser/1.3.1.1/MODULE.bazel": "5e463fbfba7b1701d957555ed45097d7f984211330106ccd1352c6e0af0dcf91", - "https://bcr.bazel.build/modules/swift_argument_parser/1.3.1.1/source.json": "32bd87e5f4d7acc57c5b2ff7c325ae3061d5e242c0c4c214ae87e0f1c13e54cb", + "https://bcr.bazel.build/modules/swift_argument_parser/1.5.0/MODULE.bazel": "fabd6256994e7dbb7e7f800770f3d0a70b0dc23d7111cf293ff9dc8053ec8d12", + "https://bcr.bazel.build/modules/swift_argument_parser/1.5.0/source.json": "a8b1945eb173459ea00998e804fd4d58dcf1917976981ed51033eaeeb5d10240", "https://bcr.bazel.build/modules/upb/0.0.0-20220923-a547704/MODULE.bazel": "7298990c00040a0e2f121f6c32544bab27d4452f80d9ce51349b1a28f3005c43", - "https://bcr.bazel.build/modules/upb/0.0.0-20220923-a547704/source.json": "f1ef7d3f9e0e26d4b23d1c39b5f5de71f584dd7d1b4ef83d9bbba6ec7a6a6459", + "https://bcr.bazel.build/modules/yams/5.1.3/MODULE.bazel": "5f3b2e674671971092540aafbdbd4953a8fc4348acc8c1cb3e94160fcb4f76af", + "https://bcr.bazel.build/modules/yams/5.1.3/source.json": "f9f54bc0ee648b42b4f385b71b9bf56db9f59774039fe2f1e33f7fe9a15d8874", "https://bcr.bazel.build/modules/zlib/1.2.11/MODULE.bazel": "07b389abc85fdbca459b69e2ec656ae5622873af3f845e1c9d80fe179f3effa0", - "https://bcr.bazel.build/modules/zlib/1.2.12/MODULE.bazel": "3b1a8834ada2a883674be8cbd36ede1b6ec481477ada359cd2d3ddc562340b27", "https://bcr.bazel.build/modules/zlib/1.3.1.bcr.3/MODULE.bazel": "af322bc08976524477c79d1e45e241b6efbeb918c497e8840b8ab116802dda79", - "https://bcr.bazel.build/modules/zlib/1.3.1.bcr.3/source.json": "2be409ac3c7601245958cd4fcdff4288be79ed23bd690b4b951f500d54ee6e7d" + "https://bcr.bazel.build/modules/zlib/1.3.1.bcr.3/source.json": "2be409ac3c7601245958cd4fcdff4288be79ed23bd690b4b951f500d54ee6e7d", + "https://bcr.bazel.build/modules/zlib/1.3.1/MODULE.bazel": "751c9940dcfe869f5f7274e1295422a34623555916eb98c174c1e945594bf198" }, "selectedYankedVersions": {}, "moduleExtensions": { "//bazel:extensions.bzl%generated": { "general": { - "bzlTransitiveDigest": "xZGh+e0CeHqMg70Vh0voNCEZWSMobpYB+Rt98Fb2pdg=", - "usagesDigest": "+tLn28VxrYHSJkd4sij6ZCqx9LBk8tiEaJEOx9zRbFY=", + "bzlTransitiveDigest": "dgFs0JxcnjG85QvYWXzJGeKvxaxpucFtipSkimqsDhI=", + "usagesDigest": "Nc3pLwn+vmH9FKxV1v0U1kKXgBYhp8fPFbCIYKXh9uM=", "recordedFileInputs": {}, "recordedDirentsInputs": {}, "envVariables": {}, "generatedRepoSpecs": { "periphery_generated": { - "bzlFile": "@@//bazel:extensions.bzl", - "ruleClassName": "generated_repo", + "repoRuleId": "@@//bazel:extensions.bzl%generated_repo", "attributes": {} } }, "recordedRepoMappingEntries": [] } }, - "@@apple_support~//crosstool:setup.bzl%apple_cc_configure_extension": { + "//bazel/internal:extensions.bzl%non_module_deps": { "general": { - "bzlTransitiveDigest": "ltCGFbl/LQQZXn/LEMXfKX7pGwyqNiOCHcmiQW0tmjM=", - "usagesDigest": "ij5lME/4DUg8DaFZLtV7DhUetr6zQfacN3Lov679Sig=", + "bzlTransitiveDigest": "EIyMAGMiIP3DDlG38WVEM7me6r5WhJzBFdlkwF0AcVQ=", + "usagesDigest": "sl6dqEn1RWk5V2PmnjnwYyGp4Aw1VOYu/+jBsDth14I=", "recordedFileInputs": {}, "recordedDirentsInputs": {}, "envVariables": {}, "generatedRepoSpecs": { - "local_config_apple_cc": { - "bzlFile": "@@apple_support~//crosstool:setup.bzl", - "ruleClassName": "_apple_cc_autoconf", - "attributes": {} + "com_github_tuist_xcodeproj": { + "repoRuleId": "@@bazel_tools//tools/build_defs/repo:http.bzl%http_archive", + "attributes": { + "build_file_content": "load(\"@rules_swift//swift:swift.bzl\", \"swift_library\")\n\nswift_library(\n name = \"XcodeProj\",\n srcs = glob([\"Sources/XcodeProj/**/*.swift\"]),\n visibility = [\"//visibility:public\"],\n deps = [\n \"@aexml//:AEXML\",\n \"@com_github_kylef_pathkit//:PathKit\",\n ],\n)\n ", + "sha256": "3990868f731888edabcaeacf639f0ee75e2e4430102a4f4bf40b03a60eeafe12", + "strip_prefix": "XcodeProj-8.24.7", + "url": "https://github.com/tuist/XcodeProj/archive/refs/tags/8.24.7.tar.gz" + } }, - "local_config_apple_cc_toolchains": { - "bzlFile": "@@apple_support~//crosstool:setup.bzl", - "ruleClassName": "_apple_cc_autoconf_toolchains", - "attributes": {} - } - }, - "recordedRepoMappingEntries": [ - [ - "apple_support~", - "bazel_tools", - "bazel_tools" - ] - ] - } - }, - "@@platforms//host:extension.bzl%host_platform": { - "general": { - "bzlTransitiveDigest": "xelQcPZH8+tmuOHVjL9vDxMnnQNMlwj0SlvgoqBkm4U=", - "usagesDigest": "meSzxn3DUCcYEhq4HQwExWkWtU4EjriRBQLsZN+Q0SU=", - "recordedFileInputs": {}, - "recordedDirentsInputs": {}, - "envVariables": {}, - "generatedRepoSpecs": { - "host_platform": { - "bzlFile": "@@platforms//host:extension.bzl", - "ruleClassName": "host_platform_repo", - "attributes": {} - } - }, - "recordedRepoMappingEntries": [] - } - }, - "@@rules_apple~//apple:apple.bzl%provisioning_profile_repository_extension": { - "general": { - "bzlTransitiveDigest": "aWE3fIs/Lj9vSbNECh7lz7Ut71sf1LcEobYci5RgRZA=", - "usagesDigest": "7Z64xrb1fqAPagXvp2UBfaPmOBAA3xY4Hi8el9q937Y=", - "recordedFileInputs": {}, - "recordedDirentsInputs": {}, - "envVariables": {}, - "generatedRepoSpecs": { - "local_provisioning_profiles": { - "bzlFile": "@@rules_apple~//apple/internal:local_provisioning_profiles.bzl", - "ruleClassName": "provisioning_profile_repository", - "attributes": {} - } - }, - "recordedRepoMappingEntries": [ - [ - "apple_support~", - "bazel_skylib", - "bazel_skylib~" - ], - [ - "rules_apple~", - "bazel_skylib", - "bazel_skylib~" - ], - [ - "rules_apple~", - "bazel_tools", - "bazel_tools" - ], - [ - "rules_apple~", - "build_bazel_apple_support", - "apple_support~" - ], - [ - "rules_apple~", - "build_bazel_rules_apple", - "rules_apple~" - ], - [ - "rules_apple~", - "build_bazel_rules_swift", - "rules_swift~" - ], - [ - "rules_swift~", - "bazel_skylib", - "bazel_skylib~" - ], - [ - "rules_swift~", - "bazel_tools", - "bazel_tools" - ], - [ - "rules_swift~", - "build_bazel_apple_support", - "apple_support~" - ], - [ - "rules_swift~", - "build_bazel_rules_swift", - "rules_swift~" - ], - [ - "rules_swift~", - "build_bazel_rules_swift_local_config", - "rules_swift~~non_module_deps~build_bazel_rules_swift_local_config" - ] - ] - } - }, - "@@rules_apple~//apple:extensions.bzl%non_module_deps": { - "general": { - "bzlTransitiveDigest": "QqI2oMzsUFfjjZJ8vXoddmaxmqMv4y9PfnRtECtiy8g=", - "usagesDigest": "5TgETTssdLW/3laOoi1ll7cZvUibasVrtvDEorWv/7M=", - "recordedFileInputs": {}, - "recordedDirentsInputs": {}, - "envVariables": {}, - "generatedRepoSpecs": { - "xctestrunner": { - "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", - "ruleClassName": "http_archive", + "com_github_kylef_pathkit": { + "repoRuleId": "@@bazel_tools//tools/build_defs/repo:http.bzl%http_archive", "attributes": { - "urls": [ - "https://github.com/google/xctestrunner/archive/b7698df3d435b6491b4b4c0f9fc7a63fbed5e3a6.tar.gz" - ], - "strip_prefix": "xctestrunner-b7698df3d435b6491b4b4c0f9fc7a63fbed5e3a6", - "sha256": "ae3a063c985a8633cb7eb566db21656f8db8eb9a0edb8c182312c7f0db53730d" + "build_file_content": "load(\"@rules_swift//swift:swift.bzl\", \"swift_library\")\n\nswift_library(\n name = \"PathKit\",\n srcs = glob([\"Sources/**/*.swift\"]),\n visibility = [\"//visibility:public\"],\n)\n ", + "sha256": "fcda78cdf12c1c6430c67273333e060a9195951254230e524df77841a0235dae", + "strip_prefix": "PathKit-1.0.1", + "url": "https://github.com/kylef/PathKit/archive/refs/tags/1.0.1.tar.gz" + } + }, + "com_github_apple_swift-system": { + "repoRuleId": "@@bazel_tools//tools/build_defs/repo:http.bzl%http_archive", + "attributes": { + "build_file_content": "load(\"@rules_swift//swift:swift.bzl\", \"swift_library\", \"swift_test\")\n\nconfig_setting(\n name = \"debug\",\n values = {\"compilation_mode\": \"dbg\"},\n)\n\ncc_library(\n name = \"CSystem\",\n hdrs = glob([\"Sources/CSystem/include/*.h\"]),\n aspect_hints = [\"@rules_swift//swift:auto_module\"],\n defines = select({\n \"@platforms//os:windows\": [\"_CRT_SECURE_NO_WARNINGS\"],\n \"//conditions:default\": [],\n }),\n linkstatic = True,\n tags = [\"swift_module=CSystem\"],\n)\n\nDARWIN_DEFINES = [\"SYSTEM_PACKAGE_DARWIN\"]\n\nswift_library(\n name = \"SystemPackage\",\n srcs = glob([\"Sources/System/**/*.swift\"]),\n defines = [\"SYSTEM_PACKAGE\"] +\n select({\n \"@platforms//os:macos\": DARWIN_DEFINES,\n \"@platforms//os:ios\": DARWIN_DEFINES,\n \"@platforms//os:tvos\": DARWIN_DEFINES,\n \"@platforms//os:watchos\": DARWIN_DEFINES,\n \"@platforms//os:visionos\": DARWIN_DEFINES,\n \"//conditions:default\": [],\n }) +\n select({\n \":debug\": [\"ENABLE_MOCKING\"],\n \"//conditions:default\": [],\n }),\n module_name = \"SystemPackage\",\n visibility = [\"//visibility:public\"],\n deps = [\":CSystem\"],\n)\n ", + "sha256": "799474251c3654b5483c0f49045ff6729e07acebe9d1541aabfbec68d0390457", + "strip_prefix": "swift-system-1.4.0", + "url": "https://github.com/apple/swift-system/archive/refs/tags/1.4.0.tar.gz" } } }, "recordedRepoMappingEntries": [ [ - "rules_apple~", + "", "bazel_tools", "bazel_tools" ] ] } }, - "@@rules_jvm_external~//:extensions.bzl%maven": { + "@@apple_support+//crosstool:setup.bzl%apple_cc_configure_extension": { "general": { - "bzlTransitiveDigest": "06WDcwoMOciaDDX09JBCxhi9KiKFGUIcXpQjCSle5AE=", - "usagesDigest": "UPebZtX4g40+QepdK3oMHged0o0tq6ojKbW84wE6XRA=", - "recordedFileInputs": { - "@@rules_jvm_external~//rules_jvm_external_deps_install.json": "10442a5ae27d9ff4c2003e5ab71643bf0d8b48dcf968b4173fa274c3232a8c06" - }, + "bzlTransitiveDigest": "gMOsQY7zqLH6vNcwyNeAqWPLKKmyJ29OLPdX+FMk+jE=", + "usagesDigest": "yI5Mh2z+Xz7nk0srvgIU8/75tb/cZsZGWgUI/rlzsqo=", + "recordedFileInputs": {}, "recordedDirentsInputs": {}, "envVariables": {}, "generatedRepoSpecs": { - "org_slf4j_slf4j_api_1_7_30": { - "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", - "ruleClassName": "http_file", - "attributes": { - "sha256": "cdba07964d1bb40a0761485c6b1e8c2f8fd9eb1d19c53928ac0d7f9510105c57", - "urls": [ - "https://repo1.maven.org/maven2/org/slf4j/slf4j-api/1.7.30/slf4j-api-1.7.30.jar", - "https://maven.google.com/org/slf4j/slf4j-api/1.7.30/slf4j-api-1.7.30.jar" - ], - "downloaded_file_path": "v1/https/repo1.maven.org/maven2/org/slf4j/slf4j-api/1.7.30/slf4j-api-1.7.30.jar" - } - }, - "com_google_api_grpc_proto_google_common_protos_2_0_1": { - "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", - "ruleClassName": "http_file", - "attributes": { - "sha256": "5ce71656118618731e34a5d4c61aa3a031be23446dc7de8b5a5e77b66ebcd6ef", - "urls": [ - "https://repo1.maven.org/maven2/com/google/api/grpc/proto-google-common-protos/2.0.1/proto-google-common-protos-2.0.1.jar", - "https://maven.google.com/com/google/api/grpc/proto-google-common-protos/2.0.1/proto-google-common-protos-2.0.1.jar" - ], - "downloaded_file_path": "v1/https/repo1.maven.org/maven2/com/google/api/grpc/proto-google-common-protos/2.0.1/proto-google-common-protos-2.0.1.jar" - } - }, - "com_google_api_gax_1_60_0": { - "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", - "ruleClassName": "http_file", - "attributes": { - "sha256": "02f37d4ff1a7b8d71dff8064cf9568aa4f4b61bcc4485085d16130f32afa5a79", - "urls": [ - "https://repo1.maven.org/maven2/com/google/api/gax/1.60.0/gax-1.60.0.jar", - "https://maven.google.com/com/google/api/gax/1.60.0/gax-1.60.0.jar" - ], - "downloaded_file_path": "v1/https/repo1.maven.org/maven2/com/google/api/gax/1.60.0/gax-1.60.0.jar" - } - }, - "com_google_guava_failureaccess_1_0_1": { - "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", - "ruleClassName": "http_file", - "attributes": { - "sha256": "a171ee4c734dd2da837e4b16be9df4661afab72a41adaf31eb84dfdaf936ca26", - "urls": [ - "https://repo1.maven.org/maven2/com/google/guava/failureaccess/1.0.1/failureaccess-1.0.1.jar", - "https://maven.google.com/com/google/guava/failureaccess/1.0.1/failureaccess-1.0.1.jar" - ], - "downloaded_file_path": "v1/https/repo1.maven.org/maven2/com/google/guava/failureaccess/1.0.1/failureaccess-1.0.1.jar" - } - }, - "commons_logging_commons_logging_1_2": { - "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", - "ruleClassName": "http_file", - "attributes": { - "sha256": "daddea1ea0be0f56978ab3006b8ac92834afeefbd9b7e4e6316fca57df0fa636", - "urls": [ - "https://repo1.maven.org/maven2/commons-logging/commons-logging/1.2/commons-logging-1.2.jar", - "https://maven.google.com/commons-logging/commons-logging/1.2/commons-logging-1.2.jar" - ], - "downloaded_file_path": "v1/https/repo1.maven.org/maven2/commons-logging/commons-logging/1.2/commons-logging-1.2.jar" - } - }, - "com_google_http_client_google_http_client_appengine_1_38_0": { - "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", - "ruleClassName": "http_file", - "attributes": { - "sha256": "f97b495fd97ac3a3d59099eb2b55025f4948230da15a076f189b9cff37c6b4d2", - "urls": [ - "https://repo1.maven.org/maven2/com/google/http-client/google-http-client-appengine/1.38.0/google-http-client-appengine-1.38.0.jar", - "https://maven.google.com/com/google/http-client/google-http-client-appengine/1.38.0/google-http-client-appengine-1.38.0.jar" - ], - "downloaded_file_path": "v1/https/repo1.maven.org/maven2/com/google/http-client/google-http-client-appengine/1.38.0/google-http-client-appengine-1.38.0.jar" - } - }, - "com_google_cloud_google_cloud_storage_1_113_4": { - "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", - "ruleClassName": "http_file", - "attributes": { - "sha256": "796833e9bdab80c40bbc820e65087eb8f28c6bfbca194d2e3e00d98cb5bc55d6", - "urls": [ - "https://repo1.maven.org/maven2/com/google/cloud/google-cloud-storage/1.113.4/google-cloud-storage-1.113.4.jar", - "https://maven.google.com/com/google/cloud/google-cloud-storage/1.113.4/google-cloud-storage-1.113.4.jar" - ], - "downloaded_file_path": "v1/https/repo1.maven.org/maven2/com/google/cloud/google-cloud-storage/1.113.4/google-cloud-storage-1.113.4.jar" - } - }, - "io_grpc_grpc_context_1_33_1": { - "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", - "ruleClassName": "http_file", - "attributes": { - "sha256": "99b8aea2b614fe0e61c3676e681259dc43c2de7f64620998e1a8435eb2976496", - "urls": [ - "https://repo1.maven.org/maven2/io/grpc/grpc-context/1.33.1/grpc-context-1.33.1.jar", - "https://maven.google.com/io/grpc/grpc-context/1.33.1/grpc-context-1.33.1.jar" - ], - "downloaded_file_path": "v1/https/repo1.maven.org/maven2/io/grpc/grpc-context/1.33.1/grpc-context-1.33.1.jar" - } - }, - "com_google_api_grpc_proto_google_iam_v1_1_0_3": { - "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", - "ruleClassName": "http_file", - "attributes": { - "sha256": "64cee7383a97e846da8d8e160e6c8fe30561e507260552c59e6ccfc81301fdc8", - "urls": [ - "https://repo1.maven.org/maven2/com/google/api/grpc/proto-google-iam-v1/1.0.3/proto-google-iam-v1-1.0.3.jar", - "https://maven.google.com/com/google/api/grpc/proto-google-iam-v1/1.0.3/proto-google-iam-v1-1.0.3.jar" - ], - "downloaded_file_path": "v1/https/repo1.maven.org/maven2/com/google/api/grpc/proto-google-iam-v1/1.0.3/proto-google-iam-v1-1.0.3.jar" - } - }, - "com_google_api_api_common_1_10_1": { - "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", - "ruleClassName": "http_file", - "attributes": { - "sha256": "2a033f24bb620383eda440ad307cb8077cfec1c7eadc684d65216123a1b9613a", - "urls": [ - "https://repo1.maven.org/maven2/com/google/api/api-common/1.10.1/api-common-1.10.1.jar", - "https://maven.google.com/com/google/api/api-common/1.10.1/api-common-1.10.1.jar" - ], - "downloaded_file_path": "v1/https/repo1.maven.org/maven2/com/google/api/api-common/1.10.1/api-common-1.10.1.jar" - } - }, - "com_google_auth_google_auth_library_oauth2_http_0_22_0": { - "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", - "ruleClassName": "http_file", - "attributes": { - "sha256": "1722d895c42dc42ea1d1f392ddbec1fbb28f7a979022c3a6c29acc39cc777ad1", - "urls": [ - "https://repo1.maven.org/maven2/com/google/auth/google-auth-library-oauth2-http/0.22.0/google-auth-library-oauth2-http-0.22.0.jar", - "https://maven.google.com/com/google/auth/google-auth-library-oauth2-http/0.22.0/google-auth-library-oauth2-http-0.22.0.jar" - ], - "downloaded_file_path": "v1/https/repo1.maven.org/maven2/com/google/auth/google-auth-library-oauth2-http/0.22.0/google-auth-library-oauth2-http-0.22.0.jar" - } - }, - "com_typesafe_netty_netty_reactive_streams_2_0_5": { - "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", - "ruleClassName": "http_file", - "attributes": { - "sha256": "f949849fc8ee75fde468ba3a35df2e04577fa31a2940b83b2a7dc9d14dac13d6", - "urls": [ - "https://repo1.maven.org/maven2/com/typesafe/netty/netty-reactive-streams/2.0.5/netty-reactive-streams-2.0.5.jar", - "https://maven.google.com/com/typesafe/netty/netty-reactive-streams/2.0.5/netty-reactive-streams-2.0.5.jar" - ], - "downloaded_file_path": "v1/https/repo1.maven.org/maven2/com/typesafe/netty/netty-reactive-streams/2.0.5/netty-reactive-streams-2.0.5.jar" - } - }, - "com_typesafe_netty_netty_reactive_streams_http_2_0_5": { - "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", - "ruleClassName": "http_file", - "attributes": { - "sha256": "b39224751ad936758176e9d994230380ade5e9079e7c8ad778e3995779bcf303", - "urls": [ - "https://repo1.maven.org/maven2/com/typesafe/netty/netty-reactive-streams-http/2.0.5/netty-reactive-streams-http-2.0.5.jar", - "https://maven.google.com/com/typesafe/netty/netty-reactive-streams-http/2.0.5/netty-reactive-streams-http-2.0.5.jar" - ], - "downloaded_file_path": "v1/https/repo1.maven.org/maven2/com/typesafe/netty/netty-reactive-streams-http/2.0.5/netty-reactive-streams-http-2.0.5.jar" - } - }, - "javax_annotation_javax_annotation_api_1_3_2": { - "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", - "ruleClassName": "http_file", - "attributes": { - "sha256": "e04ba5195bcd555dc95650f7cc614d151e4bcd52d29a10b8aa2197f3ab89ab9b", - "urls": [ - "https://repo1.maven.org/maven2/javax/annotation/javax.annotation-api/1.3.2/javax.annotation-api-1.3.2.jar", - "https://maven.google.com/javax/annotation/javax.annotation-api/1.3.2/javax.annotation-api-1.3.2.jar" - ], - "downloaded_file_path": "v1/https/repo1.maven.org/maven2/javax/annotation/javax.annotation-api/1.3.2/javax.annotation-api-1.3.2.jar" - } - }, - "com_google_j2objc_j2objc_annotations_1_3": { - "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", - "ruleClassName": "http_file", - "attributes": { - "sha256": "21af30c92267bd6122c0e0b4d20cccb6641a37eaf956c6540ec471d584e64a7b", - "urls": [ - "https://repo1.maven.org/maven2/com/google/j2objc/j2objc-annotations/1.3/j2objc-annotations-1.3.jar", - "https://maven.google.com/com/google/j2objc/j2objc-annotations/1.3/j2objc-annotations-1.3.jar" - ], - "downloaded_file_path": "v1/https/repo1.maven.org/maven2/com/google/j2objc/j2objc-annotations/1.3/j2objc-annotations-1.3.jar" - } - }, - "software_amazon_awssdk_metrics_spi_2_17_183": { - "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", - "ruleClassName": "http_file", - "attributes": { - "sha256": "08a11dc8c4ba464beafbcc7ac05b8c724c1ccb93da99482e82a68540ac704e4a", - "urls": [ - "https://repo1.maven.org/maven2/software/amazon/awssdk/metrics-spi/2.17.183/metrics-spi-2.17.183.jar", - "https://maven.google.com/software/amazon/awssdk/metrics-spi/2.17.183/metrics-spi-2.17.183.jar" - ], - "downloaded_file_path": "v1/https/repo1.maven.org/maven2/software/amazon/awssdk/metrics-spi/2.17.183/metrics-spi-2.17.183.jar" - } - }, - "org_reactivestreams_reactive_streams_1_0_3": { - "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", - "ruleClassName": "http_file", - "attributes": { - "sha256": "1dee0481072d19c929b623e155e14d2f6085dc011529a0a0dbefc84cf571d865", - "urls": [ - "https://repo1.maven.org/maven2/org/reactivestreams/reactive-streams/1.0.3/reactive-streams-1.0.3.jar", - "https://maven.google.com/org/reactivestreams/reactive-streams/1.0.3/reactive-streams-1.0.3.jar" - ], - "downloaded_file_path": "v1/https/repo1.maven.org/maven2/org/reactivestreams/reactive-streams/1.0.3/reactive-streams-1.0.3.jar" - } - }, - "com_google_http_client_google_http_client_jackson2_1_38_0": { - "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", - "ruleClassName": "http_file", - "attributes": { - "sha256": "e6504a82425fcc2168a4ca4175138ddcc085168daed8cdedb86d8f6fdc296e1e", - "urls": [ - "https://repo1.maven.org/maven2/com/google/http-client/google-http-client-jackson2/1.38.0/google-http-client-jackson2-1.38.0.jar", - "https://maven.google.com/com/google/http-client/google-http-client-jackson2/1.38.0/google-http-client-jackson2-1.38.0.jar" - ], - "downloaded_file_path": "v1/https/repo1.maven.org/maven2/com/google/http-client/google-http-client-jackson2/1.38.0/google-http-client-jackson2-1.38.0.jar" - } - }, - "io_netty_netty_transport_4_1_72_Final": { - "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", - "ruleClassName": "http_file", - "attributes": { - "sha256": "c5fb68e9a65b6e8a516adfcb9fa323479ee7b4d9449d8a529d2ecab3d3711d5a", - "urls": [ - "https://repo1.maven.org/maven2/io/netty/netty-transport/4.1.72.Final/netty-transport-4.1.72.Final.jar", - "https://maven.google.com/io/netty/netty-transport/4.1.72.Final/netty-transport-4.1.72.Final.jar" - ], - "downloaded_file_path": "v1/https/repo1.maven.org/maven2/io/netty/netty-transport/4.1.72.Final/netty-transport-4.1.72.Final.jar" - } - }, - "io_netty_netty_codec_http2_4_1_72_Final": { - "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", - "ruleClassName": "http_file", - "attributes": { - "sha256": "c89a70500f59e8563e720aaa808263a514bd9e2bd91ba84eab8c2ccb45f234b2", - "urls": [ - "https://repo1.maven.org/maven2/io/netty/netty-codec-http2/4.1.72.Final/netty-codec-http2-4.1.72.Final.jar", - "https://maven.google.com/io/netty/netty-codec-http2/4.1.72.Final/netty-codec-http2-4.1.72.Final.jar" - ], - "downloaded_file_path": "v1/https/repo1.maven.org/maven2/io/netty/netty-codec-http2/4.1.72.Final/netty-codec-http2-4.1.72.Final.jar" - } - }, - "io_opencensus_opencensus_api_0_24_0": { - "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", - "ruleClassName": "http_file", - "attributes": { - "sha256": "f561b1cc2673844288e596ddf5bb6596868a8472fd2cb8993953fc5c034b2352", - "urls": [ - "https://repo1.maven.org/maven2/io/opencensus/opencensus-api/0.24.0/opencensus-api-0.24.0.jar", - "https://maven.google.com/io/opencensus/opencensus-api/0.24.0/opencensus-api-0.24.0.jar" - ], - "downloaded_file_path": "v1/https/repo1.maven.org/maven2/io/opencensus/opencensus-api/0.24.0/opencensus-api-0.24.0.jar" - } - }, - "rules_jvm_external_deps": { - "bzlFile": "@@rules_jvm_external~//:coursier.bzl", - "ruleClassName": "pinned_coursier_fetch", - "attributes": { - "repositories": [ - "{ \"repo_url\": \"https://repo1.maven.org/maven2\" }" - ], - "artifacts": [ - "{\"artifact\":\"google-cloud-core\",\"group\":\"com.google.cloud\",\"version\":\"1.93.10\"}", - "{\"artifact\":\"google-cloud-storage\",\"group\":\"com.google.cloud\",\"version\":\"1.113.4\"}", - "{\"artifact\":\"gson\",\"group\":\"com.google.code.gson\",\"version\":\"2.9.0\"}", - "{\"artifact\":\"maven-artifact\",\"group\":\"org.apache.maven\",\"version\":\"3.8.6\"}", - "{\"artifact\":\"s3\",\"group\":\"software.amazon.awssdk\",\"version\":\"2.17.183\"}" - ], - "fetch_sources": true, - "fetch_javadoc": false, - "generate_compat_repositories": false, - "maven_install_json": "@@rules_jvm_external~//:rules_jvm_external_deps_install.json", - "override_targets": {}, - "strict_visibility": false, - "strict_visibility_value": [ - "@@//visibility:private" - ], - "jetify": false, - "jetify_include_list": [ - "*" - ], - "additional_netrc_lines": [], - "fail_if_repin_required": false, - "use_starlark_android_rules": false, - "aar_import_bzl_label": "@build_bazel_rules_android//android:rules.bzl", - "duplicate_version_warning": "warn" - } - }, - "org_threeten_threetenbp_1_5_0": { - "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", - "ruleClassName": "http_file", - "attributes": { - "sha256": "dcf9c0f940739f2a825cd8626ff27113459a2f6eb18797c7152f93fff69c264f", - "urls": [ - "https://repo1.maven.org/maven2/org/threeten/threetenbp/1.5.0/threetenbp-1.5.0.jar", - "https://maven.google.com/org/threeten/threetenbp/1.5.0/threetenbp-1.5.0.jar" - ], - "downloaded_file_path": "v1/https/repo1.maven.org/maven2/org/threeten/threetenbp/1.5.0/threetenbp-1.5.0.jar" - } - }, - "software_amazon_awssdk_http_client_spi_2_17_183": { - "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", - "ruleClassName": "http_file", - "attributes": { - "sha256": "fe7120f175df9e47ebcc5d946d7f40110faf2ba0a30364f3b935d5b8a5a6c3c6", - "urls": [ - "https://repo1.maven.org/maven2/software/amazon/awssdk/http-client-spi/2.17.183/http-client-spi-2.17.183.jar", - "https://maven.google.com/software/amazon/awssdk/http-client-spi/2.17.183/http-client-spi-2.17.183.jar" - ], - "downloaded_file_path": "v1/https/repo1.maven.org/maven2/software/amazon/awssdk/http-client-spi/2.17.183/http-client-spi-2.17.183.jar" - } - }, - "software_amazon_awssdk_third_party_jackson_core_2_17_183": { - "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", - "ruleClassName": "http_file", - "attributes": { - "sha256": "1bc27c9960993c20e1ab058012dd1ae04c875eec9f0f08f2b2ca41e578dee9a4", - "urls": [ - "https://repo1.maven.org/maven2/software/amazon/awssdk/third-party-jackson-core/2.17.183/third-party-jackson-core-2.17.183.jar", - "https://maven.google.com/software/amazon/awssdk/third-party-jackson-core/2.17.183/third-party-jackson-core-2.17.183.jar" - ], - "downloaded_file_path": "v1/https/repo1.maven.org/maven2/software/amazon/awssdk/third-party-jackson-core/2.17.183/third-party-jackson-core-2.17.183.jar" - } - }, - "software_amazon_eventstream_eventstream_1_0_1": { - "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", - "ruleClassName": "http_file", - "attributes": { - "sha256": "0c37d8e696117f02c302191b8110b0d0eb20fa412fce34c3a269ec73c16ce822", - "urls": [ - "https://repo1.maven.org/maven2/software/amazon/eventstream/eventstream/1.0.1/eventstream-1.0.1.jar", - "https://maven.google.com/software/amazon/eventstream/eventstream/1.0.1/eventstream-1.0.1.jar" - ], - "downloaded_file_path": "v1/https/repo1.maven.org/maven2/software/amazon/eventstream/eventstream/1.0.1/eventstream-1.0.1.jar" - } - }, - "com_google_oauth_client_google_oauth_client_1_31_1": { - "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", - "ruleClassName": "http_file", - "attributes": { - "sha256": "4ed4e2948251dbda66ce251bd7f3b32cd8570055e5cdb165a3c7aea8f43da0ff", - "urls": [ - "https://repo1.maven.org/maven2/com/google/oauth-client/google-oauth-client/1.31.1/google-oauth-client-1.31.1.jar", - "https://maven.google.com/com/google/oauth-client/google-oauth-client/1.31.1/google-oauth-client-1.31.1.jar" - ], - "downloaded_file_path": "v1/https/repo1.maven.org/maven2/com/google/oauth-client/google-oauth-client/1.31.1/google-oauth-client-1.31.1.jar" - } - }, - "maven": { - "bzlFile": "@@rules_jvm_external~//:coursier.bzl", - "ruleClassName": "coursier_fetch", - "attributes": { - "repositories": [ - "{ \"repo_url\": \"https://repo1.maven.org/maven2\" }" - ], - "artifacts": [ - "{\"artifact\":\"jsr305\",\"group\":\"com.google.code.findbugs\",\"version\":\"3.0.2\"}", - "{\"artifact\":\"gson\",\"group\":\"com.google.code.gson\",\"version\":\"2.8.9\"}", - "{\"artifact\":\"error_prone_annotations\",\"group\":\"com.google.errorprone\",\"version\":\"2.3.2\"}", - "{\"artifact\":\"j2objc-annotations\",\"group\":\"com.google.j2objc\",\"version\":\"1.3\"}", - "{\"artifact\":\"guava\",\"group\":\"com.google.guava\",\"version\":\"31.1-jre\"}", - "{\"artifact\":\"guava-testlib\",\"group\":\"com.google.guava\",\"version\":\"31.1-jre\"}", - "{\"artifact\":\"truth\",\"group\":\"com.google.truth\",\"version\":\"1.1.2\"}", - "{\"artifact\":\"junit\",\"group\":\"junit\",\"version\":\"4.13.2\"}", - "{\"artifact\":\"mockito-core\",\"group\":\"org.mockito\",\"version\":\"4.3.1\"}" - ], - "fail_on_missing_checksum": true, - "fetch_sources": true, - "fetch_javadoc": false, - "use_unsafe_shared_cache": false, - "excluded_artifacts": [], - "generate_compat_repositories": false, - "version_conflict_policy": "default", - "override_targets": {}, - "strict_visibility": false, - "strict_visibility_value": [ - "@@//visibility:private" - ], - "resolve_timeout": 600, - "jetify": false, - "jetify_include_list": [ - "*" - ], - "use_starlark_android_rules": false, - "aar_import_bzl_label": "@build_bazel_rules_android//android:rules.bzl", - "duplicate_version_warning": "warn" - } - }, - "software_amazon_awssdk_aws_xml_protocol_2_17_183": { - "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", - "ruleClassName": "http_file", - "attributes": { - "sha256": "566bba05d49256fa6994efd68fa625ae05a62ea45ee74bb9130d20ea20988363", - "urls": [ - "https://repo1.maven.org/maven2/software/amazon/awssdk/aws-xml-protocol/2.17.183/aws-xml-protocol-2.17.183.jar", - "https://maven.google.com/software/amazon/awssdk/aws-xml-protocol/2.17.183/aws-xml-protocol-2.17.183.jar" - ], - "downloaded_file_path": "v1/https/repo1.maven.org/maven2/software/amazon/awssdk/aws-xml-protocol/2.17.183/aws-xml-protocol-2.17.183.jar" - } - }, - "software_amazon_awssdk_annotations_2_17_183": { - "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", - "ruleClassName": "http_file", - "attributes": { - "sha256": "8e4d72361ca805a0bd8bbd9017cd7ff77c8d170f2dd469c7d52d5653330bb3fd", - "urls": [ - "https://repo1.maven.org/maven2/software/amazon/awssdk/annotations/2.17.183/annotations-2.17.183.jar", - "https://maven.google.com/software/amazon/awssdk/annotations/2.17.183/annotations-2.17.183.jar" - ], - "downloaded_file_path": "v1/https/repo1.maven.org/maven2/software/amazon/awssdk/annotations/2.17.183/annotations-2.17.183.jar" - } - }, - "software_amazon_awssdk_netty_nio_client_2_17_183": { - "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", - "ruleClassName": "http_file", - "attributes": { - "sha256": "a6d356f364c56d7b90006b0b7e503b8630010993a5587ce42e74b10b8dca2238", - "urls": [ - "https://repo1.maven.org/maven2/software/amazon/awssdk/netty-nio-client/2.17.183/netty-nio-client-2.17.183.jar", - "https://maven.google.com/software/amazon/awssdk/netty-nio-client/2.17.183/netty-nio-client-2.17.183.jar" - ], - "downloaded_file_path": "v1/https/repo1.maven.org/maven2/software/amazon/awssdk/netty-nio-client/2.17.183/netty-nio-client-2.17.183.jar" - } - }, - "com_google_auto_value_auto_value_annotations_1_7_4": { - "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", - "ruleClassName": "http_file", - "attributes": { - "sha256": "fedd59b0b4986c342f6ab2d182f2a4ee9fceb2c7e2d5bdc4dc764c92394a23d3", - "urls": [ - "https://repo1.maven.org/maven2/com/google/auto/value/auto-value-annotations/1.7.4/auto-value-annotations-1.7.4.jar", - "https://maven.google.com/com/google/auto/value/auto-value-annotations/1.7.4/auto-value-annotations-1.7.4.jar" - ], - "downloaded_file_path": "v1/https/repo1.maven.org/maven2/com/google/auto/value/auto-value-annotations/1.7.4/auto-value-annotations-1.7.4.jar" - } - }, - "io_netty_netty_transport_native_unix_common_4_1_72_Final": { - "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", - "ruleClassName": "http_file", - "attributes": { - "sha256": "6f8f1cc29b5a234eeee9439a63eb3f03a5994aa540ff555cb0b2c88cefaf6877", - "urls": [ - "https://repo1.maven.org/maven2/io/netty/netty-transport-native-unix-common/4.1.72.Final/netty-transport-native-unix-common-4.1.72.Final.jar", - "https://maven.google.com/io/netty/netty-transport-native-unix-common/4.1.72.Final/netty-transport-native-unix-common-4.1.72.Final.jar" - ], - "downloaded_file_path": "v1/https/repo1.maven.org/maven2/io/netty/netty-transport-native-unix-common/4.1.72.Final/netty-transport-native-unix-common-4.1.72.Final.jar" - } - }, - "io_opencensus_opencensus_contrib_http_util_0_24_0": { - "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", - "ruleClassName": "http_file", - "attributes": { - "sha256": "7155273bbb1ed3d477ea33cf19d7bbc0b285ff395f43b29ae576722cf247000f", - "urls": [ - "https://repo1.maven.org/maven2/io/opencensus/opencensus-contrib-http-util/0.24.0/opencensus-contrib-http-util-0.24.0.jar", - "https://maven.google.com/io/opencensus/opencensus-contrib-http-util/0.24.0/opencensus-contrib-http-util-0.24.0.jar" - ], - "downloaded_file_path": "v1/https/repo1.maven.org/maven2/io/opencensus/opencensus-contrib-http-util/0.24.0/opencensus-contrib-http-util-0.24.0.jar" - } - }, - "com_fasterxml_jackson_core_jackson_core_2_11_3": { - "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", - "ruleClassName": "http_file", - "attributes": { - "sha256": "78cd0a6b936232e06dd3e38da8a0345348a09cd1ff9c4d844c6ee72c75cfc402", - "urls": [ - "https://repo1.maven.org/maven2/com/fasterxml/jackson/core/jackson-core/2.11.3/jackson-core-2.11.3.jar", - "https://maven.google.com/com/fasterxml/jackson/core/jackson-core/2.11.3/jackson-core-2.11.3.jar" - ], - "downloaded_file_path": "v1/https/repo1.maven.org/maven2/com/fasterxml/jackson/core/jackson-core/2.11.3/jackson-core-2.11.3.jar" - } - }, - "com_google_cloud_google_cloud_core_1_93_10": { - "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", - "ruleClassName": "http_file", - "attributes": { - "sha256": "832d74eca66f4601e162a8460d6f59f50d1d23f93c18b02654423b6b0d67c6ea", - "urls": [ - "https://repo1.maven.org/maven2/com/google/cloud/google-cloud-core/1.93.10/google-cloud-core-1.93.10.jar", - "https://maven.google.com/com/google/cloud/google-cloud-core/1.93.10/google-cloud-core-1.93.10.jar" - ], - "downloaded_file_path": "v1/https/repo1.maven.org/maven2/com/google/cloud/google-cloud-core/1.93.10/google-cloud-core-1.93.10.jar" - } - }, - "com_google_auth_google_auth_library_credentials_0_22_0": { - "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", - "ruleClassName": "http_file", - "attributes": { - "sha256": "42c76031276de5b520909e9faf88c5b3c9a722d69ee9cfdafedb1c52c355dfc5", - "urls": [ - "https://repo1.maven.org/maven2/com/google/auth/google-auth-library-credentials/0.22.0/google-auth-library-credentials-0.22.0.jar", - "https://maven.google.com/com/google/auth/google-auth-library-credentials/0.22.0/google-auth-library-credentials-0.22.0.jar" - ], - "downloaded_file_path": "v1/https/repo1.maven.org/maven2/com/google/auth/google-auth-library-credentials/0.22.0/google-auth-library-credentials-0.22.0.jar" - } - }, - "com_google_guava_guava_30_0_android": { - "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", - "ruleClassName": "http_file", - "attributes": { - "sha256": "3345c82c2cc70a0053e8db9031edc6d71625ef0dea6a2c8f5ebd6cb76d2bf843", - "urls": [ - "https://repo1.maven.org/maven2/com/google/guava/guava/30.0-android/guava-30.0-android.jar", - "https://maven.google.com/com/google/guava/guava/30.0-android/guava-30.0-android.jar" - ], - "downloaded_file_path": "v1/https/repo1.maven.org/maven2/com/google/guava/guava/30.0-android/guava-30.0-android.jar" - } - }, - "software_amazon_awssdk_profiles_2_17_183": { - "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", - "ruleClassName": "http_file", - "attributes": { - "sha256": "78833b32fde3f1c5320373b9ea955c1bbc28f2c904010791c4784e610193ee56", - "urls": [ - "https://repo1.maven.org/maven2/software/amazon/awssdk/profiles/2.17.183/profiles-2.17.183.jar", - "https://maven.google.com/software/amazon/awssdk/profiles/2.17.183/profiles-2.17.183.jar" - ], - "downloaded_file_path": "v1/https/repo1.maven.org/maven2/software/amazon/awssdk/profiles/2.17.183/profiles-2.17.183.jar" - } - }, - "org_apache_httpcomponents_httpcore_4_4_13": { - "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", - "ruleClassName": "http_file", - "attributes": { - "sha256": "e06e89d40943245fcfa39ec537cdbfce3762aecde8f9c597780d2b00c2b43424", - "urls": [ - "https://repo1.maven.org/maven2/org/apache/httpcomponents/httpcore/4.4.13/httpcore-4.4.13.jar", - "https://maven.google.com/org/apache/httpcomponents/httpcore/4.4.13/httpcore-4.4.13.jar" - ], - "downloaded_file_path": "v1/https/repo1.maven.org/maven2/org/apache/httpcomponents/httpcore/4.4.13/httpcore-4.4.13.jar" - } - }, - "io_netty_netty_common_4_1_72_Final": { - "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", - "ruleClassName": "http_file", - "attributes": { - "sha256": "8adb4c291260ceb2859a68c49f0adeed36bf49587608e2b81ecff6aaf06025e9", - "urls": [ - "https://repo1.maven.org/maven2/io/netty/netty-common/4.1.72.Final/netty-common-4.1.72.Final.jar", - "https://maven.google.com/io/netty/netty-common/4.1.72.Final/netty-common-4.1.72.Final.jar" - ], - "downloaded_file_path": "v1/https/repo1.maven.org/maven2/io/netty/netty-common/4.1.72.Final/netty-common-4.1.72.Final.jar" - } - }, - "io_netty_netty_transport_classes_epoll_4_1_72_Final": { - "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", - "ruleClassName": "http_file", - "attributes": { - "sha256": "e1528a9751c1285aa7beaf3a1eb0597151716426ce38598ac9bc0891209b9e68", - "urls": [ - "https://repo1.maven.org/maven2/io/netty/netty-transport-classes-epoll/4.1.72.Final/netty-transport-classes-epoll-4.1.72.Final.jar", - "https://maven.google.com/io/netty/netty-transport-classes-epoll/4.1.72.Final/netty-transport-classes-epoll-4.1.72.Final.jar" - ], - "downloaded_file_path": "v1/https/repo1.maven.org/maven2/io/netty/netty-transport-classes-epoll/4.1.72.Final/netty-transport-classes-epoll-4.1.72.Final.jar" - } - }, - "com_google_cloud_google_cloud_core_http_1_93_10": { - "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", - "ruleClassName": "http_file", - "attributes": { - "sha256": "81ac67c14c7c4244d2b7db2607ad352416aca8d3bb2adf338964e8fea25b1b3c", - "urls": [ - "https://repo1.maven.org/maven2/com/google/cloud/google-cloud-core-http/1.93.10/google-cloud-core-http-1.93.10.jar", - "https://maven.google.com/com/google/cloud/google-cloud-core-http/1.93.10/google-cloud-core-http-1.93.10.jar" - ], - "downloaded_file_path": "v1/https/repo1.maven.org/maven2/com/google/cloud/google-cloud-core-http/1.93.10/google-cloud-core-http-1.93.10.jar" - } - }, - "software_amazon_awssdk_utils_2_17_183": { - "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", - "ruleClassName": "http_file", - "attributes": { - "sha256": "7bd849bb5aa71bfdf6b849643736ecab3a7b3f204795804eefe5754104231ec6", - "urls": [ - "https://repo1.maven.org/maven2/software/amazon/awssdk/utils/2.17.183/utils-2.17.183.jar", - "https://maven.google.com/software/amazon/awssdk/utils/2.17.183/utils-2.17.183.jar" - ], - "downloaded_file_path": "v1/https/repo1.maven.org/maven2/software/amazon/awssdk/utils/2.17.183/utils-2.17.183.jar" - } - }, - "org_apache_commons_commons_lang3_3_8_1": { - "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", - "ruleClassName": "http_file", - "attributes": { - "sha256": "dac807f65b07698ff39b1b07bfef3d87ae3fd46d91bbf8a2bc02b2a831616f68", - "urls": [ - "https://repo1.maven.org/maven2/org/apache/commons/commons-lang3/3.8.1/commons-lang3-3.8.1.jar", - "https://maven.google.com/org/apache/commons/commons-lang3/3.8.1/commons-lang3-3.8.1.jar" - ], - "downloaded_file_path": "v1/https/repo1.maven.org/maven2/org/apache/commons/commons-lang3/3.8.1/commons-lang3-3.8.1.jar" - } - }, - "software_amazon_awssdk_aws_core_2_17_183": { - "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", - "ruleClassName": "http_file", - "attributes": { - "sha256": "bccbdbea689a665a702ff19828662d87fb7fe81529df13f02ef1e4c474ea9f93", - "urls": [ - "https://repo1.maven.org/maven2/software/amazon/awssdk/aws-core/2.17.183/aws-core-2.17.183.jar", - "https://maven.google.com/software/amazon/awssdk/aws-core/2.17.183/aws-core-2.17.183.jar" - ], - "downloaded_file_path": "v1/https/repo1.maven.org/maven2/software/amazon/awssdk/aws-core/2.17.183/aws-core-2.17.183.jar" - } - }, - "com_google_api_gax_httpjson_0_77_0": { - "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", - "ruleClassName": "http_file", - "attributes": { - "sha256": "fd4dae47fa016d3b26e8d90b67ddc6c23c4c06e8bcdf085c70310ab7ef324bd6", - "urls": [ - "https://repo1.maven.org/maven2/com/google/api/gax-httpjson/0.77.0/gax-httpjson-0.77.0.jar", - "https://maven.google.com/com/google/api/gax-httpjson/0.77.0/gax-httpjson-0.77.0.jar" - ], - "downloaded_file_path": "v1/https/repo1.maven.org/maven2/com/google/api/gax-httpjson/0.77.0/gax-httpjson-0.77.0.jar" - } - }, - "unpinned_rules_jvm_external_deps": { - "bzlFile": "@@rules_jvm_external~//:coursier.bzl", - "ruleClassName": "coursier_fetch", - "attributes": { - "repositories": [ - "{ \"repo_url\": \"https://repo1.maven.org/maven2\" }" - ], - "artifacts": [ - "{\"artifact\":\"google-cloud-core\",\"group\":\"com.google.cloud\",\"version\":\"1.93.10\"}", - "{\"artifact\":\"google-cloud-storage\",\"group\":\"com.google.cloud\",\"version\":\"1.113.4\"}", - "{\"artifact\":\"gson\",\"group\":\"com.google.code.gson\",\"version\":\"2.9.0\"}", - "{\"artifact\":\"maven-artifact\",\"group\":\"org.apache.maven\",\"version\":\"3.8.6\"}", - "{\"artifact\":\"s3\",\"group\":\"software.amazon.awssdk\",\"version\":\"2.17.183\"}" - ], - "fail_on_missing_checksum": true, - "fetch_sources": true, - "fetch_javadoc": false, - "use_unsafe_shared_cache": false, - "excluded_artifacts": [], - "generate_compat_repositories": false, - "version_conflict_policy": "default", - "override_targets": {}, - "strict_visibility": false, - "strict_visibility_value": [ - "@@//visibility:private" - ], - "maven_install_json": "@@rules_jvm_external~//:rules_jvm_external_deps_install.json", - "resolve_timeout": 600, - "jetify": false, - "jetify_include_list": [ - "*" - ], - "use_starlark_android_rules": false, - "aar_import_bzl_label": "@build_bazel_rules_android//android:rules.bzl", - "duplicate_version_warning": "warn" - } - }, - "software_amazon_awssdk_regions_2_17_183": { - "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", - "ruleClassName": "http_file", - "attributes": { - "sha256": "d3079395f3ffc07d04ffcce16fca29fb5968197f6e9ea3dbff6be297102b40a5", - "urls": [ - "https://repo1.maven.org/maven2/software/amazon/awssdk/regions/2.17.183/regions-2.17.183.jar", - "https://maven.google.com/software/amazon/awssdk/regions/2.17.183/regions-2.17.183.jar" - ], - "downloaded_file_path": "v1/https/repo1.maven.org/maven2/software/amazon/awssdk/regions/2.17.183/regions-2.17.183.jar" - } - }, - "com_google_errorprone_error_prone_annotations_2_4_0": { - "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", - "ruleClassName": "http_file", - "attributes": { - "sha256": "5f2a0648230a662e8be049df308d583d7369f13af683e44ddf5829b6d741a228", - "urls": [ - "https://repo1.maven.org/maven2/com/google/errorprone/error_prone_annotations/2.4.0/error_prone_annotations-2.4.0.jar", - "https://maven.google.com/com/google/errorprone/error_prone_annotations/2.4.0/error_prone_annotations-2.4.0.jar" - ], - "downloaded_file_path": "v1/https/repo1.maven.org/maven2/com/google/errorprone/error_prone_annotations/2.4.0/error_prone_annotations-2.4.0.jar" - } - }, - "io_netty_netty_handler_4_1_72_Final": { - "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", - "ruleClassName": "http_file", - "attributes": { - "sha256": "9cb6012af7e06361d738ac4e3bdc49a158f8cf87d9dee0f2744056b7d99c28d5", - "urls": [ - "https://repo1.maven.org/maven2/io/netty/netty-handler/4.1.72.Final/netty-handler-4.1.72.Final.jar", - "https://maven.google.com/io/netty/netty-handler/4.1.72.Final/netty-handler-4.1.72.Final.jar" - ], - "downloaded_file_path": "v1/https/repo1.maven.org/maven2/io/netty/netty-handler/4.1.72.Final/netty-handler-4.1.72.Final.jar" - } - }, - "software_amazon_awssdk_aws_query_protocol_2_17_183": { - "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", - "ruleClassName": "http_file", - "attributes": { - "sha256": "4dace03c76f80f3dec920cb3dedb2a95984c4366ef4fda728660cb90bed74848", - "urls": [ - "https://repo1.maven.org/maven2/software/amazon/awssdk/aws-query-protocol/2.17.183/aws-query-protocol-2.17.183.jar", - "https://maven.google.com/software/amazon/awssdk/aws-query-protocol/2.17.183/aws-query-protocol-2.17.183.jar" - ], - "downloaded_file_path": "v1/https/repo1.maven.org/maven2/software/amazon/awssdk/aws-query-protocol/2.17.183/aws-query-protocol-2.17.183.jar" - } - }, - "io_netty_netty_codec_http_4_1_72_Final": { - "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", - "ruleClassName": "http_file", - "attributes": { - "sha256": "fa6fec88010bfaf6a7415b5364671b6b18ffb6b35a986ab97b423fd8c3a0174b", - "urls": [ - "https://repo1.maven.org/maven2/io/netty/netty-codec-http/4.1.72.Final/netty-codec-http-4.1.72.Final.jar", - "https://maven.google.com/io/netty/netty-codec-http/4.1.72.Final/netty-codec-http-4.1.72.Final.jar" - ], - "downloaded_file_path": "v1/https/repo1.maven.org/maven2/io/netty/netty-codec-http/4.1.72.Final/netty-codec-http-4.1.72.Final.jar" - } - }, - "io_netty_netty_resolver_4_1_72_Final": { - "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", - "ruleClassName": "http_file", - "attributes": { - "sha256": "6474598aab7cc9d8d6cfa06c05bd1b19adbf7f8451dbdd73070b33a6c60b1b90", - "urls": [ - "https://repo1.maven.org/maven2/io/netty/netty-resolver/4.1.72.Final/netty-resolver-4.1.72.Final.jar", - "https://maven.google.com/io/netty/netty-resolver/4.1.72.Final/netty-resolver-4.1.72.Final.jar" - ], - "downloaded_file_path": "v1/https/repo1.maven.org/maven2/io/netty/netty-resolver/4.1.72.Final/netty-resolver-4.1.72.Final.jar" - } - }, - "software_amazon_awssdk_protocol_core_2_17_183": { - "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", - "ruleClassName": "http_file", - "attributes": { - "sha256": "10e7c4faa1f05e2d73055d0390dbd0bb6450e2e6cb85beda051b1e4693c826ce", - "urls": [ - "https://repo1.maven.org/maven2/software/amazon/awssdk/protocol-core/2.17.183/protocol-core-2.17.183.jar", - "https://maven.google.com/software/amazon/awssdk/protocol-core/2.17.183/protocol-core-2.17.183.jar" - ], - "downloaded_file_path": "v1/https/repo1.maven.org/maven2/software/amazon/awssdk/protocol-core/2.17.183/protocol-core-2.17.183.jar" - } - }, - "org_checkerframework_checker_compat_qual_2_5_5": { - "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", - "ruleClassName": "http_file", - "attributes": { - "sha256": "11d134b245e9cacc474514d2d66b5b8618f8039a1465cdc55bbc0b34e0008b7a", - "urls": [ - "https://repo1.maven.org/maven2/org/checkerframework/checker-compat-qual/2.5.5/checker-compat-qual-2.5.5.jar", - "https://maven.google.com/org/checkerframework/checker-compat-qual/2.5.5/checker-compat-qual-2.5.5.jar" - ], - "downloaded_file_path": "v1/https/repo1.maven.org/maven2/org/checkerframework/checker-compat-qual/2.5.5/checker-compat-qual-2.5.5.jar" - } - }, - "com_google_apis_google_api_services_storage_v1_rev20200927_1_30_10": { - "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", - "ruleClassName": "http_file", - "attributes": { - "sha256": "52d26a9d105f8d8a0850807285f307a76cea8f3e0cdb2be4d3b15b1adfa77351", - "urls": [ - "https://repo1.maven.org/maven2/com/google/apis/google-api-services-storage/v1-rev20200927-1.30.10/google-api-services-storage-v1-rev20200927-1.30.10.jar", - "https://maven.google.com/com/google/apis/google-api-services-storage/v1-rev20200927-1.30.10/google-api-services-storage-v1-rev20200927-1.30.10.jar" - ], - "downloaded_file_path": "v1/https/repo1.maven.org/maven2/com/google/apis/google-api-services-storage/v1-rev20200927-1.30.10/google-api-services-storage-v1-rev20200927-1.30.10.jar" - } - }, - "com_google_api_client_google_api_client_1_30_11": { - "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", - "ruleClassName": "http_file", - "attributes": { - "sha256": "ee6f97865cc7de6c7c80955c3f37372cf3887bd75e4fc06f1058a6b4cd9bf4da", - "urls": [ - "https://repo1.maven.org/maven2/com/google/api-client/google-api-client/1.30.11/google-api-client-1.30.11.jar", - "https://maven.google.com/com/google/api-client/google-api-client/1.30.11/google-api-client-1.30.11.jar" - ], - "downloaded_file_path": "v1/https/repo1.maven.org/maven2/com/google/api-client/google-api-client/1.30.11/google-api-client-1.30.11.jar" - } - }, - "software_amazon_awssdk_s3_2_17_183": { - "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", - "ruleClassName": "http_file", - "attributes": { - "sha256": "ab073b91107a9e4ed9f030314077d137fe627e055ad895fabb036980a050e360", - "urls": [ - "https://repo1.maven.org/maven2/software/amazon/awssdk/s3/2.17.183/s3-2.17.183.jar", - "https://maven.google.com/software/amazon/awssdk/s3/2.17.183/s3-2.17.183.jar" - ], - "downloaded_file_path": "v1/https/repo1.maven.org/maven2/software/amazon/awssdk/s3/2.17.183/s3-2.17.183.jar" - } - }, - "org_apache_maven_maven_artifact_3_8_6": { - "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", - "ruleClassName": "http_file", - "attributes": { - "sha256": "de22a4c6f54fe31276a823b1bbd3adfd6823529e732f431b5eff0852c2b9252b", - "urls": [ - "https://repo1.maven.org/maven2/org/apache/maven/maven-artifact/3.8.6/maven-artifact-3.8.6.jar", - "https://maven.google.com/org/apache/maven/maven-artifact/3.8.6/maven-artifact-3.8.6.jar" - ], - "downloaded_file_path": "v1/https/repo1.maven.org/maven2/org/apache/maven/maven-artifact/3.8.6/maven-artifact-3.8.6.jar" - } - }, - "org_apache_httpcomponents_httpclient_4_5_13": { - "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", - "ruleClassName": "http_file", - "attributes": { - "sha256": "6fe9026a566c6a5001608cf3fc32196641f6c1e5e1986d1037ccdbd5f31ef743", - "urls": [ - "https://repo1.maven.org/maven2/org/apache/httpcomponents/httpclient/4.5.13/httpclient-4.5.13.jar", - "https://maven.google.com/org/apache/httpcomponents/httpclient/4.5.13/httpclient-4.5.13.jar" - ], - "downloaded_file_path": "v1/https/repo1.maven.org/maven2/org/apache/httpcomponents/httpclient/4.5.13/httpclient-4.5.13.jar" - } - }, - "com_google_guava_listenablefuture_9999_0_empty_to_avoid_conflict_with_guava": { - "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", - "ruleClassName": "http_file", - "attributes": { - "sha256": "b372a037d4230aa57fbeffdef30fd6123f9c0c2db85d0aced00c91b974f33f99", - "urls": [ - "https://repo1.maven.org/maven2/com/google/guava/listenablefuture/9999.0-empty-to-avoid-conflict-with-guava/listenablefuture-9999.0-empty-to-avoid-conflict-with-guava.jar", - "https://maven.google.com/com/google/guava/listenablefuture/9999.0-empty-to-avoid-conflict-with-guava/listenablefuture-9999.0-empty-to-avoid-conflict-with-guava.jar" - ], - "downloaded_file_path": "v1/https/repo1.maven.org/maven2/com/google/guava/listenablefuture/9999.0-empty-to-avoid-conflict-with-guava/listenablefuture-9999.0-empty-to-avoid-conflict-with-guava.jar" - } - }, - "com_google_http_client_google_http_client_1_38_0": { - "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", - "ruleClassName": "http_file", - "attributes": { - "sha256": "411f4a42519b6b78bdc0fcfdf74c9edcef0ee97afa4a667abe04045a508d6302", - "urls": [ - "https://repo1.maven.org/maven2/com/google/http-client/google-http-client/1.38.0/google-http-client-1.38.0.jar", - "https://maven.google.com/com/google/http-client/google-http-client/1.38.0/google-http-client-1.38.0.jar" - ], - "downloaded_file_path": "v1/https/repo1.maven.org/maven2/com/google/http-client/google-http-client/1.38.0/google-http-client-1.38.0.jar" - } - }, - "software_amazon_awssdk_apache_client_2_17_183": { - "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", - "ruleClassName": "http_file", - "attributes": { - "sha256": "78ceae502fce6a97bbe5ff8f6a010a52ab7ea3ae66cb1a4122e18185fce45022", - "urls": [ - "https://repo1.maven.org/maven2/software/amazon/awssdk/apache-client/2.17.183/apache-client-2.17.183.jar", - "https://maven.google.com/software/amazon/awssdk/apache-client/2.17.183/apache-client-2.17.183.jar" - ], - "downloaded_file_path": "v1/https/repo1.maven.org/maven2/software/amazon/awssdk/apache-client/2.17.183/apache-client-2.17.183.jar" - } - }, - "software_amazon_awssdk_arns_2_17_183": { - "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", - "ruleClassName": "http_file", - "attributes": { - "sha256": "659a185e191d66c71de81209490e66abeaccae208ea7b2831a738670823447aa", - "urls": [ - "https://repo1.maven.org/maven2/software/amazon/awssdk/arns/2.17.183/arns-2.17.183.jar", - "https://maven.google.com/software/amazon/awssdk/arns/2.17.183/arns-2.17.183.jar" - ], - "downloaded_file_path": "v1/https/repo1.maven.org/maven2/software/amazon/awssdk/arns/2.17.183/arns-2.17.183.jar" - } - }, - "com_google_code_gson_gson_2_9_0": { - "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", - "ruleClassName": "http_file", - "attributes": { - "sha256": "c96d60551331a196dac54b745aa642cd078ef89b6f267146b705f2c2cbef052d", - "urls": [ - "https://repo1.maven.org/maven2/com/google/code/gson/gson/2.9.0/gson-2.9.0.jar", - "https://maven.google.com/com/google/code/gson/gson/2.9.0/gson-2.9.0.jar" - ], - "downloaded_file_path": "v1/https/repo1.maven.org/maven2/com/google/code/gson/gson/2.9.0/gson-2.9.0.jar" - } + "local_config_apple_cc_toolchains": { + "repoRuleId": "@@apple_support+//crosstool:setup.bzl%_apple_cc_autoconf_toolchains", + "attributes": {} }, - "io_netty_netty_buffer_4_1_72_Final": { - "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", - "ruleClassName": "http_file", + "local_config_apple_cc": { + "repoRuleId": "@@apple_support+//crosstool:setup.bzl%_apple_cc_autoconf", + "attributes": {} + } + }, + "recordedRepoMappingEntries": [ + [ + "apple_support+", + "bazel_tools", + "bazel_tools" + ], + [ + "bazel_tools", + "rules_cc", + "rules_cc+" + ] + ] + } + }, + "@@buildifier_prebuilt+//:defs.bzl%buildifier_prebuilt_deps_extension": { + "general": { + "bzlTransitiveDigest": "qC/0s/MZ8q8Sf6/o/iJNMssZNgXa3CjJ7vEVbpHFQRs=", + "usagesDigest": "eWMDBEn8E8CrwAPXrlrjIap2pseSMhxDyDdrntHBOOE=", + "recordedFileInputs": {}, + "recordedDirentsInputs": {}, + "envVariables": {}, + "generatedRepoSpecs": { + "buildifier_darwin_amd64": { + "repoRuleId": "@@bazel_tools//tools/build_defs/repo:http.bzl%http_file", "attributes": { - "sha256": "568ff7cd9d8e2284ec980730c88924f686642929f8f219a74518b4e64755f3a1", "urls": [ - "https://repo1.maven.org/maven2/io/netty/netty-buffer/4.1.72.Final/netty-buffer-4.1.72.Final.jar", - "https://maven.google.com/io/netty/netty-buffer/4.1.72.Final/netty-buffer-4.1.72.Final.jar" + "https://github.com/bazelbuild/buildtools/releases/download/v7.3.1/buildifier-darwin-amd64" ], - "downloaded_file_path": "v1/https/repo1.maven.org/maven2/io/netty/netty-buffer/4.1.72.Final/netty-buffer-4.1.72.Final.jar" + "downloaded_file_path": "buildifier", + "executable": true, + "sha256": "375f823103d01620aaec20a0c29c6cbca99f4fd0725ae30b93655c6704f44d71" } }, - "com_google_code_findbugs_jsr305_3_0_2": { - "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", - "ruleClassName": "http_file", + "buildifier_darwin_arm64": { + "repoRuleId": "@@bazel_tools//tools/build_defs/repo:http.bzl%http_file", "attributes": { - "sha256": "766ad2a0783f2687962c8ad74ceecc38a28b9f72a2d085ee438b7813e928d0c7", "urls": [ - "https://repo1.maven.org/maven2/com/google/code/findbugs/jsr305/3.0.2/jsr305-3.0.2.jar", - "https://maven.google.com/com/google/code/findbugs/jsr305/3.0.2/jsr305-3.0.2.jar" + "https://github.com/bazelbuild/buildtools/releases/download/v7.3.1/buildifier-darwin-arm64" ], - "downloaded_file_path": "v1/https/repo1.maven.org/maven2/com/google/code/findbugs/jsr305/3.0.2/jsr305-3.0.2.jar" + "downloaded_file_path": "buildifier", + "executable": true, + "sha256": "5a6afc6ac7a09f5455ba0b89bd99d5ae23b4174dc5dc9d6c0ed5ce8caac3f813" } }, - "commons_codec_commons_codec_1_11": { - "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", - "ruleClassName": "http_file", + "buildifier_linux_amd64": { + "repoRuleId": "@@bazel_tools//tools/build_defs/repo:http.bzl%http_file", "attributes": { - "sha256": "e599d5318e97aa48f42136a2927e6dfa4e8881dff0e6c8e3109ddbbff51d7b7d", "urls": [ - "https://repo1.maven.org/maven2/commons-codec/commons-codec/1.11/commons-codec-1.11.jar", - "https://maven.google.com/commons-codec/commons-codec/1.11/commons-codec-1.11.jar" + "https://github.com/bazelbuild/buildtools/releases/download/v7.3.1/buildifier-linux-amd64" ], - "downloaded_file_path": "v1/https/repo1.maven.org/maven2/commons-codec/commons-codec/1.11/commons-codec-1.11.jar" + "downloaded_file_path": "buildifier", + "executable": true, + "sha256": "5474cc5128a74e806783d54081f581662c4be8ae65022f557e9281ed5dc88009" } }, - "software_amazon_awssdk_auth_2_17_183": { - "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", - "ruleClassName": "http_file", + "buildifier_linux_arm64": { + "repoRuleId": "@@bazel_tools//tools/build_defs/repo:http.bzl%http_file", "attributes": { - "sha256": "8820c6636e5c14efc29399fb5565ce50212b0c1f4ed720a025a2c402d54e0978", "urls": [ - "https://repo1.maven.org/maven2/software/amazon/awssdk/auth/2.17.183/auth-2.17.183.jar", - "https://maven.google.com/software/amazon/awssdk/auth/2.17.183/auth-2.17.183.jar" + "https://github.com/bazelbuild/buildtools/releases/download/v7.3.1/buildifier-linux-arm64" ], - "downloaded_file_path": "v1/https/repo1.maven.org/maven2/software/amazon/awssdk/auth/2.17.183/auth-2.17.183.jar" + "downloaded_file_path": "buildifier", + "executable": true, + "sha256": "0bf86c4bfffaf4f08eed77bde5b2082e4ae5039a11e2e8b03984c173c34a561c" } }, - "software_amazon_awssdk_json_utils_2_17_183": { - "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", - "ruleClassName": "http_file", + "buildifier_windows_amd64": { + "repoRuleId": "@@bazel_tools//tools/build_defs/repo:http.bzl%http_file", "attributes": { - "sha256": "51ab7f550adc06afcb49f5270cdf690f1bfaaee243abaa5d978095e2a1e4e1a5", "urls": [ - "https://repo1.maven.org/maven2/software/amazon/awssdk/json-utils/2.17.183/json-utils-2.17.183.jar", - "https://maven.google.com/software/amazon/awssdk/json-utils/2.17.183/json-utils-2.17.183.jar" + "https://github.com/bazelbuild/buildtools/releases/download/v7.3.1/buildifier-windows-amd64.exe" ], - "downloaded_file_path": "v1/https/repo1.maven.org/maven2/software/amazon/awssdk/json-utils/2.17.183/json-utils-2.17.183.jar" + "downloaded_file_path": "buildifier.exe", + "executable": true, + "sha256": "370cd576075ad29930a82f5de132f1a1de4084c784a82514bd4da80c85acf4a8" } }, - "org_codehaus_plexus_plexus_utils_3_3_1": { - "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", - "ruleClassName": "http_file", + "buildozer_darwin_amd64": { + "repoRuleId": "@@bazel_tools//tools/build_defs/repo:http.bzl%http_file", "attributes": { - "sha256": "4b570fcdbe5a894f249d2eb9b929358a9c88c3e548d227a80010461930222f2a", "urls": [ - "https://repo1.maven.org/maven2/org/codehaus/plexus/plexus-utils/3.3.1/plexus-utils-3.3.1.jar", - "https://maven.google.com/org/codehaus/plexus/plexus-utils/3.3.1/plexus-utils-3.3.1.jar" + "https://github.com/bazelbuild/buildtools/releases/download/v7.3.1/buildozer-darwin-amd64" ], - "downloaded_file_path": "v1/https/repo1.maven.org/maven2/org/codehaus/plexus/plexus-utils/3.3.1/plexus-utils-3.3.1.jar" + "downloaded_file_path": "buildozer", + "executable": true, + "sha256": "854c9583efc166602276802658cef3f224d60898cfaa60630b33d328db3b0de2" } }, - "com_google_protobuf_protobuf_java_util_3_13_0": { - "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", - "ruleClassName": "http_file", + "buildozer_darwin_arm64": { + "repoRuleId": "@@bazel_tools//tools/build_defs/repo:http.bzl%http_file", "attributes": { - "sha256": "d9de66b8c9445905dfa7064f6d5213d47ce88a20d34e21d83c4a94a229e14e62", "urls": [ - "https://repo1.maven.org/maven2/com/google/protobuf/protobuf-java-util/3.13.0/protobuf-java-util-3.13.0.jar", - "https://maven.google.com/com/google/protobuf/protobuf-java-util/3.13.0/protobuf-java-util-3.13.0.jar" + "https://github.com/bazelbuild/buildtools/releases/download/v7.3.1/buildozer-darwin-arm64" ], - "downloaded_file_path": "v1/https/repo1.maven.org/maven2/com/google/protobuf/protobuf-java-util/3.13.0/protobuf-java-util-3.13.0.jar" + "downloaded_file_path": "buildozer", + "executable": true, + "sha256": "31b1bfe20d7d5444be217af78f94c5c43799cdf847c6ce69794b7bf3319c5364" } }, - "io_netty_netty_codec_4_1_72_Final": { - "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", - "ruleClassName": "http_file", + "buildozer_linux_amd64": { + "repoRuleId": "@@bazel_tools//tools/build_defs/repo:http.bzl%http_file", "attributes": { - "sha256": "5d8591ca271a1e9c224e8de3873aa9936acb581ee0db514e7dc18523df36d16c", "urls": [ - "https://repo1.maven.org/maven2/io/netty/netty-codec/4.1.72.Final/netty-codec-4.1.72.Final.jar", - "https://maven.google.com/io/netty/netty-codec/4.1.72.Final/netty-codec-4.1.72.Final.jar" + "https://github.com/bazelbuild/buildtools/releases/download/v7.3.1/buildozer-linux-amd64" ], - "downloaded_file_path": "v1/https/repo1.maven.org/maven2/io/netty/netty-codec/4.1.72.Final/netty-codec-4.1.72.Final.jar" + "downloaded_file_path": "buildozer", + "executable": true, + "sha256": "3305e287b3fcc68b9a35fd8515ee617452cd4e018f9e6886b6c7cdbcba8710d4" } }, - "com_google_protobuf_protobuf_java_3_13_0": { - "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", - "ruleClassName": "http_file", + "buildozer_linux_arm64": { + "repoRuleId": "@@bazel_tools//tools/build_defs/repo:http.bzl%http_file", "attributes": { - "sha256": "97d5b2758408690c0dc276238707492a0b6a4d71206311b6c442cdc26c5973ff", "urls": [ - "https://repo1.maven.org/maven2/com/google/protobuf/protobuf-java/3.13.0/protobuf-java-3.13.0.jar", - "https://maven.google.com/com/google/protobuf/protobuf-java/3.13.0/protobuf-java-3.13.0.jar" + "https://github.com/bazelbuild/buildtools/releases/download/v7.3.1/buildozer-linux-arm64" ], - "downloaded_file_path": "v1/https/repo1.maven.org/maven2/com/google/protobuf/protobuf-java/3.13.0/protobuf-java-3.13.0.jar" + "downloaded_file_path": "buildozer", + "executable": true, + "sha256": "0b5a2a717ac4fc911e1fec8d92af71dbb4fe95b10e5213da0cc3d56cea64a328" } }, - "io_netty_netty_tcnative_classes_2_0_46_Final": { - "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", - "ruleClassName": "http_file", + "buildozer_windows_amd64": { + "repoRuleId": "@@bazel_tools//tools/build_defs/repo:http.bzl%http_file", "attributes": { - "sha256": "d3ec888dcc4ac7915bf88b417c5e04fd354f4311032a748a6882df09347eed9a", "urls": [ - "https://repo1.maven.org/maven2/io/netty/netty-tcnative-classes/2.0.46.Final/netty-tcnative-classes-2.0.46.Final.jar", - "https://maven.google.com/io/netty/netty-tcnative-classes/2.0.46.Final/netty-tcnative-classes-2.0.46.Final.jar" + "https://github.com/bazelbuild/buildtools/releases/download/v7.3.1/buildozer-windows-amd64.exe" ], - "downloaded_file_path": "v1/https/repo1.maven.org/maven2/io/netty/netty-tcnative-classes/2.0.46.Final/netty-tcnative-classes-2.0.46.Final.jar" + "downloaded_file_path": "buildozer.exe", + "executable": true, + "sha256": "58d41ce53257c5594c9bc86d769f580909269f68de114297f46284fbb9023dcf" } }, - "software_amazon_awssdk_sdk_core_2_17_183": { - "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", - "ruleClassName": "http_file", + "buildifier_prebuilt_toolchains": { + "repoRuleId": "@@buildifier_prebuilt+//:defs.bzl%_buildifier_toolchain_setup", "attributes": { - "sha256": "677e9cc90fdd82c1f40f97b99cb115b13ad6c3f58beeeab1c061af6954d64c77", - "urls": [ - "https://repo1.maven.org/maven2/software/amazon/awssdk/sdk-core/2.17.183/sdk-core-2.17.183.jar", - "https://maven.google.com/software/amazon/awssdk/sdk-core/2.17.183/sdk-core-2.17.183.jar" - ], - "downloaded_file_path": "v1/https/repo1.maven.org/maven2/software/amazon/awssdk/sdk-core/2.17.183/sdk-core-2.17.183.jar" + "assets_json": "[{\"arch\":\"amd64\",\"name\":\"buildifier\",\"platform\":\"darwin\",\"sha256\":\"375f823103d01620aaec20a0c29c6cbca99f4fd0725ae30b93655c6704f44d71\",\"version\":\"v7.3.1\"},{\"arch\":\"arm64\",\"name\":\"buildifier\",\"platform\":\"darwin\",\"sha256\":\"5a6afc6ac7a09f5455ba0b89bd99d5ae23b4174dc5dc9d6c0ed5ce8caac3f813\",\"version\":\"v7.3.1\"},{\"arch\":\"amd64\",\"name\":\"buildifier\",\"platform\":\"linux\",\"sha256\":\"5474cc5128a74e806783d54081f581662c4be8ae65022f557e9281ed5dc88009\",\"version\":\"v7.3.1\"},{\"arch\":\"arm64\",\"name\":\"buildifier\",\"platform\":\"linux\",\"sha256\":\"0bf86c4bfffaf4f08eed77bde5b2082e4ae5039a11e2e8b03984c173c34a561c\",\"version\":\"v7.3.1\"},{\"arch\":\"amd64\",\"name\":\"buildifier\",\"platform\":\"windows\",\"sha256\":\"370cd576075ad29930a82f5de132f1a1de4084c784a82514bd4da80c85acf4a8\",\"version\":\"v7.3.1\"},{\"arch\":\"amd64\",\"name\":\"buildozer\",\"platform\":\"darwin\",\"sha256\":\"854c9583efc166602276802658cef3f224d60898cfaa60630b33d328db3b0de2\",\"version\":\"v7.3.1\"},{\"arch\":\"arm64\",\"name\":\"buildozer\",\"platform\":\"darwin\",\"sha256\":\"31b1bfe20d7d5444be217af78f94c5c43799cdf847c6ce69794b7bf3319c5364\",\"version\":\"v7.3.1\"},{\"arch\":\"amd64\",\"name\":\"buildozer\",\"platform\":\"linux\",\"sha256\":\"3305e287b3fcc68b9a35fd8515ee617452cd4e018f9e6886b6c7cdbcba8710d4\",\"version\":\"v7.3.1\"},{\"arch\":\"arm64\",\"name\":\"buildozer\",\"platform\":\"linux\",\"sha256\":\"0b5a2a717ac4fc911e1fec8d92af71dbb4fe95b10e5213da0cc3d56cea64a328\",\"version\":\"v7.3.1\"},{\"arch\":\"amd64\",\"name\":\"buildozer\",\"platform\":\"windows\",\"sha256\":\"58d41ce53257c5594c9bc86d769f580909269f68de114297f46284fbb9023dcf\",\"version\":\"v7.3.1\"}]" } } }, "recordedRepoMappingEntries": [ [ - "rules_jvm_external~", - "bazel_tools", - "bazel_tools" + "buildifier_prebuilt+", + "bazel_skylib", + "bazel_skylib+" ], [ - "rules_jvm_external~", - "rules_jvm_external", - "rules_jvm_external~" + "buildifier_prebuilt+", + "bazel_tools", + "bazel_tools" ] ] } }, - "@@rules_jvm_external~//:non-module-deps.bzl%non_module_deps": { + "@@platforms//host:extension.bzl%host_platform": { "general": { - "bzlTransitiveDigest": "l6SlNloqPvd60dcuPdWiJNi3g3jfK76fcZc0i/Yr0dQ=", - "usagesDigest": "bTG4ItERqhG1LeSs62hQ01DiMarFsflWgpZaghM5qik=", + "bzlTransitiveDigest": "xelQcPZH8+tmuOHVjL9vDxMnnQNMlwj0SlvgoqBkm4U=", + "usagesDigest": "SeQiIN/f8/Qt9vYQk7qcXp4I4wJeEC0RnQDiaaJ4tb8=", "recordedFileInputs": {}, "recordedDirentsInputs": {}, "envVariables": {}, "generatedRepoSpecs": { - "io_bazel_rules_kotlin": { - "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", - "ruleClassName": "http_archive", - "attributes": { - "sha256": "946747acdbeae799b085d12b240ec346f775ac65236dfcf18aa0cd7300f6de78", - "urls": [ - "https://github.com/bazelbuild/rules_kotlin/releases/download/v1.7.0-RC-2/rules_kotlin_release.tgz" - ] - } + "host_platform": { + "repoRuleId": "@@platforms//host:extension.bzl%host_platform_repo", + "attributes": {} } }, - "recordedRepoMappingEntries": [ - [ - "rules_jvm_external~", - "bazel_tools", - "bazel_tools" - ] - ] + "recordedRepoMappingEntries": [] } }, - "@@rules_python~//python/extensions:python.bzl%python": { + "@@rules_java+//java:rules_java_deps.bzl%compatibility_proxy": { "general": { - "bzlTransitiveDigest": "GnREFVYskmF5MZu1H3nyqMWFZ2U/bty7gcbHX+l45kY=", - "usagesDigest": "7vjNHuEgQORYN9+9/77Q4zw1kawobM2oCQb9p0uhL68=", + "bzlTransitiveDigest": "84xJEZ1jnXXwo8BXMprvBm++rRt4jsTu9liBxz0ivps=", + "usagesDigest": "jTQDdLDxsS43zuRmg1faAjIEPWdLAbDAowI1pInQSoo=", "recordedFileInputs": {}, "recordedDirentsInputs": {}, "envVariables": {}, "generatedRepoSpecs": { - "pythons_hub": { - "bzlFile": "@@rules_python~//python/extensions/private:interpreter_hub.bzl", - "ruleClassName": "hub_repo", - "attributes": { - "toolchains": [] - } + "compatibility_proxy": { + "repoRuleId": "@@rules_java+//java:rules_java_deps.bzl%_compatibility_proxy_repo_rule", + "attributes": {} } }, "recordedRepoMappingEntries": [ [ - "rules_python~", + "rules_java+", "bazel_tools", "bazel_tools" - ], - [ - "rules_python~", - "rules_python", - "rules_python~" ] ] } }, - "@@rules_python~//python/extensions/private:internal_deps.bzl%internal_deps": { + "@@rules_kotlin+//src/main/starlark/core/repositories:bzlmod_setup.bzl%rules_kotlin_extensions": { "general": { - "bzlTransitiveDigest": "PiT9IOA5dSBSmnfZRUrvgo71zttPpvs3cNPbxftlChs=", - "usagesDigest": "b+nMDqtqPCBxiMBewNNde3aNjzKqZyvJuN5/49xB62s=", + "bzlTransitiveDigest": "sFhcgPbDQehmbD1EOXzX4H1q/CD5df8zwG4kp4jbvr8=", + "usagesDigest": "QI2z8ZUR+mqtbwsf2fLqYdJAkPOHdOV+tF2yVAUgRzw=", "recordedFileInputs": {}, "recordedDirentsInputs": {}, "envVariables": {}, "generatedRepoSpecs": { - "pypi__coverage_cp39_aarch64-apple-darwin": { - "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", - "ruleClassName": "http_archive", - "attributes": { - "build_file_content": "\nfilegroup(\n name = \"coverage\",\n srcs = [\"coverage/__main__.py\"],\n data = glob([\"coverage/*.py\", \"coverage/**/*.py\", \"coverage/*.so\"]),\n visibility = [\"//visibility:public\"],\n)\n ", - "patch_args": [ - "-p1" - ], - "patches": [ - "@@rules_python~//python/private:coverage.patch" - ], - "sha256": "95203854f974e07af96358c0b261f1048d8e1083f2de9b1c565e1be4a3a48cfc", - "type": "zip", - "urls": [ - "https://files.pythonhosted.org/packages/63/e9/f23e8664ec4032d7802a1cf920853196bcbdce7b56408e3efe1b2da08f3c/coverage-6.5.0-cp39-cp39-macosx_11_0_arm64.whl" - ] - } - }, - "pypi__coverage_cp38_aarch64-unknown-linux-gnu": { - "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", - "ruleClassName": "http_archive", - "attributes": { - "build_file_content": "\nfilegroup(\n name = \"coverage\",\n srcs = [\"coverage/__main__.py\"],\n data = glob([\"coverage/*.py\", \"coverage/**/*.py\", \"coverage/*.so\"]),\n visibility = [\"//visibility:public\"],\n)\n ", - "patch_args": [ - "-p1" - ], - "patches": [ - "@@rules_python~//python/private:coverage.patch" - ], - "sha256": "6c4459b3de97b75e3bd6b7d4b7f0db13f17f504f3d13e2a7c623786289dd670e", - "type": "zip", - "urls": [ - "https://files.pythonhosted.org/packages/40/3b/cd68cb278c4966df00158811ec1e357b9a7d132790c240fc65da57e10013/coverage-6.5.0-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl" - ] - } - }, - "pypi__pip_tools": { - "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", - "ruleClassName": "http_archive", - "attributes": { - "url": "https://files.pythonhosted.org/packages/5e/e8/f6d7d1847c7351048da870417724ace5c4506e816b38db02f4d7c675c189/pip_tools-6.12.1-py3-none-any.whl", - "sha256": "f0c0c0ec57b58250afce458e2e6058b1f30a4263db895b7d72fd6311bf1dc6f7", - "type": "zip", - "build_file_content": "package(default_visibility = [\"//visibility:public\"])\n\nload(\"@rules_python//python:defs.bzl\", \"py_library\")\n\npy_library(\n name = \"lib\",\n srcs = glob([\"**/*.py\"]),\n data = glob([\"**/*\"], exclude=[\n # These entries include those put into user-installed dependencies by\n # data_exclude in /python/pip_install/tools/bazel.py\n # to avoid non-determinism following pip install's behavior.\n \"**/*.py\",\n \"**/*.pyc\",\n \"**/* *\",\n \"**/*.dist-info/RECORD\",\n \"BUILD\",\n \"WORKSPACE\",\n ]),\n # This makes this directory a top-level in the python import\n # search path for anything that depends on this.\n imports = [\".\"],\n)\n" - } - }, - "pypi__coverage_cp310_x86_64-unknown-linux-gnu": { - "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", - "ruleClassName": "http_archive", - "attributes": { - "build_file_content": "\nfilegroup(\n name = \"coverage\",\n srcs = [\"coverage/__main__.py\"],\n data = glob([\"coverage/*.py\", \"coverage/**/*.py\", \"coverage/*.so\"]),\n visibility = [\"//visibility:public\"],\n)\n ", - "patch_args": [ - "-p1" - ], - "patches": [ - "@@rules_python~//python/private:coverage.patch" - ], - "sha256": "af4fffaffc4067232253715065e30c5a7ec6faac36f8fc8d6f64263b15f74db0", - "type": "zip", - "urls": [ - "https://files.pythonhosted.org/packages/3c/7d/d5211ea782b193ab8064b06dc0cc042cf1a4ca9c93a530071459172c550f/coverage-6.5.0-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl" - ] - } - }, - "pypi__coverage_cp311_x86_64-apple-darwin": { - "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", - "ruleClassName": "http_archive", - "attributes": { - "build_file_content": "\nfilegroup(\n name = \"coverage\",\n srcs = [\"coverage/__main__.py\"],\n data = glob([\"coverage/*.py\", \"coverage/**/*.py\", \"coverage/*.so\"]),\n visibility = [\"//visibility:public\"],\n)\n ", - "patch_args": [ - "-p1" - ], - "patches": [ - "@@rules_python~//python/private:coverage.patch" - ], - "sha256": "4a5375e28c5191ac38cca59b38edd33ef4cc914732c916f2929029b4bfb50795", - "type": "zip", - "urls": [ - "https://files.pythonhosted.org/packages/50/cf/455930004231fa87efe8be06d13512f34e070ddfee8b8bf5a050cdc47ab3/coverage-6.5.0-cp311-cp311-macosx_10_9_x86_64.whl" - ] - } - }, - "pypi__coverage_cp310_aarch64-unknown-linux-gnu": { - "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", - "ruleClassName": "http_archive", - "attributes": { - "build_file_content": "\nfilegroup(\n name = \"coverage\",\n srcs = [\"coverage/__main__.py\"],\n data = glob([\"coverage/*.py\", \"coverage/**/*.py\", \"coverage/*.so\"]),\n visibility = [\"//visibility:public\"],\n)\n ", - "patch_args": [ - "-p1" - ], - "patches": [ - "@@rules_python~//python/private:coverage.patch" - ], - "sha256": "b4a5be1748d538a710f87542f22c2cad22f80545a847ad91ce45e77417293eb4", - "type": "zip", - "urls": [ - "https://files.pythonhosted.org/packages/15/b0/3639d84ee8a900da0cf6450ab46e22517e4688b6cec0ba8ab6f8166103a2/coverage-6.5.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl" - ] - } - }, - "pypi__coverage_cp39_aarch64-unknown-linux-gnu": { - "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", - "ruleClassName": "http_archive", - "attributes": { - "build_file_content": "\nfilegroup(\n name = \"coverage\",\n srcs = [\"coverage/__main__.py\"],\n data = glob([\"coverage/*.py\", \"coverage/**/*.py\", \"coverage/*.so\"]),\n visibility = [\"//visibility:public\"],\n)\n ", - "patch_args": [ - "-p1" - ], - "patches": [ - "@@rules_python~//python/private:coverage.patch" - ], - "sha256": "b9023e237f4c02ff739581ef35969c3739445fb059b060ca51771e69101efffe", - "type": "zip", - "urls": [ - "https://files.pythonhosted.org/packages/18/95/27f80dcd8273171b781a19d109aeaed7f13d78ef6d1e2f7134a5826fd1b4/coverage-6.5.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl" - ] - } - }, - "pypi__coverage_cp310_aarch64-apple-darwin": { - "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", - "ruleClassName": "http_archive", - "attributes": { - "build_file_content": "\nfilegroup(\n name = \"coverage\",\n srcs = [\"coverage/__main__.py\"],\n data = glob([\"coverage/*.py\", \"coverage/**/*.py\", \"coverage/*.so\"]),\n visibility = [\"//visibility:public\"],\n)\n ", - "patch_args": [ - "-p1" - ], - "patches": [ - "@@rules_python~//python/private:coverage.patch" - ], - "sha256": "784f53ebc9f3fd0e2a3f6a78b2be1bd1f5575d7863e10c6e12504f240fd06660", - "type": "zip", - "urls": [ - "https://files.pythonhosted.org/packages/89/a2/cbf599e50bb4be416e0408c4cf523c354c51d7da39935461a9687e039481/coverage-6.5.0-cp310-cp310-macosx_11_0_arm64.whl" - ] - } - }, - "pypi__pip": { - "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", - "ruleClassName": "http_archive", - "attributes": { - "url": "https://files.pythonhosted.org/packages/09/bd/2410905c76ee14c62baf69e3f4aa780226c1bbfc9485731ad018e35b0cb5/pip-22.3.1-py3-none-any.whl", - "sha256": "908c78e6bc29b676ede1c4d57981d490cb892eb45cd8c214ab6298125119e077", - "type": "zip", - "build_file_content": "package(default_visibility = [\"//visibility:public\"])\n\nload(\"@rules_python//python:defs.bzl\", \"py_library\")\n\npy_library(\n name = \"lib\",\n srcs = glob([\"**/*.py\"]),\n data = glob([\"**/*\"], exclude=[\n # These entries include those put into user-installed dependencies by\n # data_exclude in /python/pip_install/tools/bazel.py\n # to avoid non-determinism following pip install's behavior.\n \"**/*.py\",\n \"**/*.pyc\",\n \"**/* *\",\n \"**/*.dist-info/RECORD\",\n \"BUILD\",\n \"WORKSPACE\",\n ]),\n # This makes this directory a top-level in the python import\n # search path for anything that depends on this.\n imports = [\".\"],\n)\n" - } - }, - "pypi__coverage_cp38_x86_64-apple-darwin": { - "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", - "ruleClassName": "http_archive", - "attributes": { - "build_file_content": "\nfilegroup(\n name = \"coverage\",\n srcs = [\"coverage/__main__.py\"],\n data = glob([\"coverage/*.py\", \"coverage/**/*.py\", \"coverage/*.so\"]),\n visibility = [\"//visibility:public\"],\n)\n ", - "patch_args": [ - "-p1" - ], - "patches": [ - "@@rules_python~//python/private:coverage.patch" - ], - "sha256": "d900bb429fdfd7f511f868cedd03a6bbb142f3f9118c09b99ef8dc9bf9643c3c", - "type": "zip", - "urls": [ - "https://files.pythonhosted.org/packages/05/63/a789b462075395d34f8152229dccf92b25ca73eac05b3f6cd75fa5017095/coverage-6.5.0-cp38-cp38-macosx_10_9_x86_64.whl" - ] - } - }, - "pypi__coverage_cp311_x86_64-unknown-linux-gnu": { - "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", - "ruleClassName": "http_archive", + "com_github_jetbrains_kotlin_git": { + "repoRuleId": "@@rules_kotlin+//src/main/starlark/core/repositories:compiler.bzl%kotlin_compiler_git_repository", "attributes": { - "build_file_content": "\nfilegroup(\n name = \"coverage\",\n srcs = [\"coverage/__main__.py\"],\n data = glob([\"coverage/*.py\", \"coverage/**/*.py\", \"coverage/*.so\"]),\n visibility = [\"//visibility:public\"],\n)\n ", - "patch_args": [ - "-p1" - ], - "patches": [ - "@@rules_python~//python/private:coverage.patch" - ], - "sha256": "a8fb6cf131ac4070c9c5a3e21de0f7dc5a0fbe8bc77c9456ced896c12fcdad91", - "type": "zip", "urls": [ - "https://files.pythonhosted.org/packages/6a/63/8e82513b7e4a1b8d887b4e85c1c2b6c9b754a581b187c0b084f3330ac479/coverage-6.5.0-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl" - ] - } - }, - "pypi__tomli": { - "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", - "ruleClassName": "http_archive", - "attributes": { - "url": "https://files.pythonhosted.org/packages/97/75/10a9ebee3fd790d20926a90a2547f0bf78f371b2f13aa822c759680ca7b9/tomli-2.0.1-py3-none-any.whl", - "sha256": "939de3e7a6161af0c887ef91b7d41a53e7c5a1ca976325f429cb46ea9bc30ecc", - "type": "zip", - "build_file_content": "package(default_visibility = [\"//visibility:public\"])\n\nload(\"@rules_python//python:defs.bzl\", \"py_library\")\n\npy_library(\n name = \"lib\",\n srcs = glob([\"**/*.py\"]),\n data = glob([\"**/*\"], exclude=[\n # These entries include those put into user-installed dependencies by\n # data_exclude in /python/pip_install/tools/bazel.py\n # to avoid non-determinism following pip install's behavior.\n \"**/*.py\",\n \"**/*.pyc\",\n \"**/* *\",\n \"**/*.dist-info/RECORD\",\n \"BUILD\",\n \"WORKSPACE\",\n ]),\n # This makes this directory a top-level in the python import\n # search path for anything that depends on this.\n imports = [\".\"],\n)\n" - } - }, - "pypi__coverage_cp39_x86_64-apple-darwin": { - "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", - "ruleClassName": "http_archive", - "attributes": { - "build_file_content": "\nfilegroup(\n name = \"coverage\",\n srcs = [\"coverage/__main__.py\"],\n data = glob([\"coverage/*.py\", \"coverage/**/*.py\", \"coverage/*.so\"]),\n visibility = [\"//visibility:public\"],\n)\n ", - "patch_args": [ - "-p1" + "https://github.com/JetBrains/kotlin/releases/download/v1.9.23/kotlin-compiler-1.9.23.zip" ], - "patches": [ - "@@rules_python~//python/private:coverage.patch" - ], - "sha256": "633713d70ad6bfc49b34ead4060531658dc6dfc9b3eb7d8a716d5873377ab745", - "type": "zip", - "urls": [ - "https://files.pythonhosted.org/packages/ea/52/c08080405329326a7ff16c0dfdb4feefaa8edd7446413df67386fe1bbfe0/coverage-6.5.0-cp39-cp39-macosx_10_9_x86_64.whl" - ] + "sha256": "93137d3aab9afa9b27cb06a824c2324195c6b6f6179d8a8653f440f5bd58be88" } }, - "pypi__wheel": { - "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", - "ruleClassName": "http_archive", + "com_github_jetbrains_kotlin": { + "repoRuleId": "@@rules_kotlin+//src/main/starlark/core/repositories:compiler.bzl%kotlin_capabilities_repository", "attributes": { - "url": "https://files.pythonhosted.org/packages/bd/7c/d38a0b30ce22fc26ed7dbc087c6d00851fb3395e9d0dac40bec1f905030c/wheel-0.38.4-py3-none-any.whl", - "sha256": "b60533f3f5d530e971d6737ca6d58681ee434818fab630c83a734bb10c083ce8", - "type": "zip", - "build_file_content": "package(default_visibility = [\"//visibility:public\"])\n\nload(\"@rules_python//python:defs.bzl\", \"py_library\")\n\npy_library(\n name = \"lib\",\n srcs = glob([\"**/*.py\"]),\n data = glob([\"**/*\"], exclude=[\n # These entries include those put into user-installed dependencies by\n # data_exclude in /python/pip_install/tools/bazel.py\n # to avoid non-determinism following pip install's behavior.\n \"**/*.py\",\n \"**/*.pyc\",\n \"**/* *\",\n \"**/*.dist-info/RECORD\",\n \"BUILD\",\n \"WORKSPACE\",\n ]),\n # This makes this directory a top-level in the python import\n # search path for anything that depends on this.\n imports = [\".\"],\n)\n" + "git_repository_name": "com_github_jetbrains_kotlin_git", + "compiler_version": "1.9.23" } }, - "pypi__coverage_cp311_aarch64-unknown-linux-gnu": { - "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", - "ruleClassName": "http_archive", + "com_github_google_ksp": { + "repoRuleId": "@@rules_kotlin+//src/main/starlark/core/repositories:ksp.bzl%ksp_compiler_plugin_repository", "attributes": { - "build_file_content": "\nfilegroup(\n name = \"coverage\",\n srcs = [\"coverage/__main__.py\"],\n data = glob([\"coverage/*.py\", \"coverage/**/*.py\", \"coverage/*.so\"]),\n visibility = [\"//visibility:public\"],\n)\n ", - "patch_args": [ - "-p1" - ], - "patches": [ - "@@rules_python~//python/private:coverage.patch" - ], - "sha256": "c4ed2820d919351f4167e52425e096af41bfabacb1857186c1ea32ff9983ed75", - "type": "zip", "urls": [ - "https://files.pythonhosted.org/packages/36/f3/5cbd79cf4cd059c80b59104aca33b8d05af4ad5bf5b1547645ecee716378/coverage-6.5.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl" - ] - } - }, - "pypi__click": { - "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", - "ruleClassName": "http_archive", - "attributes": { - "url": "https://files.pythonhosted.org/packages/76/0a/b6c5f311e32aeb3b406e03c079ade51e905ea630fc19d1262a46249c1c86/click-8.0.1-py3-none-any.whl", - "sha256": "fba402a4a47334742d782209a7c79bc448911afe1149d07bdabdf480b3e2f4b6", - "type": "zip", - "build_file_content": "package(default_visibility = [\"//visibility:public\"])\n\nload(\"@rules_python//python:defs.bzl\", \"py_library\")\n\npy_library(\n name = \"lib\",\n srcs = glob([\"**/*.py\"]),\n data = glob([\"**/*\"], exclude=[\n # These entries include those put into user-installed dependencies by\n # data_exclude in /python/pip_install/tools/bazel.py\n # to avoid non-determinism following pip install's behavior.\n \"**/*.py\",\n \"**/*.pyc\",\n \"**/* *\",\n \"**/*.dist-info/RECORD\",\n \"BUILD\",\n \"WORKSPACE\",\n ]),\n # This makes this directory a top-level in the python import\n # search path for anything that depends on this.\n imports = [\".\"],\n)\n" - } - }, - "pypi__coverage_cp39_x86_64-unknown-linux-gnu": { - "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", - "ruleClassName": "http_archive", - "attributes": { - "build_file_content": "\nfilegroup(\n name = \"coverage\",\n srcs = [\"coverage/__main__.py\"],\n data = glob([\"coverage/*.py\", \"coverage/**/*.py\", \"coverage/*.so\"]),\n visibility = [\"//visibility:public\"],\n)\n ", - "patch_args": [ - "-p1" + "https://github.com/google/ksp/releases/download/1.9.23-1.0.20/artifacts.zip" ], - "patches": [ - "@@rules_python~//python/private:coverage.patch" - ], - "sha256": "8f830ed581b45b82451a40faabb89c84e1a998124ee4212d440e9c6cf70083e5", - "type": "zip", - "urls": [ - "https://files.pythonhosted.org/packages/6b/f2/919f0fdc93d3991ca074894402074d847be8ac1e1d78e7e9e1c371b69a6f/coverage-6.5.0-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl" - ] - } - }, - "pypi__importlib_metadata": { - "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", - "ruleClassName": "http_archive", - "attributes": { - "url": "https://files.pythonhosted.org/packages/d7/31/74dcb59a601b95fce3b0334e8fc9db758f78e43075f22aeb3677dfb19f4c/importlib_metadata-1.4.0-py2.py3-none-any.whl", - "sha256": "bdd9b7c397c273bcc9a11d6629a38487cd07154fa255a467bf704cd2c258e359", - "type": "zip", - "build_file_content": "package(default_visibility = [\"//visibility:public\"])\n\nload(\"@rules_python//python:defs.bzl\", \"py_library\")\n\npy_library(\n name = \"lib\",\n srcs = glob([\"**/*.py\"]),\n data = glob([\"**/*\"], exclude=[\n # These entries include those put into user-installed dependencies by\n # data_exclude in /python/pip_install/tools/bazel.py\n # to avoid non-determinism following pip install's behavior.\n \"**/*.py\",\n \"**/*.pyc\",\n \"**/* *\",\n \"**/*.dist-info/RECORD\",\n \"BUILD\",\n \"WORKSPACE\",\n ]),\n # This makes this directory a top-level in the python import\n # search path for anything that depends on this.\n imports = [\".\"],\n)\n" - } - }, - "pypi__pep517": { - "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", - "ruleClassName": "http_archive", - "attributes": { - "url": "https://files.pythonhosted.org/packages/ee/2f/ef63e64e9429111e73d3d6cbee80591672d16f2725e648ebc52096f3d323/pep517-0.13.0-py3-none-any.whl", - "sha256": "4ba4446d80aed5b5eac6509ade100bff3e7943a8489de249654a5ae9b33ee35b", - "type": "zip", - "build_file_content": "package(default_visibility = [\"//visibility:public\"])\n\nload(\"@rules_python//python:defs.bzl\", \"py_library\")\n\npy_library(\n name = \"lib\",\n srcs = glob([\"**/*.py\"]),\n data = glob([\"**/*\"], exclude=[\n # These entries include those put into user-installed dependencies by\n # data_exclude in /python/pip_install/tools/bazel.py\n # to avoid non-determinism following pip install's behavior.\n \"**/*.py\",\n \"**/*.pyc\",\n \"**/* *\",\n \"**/*.dist-info/RECORD\",\n \"BUILD\",\n \"WORKSPACE\",\n ]),\n # This makes this directory a top-level in the python import\n # search path for anything that depends on this.\n imports = [\".\"],\n)\n" + "sha256": "ee0618755913ef7fd6511288a232e8fad24838b9af6ea73972a76e81053c8c2d", + "strip_version": "1.9.23-1.0.20" } }, - "pypi__coverage_cp38_x86_64-unknown-linux-gnu": { - "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", - "ruleClassName": "http_archive", + "com_github_pinterest_ktlint": { + "repoRuleId": "@@bazel_tools//tools/build_defs/repo:http.bzl%http_file", "attributes": { - "build_file_content": "\nfilegroup(\n name = \"coverage\",\n srcs = [\"coverage/__main__.py\"],\n data = glob([\"coverage/*.py\", \"coverage/**/*.py\", \"coverage/*.so\"]),\n visibility = [\"//visibility:public\"],\n)\n ", - "patch_args": [ - "-p1" - ], - "patches": [ - "@@rules_python~//python/private:coverage.patch" - ], - "sha256": "6b07130585d54fe8dff3d97b93b0e20290de974dc8177c320aeaf23459219c0b", - "type": "zip", + "sha256": "01b2e0ef893383a50dbeb13970fe7fa3be36ca3e83259e01649945b09d736985", "urls": [ - "https://files.pythonhosted.org/packages/bd/a0/e263b115808226fdb2658f1887808c06ac3f1b579ef5dda02309e0d54459/coverage-6.5.0-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl" - ] - } - }, - "pypi__coverage_cp38_aarch64-apple-darwin": { - "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", - "ruleClassName": "http_archive", - "attributes": { - "build_file_content": "\nfilegroup(\n name = \"coverage\",\n srcs = [\"coverage/__main__.py\"],\n data = glob([\"coverage/*.py\", \"coverage/**/*.py\", \"coverage/*.so\"]),\n visibility = [\"//visibility:public\"],\n)\n ", - "patch_args": [ - "-p1" - ], - "patches": [ - "@@rules_python~//python/private:coverage.patch" + "https://github.com/pinterest/ktlint/releases/download/1.3.0/ktlint" ], - "sha256": "2198ea6fc548de52adc826f62cb18554caedfb1d26548c1b7c88d8f7faa8f6ba", - "type": "zip", - "urls": [ - "https://files.pythonhosted.org/packages/07/82/79fa21ceca9a9b091eb3c67e27eb648dade27b2c9e1eb23af47232a2a365/coverage-6.5.0-cp38-cp38-macosx_11_0_arm64.whl" - ] - } - }, - "pypi__packaging": { - "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", - "ruleClassName": "http_archive", - "attributes": { - "url": "https://files.pythonhosted.org/packages/8f/7b/42582927d281d7cb035609cd3a543ffac89b74f3f4ee8e1c50914bcb57eb/packaging-22.0-py3-none-any.whl", - "sha256": "957e2148ba0e1a3b282772e791ef1d8083648bc131c8ab0c1feba110ce1146c3", - "type": "zip", - "build_file_content": "package(default_visibility = [\"//visibility:public\"])\n\nload(\"@rules_python//python:defs.bzl\", \"py_library\")\n\npy_library(\n name = \"lib\",\n srcs = glob([\"**/*.py\"]),\n data = glob([\"**/*\"], exclude=[\n # These entries include those put into user-installed dependencies by\n # data_exclude in /python/pip_install/tools/bazel.py\n # to avoid non-determinism following pip install's behavior.\n \"**/*.py\",\n \"**/*.pyc\",\n \"**/* *\",\n \"**/*.dist-info/RECORD\",\n \"BUILD\",\n \"WORKSPACE\",\n ]),\n # This makes this directory a top-level in the python import\n # search path for anything that depends on this.\n imports = [\".\"],\n)\n" - } - }, - "pypi__setuptools": { - "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", - "ruleClassName": "http_archive", - "attributes": { - "url": "https://files.pythonhosted.org/packages/7c/5b/3d92b9f0f7ca1645cba48c080b54fe7d8b1033a4e5720091d1631c4266db/setuptools-60.10.0-py3-none-any.whl", - "sha256": "782ef48d58982ddb49920c11a0c5c9c0b02e7d7d1c2ad0aa44e1a1e133051c96", - "type": "zip", - "build_file_content": "package(default_visibility = [\"//visibility:public\"])\n\nload(\"@rules_python//python:defs.bzl\", \"py_library\")\n\npy_library(\n name = \"lib\",\n srcs = glob([\"**/*.py\"]),\n data = glob([\"**/*\"], exclude=[\n # These entries include those put into user-installed dependencies by\n # data_exclude in /python/pip_install/tools/bazel.py\n # to avoid non-determinism following pip install's behavior.\n \"**/*.py\",\n \"**/*.pyc\",\n \"**/* *\",\n \"**/*.dist-info/RECORD\",\n \"BUILD\",\n \"WORKSPACE\",\n ]),\n # This makes this directory a top-level in the python import\n # search path for anything that depends on this.\n imports = [\".\"],\n)\n" - } - }, - "pypi__zipp": { - "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", - "ruleClassName": "http_archive", - "attributes": { - "url": "https://files.pythonhosted.org/packages/f4/50/cc72c5bcd48f6e98219fc4a88a5227e9e28b81637a99c49feba1d51f4d50/zipp-1.0.0-py2.py3-none-any.whl", - "sha256": "8dda78f06bd1674bd8720df8a50bb47b6e1233c503a4eed8e7810686bde37656", - "type": "zip", - "build_file_content": "package(default_visibility = [\"//visibility:public\"])\n\nload(\"@rules_python//python:defs.bzl\", \"py_library\")\n\npy_library(\n name = \"lib\",\n srcs = glob([\"**/*.py\"]),\n data = glob([\"**/*\"], exclude=[\n # These entries include those put into user-installed dependencies by\n # data_exclude in /python/pip_install/tools/bazel.py\n # to avoid non-determinism following pip install's behavior.\n \"**/*.py\",\n \"**/*.pyc\",\n \"**/* *\",\n \"**/*.dist-info/RECORD\",\n \"BUILD\",\n \"WORKSPACE\",\n ]),\n # This makes this directory a top-level in the python import\n # search path for anything that depends on this.\n imports = [\".\"],\n)\n" - } - }, - "pypi__colorama": { - "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", - "ruleClassName": "http_archive", - "attributes": { - "url": "https://files.pythonhosted.org/packages/d1/d6/3965ed04c63042e047cb6a3e6ed1a63a35087b6a609aa3a15ed8ac56c221/colorama-0.4.6-py2.py3-none-any.whl", - "sha256": "4f1d9991f5acc0ca119f9d443620b77f9d6b33703e51011c16baf57afb285fc6", - "type": "zip", - "build_file_content": "package(default_visibility = [\"//visibility:public\"])\n\nload(\"@rules_python//python:defs.bzl\", \"py_library\")\n\npy_library(\n name = \"lib\",\n srcs = glob([\"**/*.py\"]),\n data = glob([\"**/*\"], exclude=[\n # These entries include those put into user-installed dependencies by\n # data_exclude in /python/pip_install/tools/bazel.py\n # to avoid non-determinism following pip install's behavior.\n \"**/*.py\",\n \"**/*.pyc\",\n \"**/* *\",\n \"**/*.dist-info/RECORD\",\n \"BUILD\",\n \"WORKSPACE\",\n ]),\n # This makes this directory a top-level in the python import\n # search path for anything that depends on this.\n imports = [\".\"],\n)\n" - } - }, - "pypi__build": { - "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", - "ruleClassName": "http_archive", - "attributes": { - "url": "https://files.pythonhosted.org/packages/03/97/f58c723ff036a8d8b4d3115377c0a37ed05c1f68dd9a0d66dab5e82c5c1c/build-0.9.0-py3-none-any.whl", - "sha256": "38a7a2b7a0bdc61a42a0a67509d88c71ecfc37b393baba770fae34e20929ff69", - "type": "zip", - "build_file_content": "package(default_visibility = [\"//visibility:public\"])\n\nload(\"@rules_python//python:defs.bzl\", \"py_library\")\n\npy_library(\n name = \"lib\",\n srcs = glob([\"**/*.py\"]),\n data = glob([\"**/*\"], exclude=[\n # These entries include those put into user-installed dependencies by\n # data_exclude in /python/pip_install/tools/bazel.py\n # to avoid non-determinism following pip install's behavior.\n \"**/*.py\",\n \"**/*.pyc\",\n \"**/* *\",\n \"**/*.dist-info/RECORD\",\n \"BUILD\",\n \"WORKSPACE\",\n ]),\n # This makes this directory a top-level in the python import\n # search path for anything that depends on this.\n imports = [\".\"],\n)\n" + "executable": true } }, - "pypi__coverage_cp310_x86_64-apple-darwin": { - "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", - "ruleClassName": "http_archive", + "rules_android": { + "repoRuleId": "@@bazel_tools//tools/build_defs/repo:http.bzl%http_archive", "attributes": { - "build_file_content": "\nfilegroup(\n name = \"coverage\",\n srcs = [\"coverage/__main__.py\"],\n data = glob([\"coverage/*.py\", \"coverage/**/*.py\", \"coverage/*.so\"]),\n visibility = [\"//visibility:public\"],\n)\n ", - "patch_args": [ - "-p1" - ], - "patches": [ - "@@rules_python~//python/private:coverage.patch" - ], - "sha256": "ef8674b0ee8cc11e2d574e3e2998aea5df5ab242e012286824ea3c6970580e53", - "type": "zip", + "sha256": "cd06d15dd8bb59926e4d65f9003bfc20f9da4b2519985c27e190cddc8b7a7806", + "strip_prefix": "rules_android-0.1.1", "urls": [ - "https://files.pythonhosted.org/packages/c4/8d/5ec7d08f4601d2d792563fe31db5e9322c306848fec1e65ec8885927f739/coverage-6.5.0-cp310-cp310-macosx_10_9_x86_64.whl" + "https://github.com/bazelbuild/rules_android/archive/v0.1.1.zip" ] } - }, - "pypi__installer": { - "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", - "ruleClassName": "http_archive", - "attributes": { - "url": "https://files.pythonhosted.org/packages/e5/ca/1172b6638d52f2d6caa2dd262ec4c811ba59eee96d54a7701930726bce18/installer-0.7.0-py3-none-any.whl", - "sha256": "05d1933f0a5ba7d8d6296bb6d5018e7c94fa473ceb10cf198a92ccea19c27b53", - "type": "zip", - "build_file_content": "package(default_visibility = [\"//visibility:public\"])\n\nload(\"@rules_python//python:defs.bzl\", \"py_library\")\n\npy_library(\n name = \"lib\",\n srcs = glob([\"**/*.py\"]),\n data = glob([\"**/*\"], exclude=[\n # These entries include those put into user-installed dependencies by\n # data_exclude in /python/pip_install/tools/bazel.py\n # to avoid non-determinism following pip install's behavior.\n \"**/*.py\",\n \"**/*.pyc\",\n \"**/* *\",\n \"**/*.dist-info/RECORD\",\n \"BUILD\",\n \"WORKSPACE\",\n ]),\n # This makes this directory a top-level in the python import\n # search path for anything that depends on this.\n imports = [\".\"],\n)\n" - } - }, - "pypi__more_itertools": { - "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", - "ruleClassName": "http_archive", - "attributes": { - "url": "https://files.pythonhosted.org/packages/bd/3f/c4b3dbd315e248f84c388bd4a72b131a29f123ecacc37ffb2b3834546e42/more_itertools-8.13.0-py3-none-any.whl", - "sha256": "c5122bffc5f104d37c1626b8615b511f3427aa5389b94d61e5ef8236bfbc3ddb", - "type": "zip", - "build_file_content": "package(default_visibility = [\"//visibility:public\"])\n\nload(\"@rules_python//python:defs.bzl\", \"py_library\")\n\npy_library(\n name = \"lib\",\n srcs = glob([\"**/*.py\"]),\n data = glob([\"**/*\"], exclude=[\n # These entries include those put into user-installed dependencies by\n # data_exclude in /python/pip_install/tools/bazel.py\n # to avoid non-determinism following pip install's behavior.\n \"**/*.py\",\n \"**/*.pyc\",\n \"**/* *\",\n \"**/*.dist-info/RECORD\",\n \"BUILD\",\n \"WORKSPACE\",\n ]),\n # This makes this directory a top-level in the python import\n # search path for anything that depends on this.\n imports = [\".\"],\n)\n" - } } }, "recordedRepoMappingEntries": [ [ - "rules_python~", - "bazel_skylib", - "bazel_skylib~" - ], - [ - "rules_python~", + "rules_kotlin+", "bazel_tools", "bazel_tools" - ], - [ - "rules_python~", - "rules_python", - "rules_python~" ] ] } }, - "@@rules_swift~//swift:extensions.bzl%non_module_deps": { + "@@rules_swift+//swift:extensions.bzl%non_module_deps": { "general": { - "bzlTransitiveDigest": "SMlSpPt7J3akRjdCKkCLB4onHNyplTFRm/cjRcBXTK4=", - "usagesDigest": "v8pVOoO9zhy1k73hpXrq8i5itmO9MQIRw5rQZKguitI=", + "bzlTransitiveDigest": "r/zoigrb42fT/zIUCLua7Xptst5Dk96z/IyAElaPNf8=", + "usagesDigest": "4Y6W/yVgoJW3KQ1cAUW3QrehzbhFb8P9LqojIjar2pM=", "recordedFileInputs": {}, "recordedDirentsInputs": {}, "envVariables": {}, "generatedRepoSpecs": { - "com_github_apple_swift_docc_symbolkit": { - "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", - "ruleClassName": "http_archive", + "com_github_apple_swift_protobuf": { + "repoRuleId": "@@bazel_tools//tools/build_defs/repo:http.bzl%http_archive", "attributes": { "urls": [ - "https://github.com/apple/swift-docc-symbolkit/archive/refs/tags/swift-5.10-RELEASE.tar.gz" + "https://github.com/apple/swift-protobuf/archive/1.20.2.tar.gz" ], - "sha256": "de1d4b6940468ddb53b89df7aa1a81323b9712775b0e33e8254fa0f6f7469a97", - "strip_prefix": "swift-docc-symbolkit-swift-5.10-RELEASE", - "build_file": "@@rules_swift~//third_party:com_github_apple_swift_docc_symbolkit/BUILD.overlay" + "sha256": "3fb50bd4d293337f202d917b6ada22f9548a0a0aed9d9a4d791e6fbd8a246ebb", + "strip_prefix": "swift-protobuf-1.20.2/", + "build_file": "@@rules_swift+//third_party:com_github_apple_swift_protobuf/BUILD.overlay" } }, - "com_github_apple_swift_nio_http2": { - "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", - "ruleClassName": "http_archive", + "com_github_grpc_grpc_swift": { + "repoRuleId": "@@bazel_tools//tools/build_defs/repo:http.bzl%http_archive", "attributes": { "urls": [ - "https://github.com/apple/swift-nio-http2/archive/1.26.0.tar.gz" + "https://github.com/grpc/grpc-swift/archive/1.16.0.tar.gz" ], - "sha256": "f0edfc9d6a7be1d587e5b403f2d04264bdfae59aac1d74f7d974a9022c6d2b25", - "strip_prefix": "swift-nio-http2-1.26.0/", - "build_file": "@@rules_swift~//third_party:com_github_apple_swift_nio_http2/BUILD.overlay" + "sha256": "58b60431d0064969f9679411264b82e40a217ae6bd34e17096d92cc4e47556a5", + "strip_prefix": "grpc-swift-1.16.0/", + "build_file": "@@rules_swift+//third_party:com_github_grpc_grpc_swift/BUILD.overlay" } }, - "build_bazel_rules_swift_index_import": { - "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", - "ruleClassName": "http_archive", + "com_github_apple_swift_docc_symbolkit": { + "repoRuleId": "@@bazel_tools//tools/build_defs/repo:http.bzl%http_archive", "attributes": { - "build_file": "@@rules_swift~//third_party:build_bazel_rules_swift_index_import/BUILD.overlay", - "canonical_id": "index-import-5.8", "urls": [ - "https://github.com/MobileNativeFoundation/index-import/releases/download/5.8.0.1/index-import.tar.gz" + "https://github.com/apple/swift-docc-symbolkit/archive/refs/tags/swift-5.10-RELEASE.tar.gz" ], - "sha256": "28c1ffa39d99e74ed70623899b207b41f79214c498c603915aef55972a851a15" + "sha256": "de1d4b6940468ddb53b89df7aa1a81323b9712775b0e33e8254fa0f6f7469a97", + "strip_prefix": "swift-docc-symbolkit-swift-5.10-RELEASE", + "build_file": "@@rules_swift+//third_party:com_github_apple_swift_docc_symbolkit/BUILD.overlay" } }, - "com_github_apple_swift_log": { - "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", - "ruleClassName": "http_archive", + "com_github_apple_swift_nio": { + "repoRuleId": "@@bazel_tools//tools/build_defs/repo:http.bzl%http_archive", "attributes": { "urls": [ - "https://github.com/apple/swift-log/archive/1.4.4.tar.gz" + "https://github.com/apple/swift-nio/archive/2.42.0.tar.gz" ], - "sha256": "48fe66426c784c0c20031f15dc17faf9f4c9037c192bfac2f643f65cb2321ba0", - "strip_prefix": "swift-log-1.4.4/", - "build_file": "@@rules_swift~//third_party:com_github_apple_swift_log/BUILD.overlay" + "sha256": "e3304bc3fb53aea74a3e54bd005ede11f6dc357117d9b1db642d03aea87194a0", + "strip_prefix": "swift-nio-2.42.0/", + "build_file": "@@rules_swift+//third_party:com_github_apple_swift_nio/BUILD.overlay" } }, - "com_github_apple_swift_collections": { - "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", - "ruleClassName": "http_archive", + "com_github_apple_swift_nio_http2": { + "repoRuleId": "@@bazel_tools//tools/build_defs/repo:http.bzl%http_archive", "attributes": { "urls": [ - "https://github.com/apple/swift-collections/archive/1.0.4.tar.gz" + "https://github.com/apple/swift-nio-http2/archive/1.26.0.tar.gz" ], - "sha256": "d9e4c8a91c60fb9c92a04caccbb10ded42f4cb47b26a212bc6b39cc390a4b096", - "strip_prefix": "swift-collections-1.0.4/", - "build_file": "@@rules_swift~//third_party:com_github_apple_swift_collections/BUILD.overlay" + "sha256": "f0edfc9d6a7be1d587e5b403f2d04264bdfae59aac1d74f7d974a9022c6d2b25", + "strip_prefix": "swift-nio-http2-1.26.0/", + "build_file": "@@rules_swift+//third_party:com_github_apple_swift_nio_http2/BUILD.overlay" } }, - "com_github_grpc_grpc_swift": { - "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", - "ruleClassName": "http_archive", + "com_github_apple_swift_nio_transport_services": { + "repoRuleId": "@@bazel_tools//tools/build_defs/repo:http.bzl%http_archive", "attributes": { "urls": [ - "https://github.com/grpc/grpc-swift/archive/1.16.0.tar.gz" + "https://github.com/apple/swift-nio-transport-services/archive/1.15.0.tar.gz" ], - "sha256": "58b60431d0064969f9679411264b82e40a217ae6bd34e17096d92cc4e47556a5", - "strip_prefix": "grpc-swift-1.16.0/", - "build_file": "@@rules_swift~//third_party:com_github_grpc_grpc_swift/BUILD.overlay" + "sha256": "f3498dafa633751a52b9b7f741f7ac30c42bcbeb3b9edca6d447e0da8e693262", + "strip_prefix": "swift-nio-transport-services-1.15.0/", + "build_file": "@@rules_swift+//third_party:com_github_apple_swift_nio_transport_services/BUILD.overlay" } }, "com_github_apple_swift_nio_extras": { - "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", - "ruleClassName": "http_archive", + "repoRuleId": "@@bazel_tools//tools/build_defs/repo:http.bzl%http_archive", "attributes": { "urls": [ "https://github.com/apple/swift-nio-extras/archive/1.4.0.tar.gz" ], "sha256": "4684b52951d9d9937bb3e8ccd6b5daedd777021ef2519ea2f18c4c922843b52b", "strip_prefix": "swift-nio-extras-1.4.0/", - "build_file": "@@rules_swift~//third_party:com_github_apple_swift_nio_extras/BUILD.overlay" + "build_file": "@@rules_swift+//third_party:com_github_apple_swift_nio_extras/BUILD.overlay" } }, - "com_github_apple_swift_protobuf": { - "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", - "ruleClassName": "http_archive", + "com_github_apple_swift_log": { + "repoRuleId": "@@bazel_tools//tools/build_defs/repo:http.bzl%http_archive", "attributes": { "urls": [ - "https://github.com/apple/swift-protobuf/archive/1.20.2.tar.gz" + "https://github.com/apple/swift-log/archive/1.4.4.tar.gz" ], - "sha256": "3fb50bd4d293337f202d917b6ada22f9548a0a0aed9d9a4d791e6fbd8a246ebb", - "strip_prefix": "swift-protobuf-1.20.2/", - "build_file": "@@rules_swift~//third_party:com_github_apple_swift_protobuf/BUILD.overlay" + "sha256": "48fe66426c784c0c20031f15dc17faf9f4c9037c192bfac2f643f65cb2321ba0", + "strip_prefix": "swift-log-1.4.4/", + "build_file": "@@rules_swift+//third_party:com_github_apple_swift_log/BUILD.overlay" } }, "com_github_apple_swift_nio_ssl": { - "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", - "ruleClassName": "http_archive", + "repoRuleId": "@@bazel_tools//tools/build_defs/repo:http.bzl%http_archive", "attributes": { "urls": [ "https://github.com/apple/swift-nio-ssl/archive/2.23.0.tar.gz" ], "sha256": "4787c63f61dd04d99e498adc3d1a628193387e41efddf8de19b8db04544d016d", "strip_prefix": "swift-nio-ssl-2.23.0/", - "build_file": "@@rules_swift~//third_party:com_github_apple_swift_nio_ssl/BUILD.overlay" + "build_file": "@@rules_swift+//third_party:com_github_apple_swift_nio_ssl/BUILD.overlay" } }, - "com_github_apple_swift_atomics": { - "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", - "ruleClassName": "http_archive", + "com_github_apple_swift_collections": { + "repoRuleId": "@@bazel_tools//tools/build_defs/repo:http.bzl%http_archive", "attributes": { "urls": [ - "https://github.com/apple/swift-atomics/archive/1.1.0.tar.gz" + "https://github.com/apple/swift-collections/archive/1.0.4.tar.gz" ], - "sha256": "1bee7f469f7e8dc49f11cfa4da07182fbc79eab000ec2c17bfdce468c5d276fb", - "strip_prefix": "swift-atomics-1.1.0/", - "build_file": "@@rules_swift~//third_party:com_github_apple_swift_atomics/BUILD.overlay" + "sha256": "d9e4c8a91c60fb9c92a04caccbb10ded42f4cb47b26a212bc6b39cc390a4b096", + "strip_prefix": "swift-collections-1.0.4/", + "build_file": "@@rules_swift+//third_party:com_github_apple_swift_collections/BUILD.overlay" } }, - "com_github_apple_swift_nio_transport_services": { - "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", - "ruleClassName": "http_archive", + "com_github_apple_swift_atomics": { + "repoRuleId": "@@bazel_tools//tools/build_defs/repo:http.bzl%http_archive", "attributes": { "urls": [ - "https://github.com/apple/swift-nio-transport-services/archive/1.15.0.tar.gz" + "https://github.com/apple/swift-atomics/archive/1.1.0.tar.gz" ], - "sha256": "f3498dafa633751a52b9b7f741f7ac30c42bcbeb3b9edca6d447e0da8e693262", - "strip_prefix": "swift-nio-transport-services-1.15.0/", - "build_file": "@@rules_swift~//third_party:com_github_apple_swift_nio_transport_services/BUILD.overlay" + "sha256": "1bee7f469f7e8dc49f11cfa4da07182fbc79eab000ec2c17bfdce468c5d276fb", + "strip_prefix": "swift-atomics-1.1.0/", + "build_file": "@@rules_swift+//third_party:com_github_apple_swift_atomics/BUILD.overlay" } }, - "com_github_apple_swift_nio": { - "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", - "ruleClassName": "http_archive", + "build_bazel_rules_swift_index_import": { + "repoRuleId": "@@bazel_tools//tools/build_defs/repo:http.bzl%http_archive", "attributes": { + "build_file": "@@rules_swift+//third_party:build_bazel_rules_swift_index_import/BUILD.overlay", + "canonical_id": "index-import-5.8", "urls": [ - "https://github.com/apple/swift-nio/archive/2.42.0.tar.gz" + "https://github.com/MobileNativeFoundation/index-import/releases/download/5.8.0.1/index-import.tar.gz" ], - "sha256": "e3304bc3fb53aea74a3e54bd005ede11f6dc357117d9b1db642d03aea87194a0", - "strip_prefix": "swift-nio-2.42.0/", - "build_file": "@@rules_swift~//third_party:com_github_apple_swift_nio/BUILD.overlay" + "sha256": "28c1ffa39d99e74ed70623899b207b41f79214c498c603915aef55972a851a15" } }, "build_bazel_rules_swift_local_config": { - "bzlFile": "@@rules_swift~//swift/internal:swift_autoconfiguration.bzl", - "ruleClassName": "swift_autoconfiguration", + "repoRuleId": "@@rules_swift+//swift/internal:swift_autoconfiguration.bzl%swift_autoconfiguration", "attributes": {} } }, "recordedRepoMappingEntries": [ [ - "rules_swift~", + "rules_swift+", "bazel_tools", "bazel_tools" - ], - [ - "rules_swift~", - "build_bazel_rules_swift", - "rules_swift~" ] ] } diff --git a/Package.swift b/Package.swift index 2a74ece865..14794bd1d7 100644 --- a/Package.swift +++ b/Package.swift @@ -7,7 +7,7 @@ var dependencies: [Package.Dependency] = [ .package(url: "https://github.com/tadija/AEXML", from: "4.0.0"), .package(url: "https://github.com/apple/swift-argument-parser", from: "1.0.0"), .package(url: "https://github.com/kateinoigakukun/swift-indexstore", from: "0.3.0"), - .package(url: "https://github.com/apple/swift-syntax", from: "600.0.0"), + .package(url: "https://github.com/apple/swift-syntax", from: "600.0.1"), .package(url: "https://github.com/ileitch/swift-filename-matcher", from: "0.0.0"), ] @@ -83,6 +83,7 @@ var targets: [PackageDescription.Target] = [ .target(name: "SyntaxAnalysis"), .target(name: "Shared"), .product(name: "SwiftIndexStore", package: "swift-indexstore"), + .product(name: "AEXML", package: "AEXML"), ] ), .target( diff --git a/Sources/BUILD.bazel b/Sources/BUILD.bazel new file mode 100644 index 0000000000..0ffe0c6d27 --- /dev/null +++ b/Sources/BUILD.bazel @@ -0,0 +1,277 @@ +load("@rules_swift//swift:swift.bzl", "swift_binary", "swift_library") +load("//bazel/internal:opt.bzl", "optimized_swift_binary") # buildifier: disable=bzl-visibility + +swift_library( + name = "XcodeSupport", + srcs = [ + "XcodeSupport/XcodeProject.swift", + "XcodeSupport/XcodeProjectSetupGuide.swift", + "XcodeSupport/XcodeProjectlike.swift", + "XcodeSupport/XcodeTarget.swift", + "XcodeSupport/XcodeWorkspace.swift", + "XcodeSupport/Xcodebuild.swift", + ], + module_name = "XcodeSupport", + deps = [ + "//Sources:PeripheryKit", + "//Sources:Shared", + "//Sources:SourceGraph", + "@com_github_tuist_xcodeproj//:XcodeProj", + ], +) + +swift_library( + name = "SyntaxAnalysis", + srcs = [ + "SyntaxAnalysis/CommentCommand.swift", + "SyntaxAnalysis/DeclarationSyntaxVisitor.swift", + "SyntaxAnalysis/ImportSyntaxVisitor.swift", + "SyntaxAnalysis/MultiplexingSyntaxVisitor.swift", + "SyntaxAnalysis/SourceLocationBuilder.swift", + "SyntaxAnalysis/TypeSyntaxInspector.swift", + "SyntaxAnalysis/UnusedParameterAnalyzer.swift", + "SyntaxAnalysis/UnusedParameterParser.swift", + ], + module_name = "SyntaxAnalysis", + deps = [ + "//Sources:Shared", + "//Sources:SourceGraph", + "@swift-syntax//:SwiftParser", + "@swift-syntax//:SwiftSyntax", + ], +) + +swift_library( + name = "SourceGraph", + srcs = [ + "SourceGraph/Elements/Accessibility.swift", + "SourceGraph/Elements/AssetReference.swift", + "SourceGraph/Elements/CommentCommand.swift", + "SourceGraph/Elements/Declaration.swift", + "SourceGraph/Elements/ImportStatement.swift", + "SourceGraph/Elements/Location.swift", + "SourceGraph/Elements/ProjectFileKind.swift", + "SourceGraph/Elements/Reference.swift", + "SourceGraph/Elements/SourceFile.swift", + "SourceGraph/Mutators/AccessibilityCascader.swift", + "SourceGraph/Mutators/AncestralReferenceEliminator.swift", + "SourceGraph/Mutators/AssetReferenceRetainer.swift", + "SourceGraph/Mutators/AssignOnlyPropertyReferenceEliminator.swift", + "SourceGraph/Mutators/CapitalSelfFunctionCallRetainer.swift", + "SourceGraph/Mutators/CodablePropertyRetainer.swift", + "SourceGraph/Mutators/CodingKeyEnumReferenceBuilder.swift", + "SourceGraph/Mutators/ComplexPropertyAccessorReferenceBuilder.swift", + "SourceGraph/Mutators/DefaultConstructorReferenceBuilder.swift", + "SourceGraph/Mutators/DynamicMemberLookupReferenceBuilder.swift", + "SourceGraph/Mutators/EntryPointAttributeRetainer.swift", + "SourceGraph/Mutators/EnumCaseReferenceBuilder.swift", + "SourceGraph/Mutators/ExtensionReferenceBuilder.swift", + "SourceGraph/Mutators/ExternalOverrideRetainer.swift", + "SourceGraph/Mutators/ExternalTypeProtocolConformanceReferenceRemover.swift", + "SourceGraph/Mutators/GenericClassAndStructConstructorReferenceBuilder.swift", + "SourceGraph/Mutators/InterfaceBuilderPropertyRetainer.swift", + "SourceGraph/Mutators/ObjCAccessibleRetainer.swift", + "SourceGraph/Mutators/PropertyWrapperRetainer.swift", + "SourceGraph/Mutators/ProtocolConformanceReferenceBuilder.swift", + "SourceGraph/Mutators/ProtocolExtensionReferenceBuilder.swift", + "SourceGraph/Mutators/PubliclyAccessibleRetainer.swift", + "SourceGraph/Mutators/RedundantExplicitPublicAccessibilityMarker.swift", + "SourceGraph/Mutators/RedundantProtocolMarker.swift", + "SourceGraph/Mutators/ResultBuilderRetainer.swift", + "SourceGraph/Mutators/StringInterpolationAppendInterpolationRetainer.swift", + "SourceGraph/Mutators/StructImplicitInitializerReferenceBuilder.swift", + "SourceGraph/Mutators/SwiftUIRetainer.swift", + "SourceGraph/Mutators/UnusedImportMarker.swift", + "SourceGraph/Mutators/UnusedParameterRetainer.swift", + "SourceGraph/Mutators/UsedDeclarationMarker.swift", + "SourceGraph/Mutators/XCTestRetainer.swift", + "SourceGraph/SourceGraph.swift", + "SourceGraph/SourceGraphDebugger.swift", + "SourceGraph/SourceGraphMutator.swift", + "SourceGraph/SourceGraphMutatorRunner.swift", + "SourceGraph/SynchronizedSourceGraph.swift", + ], + module_name = "SourceGraph", + deps = [ + "//Sources:Configuration", + "//Sources:Shared", + "@swift-syntax//:SwiftSyntax", + ], +) + +swift_library( + name = "Shared", + srcs = [ + "Shared/Benchmark.swift", + "Shared/Constants.swift", + "Shared/PeripheryError.swift", + "Shared/ProjectKind.swift", + "Shared/PropertyTypeSanitizer.swift", + "Shared/SetupGuide.swift", + "Shared/Shell.swift", + "Shared/SwiftVersion.swift", + "Shared/SwiftVersionParser.swift", + "Shared/UnfairLock.swift", + ], + module_name = "Shared", + deps = [ + "//Sources:Extensions", + "//Sources:Logger", + "@com_github_apple_swift-system//:SystemPackage", + "@swift-filename-matcher//:FilenameMatcher", + ], +) + +swift_library( + name = "ProjectDrivers", + srcs = [ + "ProjectDrivers/BazelProjectDriver.swift", + "ProjectDrivers/GenericProjectDriver.swift", + "ProjectDrivers/ProjectDriver.swift", + "ProjectDrivers/SPM.swift", + "ProjectDrivers/SPMProjectDriver.swift", + "ProjectDrivers/XcodeProjectDriver.swift", + ], + module_name = "ProjectDrivers", + deps = [ + "//Sources:Indexer", + "//Sources:Shared", + "//Sources:SourceGraph", + "//Sources:XcodeSupport", + ], +) + +swift_library( + name = "PeripheryKit", + srcs = [ + "PeripheryKit/Results/Baseline.swift", + "PeripheryKit/Results/CheckstyleFormatter.swift", + "PeripheryKit/Results/CodeClimateFormatter.swift", + "PeripheryKit/Results/CsvFormatter.swift", + "PeripheryKit/Results/GitHubActionsFormatter.swift", + "PeripheryKit/Results/JsonFormatter.swift", + "PeripheryKit/Results/OutputDeclarationFilter.swift", + "PeripheryKit/Results/OutputFormatter.swift", + "PeripheryKit/Results/XcodeFormatter.swift", + "PeripheryKit/ScanResult.swift", + "PeripheryKit/ScanResultBuilder.swift", + ], + module_name = "PeripheryKit", + deps = [ + "//Sources:Indexer", + "//Sources:Shared", + "//Sources:SourceGraph", + "@aexml//:AEXML", + "@com_github_apple_swift-system//:SystemPackage", + "@swift-filename-matcher//:FilenameMatcher", + "@swift-indexstore//:SwiftIndexStore", + "@swift-syntax//:SwiftParser", + "@swift-syntax//:SwiftSyntax", + ], +) + +swift_library( + name = "Logger", + srcs = ["Logger/Logger.swift"], + module_name = "Logger", +) + +swift_library( + name = "Indexer", + srcs = [ + "Indexer/IndexPipeline.swift", + "Indexer/IndexPlan.swift", + "Indexer/Indexer.swift", + "Indexer/InfoPlistIndexer.swift", + "Indexer/InfoPlistParser.swift", + "Indexer/JobPool.swift", + "Indexer/SourceFileCollector.swift", + "Indexer/SwiftIndexer.swift", + "Indexer/XCDataModelIndexer.swift", + "Indexer/XCDataModelParser.swift", + "Indexer/XCMappingModelIndexer.swift", + "Indexer/XCMappingModelParser.swift", + "Indexer/XibIndexer.swift", + "Indexer/XibParser.swift", + ], + module_name = "Indexer", + deps = [ + "//Sources:Shared", + "//Sources:SyntaxAnalysis", + "@aexml//:AEXML", + "@swift-indexstore//:SwiftIndexStore", + ], +) + +swift_binary( + name = "Frontend", + srcs = [ + "Frontend/Commands/CheckUpdateCommand.swift", + "Frontend/Commands/ClearCacheCommand.swift", + "Frontend/Commands/FrontendCommand.swift", + "Frontend/Commands/ScanCommand.swift", + "Frontend/Commands/VersionCommand.swift", + "Frontend/CommonSetupGuide.swift", + "Frontend/GuidedSetup.swift", + "Frontend/Logger+Extension.swift", + "Frontend/Project.swift", + "Frontend/SPMProjectSetupGuide.swift", + "Frontend/Scan.swift", + "Frontend/UpdateChecker.swift", + "Frontend/Version.swift", + "Frontend/main.swift", + ], + module_name = "Frontend", + deps = [ + "//Sources:Configuration", + "//Sources:PeripheryKit", + "//Sources:ProjectDrivers", + "//Sources:Shared", + "//Sources:SourceGraph", + "@swift-filename-matcher//:FilenameMatcher", + "@swift_argument_parser//:ArgumentParser", + ], +) + +optimized_swift_binary( + name = "Frontend_opt", + target = ":Frontend", + visibility = ["//visibility:public"], +) + +swift_library( + name = "Extensions", + srcs = [ + "Extensions/Array+Extension.swift", + "Extensions/Collection+Extension.swift", + "Extensions/FilePath+Extension.swift", + "Extensions/FilePath+Glob.swift", + "Extensions/FilenameMatcher+Extension.swift", + "Extensions/Sequence+Extension.swift", + "Extensions/Set+Extension.swift", + "Extensions/String+Extension.swift", + "Extensions/String+Version.swift", + ], + module_name = "Extensions", + deps = [ + "@com_github_apple_swift-system//:SystemPackage", + "@swift-filename-matcher//:FilenameMatcher", + ], +) + +swift_library( + name = "Configuration", + srcs = [ + "Configuration/Configuration.swift", + "Configuration/OutputFormat.swift", + ], + module_name = "Configuration", + deps = [ + "//Sources:Extensions", + "//Sources:Logger", + "//Sources:Shared", + "@com_github_apple_swift-system//:SystemPackage", + "@swift-filename-matcher//:FilenameMatcher", + "@yams//:Yams", + ], +) diff --git a/Sources/Configuration/Configuration.swift b/Sources/Configuration/Configuration.swift index 7428078ddd..dec444ab9c 100644 --- a/Sources/Configuration/Configuration.swift +++ b/Sources/Configuration/Configuration.swift @@ -153,11 +153,12 @@ public final class Configuration { FileManager.default.createFile(atPath: path.string, contents: data) } - public func load(from path: FilePath?, logger: Logger) throws { + public func load(from path: FilePath?) throws { guard let path = try configurationPath(withUserProvided: path) else { return } let encodedYAML = try String(contentsOf: path.url) let yaml = try Yams.load(yaml: encodedYAML) as? [String: Any] ?? [:] + let logger = Logger(quiet: false) for (key, value) in yaml { if let setting = settings.first(where: { key == $0.key }) { diff --git a/Sources/Frontend/Commands/ScanCommand.swift b/Sources/Frontend/Commands/ScanCommand.swift index 8dc85d65d7..e006e7549b 100644 --- a/Sources/Frontend/Commands/ScanCommand.swift +++ b/Sources/Frontend/Commands/ScanCommand.swift @@ -140,13 +140,10 @@ struct ScanCommand: FrontendCommand { private static let defaultConfiguration = Configuration() func run() throws { - let logger = Logger(quiet: quiet, verbose: verbose) - logger.contextualized(with: "version").debug(PeripheryVersion) - let configuration = Configuration() if !setup { - try configuration.load(from: config, logger: logger) + try configuration.load(from: config) } configuration.guidedSetup = setup @@ -190,6 +187,11 @@ struct ScanCommand: FrontendCommand { configuration.apply(\.$bazel, bazel) configuration.apply(\.$bazelFilter, bazelFilter) + let logger = Logger( + quiet: configuration.quiet, + verbose: configuration.verbose + ) + logger.contextualized(with: "version").debug(PeripheryVersion) let shell = Shell(logger: logger) let swiftVersion = SwiftVersion(shell: shell) logger.debug(swiftVersion.fullVersion) diff --git a/Sources/ProjectDrivers/BazelProjectDriver.swift b/Sources/ProjectDrivers/BazelProjectDriver.swift index 161cc3f154..3edfa584c4 100644 --- a/Sources/ProjectDrivers/BazelProjectDriver.swift +++ b/Sources/ProjectDrivers/BazelProjectDriver.swift @@ -9,13 +9,7 @@ class BazelProjectDriver: ProjectDriver { FilePath("MODULE.bazel").exists || FilePath("WORKSPACE").exists } - static func build(configuration: Configuration, shell: Shell, logger: Logger) throws -> Self { - configuration.bazel = false // Generic project mode is used for the actual scan. - configuration.reportExclude.append("**/bazel-out/**/*") - return self.init(configuration: configuration, shell: shell, logger: logger) - } - - static let topLevelKinds = [ + private static let topLevelKinds = [ // rules_apple, iOS "ios_app_clip", "ios_application", @@ -69,7 +63,7 @@ class BazelProjectDriver: ProjectDriver { private lazy var contextLogger: ContextualLogger = logger.contextualized(with: "bazel") - required init( + public required init( configuration: Configuration, shell: Shell, logger: Logger, @@ -89,13 +83,15 @@ class BazelProjectDriver: ProjectDriver { try fileManager.createDirectory(at: outputPath.url, withIntermediateDirectories: true) let configPath = outputPath.appending("periphery.yml") + configuration.bazel = false // Generic project mode is used for the actual scan. + configuration.reportExclude.append("**/bazel-out/**/*") try configuration.save(to: configPath) contextLogger.debug("Configuration written to \(configPath)") let buildPath = outputPath.appending("BUILD.bazel") let deps = try queryTargets().joined(separator: ",\n") let buildFileContents = """ - load("@periphery//bazel/scan:scan.bzl", "scan") + load("@periphery//bazel:rules.bzl", "scan") scan( name = "scan", @@ -124,7 +120,7 @@ class BazelProjectDriver: ProjectDriver { "run", "--check_visibility=false", "--ui_event_filters=-info,-debug,-warning", - "@periphery//:scan", + "@periphery_generated//rule:scan", ]) // The actual scan is performed by Bazel. diff --git a/Sources/ProjectDrivers/Project.swift b/Sources/ProjectDrivers/Project.swift index c7610dce61..544ef4b665 100644 --- a/Sources/ProjectDrivers/Project.swift +++ b/Sources/ProjectDrivers/Project.swift @@ -80,7 +80,7 @@ public final class Project { case .spm: return try SPMProjectDriver(configuration: configuration, shell: shell, logger: logger) case .bazel: - return try BazelProjectDriver.build( + return BazelProjectDriver( configuration: configuration, shell: shell, logger: logger diff --git a/Sources/ProjectDrivers/XcodeProjectDriver.swift b/Sources/ProjectDrivers/XcodeProjectDriver.swift index e46e71eabb..f6adfb136a 100644 --- a/Sources/ProjectDrivers/XcodeProjectDriver.swift +++ b/Sources/ProjectDrivers/XcodeProjectDriver.swift @@ -21,6 +21,11 @@ shell: Shell, logger: Logger ) throws { + if configuration.outputFormat.supportsAuxiliaryOutput { + let asterisk = colorize("*", .boldGreen) + logger.info("\(asterisk) Inspecting project...") + } + let xcodebuild = Xcodebuild(shell: shell, logger: logger) guard !configuration.schemes.isEmpty else { diff --git a/Sources/Scan/Scan.swift b/Sources/Scan/Scan.swift index 9d6376abf6..0648aa99e7 100644 --- a/Sources/Scan/Scan.swift +++ b/Sources/Scan/Scan.swift @@ -59,12 +59,6 @@ public final class Scan { private func setup(_ project: Project) throws -> ProjectDriver { let driverSetupInterval = logger.beginInterval("driver:setup") - - if configuration.outputFormat.supportsAuxiliaryOutput { - let asterisk = colorize("*", .boldGreen) - logger.info("\(asterisk) Inspecting project...") - } - let driver = try project.driver() logger.endInterval(driverSetupInterval) return driver diff --git a/Sources/Shared/Shell.swift b/Sources/Shared/Shell.swift index ae27c4ea12..f393e8ddb5 100644 --- a/Sources/Shared/Shell.swift +++ b/Sources/Shared/Shell.swift @@ -68,7 +68,7 @@ open class Shell { _ args: [String], stderr: Bool = true ) throws -> String { - let env = environment + let env = pristineEnvironment let (status, output) = try exec(args, environment: env, stderr: stderr) if status == 0 { @@ -87,7 +87,7 @@ open class Shell { _ args: [String], stderr: Bool = true ) throws -> Int32 { - let env = environment + let env = pristineEnvironment let (status, _) = try exec(args, environment: env, stderr: stderr, captureOutput: false) return status } diff --git a/bazel/extensions.bzl b/bazel/extensions.bzl index 67244e28ef..076ae68908 100644 --- a/bazel/extensions.bzl +++ b/bazel/extensions.bzl @@ -1,3 +1,7 @@ +""" + Public module extensions. +""" + def _generated_repo_impl(repository_ctx): repository_ctx.file( "BUILD.bazel", diff --git a/bazel/internal/BUILD.bazel b/bazel/internal/BUILD.bazel new file mode 100644 index 0000000000..c3d60a89af --- /dev/null +++ b/bazel/internal/BUILD.bazel @@ -0,0 +1,25 @@ +load("@buildifier_prebuilt//:rules.bzl", "buildifier") + +exports_files([ + "run.sh", +]) + +buildifier( + name = "buildifier.fix", + exclude_patterns = [ + "./.git/**/*", + "**/.build/**/*", + ], + lint_mode = "fix", + mode = "fix", +) + +buildifier( + name = "buildifier.check", + exclude_patterns = [ + "./.git/**/*", + "**/.build/**/*", + ], + lint_mode = "warn", + mode = "check", +) diff --git a/bazel/internal/bazel_baseline.json b/bazel/internal/bazel_baseline.json new file mode 100644 index 0000000000..723bd90fb8 --- /dev/null +++ b/bazel/internal/bazel_baseline.json @@ -0,0 +1 @@ +{"v1":{"usrs":["s:13Configuration15AbstractSettingP5resetyyF","s:13Configuration7SettingC5resetyyF","s:13ConfigurationAAC13resetMatchersyyF","s:13ConfigurationAAC5resetyyF","s:13SystemPackage8FilePathV10ExtensionsE5chdir7closureyyyKXE_tKF","s:14SyntaxAnalysis21UnusedParameterParserV5parse4file0F9ProtocolsSayAA8FunctionCG11SourceGraph0J4FileC_SbtKFZ"]}} \ No newline at end of file diff --git a/bazel/internal/extensions.bzl b/bazel/internal/extensions.bzl new file mode 100644 index 0000000000..4c93bc4a3f --- /dev/null +++ b/bazel/internal/extensions.bzl @@ -0,0 +1,10 @@ +""" + Internal module extensions. +""" + +load( + "//bazel/internal:repositories.bzl", + "periphery_dependencies", +) + +non_module_deps = module_extension(implementation = lambda _: periphery_dependencies()) diff --git a/bazel/internal/opt.bzl b/bazel/internal/opt.bzl new file mode 100644 index 0000000000..8e2b46cb35 --- /dev/null +++ b/bazel/internal/opt.bzl @@ -0,0 +1,47 @@ +""" + Rules for enabling Swift optimizations. +""" + +def _enable_optimizations_impl( + settings, + attr): # @unused + return { + "//command_line_option:compilation_mode": "opt", + "//command_line_option:features": settings["//command_line_option:features"] + [ + "swift.opt_uses_wmo", + "-swift.opt_uses_osize", + ], + } + +_enable_optimizations = transition( + implementation = _enable_optimizations_impl, + inputs = ["//command_line_option:features"], + outputs = ["//command_line_option:compilation_mode", "//command_line_option:features"], +) + +def _optimized_swift_binary_impl(ctx): + default_info = ctx.attr.target[0][DefaultInfo] + new_exe = ctx.actions.declare_file(ctx.label.name) + ctx.actions.symlink( + output = new_exe, + target_file = ctx.executable.target, + ) + return [ + DefaultInfo( + executable = new_exe, + files = depset([new_exe], transitive = [default_info.files]), + runfiles = ctx.runfiles().merge(default_info.default_runfiles), + ), + ] + +optimized_swift_binary = rule( + attrs = { + "target": attr.label( + cfg = _enable_optimizations, + mandatory = True, + executable = True, + ), + }, + executable = True, + implementation = _optimized_swift_binary_impl, +) diff --git a/bazel/internal/repositories.bzl b/bazel/internal/repositories.bzl new file mode 100644 index 0000000000..75cdb312ed --- /dev/null +++ b/bazel/internal/repositories.bzl @@ -0,0 +1,93 @@ +""" + Non-module dependencies that are not available in the Bazel ecosystem. +""" + +load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") + +def periphery_dependencies(): + http_archive( + name = "com_github_tuist_xcodeproj", + build_file_content = """\ +load("@rules_swift//swift:swift.bzl", "swift_library") + +swift_library( + name = "XcodeProj", + srcs = glob(["Sources/XcodeProj/**/*.swift"]), + visibility = ["//visibility:public"], + deps = [ + "@aexml//:AEXML", + "@com_github_kylef_pathkit//:PathKit", + ], +) + """, + sha256 = "3990868f731888edabcaeacf639f0ee75e2e4430102a4f4bf40b03a60eeafe12", + strip_prefix = "XcodeProj-8.24.7", + url = "https://github.com/tuist/XcodeProj/archive/refs/tags/8.24.7.tar.gz", + ) + + http_archive( + name = "com_github_kylef_pathkit", + build_file_content = """\ +load("@rules_swift//swift:swift.bzl", "swift_library") + +swift_library( + name = "PathKit", + srcs = glob(["Sources/**/*.swift"]), + visibility = ["//visibility:public"], +) + """, + sha256 = "fcda78cdf12c1c6430c67273333e060a9195951254230e524df77841a0235dae", + strip_prefix = "PathKit-1.0.1", + url = "https://github.com/kylef/PathKit/archive/refs/tags/1.0.1.tar.gz", + ) + + # TODO: https://github.com/apple/swift-system/pull/194 + http_archive( + name = "com_github_apple_swift-system", + build_file_content = """\ +load("@rules_swift//swift:swift.bzl", "swift_library", "swift_test") + +config_setting( + name = "debug", + values = {"compilation_mode": "dbg"}, +) + +cc_library( + name = "CSystem", + hdrs = glob(["Sources/CSystem/include/*.h"]), + aspect_hints = ["@rules_swift//swift:auto_module"], + defines = select({ + "@platforms//os:windows": ["_CRT_SECURE_NO_WARNINGS"], + "//conditions:default": [], + }), + linkstatic = True, + tags = ["swift_module=CSystem"], +) + +DARWIN_DEFINES = ["SYSTEM_PACKAGE_DARWIN"] + +swift_library( + name = "SystemPackage", + srcs = glob(["Sources/System/**/*.swift"]), + defines = ["SYSTEM_PACKAGE"] + + select({ + "@platforms//os:macos": DARWIN_DEFINES, + "@platforms//os:ios": DARWIN_DEFINES, + "@platforms//os:tvos": DARWIN_DEFINES, + "@platforms//os:watchos": DARWIN_DEFINES, + "@platforms//os:visionos": DARWIN_DEFINES, + "//conditions:default": [], + }) + + select({ + ":debug": ["ENABLE_MOCKING"], + "//conditions:default": [], + }), + module_name = "SystemPackage", + visibility = ["//visibility:public"], + deps = [":CSystem"], +) + """, + sha256 = "799474251c3654b5483c0f49045ff6729e07acebe9d1541aabfbec68d0390457", + strip_prefix = "swift-system-1.4.0", + url = "https://github.com/apple/swift-system/archive/refs/tags/1.4.0.tar.gz", + ) diff --git a/bazel/internal/run.sh b/bazel/internal/run.sh new file mode 100755 index 0000000000..8c97499596 --- /dev/null +++ b/bazel/internal/run.sh @@ -0,0 +1,11 @@ +#!/bin/bash + +set -e + +LAUNCH_WORKING_DIRECTORY=$(pwd) + +if test "${BUILD_WORKING_DIRECTORY+x}"; then + cd $BUILD_WORKING_DIRECTORY +fi + +$LAUNCH_WORKING_DIRECTORY/Sources/Frontend "${@:1}" \ No newline at end of file diff --git a/bazel/internal/scan/BUILD.bazel b/bazel/internal/scan/BUILD.bazel new file mode 100644 index 0000000000..3b371ef739 --- /dev/null +++ b/bazel/internal/scan/BUILD.bazel @@ -0,0 +1,3 @@ +exports_files([ + "scan_template.sh", +]) diff --git a/bazel/scan/scan.bzl b/bazel/internal/scan/scan.bzl similarity index 85% rename from bazel/scan/scan.bzl rename to bazel/internal/scan/scan.bzl index 5b888bae28..e15e8312f6 100644 --- a/bazel/scan/scan.bzl +++ b/bazel/internal/scan/scan.bzl @@ -1,6 +1,10 @@ +""" + Declares the `scan` rule which acts as the primary entry point for the Periphery Bazel integration. +""" + load("@bazel_skylib//lib:sets.bzl", "sets") -load("@rules_swift//swift:providers.bzl", "SwiftInfo") load("@rules_apple//apple:providers.bzl", "AppleResourceInfo") +load("@rules_swift//swift:providers.bzl", "SwiftBinaryInfo", "SwiftInfo") PeripheryInfo = provider( doc = "Provides inputs needed to generate a generic project configuration file.", @@ -41,18 +45,25 @@ def _scan_inputs_aspect_impl(target, ctx): xcdatamodels = [] xcmappingmodels = [] - if not target.label.workspace_name: # Ignore external deps - if SwiftInfo in target and hasattr(target[SwiftInfo], "direct_modules"): - for module in target[SwiftInfo].direct_modules: - if hasattr(module, "swift"): - if hasattr(module.compilation_context, "direct_sources"): - swift_srcs.extend([src for src in module.compilation_context.direct_sources if src.extension == "swift"]) + if not target.label.workspace_name: # Ignore external deps + modules = [] + + if SwiftBinaryInfo in target: + modules.extend(target[SwiftBinaryInfo].swift_info.direct_modules) + + if SwiftInfo in target: + modules.extend(target[SwiftInfo].direct_modules) - if ctx.rule.attr.testonly: - test_targets.append(module.name) + for module in modules: + if hasattr(module, "swift"): + if hasattr(module.compilation_context, "direct_sources"): + swift_srcs.extend([src for src in module.compilation_context.direct_sources if src.extension == "swift"]) - if hasattr(module.swift, "indexstore") and module.swift.indexstore: - indexstores.append(module.swift.indexstore) + if ctx.rule.attr.testonly: + test_targets.append(module.name) + + if hasattr(module.swift, "indexstore") and module.swift.indexstore: + indexstores.append(module.swift.indexstore) if AppleResourceInfo in target: # Each attribute has the structure '[(parent, resource_swift_module, resource_depset)]' @@ -172,8 +183,8 @@ def _scan_impl(ctx): substitutions = { "%periphery_binary%": ctx.attr.periphery_binary, "%config_path%": ctx.attr.config, - "%project_config_path%": project_config_file.path - } + "%project_config_path%": project_config_file.path, + }, ) return DefaultInfo( @@ -186,7 +197,7 @@ def _scan_impl(ctx): # in the indexstores and will be read by Periphery, and therefore must be present in # the runfiles. files = swift_srcs + indexstores + plists + xibs + xcdatamodels + xcmappingmodels, - ) + ), ) scan_inputs_aspect = aspect( @@ -201,13 +212,13 @@ scan = rule( cfg = _force_indexstore, mandatory = True, aspects = [scan_inputs_aspect], - doc = "Top-level project targets to scan." + doc = "Top-level project targets to scan.", ), "config": attr.string(doc = "Path to the periphery.yml configuration file."), "periphery_binary": attr.string(doc = "Path to the periphery binary."), "_template": attr.label( allow_single_file = True, - default = "@periphery//bazel/scan:scan_template.sh", + default = "@periphery//bazel/internal/scan:scan_template.sh", ), }, outputs = { diff --git a/bazel/scan/scan_template.sh b/bazel/internal/scan/scan_template.sh similarity index 99% rename from bazel/scan/scan_template.sh rename to bazel/internal/scan/scan_template.sh index 2b0ec01c49..fb0b037033 100644 --- a/bazel/scan/scan_template.sh +++ b/bazel/internal/scan/scan_template.sh @@ -1,2 +1,3 @@ cd $BUILD_WORKSPACE_DIRECTORY + %periphery_binary% scan --config "%config_path%" --generic-project-config "%project_config_path%" diff --git a/bazel/rules.bzl b/bazel/rules.bzl new file mode 100644 index 0000000000..1a4efde119 --- /dev/null +++ b/bazel/rules.bzl @@ -0,0 +1,10 @@ +""" + Periphery public rules. +""" + +load( + "//bazel/internal/scan:scan.bzl", + _scan = "scan", +) + +scan = _scan diff --git a/bazel/scan/BUILD.bazel b/bazel/scan/BUILD.bazel deleted file mode 100644 index 9181ac277f..0000000000 --- a/bazel/scan/BUILD.bazel +++ /dev/null @@ -1,3 +0,0 @@ -exports_files([ - "scan_template.sh" -]) diff --git a/scripts/benchmark b/scripts/benchmark deleted file mode 100755 index b5e73b1efd..0000000000 --- a/scripts/benchmark +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/bash - -set -e -make build_arm64 -./.build/release/periphery scan --quiet -hyperfine --warmup 3 './.build/release/periphery scan --quiet --skip-build' diff --git a/scripts/gen_bazel_rules.rb b/scripts/gen_bazel_rules.rb new file mode 100644 index 0000000000..5715b9b416 --- /dev/null +++ b/scripts/gen_bazel_rules.rb @@ -0,0 +1,117 @@ +#!/usr/bin/env ruby + +require 'json' + +PRODUCTS = { + "ArgumentParser" => "@swift_argument_parser", + "SystemPackage" => "@com_github_apple_swift-system", + "SwiftIndexStore" => "@swift-indexstore", + "FilenameMatcher" => "@swift-filename-matcher", + "Yams" => "@yams", + "SwiftParser" => "@swift-syntax", + "SwiftSyntax" => "@swift-syntax", + "XcodeProj" => "@com_github_tuist_xcodeproj", + "AEXML" => "@aexml", +} + +def parse_json + JSON.parse(`swift package describe --type json`) +rescue JSON::ParserError => e + puts "Error parsing JSON: #{e.message}" + exit 1 +end + +def target_labels(targets) + targets.each_with_object({}) do |target, labels| + labels[target["name"]] = generate_label(target) + end +end + +def generate_label(target) + "//Sources:#{target["name"]}" +end + +def generate_sources(target) + path = target["path"].split("/").last + + target["sources"].map do |source| + "#{path}/#{source}" + end +end + +def generate_dependencies(target, target_labels) + deps = (target["target_dependencies"] || []).map { |dep| "\"#{target_labels[dep]}\"" } + deps += (target["product_dependencies"] || []).map do |dep| + pkg = PRODUCTS[dep] + "\"#{pkg}//:#{dep}\"" + end + deps +end + +def generate_attrs(target, name, path, sources, deps) + attrs = { + "name" => "\"#{name}\"", + "module_name" => "\"#{name}\"", + "srcs" => sources.map { |src| src } + } + + if target["type"] == "library" + end + + attrs["deps"] = "[\n #{deps.sort.join(",\n ")}\n ]" unless deps.empty? + attrs +end + +def generate_bazel_rule(path, rule, name, attrs) + formatted_attrs = attrs.map { |k, v| " #{k} = #{v}" }.join(",\n") + formatted_rule = "#{rule}(\n#{formatted_attrs}\n)" + + if rule == "swift_binary" + return <<~EOS + #{formatted_rule} + + optimized_swift_binary( + name = "#{name}_opt", + target = ":#{name}", + visibility = ["//visibility:public"], + ) + EOS + else + return formatted_rule + end +end + +json = parse_json +labels = target_labels(json["targets"]) + +rules = json["targets"].map do |target| + name = target["name"] + path = target["path"] + + next if path.start_with?("Tests") + + puts generate_label(target) + + type = target["type"] + sources = generate_sources(target) + deps = generate_dependencies(target, labels) + + rule = case type + when "executable" then "swift_binary" + when "test" then "swift_test" + else "swift_library" + end + + attrs = generate_attrs(target, name, path, sources, deps) + generate_bazel_rule(path, rule, name, attrs) +end + +File.write("Sources/BUILD.bazel", <<~EOS) + load("@rules_swift//swift:swift.bzl", "swift_binary", "swift_library") + load("//bazel/internal:opt.bzl", "optimized_swift_binary") + + #{rules.join("\n\n")} +EOS + +puts +exec("bazel", "run", "//bazel/internal:buildifier.fix") From b210f12544fb7f1842402babd9d30f8249c68fd9 Mon Sep 17 00:00:00 2001 From: Ian Leitch Date: Fri, 13 Dec 2024 16:55:52 +0000 Subject: [PATCH 06/63] Fix help handling --- Sources/Frontend/main.swift | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/Sources/Frontend/main.swift b/Sources/Frontend/main.swift index afa301355b..568c52741e 100644 --- a/Sources/Frontend/main.swift +++ b/Sources/Frontend/main.swift @@ -29,13 +29,7 @@ signal(SIGINT) { _ in do { var command = try PeripheryCommand.parseAsRoot() - do { - try command.run() - } catch let error as PeripheryError { - throw error - } catch { - throw PeripheryError.underlyingError(error) - } + try command.run() } catch { PeripheryCommand.exit(withError: error) } From 50dbc430c132b6762ae4e0907f9f3bcc705491fe Mon Sep 17 00:00:00 2001 From: Ian Leitch Date: Sat, 14 Dec 2024 13:25:11 +0000 Subject: [PATCH 07/63] Disable external override bug workaround in >= 6.1 --- .../Mutators/ExternalOverrideRetainer.swift | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/Sources/SourceGraph/Mutators/ExternalOverrideRetainer.swift b/Sources/SourceGraph/Mutators/ExternalOverrideRetainer.swift index a515244a6c..04dbce8495 100644 --- a/Sources/SourceGraph/Mutators/ExternalOverrideRetainer.swift +++ b/Sources/SourceGraph/Mutators/ExternalOverrideRetainer.swift @@ -4,15 +4,16 @@ import Shared /// Retains instance functions/vars that override external declarations. /// -/// It's not possible to determine if a declaration that overrides an external declaration is used, as the -/// external implementation may call the overridden declaration. +/// It's not possible to determine if a declaration that overrides an external declaration is used, +/// as the external implementation may call the overridden declaration. final class ExternalOverrideRetainer: SourceGraphMutator { private let graph: SourceGraph - private let isSwift6FixEnabled: Bool + private let isSwift60FixEnabled: Bool required init(graph: SourceGraph, configuration _: Configuration, swiftVersion: SwiftVersion) { self.graph = graph - isSwift6FixEnabled = swiftVersion.version.isVersion(greaterThanOrEqualTo: "6.0") + isSwift60FixEnabled = swiftVersion.version.isVersion(greaterThanOrEqualTo: "6.0") && + swiftVersion.version.isVersion(lessThan: "6.1") } func mutate() { @@ -38,7 +39,7 @@ final class ExternalOverrideRetainer: SourceGraphMutator { } // https://github.com/swiftlang/swift/issues/76628 - if !didIdentifyRelatedRef, isSwift6FixEnabled { + if !didIdentifyRelatedRef, isSwift60FixEnabled { graph.markRetained(decl) } } From 6c42ee1548375ab9c793c710b3d2be7d02ce319f Mon Sep 17 00:00:00 2001 From: Ian Leitch Date: Sat, 14 Dec 2024 13:33:23 +0000 Subject: [PATCH 08/63] Update linters --- .mise.toml | 4 ++-- Sources/Frontend/Commands/ScanCommand.swift | 9 +++++---- Sources/Frontend/UpdateChecker.swift | 7 ++----- Sources/PeripheryKit/Results/CheckstyleFormatter.swift | 2 +- Sources/PeripheryKit/Results/CodeClimateFormatter.swift | 4 ++-- Sources/PeripheryKit/Results/CsvFormatter.swift | 2 +- .../PeripheryKit/Results/GitHubActionsFormatter.swift | 4 ++-- Sources/PeripheryKit/Results/JsonFormatter.swift | 4 ++-- Sources/PeripheryKit/Results/OutputFormatter.swift | 2 +- Sources/PeripheryKit/Results/XcodeFormatter.swift | 2 +- 10 files changed, 19 insertions(+), 21 deletions(-) diff --git a/.mise.toml b/.mise.toml index 06a4960fda..0fb205ad02 100644 --- a/.mise.toml +++ b/.mise.toml @@ -1,3 +1,3 @@ [tools] -swiftformat = "0.54.3" -swiftlint = "0.56.2" +swiftformat = "0.55.3" +swiftlint = "0.57.1" diff --git a/Sources/Frontend/Commands/ScanCommand.swift b/Sources/Frontend/Commands/ScanCommand.swift index e006e7549b..aff85b9ab3 100644 --- a/Sources/Frontend/Commands/ScanCommand.swift +++ b/Sources/Frontend/Commands/ScanCommand.swift @@ -231,13 +231,14 @@ struct ScanCommand: FrontendCommand { try data.write(to: baselinePath.url) } - let output = try configuration.outputFormat.formatter.init(configuration: configuration).format(filteredResults) + if let output = try configuration.outputFormat.formatter.init(configuration: configuration).format(filteredResults) { + if configuration.outputFormat.supportsAuxiliaryOutput { + logger.info("", canQuiet: true) + } - if configuration.outputFormat.supportsAuxiliaryOutput { - logger.info("", canQuiet: true) + logger.info(output, canQuiet: false) } - logger.info(output, canQuiet: false) logger.endInterval(interval) updateChecker.notifyIfAvailable() diff --git a/Sources/Frontend/UpdateChecker.swift b/Sources/Frontend/UpdateChecker.swift index 9f74f0874e..091102cdb0 100644 --- a/Sources/Frontend/UpdateChecker.swift +++ b/Sources/Frontend/UpdateChecker.swift @@ -56,11 +56,8 @@ final class UpdateChecker { else { var json = "N/A" - if let data { - let decoded = String(decoding: data, as: UTF8.self) - if !decoded.isEmpty { - json = decoded - } + if let data, let decoded = String(bytes: data, encoding: .utf8) { + json = decoded } let message = "Failed to identify latest release tag in: \(json)" diff --git a/Sources/PeripheryKit/Results/CheckstyleFormatter.swift b/Sources/PeripheryKit/Results/CheckstyleFormatter.swift index b334abfa3e..7601db51ef 100644 --- a/Sources/PeripheryKit/Results/CheckstyleFormatter.swift +++ b/Sources/PeripheryKit/Results/CheckstyleFormatter.swift @@ -11,7 +11,7 @@ final class CheckstyleFormatter: OutputFormatter { self.configuration = configuration } - func format(_ results: [ScanResult]) -> String { + func format(_ results: [ScanResult]) -> String? { let parts = results.flatMap { describe($0, colored: false) } return [ "\n", diff --git a/Sources/PeripheryKit/Results/CodeClimateFormatter.swift b/Sources/PeripheryKit/Results/CodeClimateFormatter.swift index 7fcd54acc0..6797a8aa8b 100644 --- a/Sources/PeripheryKit/Results/CodeClimateFormatter.swift +++ b/Sources/PeripheryKit/Results/CodeClimateFormatter.swift @@ -10,7 +10,7 @@ final class CodeClimateFormatter: OutputFormatter { self.configuration = configuration } - func format(_ results: [PeripheryKit.ScanResult]) throws -> String { + func format(_ results: [ScanResult]) throws -> String? { var jsonObject: [Any] = [] for result in results { @@ -49,6 +49,6 @@ final class CodeClimateFormatter: OutputFormatter { } let data = try JSONSerialization.data(withJSONObject: jsonObject, options: [.prettyPrinted, .withoutEscapingSlashes]) - return String(decoding: data, as: UTF8.self) + return String(bytes: data, encoding: .utf8) } } diff --git a/Sources/PeripheryKit/Results/CsvFormatter.swift b/Sources/PeripheryKit/Results/CsvFormatter.swift index 93fdee6af0..4a365e1746 100644 --- a/Sources/PeripheryKit/Results/CsvFormatter.swift +++ b/Sources/PeripheryKit/Results/CsvFormatter.swift @@ -11,7 +11,7 @@ final class CsvFormatter: OutputFormatter { self.configuration = configuration } - func format(_ results: [ScanResult]) -> String { + func format(_ results: [ScanResult]) -> String? { var lines = ["Kind,Name,Modifiers,Attributes,Accessibility,IDs,Location,Hints"] for result in results { diff --git a/Sources/PeripheryKit/Results/GitHubActionsFormatter.swift b/Sources/PeripheryKit/Results/GitHubActionsFormatter.swift index f855b0a297..8cb6c28974 100644 --- a/Sources/PeripheryKit/Results/GitHubActionsFormatter.swift +++ b/Sources/PeripheryKit/Results/GitHubActionsFormatter.swift @@ -12,8 +12,8 @@ final class GitHubActionsFormatter: OutputFormatter { self.configuration = configuration } - func format(_ results: [ScanResult]) throws -> String { - guard !results.isEmpty else { return "" } + func format(_ results: [ScanResult]) throws -> String? { + guard !results.isEmpty else { return nil } guard configuration.relativeResults else { throw PeripheryError.usageError("`periphery scan` must be ran with `--relative-results` when using the GitHub Actions formatter") } return results.flatMap { result in diff --git a/Sources/PeripheryKit/Results/JsonFormatter.swift b/Sources/PeripheryKit/Results/JsonFormatter.swift index 9bce7491bf..6033657dda 100644 --- a/Sources/PeripheryKit/Results/JsonFormatter.swift +++ b/Sources/PeripheryKit/Results/JsonFormatter.swift @@ -10,7 +10,7 @@ final class JsonFormatter: OutputFormatter { self.configuration = configuration } - func format(_ results: [ScanResult]) throws -> String { + func format(_ results: [ScanResult]) throws -> String? { var jsonObject: [Any] = [] for result in results { @@ -48,6 +48,6 @@ final class JsonFormatter: OutputFormatter { } let data = try JSONSerialization.data(withJSONObject: jsonObject, options: [.prettyPrinted, .withoutEscapingSlashes]) - return String(decoding: data, as: UTF8.self) + return String(bytes: data, encoding: .utf8) } } diff --git a/Sources/PeripheryKit/Results/OutputFormatter.swift b/Sources/PeripheryKit/Results/OutputFormatter.swift index 3403060e46..e72197ee96 100644 --- a/Sources/PeripheryKit/Results/OutputFormatter.swift +++ b/Sources/PeripheryKit/Results/OutputFormatter.swift @@ -9,7 +9,7 @@ public protocol OutputFormatter: AnyObject { var currentFilePath: FilePath { get } init(configuration: Configuration) - func format(_ results: [ScanResult]) throws -> String + func format(_ results: [ScanResult]) throws -> String? } extension OutputFormatter { diff --git a/Sources/PeripheryKit/Results/XcodeFormatter.swift b/Sources/PeripheryKit/Results/XcodeFormatter.swift index 0bed933b75..6ab9acc6a5 100644 --- a/Sources/PeripheryKit/Results/XcodeFormatter.swift +++ b/Sources/PeripheryKit/Results/XcodeFormatter.swift @@ -12,7 +12,7 @@ final class XcodeFormatter: OutputFormatter { self.configuration = configuration } - func format(_ results: [ScanResult]) throws -> String { + func format(_ results: [ScanResult]) throws -> String? { guard !results.isEmpty else { return colorize("* ", .boldGreen) + colorize("No unused code detected.", .bold) } From 2978b8eeacf52d7e5370e94c5ecd09773cc4c74d Mon Sep 17 00:00:00 2001 From: Ian Leitch Date: Sat, 14 Dec 2024 14:19:23 +0000 Subject: [PATCH 09/63] Migrate some tasks to Mise --- .mise/tasks/benchmark | 8 +++----- .mise/tasks/build | 37 +++++++++++++++++++++++++++++++++++ .mise/tasks/lint | 2 +- .mise/tasks/lint-ci | 2 +- {scripts => .mise/tasks}/scan | 5 ++++- Makefile | 17 ---------------- scripts/release | 2 +- 7 files changed, 47 insertions(+), 26 deletions(-) create mode 100755 .mise/tasks/build rename {scripts => .mise/tasks}/scan (61%) delete mode 100644 Makefile diff --git a/.mise/tasks/benchmark b/.mise/tasks/benchmark index 5d1d6d798e..0fa8d07dee 100755 --- a/.mise/tasks/benchmark +++ b/.mise/tasks/benchmark @@ -1,9 +1,8 @@ #!/bin/bash -# mise description="Run scan benchmark" -set -eo pipefail - #USAGE flag "-b --bazel" help="Use binary built by Bazel" +set -eo pipefail + cmd="" if [ "$usage_bazel" = "true" ]; then @@ -11,8 +10,7 @@ if [ "$usage_bazel" = "true" ]; then bazel build //:periphery cmd='bazel-bin/Sources/Frontend scan --config /var/tmp/periphery_bazel/periphery.yml --generic-project-config bazel-bin/external/+generated+periphery_generated/rule/project_config.json' else - make build_arm64 - ./.build/release/periphery scan --quiet + mise r build --arch arm64 cmd='./.build/release/periphery scan --quiet --skip-build' fi diff --git a/.mise/tasks/build b/.mise/tasks/build new file mode 100755 index 0000000000..012e09ab7e --- /dev/null +++ b/.mise/tasks/build @@ -0,0 +1,37 @@ +#!/bin/bash +#USAGE flag "--arch " help="Build architecture (x86_64, arm64, release)" + +set -eo pipefail + +SWIFT_BUILD_FLAGS="--product periphery --configuration release --disable-sandbox --scratch-path .build" +EXECUTABLE_X86_64="$(swift build ${SWIFT_BUILD_FLAGS} --arch x86_64 --show-bin-path)/periphery" +EXECUTABLE_ARM64="$(swift build ${SWIFT_BUILD_FLAGS} --arch arm64 --show-bin-path)/periphery" + +build_x86_64() { + swift build ${SWIFT_BUILD_FLAGS} --arch x86_64 +} + +build_arm64() { + swift build ${SWIFT_BUILD_FLAGS} --arch arm64 +} + +if [ "$usage_arch" = "x86_64" ]; then + echo "Building for x86_64" + build_x86_64 + echo ${EXECUTABLE_X86_64} +elif [ "$usage_arch" = "arm64" ]; then + echo "Building for arm64" + build_arm64 + echo ${EXECUTABLE_ARM64} +elif [ "$usage_arch" = "release" ]; then + echo "Building for release" + build_x86_64 + build_arm64 + mkdir -p .release + lipo -create -output .release/periphery ${EXECUTABLE_X86_64} ${EXECUTABLE_ARM64} + strip -rSTX .release/periphery + echo "$(realpath .release/periphery)" +else + echo "Invalid architecture. Use --arch where is x86_64, arm64 or release" + exit 1 +fi diff --git a/.mise/tasks/lint b/.mise/tasks/lint index 25ba893395..5bd758d824 100755 --- a/.mise/tasks/lint +++ b/.mise/tasks/lint @@ -1,5 +1,5 @@ #!/bin/bash -# mise description="Lint the project" + set -euo pipefail cd $MISE_PROJECT_ROOT diff --git a/.mise/tasks/lint-ci b/.mise/tasks/lint-ci index 2081dad207..d49e1a0812 100755 --- a/.mise/tasks/lint-ci +++ b/.mise/tasks/lint-ci @@ -1,5 +1,5 @@ #!/bin/bash -# mise description="Lint the project for CI" + set -euo pipefail cd $MISE_PROJECT_ROOT diff --git a/scripts/scan b/.mise/tasks/scan similarity index 61% rename from scripts/scan rename to .mise/tasks/scan index a229745b97..c452a2545d 100755 --- a/scripts/scan +++ b/.mise/tasks/scan @@ -1,3 +1,6 @@ -set -e +#!/bin/bash + +set -euo pipefail + swift build time ./.build/debug/periphery scan "$@" diff --git a/Makefile b/Makefile deleted file mode 100644 index 4d6e3a07ce..0000000000 --- a/Makefile +++ /dev/null @@ -1,17 +0,0 @@ -SWIFT_BUILD_FLAGS=--product periphery --configuration release --disable-sandbox --scratch-path .build -EXECUTABLE_X86_64=$(shell swift build ${SWIFT_BUILD_FLAGS} --arch x86_64 --show-bin-path)/periphery -EXECUTABLE_ARM64=$(shell swift build ${SWIFT_BUILD_FLAGS} --arch arm64 --show-bin-path)/periphery - -clean: - @swift package clean - -build_x86_64: - @swift build ${SWIFT_BUILD_FLAGS} --arch x86_64 - -build_arm64: - @swift build ${SWIFT_BUILD_FLAGS} --arch arm64 - -build_release: clean build_x86_64 build_arm64 - @mkdir -p .release - @lipo -create -output .release/periphery ${EXECUTABLE_X86_64} ${EXECUTABLE_ARM64} - @strip -rSTX .release/periphery diff --git a/scripts/release b/scripts/release index 07bfd7bdf7..8b87968350 100755 --- a/scripts/release +++ b/scripts/release @@ -44,7 +44,7 @@ cat scripts/artifactbundle_info.json.template | sed s/__VERSION__/${version}/ > echo -e "\nUpdate CHANGELOG.md" confirm "Continue?" -make build_release +mise r build --arch release if [ ! -f .release/periphery ]; then echo "ERROR: Missing release binary?" From 29fd326a2550559fd15b4379f03829a5d5032e6f Mon Sep 17 00:00:00 2001 From: Ian Leitch Date: Sat, 14 Dec 2024 16:39:47 +0100 Subject: [PATCH 10/63] Ensure Bazel rules are updated (#835) --- .github/workflows/test.yml | 3 +++ .mise/tasks/gen-bazel-rules | 5 +++++ {scripts => .mise/tasks}/gen_bazel_rules.rb | 2 +- 3 files changed, 9 insertions(+), 1 deletion(-) create mode 100755 .mise/tasks/gen-bazel-rules rename {scripts => .mise/tasks}/gen_bazel_rules.rb (96%) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index a916470362..a7b3e33474 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -24,6 +24,9 @@ jobs: name: Bazel steps: - uses: actions/checkout@master + - uses: jdx/mise-action@v2 + - name: Check generated rules + run: mise r gen-bazel-rules && git diff --quiet --exit-code - name: Scan run: bazel run //:periphery -- scan --bazel --quiet --strict --baseline bazel/internal/bazel_baseline.json macOS: diff --git a/.mise/tasks/gen-bazel-rules b/.mise/tasks/gen-bazel-rules new file mode 100755 index 0000000000..ee855d2b6b --- /dev/null +++ b/.mise/tasks/gen-bazel-rules @@ -0,0 +1,5 @@ +#!/bin/bash + +set -euo pipefail + +ruby .mise/tasks/gen_bazel_rules.rb diff --git a/scripts/gen_bazel_rules.rb b/.mise/tasks/gen_bazel_rules.rb similarity index 96% rename from scripts/gen_bazel_rules.rb rename to .mise/tasks/gen_bazel_rules.rb index 5715b9b416..125bc50bb8 100644 --- a/scripts/gen_bazel_rules.rb +++ b/.mise/tasks/gen_bazel_rules.rb @@ -108,7 +108,7 @@ def generate_bazel_rule(path, rule, name, attrs) File.write("Sources/BUILD.bazel", <<~EOS) load("@rules_swift//swift:swift.bzl", "swift_binary", "swift_library") - load("//bazel/internal:opt.bzl", "optimized_swift_binary") + load("//bazel/internal:opt.bzl", "optimized_swift_binary") # buildifier: disable=bzl-visibility #{rules.join("\n\n")} EOS From 87fc6e97710007f18ac9cbf57a0b530d378a59ee Mon Sep 17 00:00:00 2001 From: Ian Leitch Date: Sat, 14 Dec 2024 17:04:11 +0100 Subject: [PATCH 11/63] Add Linux baseline (#836) --- .github/workflows/test.yml | 8 ++++---- .../internal/bazel_baseline.json => baselines/bazel.json | 0 baselines/linux.json | 1 + 3 files changed, 5 insertions(+), 4 deletions(-) rename bazel/internal/bazel_baseline.json => baselines/bazel.json (100%) create mode 100644 baselines/linux.json diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index a7b3e33474..6306b873b1 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -9,7 +9,7 @@ env: swift_package_resolve: swift package resolve swift_build: swift build swift_test: swift test - periphery_scan: ./.build/debug/periphery scan --quiet --clean-build + periphery_scan: ./.build/debug/periphery scan --quiet --clean-build --strict cache_version: 1 jobs: lint: @@ -28,7 +28,7 @@ jobs: - name: Check generated rules run: mise r gen-bazel-rules && git diff --quiet --exit-code - name: Scan - run: bazel run //:periphery -- scan --bazel --quiet --strict --baseline bazel/internal/bazel_baseline.json + run: bazel run //:periphery -- scan --bazel --quiet --strict --baseline baselines/bazel.json macOS: strategy: fail-fast: false @@ -70,7 +70,7 @@ jobs: - name: Build run: ${{ env.swift_build }} - name: Scan - run: ${{ env.periphery_scan }} --strict + run: ${{ env.periphery_scan }} - name: Test run: ${{ env.swift_test }} linux: @@ -111,6 +111,6 @@ jobs: - name: Build run: ${{ env.swift_build }} - name: Scan - run: ${{ env.periphery_scan }} + run: ${{ env.periphery_scan }} --baseline baselines/linux.json - name: Test run: ${{ env.swift_test }} diff --git a/bazel/internal/bazel_baseline.json b/baselines/bazel.json similarity index 100% rename from bazel/internal/bazel_baseline.json rename to baselines/bazel.json diff --git a/baselines/linux.json b/baselines/linux.json new file mode 100644 index 0000000000..65cd981bf9 --- /dev/null +++ b/baselines/linux.json @@ -0,0 +1 @@ +{"v1":{"usrs":["import-Configuration-Sources\/ProjectDrivers\/XcodeProjectDriver.swift:2:5","import-Indexer-Sources\/ProjectDrivers\/XcodeProjectDriver.swift:4:5","import-Logger-Sources\/ProjectDrivers\/XcodeProjectDriver.swift:5:5","import-Shared-Sources\/ProjectDrivers\/XcodeProjectDriver.swift:6:5","import-SourceGraph-Sources\/ProjectDrivers\/XcodeProjectDriver.swift:7:5","import-TestShared-Tests\/PeripheryTests\/ObjcAccessibleRetentionTest.swift:2:1","import-TestShared-Tests\/PeripheryTests\/ObjcAnnotatedRetentionTest.swift:2:1","s:11SourceGraph15ProjectFileKindO10extensionsSaySSGvp","s:6Shared14SetupSelectionO","s:6Shared17SetupGuideHelpersC6select8multiple8allowAllAA0B9SelectionOSaySSG_SbtF","s:SS10ExtensionsE4djb2Sivp","s:SS10ExtensionsE7djb2HexSSvp"]}} \ No newline at end of file From f04b575baa8576e5bb23d135254939a69fd5656d Mon Sep 17 00:00:00 2001 From: Ian Leitch Date: Sat, 14 Dec 2024 17:39:31 +0100 Subject: [PATCH 12/63] Remove support for Swift 5.9 (#837) --- .github/workflows/test.yml | 8 ++---- CHANGELOG.md | 1 + Package.swift | 2 +- Sources/BUILD.bazel | 1 - Sources/Shared/SwiftVersion.swift | 2 +- .../CapitalSelfFunctionCallRetainer.swift | 28 ------------------- .../SourceGraphMutatorRunner.swift | 1 - .../AccessibilityProject/Package.swift | 2 +- Tests/Fixtures/Package.swift | 2 +- Tests/SPMTests/SPMProject/Package.swift | 2 +- .../LocalPackages/LocalPackage/Package.swift | 2 +- 11 files changed, 9 insertions(+), 42 deletions(-) delete mode 100644 Sources/SourceGraph/Mutators/CapitalSelfFunctionCallRetainer.swift diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 6306b873b1..85da972ea2 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -33,7 +33,7 @@ jobs: strategy: fail-fast: false matrix: - xcode: ["16.1", "16.0", "15.4", "15.2"] + xcode: ["16.1", "16.0", "15.4"] include: - xcode: "16.1" macos: macos-15 @@ -41,8 +41,6 @@ jobs: macos: macos-15 - xcode: "15.4" macos: macos-14 - - xcode: "15.2" - macos: macos-14 runs-on: ${{ matrix.macos }} name: macOS steps: @@ -77,14 +75,12 @@ jobs: strategy: fail-fast: false matrix: - swift: ["6.0", "5.10", "5.9"] + swift: ["6.0", "5.10"] include: - swift: "6.0" container: "swift:6.0" - swift: "5.10" container: "swift:5.10" - - swift: "5.9" - container: "swift:5.9" runs-on: ubuntu-20.04 container: ${{ matrix.container }} name: Linux diff --git a/CHANGELOG.md b/CHANGELOG.md index 965f0c7d9a..37c2ed261c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ ##### Breaking - Support for installing via CocoaPods has been removed. +- Removed support for Swift 5.9/Xcode 15.2. ##### Enhancements diff --git a/Package.swift b/Package.swift index 14794bd1d7..c580ad01ec 100644 --- a/Package.swift +++ b/Package.swift @@ -1,4 +1,4 @@ -// swift-tools-version:5.9 +// swift-tools-version:5.10 import PackageDescription var dependencies: [Package.Dependency] = [ diff --git a/Sources/BUILD.bazel b/Sources/BUILD.bazel index 0ffe0c6d27..4c37977126 100644 --- a/Sources/BUILD.bazel +++ b/Sources/BUILD.bazel @@ -57,7 +57,6 @@ swift_library( "SourceGraph/Mutators/AncestralReferenceEliminator.swift", "SourceGraph/Mutators/AssetReferenceRetainer.swift", "SourceGraph/Mutators/AssignOnlyPropertyReferenceEliminator.swift", - "SourceGraph/Mutators/CapitalSelfFunctionCallRetainer.swift", "SourceGraph/Mutators/CodablePropertyRetainer.swift", "SourceGraph/Mutators/CodingKeyEnumReferenceBuilder.swift", "SourceGraph/Mutators/ComplexPropertyAccessorReferenceBuilder.swift", diff --git a/Sources/Shared/SwiftVersion.swift b/Sources/Shared/SwiftVersion.swift index 974502cb1c..4a4210fb49 100644 --- a/Sources/Shared/SwiftVersion.swift +++ b/Sources/Shared/SwiftVersion.swift @@ -2,7 +2,7 @@ import Extensions import Foundation public struct SwiftVersion { - static let minimumVersion = "5.9" + static let minimumVersion = "5.10" public let version: VersionString public let fullVersion: String diff --git a/Sources/SourceGraph/Mutators/CapitalSelfFunctionCallRetainer.swift b/Sources/SourceGraph/Mutators/CapitalSelfFunctionCallRetainer.swift deleted file mode 100644 index 638b9faa97..0000000000 --- a/Sources/SourceGraph/Mutators/CapitalSelfFunctionCallRetainer.swift +++ /dev/null @@ -1,28 +0,0 @@ -import Configuration -import Foundation -import Shared - -/// Retains all constructors on types instantiated via `Self(...)` to workaround false positives caused by a bug in Swift. -/// https://github.com/apple/swift/issues/64686 -/// https://github.com/peripheryapp/periphery/issues/264 -final class CapitalSelfFunctionCallRetainer: SourceGraphMutator { - private let graph: SourceGraph - private let swiftVersion: SwiftVersion - - required init(graph: SourceGraph, configuration _: Configuration, swiftVersion: SwiftVersion) { - self.graph = graph - self.swiftVersion = swiftVersion - } - - func mutate() { - guard swiftVersion.version.isVersion(lessThan: "5.9") else { return } - - for decl in graph.declarations(ofKinds: [.struct, .class]) { - guard decl.hasCapitalSelfFunctionCall else { continue } - decl.declarations - .lazy - .filter { $0.kind == .functionConstructor } - .forEach { graph.markRetained($0) } - } - } -} diff --git a/Sources/SourceGraph/SourceGraphMutatorRunner.swift b/Sources/SourceGraph/SourceGraphMutatorRunner.swift index e9090c65f2..f67ddeb587 100644 --- a/Sources/SourceGraph/SourceGraphMutatorRunner.swift +++ b/Sources/SourceGraph/SourceGraphMutatorRunner.swift @@ -40,7 +40,6 @@ public final class SourceGraphMutatorRunner { StringInterpolationAppendInterpolationRetainer.self, PropertyWrapperRetainer.self, ResultBuilderRetainer.self, - CapitalSelfFunctionCallRetainer.self, CodablePropertyRetainer.self, ExternalOverrideRetainer.self, diff --git a/Tests/AccessibilityTests/AccessibilityProject/Package.swift b/Tests/AccessibilityTests/AccessibilityProject/Package.swift index 3ec209552e..3cd569cd3c 100644 --- a/Tests/AccessibilityTests/AccessibilityProject/Package.swift +++ b/Tests/AccessibilityTests/AccessibilityProject/Package.swift @@ -1,4 +1,4 @@ -// swift-tools-version:5.9 +// swift-tools-version:5.10 import PackageDescription let package = Package( diff --git a/Tests/Fixtures/Package.swift b/Tests/Fixtures/Package.swift index 48b28fe78a..56a9d91066 100644 --- a/Tests/Fixtures/Package.swift +++ b/Tests/Fixtures/Package.swift @@ -1,4 +1,4 @@ -// swift-tools-version:5.9 +// swift-tools-version:5.10 import PackageDescription var targets: [PackageDescription.Target] = [ diff --git a/Tests/SPMTests/SPMProject/Package.swift b/Tests/SPMTests/SPMProject/Package.swift index b0a76063fb..c6260cca74 100644 --- a/Tests/SPMTests/SPMProject/Package.swift +++ b/Tests/SPMTests/SPMProject/Package.swift @@ -1,4 +1,4 @@ -// swift-tools-version:5.9 +// swift-tools-version:5.10 import PackageDescription let package = Package( diff --git a/Tests/XcodeTests/UIKitProject/LocalPackages/LocalPackage/Package.swift b/Tests/XcodeTests/UIKitProject/LocalPackages/LocalPackage/Package.swift index ef0cd76208..3ee3878a61 100644 --- a/Tests/XcodeTests/UIKitProject/LocalPackages/LocalPackage/Package.swift +++ b/Tests/XcodeTests/UIKitProject/LocalPackages/LocalPackage/Package.swift @@ -1,4 +1,4 @@ -// swift-tools-version: 5.9 +// swift-tools-version: 5.10 import PackageDescription let package = Package( From 9e116ccc4949a7bd3dbe196ea44350f441696fc9 Mon Sep 17 00:00:00 2001 From: Ian Leitch Date: Sat, 14 Dec 2024 18:54:08 +0000 Subject: [PATCH 13/63] Update Bazel deps --- .mise/tasks/gen_bazel_rules.rb | 4 +- MODULE.bazel | 17 +++--- MODULE.bazel.lock | 51 +++--------------- Package.resolved | 7 +-- Package.swift | 2 +- Sources/BUILD.bazel | 10 ++-- bazel/internal/extensions.bzl | 10 ---- bazel/internal/repositories.bzl | 93 --------------------------------- 8 files changed, 24 insertions(+), 170 deletions(-) delete mode 100644 bazel/internal/extensions.bzl delete mode 100644 bazel/internal/repositories.bzl diff --git a/.mise/tasks/gen_bazel_rules.rb b/.mise/tasks/gen_bazel_rules.rb index 125bc50bb8..2e9ec7fee7 100644 --- a/.mise/tasks/gen_bazel_rules.rb +++ b/.mise/tasks/gen_bazel_rules.rb @@ -4,13 +4,13 @@ PRODUCTS = { "ArgumentParser" => "@swift_argument_parser", - "SystemPackage" => "@com_github_apple_swift-system", + "SystemPackage" => "@swift-system", "SwiftIndexStore" => "@swift-indexstore", "FilenameMatcher" => "@swift-filename-matcher", "Yams" => "@yams", "SwiftParser" => "@swift-syntax", "SwiftSyntax" => "@swift-syntax", - "XcodeProj" => "@com_github_tuist_xcodeproj", + "XcodeProj" => "@xcodeproj", "AEXML" => "@aexml", } diff --git a/MODULE.bazel b/MODULE.bazel index c685528cc6..875d95265c 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -15,21 +15,16 @@ bazel_dep(name = "platforms", version = "0.0.10") bazel_dep(name = "buildifier_prebuilt", version = "7.3.1", dev_dependency = True) # Swift dependencies -bazel_dep(name = "swift-syntax", version = "600.0.1") -bazel_dep(name = "yams", version = "5.1.3") bazel_dep(name = "aexml", version = "4.7.0") bazel_dep(name = "swift_argument_parser", version = "1.5.0") -bazel_dep(name = "swift-indexstore", version = "0.3.0") bazel_dep(name = "swift-filename-matcher", version = "0.1.2") +bazel_dep(name = "swift-indexstore", version = "0.3.0") +bazel_dep(name = "swift-syntax", version = "600.0.1") +bazel_dep(name = "swift-system", version = "1.4.0") +bazel_dep(name = "pathkit", version = "1.0.1") +bazel_dep(name = "xcodeproj", version = "8.25.0") +bazel_dep(name = "yams", version = "5.1.3") # Extensions generated = use_extension("//bazel:extensions.bzl", "generated") use_repo(generated, "periphery_generated") - -non_module_deps = use_extension("//bazel/internal:extensions.bzl", "non_module_deps") -use_repo( - non_module_deps, - "com_github_apple_swift-system", - "com_github_kylef_pathkit", - "com_github_tuist_xcodeproj", -) diff --git a/MODULE.bazel.lock b/MODULE.bazel.lock index 62fb25df8d..9fdf4a4b6c 100644 --- a/MODULE.bazel.lock +++ b/MODULE.bazel.lock @@ -56,6 +56,8 @@ "https://bcr.bazel.build/modules/libpfm/4.11.0/MODULE.bazel": "45061ff025b301940f1e30d2c16bea596c25b176c8b6b3087e92615adbd52902", "https://bcr.bazel.build/modules/nlohmann_json/3.6.1/MODULE.bazel": "6f7b417dcc794d9add9e556673ad25cb3ba835224290f4f848f8e2db1e1fca74", "https://bcr.bazel.build/modules/nlohmann_json/3.6.1/source.json": "f448c6e8963fdfa7eb831457df83ad63d3d6355018f6574fb017e8169deb43a9", + "https://bcr.bazel.build/modules/pathkit/1.0.1/MODULE.bazel": "fae93989a10f8d90d5ac02453e6632ae7f71111687862c01f468858cef40bb5e", + "https://bcr.bazel.build/modules/pathkit/1.0.1/source.json": "3215e6b4b08f96f34024eaf186d247744ca255925d7ee3f50cf94f7cf885696b", "https://bcr.bazel.build/modules/platforms/0.0.10/MODULE.bazel": "8cb8efaf200bdeb2150d93e162c40f388529a25852b332cec879373771e48ed5", "https://bcr.bazel.build/modules/platforms/0.0.10/source.json": "f22828ff4cf021a6b577f1bf6341cb9dcd7965092a439f64fc1bb3b7a5ae4bd5", "https://bcr.bazel.build/modules/platforms/0.0.4/MODULE.bazel": "9b328e31ee156f53f3c416a64f8491f7eb731742655a47c9eec4703a71644aee", @@ -155,10 +157,14 @@ "https://bcr.bazel.build/modules/swift-indexstore/0.3.0/source.json": "0d13a7935be16621f918e68fb7def45100f153df93b7027ad06a7e633c029fab", "https://bcr.bazel.build/modules/swift-syntax/600.0.1/MODULE.bazel": "f6c886571884e56f979e2d08e27830fb20aea34cb5e518a5a9e47dbf230c6745", "https://bcr.bazel.build/modules/swift-syntax/600.0.1/source.json": "2256d164120b8ff1dfe39e93dff88be482eb2f665867ed6e99e1ad6be3c9dc49", + "https://bcr.bazel.build/modules/swift-system/1.4.0/MODULE.bazel": "2554190bc0b3651a6d9f83da29b70213aba346ca498c521c789c876f577c0eae", + "https://bcr.bazel.build/modules/swift-system/1.4.0/source.json": "420ea1ed244d7a9ea3967484e6bc5f5f681dc188bd34dda1cf1bbd3ae56f6d10", "https://bcr.bazel.build/modules/swift_argument_parser/1.3.1.1/MODULE.bazel": "5e463fbfba7b1701d957555ed45097d7f984211330106ccd1352c6e0af0dcf91", "https://bcr.bazel.build/modules/swift_argument_parser/1.5.0/MODULE.bazel": "fabd6256994e7dbb7e7f800770f3d0a70b0dc23d7111cf293ff9dc8053ec8d12", "https://bcr.bazel.build/modules/swift_argument_parser/1.5.0/source.json": "a8b1945eb173459ea00998e804fd4d58dcf1917976981ed51033eaeeb5d10240", "https://bcr.bazel.build/modules/upb/0.0.0-20220923-a547704/MODULE.bazel": "7298990c00040a0e2f121f6c32544bab27d4452f80d9ce51349b1a28f3005c43", + "https://bcr.bazel.build/modules/xcodeproj/8.25.0/MODULE.bazel": "da378f64c3cd7aa4bebc8fba4fc159a44df088e305b9b84f5716b3fb80d091cb", + "https://bcr.bazel.build/modules/xcodeproj/8.25.0/source.json": "7f6a70ba57295561a79ff9071245e3bb7dd90aaab7c1bf9933f7df5ced4f3ac9", "https://bcr.bazel.build/modules/yams/5.1.3/MODULE.bazel": "5f3b2e674671971092540aafbdbd4953a8fc4348acc8c1cb3e94160fcb4f76af", "https://bcr.bazel.build/modules/yams/5.1.3/source.json": "f9f54bc0ee648b42b4f385b71b9bf56db9f59774039fe2f1e33f7fe9a15d8874", "https://bcr.bazel.build/modules/zlib/1.2.11/MODULE.bazel": "07b389abc85fdbca459b69e2ec656ae5622873af3f845e1c9d80fe179f3effa0", @@ -184,51 +190,6 @@ "recordedRepoMappingEntries": [] } }, - "//bazel/internal:extensions.bzl%non_module_deps": { - "general": { - "bzlTransitiveDigest": "EIyMAGMiIP3DDlG38WVEM7me6r5WhJzBFdlkwF0AcVQ=", - "usagesDigest": "sl6dqEn1RWk5V2PmnjnwYyGp4Aw1VOYu/+jBsDth14I=", - "recordedFileInputs": {}, - "recordedDirentsInputs": {}, - "envVariables": {}, - "generatedRepoSpecs": { - "com_github_tuist_xcodeproj": { - "repoRuleId": "@@bazel_tools//tools/build_defs/repo:http.bzl%http_archive", - "attributes": { - "build_file_content": "load(\"@rules_swift//swift:swift.bzl\", \"swift_library\")\n\nswift_library(\n name = \"XcodeProj\",\n srcs = glob([\"Sources/XcodeProj/**/*.swift\"]),\n visibility = [\"//visibility:public\"],\n deps = [\n \"@aexml//:AEXML\",\n \"@com_github_kylef_pathkit//:PathKit\",\n ],\n)\n ", - "sha256": "3990868f731888edabcaeacf639f0ee75e2e4430102a4f4bf40b03a60eeafe12", - "strip_prefix": "XcodeProj-8.24.7", - "url": "https://github.com/tuist/XcodeProj/archive/refs/tags/8.24.7.tar.gz" - } - }, - "com_github_kylef_pathkit": { - "repoRuleId": "@@bazel_tools//tools/build_defs/repo:http.bzl%http_archive", - "attributes": { - "build_file_content": "load(\"@rules_swift//swift:swift.bzl\", \"swift_library\")\n\nswift_library(\n name = \"PathKit\",\n srcs = glob([\"Sources/**/*.swift\"]),\n visibility = [\"//visibility:public\"],\n)\n ", - "sha256": "fcda78cdf12c1c6430c67273333e060a9195951254230e524df77841a0235dae", - "strip_prefix": "PathKit-1.0.1", - "url": "https://github.com/kylef/PathKit/archive/refs/tags/1.0.1.tar.gz" - } - }, - "com_github_apple_swift-system": { - "repoRuleId": "@@bazel_tools//tools/build_defs/repo:http.bzl%http_archive", - "attributes": { - "build_file_content": "load(\"@rules_swift//swift:swift.bzl\", \"swift_library\", \"swift_test\")\n\nconfig_setting(\n name = \"debug\",\n values = {\"compilation_mode\": \"dbg\"},\n)\n\ncc_library(\n name = \"CSystem\",\n hdrs = glob([\"Sources/CSystem/include/*.h\"]),\n aspect_hints = [\"@rules_swift//swift:auto_module\"],\n defines = select({\n \"@platforms//os:windows\": [\"_CRT_SECURE_NO_WARNINGS\"],\n \"//conditions:default\": [],\n }),\n linkstatic = True,\n tags = [\"swift_module=CSystem\"],\n)\n\nDARWIN_DEFINES = [\"SYSTEM_PACKAGE_DARWIN\"]\n\nswift_library(\n name = \"SystemPackage\",\n srcs = glob([\"Sources/System/**/*.swift\"]),\n defines = [\"SYSTEM_PACKAGE\"] +\n select({\n \"@platforms//os:macos\": DARWIN_DEFINES,\n \"@platforms//os:ios\": DARWIN_DEFINES,\n \"@platforms//os:tvos\": DARWIN_DEFINES,\n \"@platforms//os:watchos\": DARWIN_DEFINES,\n \"@platforms//os:visionos\": DARWIN_DEFINES,\n \"//conditions:default\": [],\n }) +\n select({\n \":debug\": [\"ENABLE_MOCKING\"],\n \"//conditions:default\": [],\n }),\n module_name = \"SystemPackage\",\n visibility = [\"//visibility:public\"],\n deps = [\":CSystem\"],\n)\n ", - "sha256": "799474251c3654b5483c0f49045ff6729e07acebe9d1541aabfbec68d0390457", - "strip_prefix": "swift-system-1.4.0", - "url": "https://github.com/apple/swift-system/archive/refs/tags/1.4.0.tar.gz" - } - } - }, - "recordedRepoMappingEntries": [ - [ - "", - "bazel_tools", - "bazel_tools" - ] - ] - } - }, "@@apple_support+//crosstool:setup.bzl%apple_cc_configure_extension": { "general": { "bzlTransitiveDigest": "gMOsQY7zqLH6vNcwyNeAqWPLKKmyJ29OLPdX+FMk+jE=", diff --git a/Package.resolved b/Package.resolved index bd0bb3d720..481aa8f9fc 100644 --- a/Package.resolved +++ b/Package.resolved @@ -1,4 +1,5 @@ { + "originHash" : "3ea0e89d1f3fe86c12ead60c3760805da8a51683f812784e5d6b4234cbe3a43b", "pins" : [ { "identity" : "aexml", @@ -77,8 +78,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/tuist/xcodeproj", "state" : { - "revision" : "2c495492fb6e01de5e718a0fd94e0fb28a307d4d", - "version" : "8.24.7" + "revision" : "d3df4265b8383dd56dae4b01f817d30c22e7612c", + "version" : "8.25.0" } }, { @@ -91,5 +92,5 @@ } } ], - "version" : 2 + "version" : 3 } diff --git a/Package.swift b/Package.swift index c580ad01ec..d85973e879 100644 --- a/Package.swift +++ b/Package.swift @@ -15,7 +15,7 @@ var dependencies: [Package.Dependency] = [ dependencies.append( .package( url: "https://github.com/tuist/xcodeproj", - from: "8.16.0" + from: "8.25.0" ) ) #endif diff --git a/Sources/BUILD.bazel b/Sources/BUILD.bazel index 4c37977126..0f5d3e15e6 100644 --- a/Sources/BUILD.bazel +++ b/Sources/BUILD.bazel @@ -16,7 +16,7 @@ swift_library( "//Sources:PeripheryKit", "//Sources:Shared", "//Sources:SourceGraph", - "@com_github_tuist_xcodeproj//:XcodeProj", + "@xcodeproj//:XcodeProj", ], ) @@ -116,8 +116,8 @@ swift_library( deps = [ "//Sources:Extensions", "//Sources:Logger", - "@com_github_apple_swift-system//:SystemPackage", "@swift-filename-matcher//:FilenameMatcher", + "@swift-system//:SystemPackage", ], ) @@ -161,11 +161,11 @@ swift_library( "//Sources:Shared", "//Sources:SourceGraph", "@aexml//:AEXML", - "@com_github_apple_swift-system//:SystemPackage", "@swift-filename-matcher//:FilenameMatcher", "@swift-indexstore//:SwiftIndexStore", "@swift-syntax//:SwiftParser", "@swift-syntax//:SwiftSyntax", + "@swift-system//:SystemPackage", ], ) @@ -253,8 +253,8 @@ swift_library( ], module_name = "Extensions", deps = [ - "@com_github_apple_swift-system//:SystemPackage", "@swift-filename-matcher//:FilenameMatcher", + "@swift-system//:SystemPackage", ], ) @@ -269,8 +269,8 @@ swift_library( "//Sources:Extensions", "//Sources:Logger", "//Sources:Shared", - "@com_github_apple_swift-system//:SystemPackage", "@swift-filename-matcher//:FilenameMatcher", + "@swift-system//:SystemPackage", "@yams//:Yams", ], ) diff --git a/bazel/internal/extensions.bzl b/bazel/internal/extensions.bzl deleted file mode 100644 index 4c93bc4a3f..0000000000 --- a/bazel/internal/extensions.bzl +++ /dev/null @@ -1,10 +0,0 @@ -""" - Internal module extensions. -""" - -load( - "//bazel/internal:repositories.bzl", - "periphery_dependencies", -) - -non_module_deps = module_extension(implementation = lambda _: periphery_dependencies()) diff --git a/bazel/internal/repositories.bzl b/bazel/internal/repositories.bzl deleted file mode 100644 index 75cdb312ed..0000000000 --- a/bazel/internal/repositories.bzl +++ /dev/null @@ -1,93 +0,0 @@ -""" - Non-module dependencies that are not available in the Bazel ecosystem. -""" - -load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") - -def periphery_dependencies(): - http_archive( - name = "com_github_tuist_xcodeproj", - build_file_content = """\ -load("@rules_swift//swift:swift.bzl", "swift_library") - -swift_library( - name = "XcodeProj", - srcs = glob(["Sources/XcodeProj/**/*.swift"]), - visibility = ["//visibility:public"], - deps = [ - "@aexml//:AEXML", - "@com_github_kylef_pathkit//:PathKit", - ], -) - """, - sha256 = "3990868f731888edabcaeacf639f0ee75e2e4430102a4f4bf40b03a60eeafe12", - strip_prefix = "XcodeProj-8.24.7", - url = "https://github.com/tuist/XcodeProj/archive/refs/tags/8.24.7.tar.gz", - ) - - http_archive( - name = "com_github_kylef_pathkit", - build_file_content = """\ -load("@rules_swift//swift:swift.bzl", "swift_library") - -swift_library( - name = "PathKit", - srcs = glob(["Sources/**/*.swift"]), - visibility = ["//visibility:public"], -) - """, - sha256 = "fcda78cdf12c1c6430c67273333e060a9195951254230e524df77841a0235dae", - strip_prefix = "PathKit-1.0.1", - url = "https://github.com/kylef/PathKit/archive/refs/tags/1.0.1.tar.gz", - ) - - # TODO: https://github.com/apple/swift-system/pull/194 - http_archive( - name = "com_github_apple_swift-system", - build_file_content = """\ -load("@rules_swift//swift:swift.bzl", "swift_library", "swift_test") - -config_setting( - name = "debug", - values = {"compilation_mode": "dbg"}, -) - -cc_library( - name = "CSystem", - hdrs = glob(["Sources/CSystem/include/*.h"]), - aspect_hints = ["@rules_swift//swift:auto_module"], - defines = select({ - "@platforms//os:windows": ["_CRT_SECURE_NO_WARNINGS"], - "//conditions:default": [], - }), - linkstatic = True, - tags = ["swift_module=CSystem"], -) - -DARWIN_DEFINES = ["SYSTEM_PACKAGE_DARWIN"] - -swift_library( - name = "SystemPackage", - srcs = glob(["Sources/System/**/*.swift"]), - defines = ["SYSTEM_PACKAGE"] + - select({ - "@platforms//os:macos": DARWIN_DEFINES, - "@platforms//os:ios": DARWIN_DEFINES, - "@platforms//os:tvos": DARWIN_DEFINES, - "@platforms//os:watchos": DARWIN_DEFINES, - "@platforms//os:visionos": DARWIN_DEFINES, - "//conditions:default": [], - }) + - select({ - ":debug": ["ENABLE_MOCKING"], - "//conditions:default": [], - }), - module_name = "SystemPackage", - visibility = ["//visibility:public"], - deps = [":CSystem"], -) - """, - sha256 = "799474251c3654b5483c0f49045ff6729e07acebe9d1541aabfbec68d0390457", - strip_prefix = "swift-system-1.4.0", - url = "https://github.com/apple/swift-system/archive/refs/tags/1.4.0.tar.gz", - ) From 1fb898484de06eb6abe2407b232314006943fba8 Mon Sep 17 00:00:00 2001 From: Ian Leitch Date: Sat, 14 Dec 2024 22:22:27 +0000 Subject: [PATCH 14/63] Create bazel archive in release script --- .bazelignore | 1 + MODULE.bazel | 1 - scripts/release | 12 ++++++++---- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/.bazelignore b/.bazelignore index 4e05543ca7..db40dc9300 100644 --- a/.bazelignore +++ b/.bazelignore @@ -1,2 +1,3 @@ .build .git +.mise \ No newline at end of file diff --git a/MODULE.bazel b/MODULE.bazel index 875d95265c..bb9622ac8c 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -9,7 +9,6 @@ bazel_dep(name = "rules_swift", version = "2.3.0") bazel_dep(name = "rules_apple", version = "3.16.0") bazel_dep(name = "bazel_skylib", version = "1.7.1") bazel_dep(name = "apple_support", version = "1.17.1") -bazel_dep(name = "platforms", version = "0.0.10") # Bazel dev dependencies bazel_dep(name = "buildifier_prebuilt", version = "7.3.1", dev_dependency = True) diff --git a/scripts/release b/scripts/release index 8b87968350..2a37ab7915 100755 --- a/scripts/release +++ b/scripts/release @@ -51,8 +51,7 @@ if [ ! -f .release/periphery ]; then exit 1 fi -cp BUILD.bazel MODULE.bazel LICENSE.md .release/ -cp -R bazel .release/ +cp LICENSE.md MODULE.bazel BUILD.bazel bazel Sources .release/ cp scripts/release_notes.md.template .release/release_notes.md # Codesign @@ -61,7 +60,7 @@ codesign periphery # Archive zip_filename="periphery-${version}.zip" -zip -r "${zip_filename}" periphery LICENSE.md MODULE.bazel BUILD.bazel bazel +zip -r "${zip_filename}" periphery LICENSE.md codesign "${zip_filename}" echo -e "\n${zip_filename} checksum:" @@ -76,9 +75,14 @@ echo -e "\n${zip_artifactbundle} checksum:" artifactbundle_sha256=$( shasum -a 256 ${zip_artifactbundle} | awk '{print $1}' ) echo ${artifactbundle_sha256} +bazel_zip_filename="periphery-bazel-${version}.zip" +zip -r "${bazel_zip_filename}" LICENSE.md MODULE.bazel BUILD.bazel bazel Sources +codesign "${bazel_zip_filename}" + # Notarize notarize "${zip_filename}" notarize "${zip_artifactbundle}" +notarize "${bazel_zip_filename}" echo -e "\nVerify changes" confirm "Continue?" @@ -105,7 +109,7 @@ if [[ ${version} == *"beta"* ]]; then fi cd .. -gh release create --latest="${is_latest}" -F .release/release_notes.md "${version}" ".release/${zip_filename}" ".release/${zip_artifactbundle}" +gh release create --latest="${is_latest}" -F .release/release_notes.md "${version}" ".release/${zip_filename}" ".release/${zip_artifactbundle}" ".release/${bazel_zip_filename}" # Homebrew if [ $is_latest = false ]; then From a9eeaf9e2395b400e008c66a303e31d8c664f4dc Mon Sep 17 00:00:00 2001 From: Ian Leitch Date: Sat, 14 Dec 2024 22:41:38 +0000 Subject: [PATCH 15/63] Release 3.0.0.beta5 --- Sources/Frontend/Version.swift | 2 +- scripts/release | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Sources/Frontend/Version.swift b/Sources/Frontend/Version.swift index 5d8e52f770..8abd880196 100644 --- a/Sources/Frontend/Version.swift +++ b/Sources/Frontend/Version.swift @@ -1 +1 @@ -let PeripheryVersion = "3.0.0.beta4" +let PeripheryVersion = "3.0.0.beta5" diff --git a/scripts/release b/scripts/release index 2a37ab7915..181a240f9a 100755 --- a/scripts/release +++ b/scripts/release @@ -51,7 +51,8 @@ if [ ! -f .release/periphery ]; then exit 1 fi -cp LICENSE.md MODULE.bazel BUILD.bazel bazel Sources .release/ +cp LICENSE.md MODULE.bazel BUILD.bazel .release/ +cp -R bazel Sources .release/ cp scripts/release_notes.md.template .release/release_notes.md # Codesign From 81bc8b915e7cbc2c8d71d00ef816a6c8dae45846 Mon Sep 17 00:00:00 2001 From: Ian Leitch Date: Sat, 14 Dec 2024 23:43:40 +0000 Subject: [PATCH 16/63] Bazel tweaks --- .mise/tasks/gen-bazel-rules | 2 +- .mise/tasks/lint | 2 +- .mise/tasks/lint-ci | 2 +- .mise/tasks/{ => scripts}/gen_bazel_rules.rb | 0 MODULE.bazel | 6 +++--- bazel/dev/BUILD.bazel | 21 +++++++++++++++++++ bazel/internal/BUILD.bazel | 22 -------------------- scripts/release | 4 ++++ 8 files changed, 31 insertions(+), 28 deletions(-) rename .mise/tasks/{ => scripts}/gen_bazel_rules.rb (100%) create mode 100644 bazel/dev/BUILD.bazel diff --git a/.mise/tasks/gen-bazel-rules b/.mise/tasks/gen-bazel-rules index ee855d2b6b..4ed4add3ad 100755 --- a/.mise/tasks/gen-bazel-rules +++ b/.mise/tasks/gen-bazel-rules @@ -2,4 +2,4 @@ set -euo pipefail -ruby .mise/tasks/gen_bazel_rules.rb +ruby .mise/tasks/scripts/gen_bazel_rules.rb diff --git a/.mise/tasks/lint b/.mise/tasks/lint index 5bd758d824..4993690984 100755 --- a/.mise/tasks/lint +++ b/.mise/tasks/lint @@ -4,6 +4,6 @@ set -euo pipefail cd $MISE_PROJECT_ROOT -bazel run //bazel/internal:buildifier.fix +bazel run //bazel/dev:buildifier.fix swiftformat . swiftlint lint --quiet diff --git a/.mise/tasks/lint-ci b/.mise/tasks/lint-ci index d49e1a0812..9b6e9f34ff 100755 --- a/.mise/tasks/lint-ci +++ b/.mise/tasks/lint-ci @@ -4,6 +4,6 @@ set -euo pipefail cd $MISE_PROJECT_ROOT -bazel run //bazel/internal:buildifier.check +bazel run //bazel/dev:buildifier.check swiftformat --quiet --strict . swiftlint lint --quiet --strict diff --git a/.mise/tasks/gen_bazel_rules.rb b/.mise/tasks/scripts/gen_bazel_rules.rb similarity index 100% rename from .mise/tasks/gen_bazel_rules.rb rename to .mise/tasks/scripts/gen_bazel_rules.rb diff --git a/MODULE.bazel b/MODULE.bazel index bb9622ac8c..f0f1dce840 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -10,9 +10,6 @@ bazel_dep(name = "rules_apple", version = "3.16.0") bazel_dep(name = "bazel_skylib", version = "1.7.1") bazel_dep(name = "apple_support", version = "1.17.1") -# Bazel dev dependencies -bazel_dep(name = "buildifier_prebuilt", version = "7.3.1", dev_dependency = True) - # Swift dependencies bazel_dep(name = "aexml", version = "4.7.0") bazel_dep(name = "swift_argument_parser", version = "1.5.0") @@ -27,3 +24,6 @@ bazel_dep(name = "yams", version = "5.1.3") # Extensions generated = use_extension("//bazel:extensions.bzl", "generated") use_repo(generated, "periphery_generated") + +# Bazel dev dependencies +bazel_dep(name = "buildifier_prebuilt", version = "7.3.1", dev_dependency = True) diff --git a/bazel/dev/BUILD.bazel b/bazel/dev/BUILD.bazel new file mode 100644 index 0000000000..3f7cd80791 --- /dev/null +++ b/bazel/dev/BUILD.bazel @@ -0,0 +1,21 @@ +load("@buildifier_prebuilt//:rules.bzl", "buildifier") + +buildifier( + name = "buildifier.fix", + exclude_patterns = [ + "./.git/**/*", + "**/.build/**/*", + ], + lint_mode = "fix", + mode = "fix", +) + +buildifier( + name = "buildifier.check", + exclude_patterns = [ + "./.git/**/*", + "**/.build/**/*", + ], + lint_mode = "warn", + mode = "check", +) diff --git a/bazel/internal/BUILD.bazel b/bazel/internal/BUILD.bazel index c3d60a89af..a570874911 100644 --- a/bazel/internal/BUILD.bazel +++ b/bazel/internal/BUILD.bazel @@ -1,25 +1,3 @@ -load("@buildifier_prebuilt//:rules.bzl", "buildifier") - exports_files([ "run.sh", ]) - -buildifier( - name = "buildifier.fix", - exclude_patterns = [ - "./.git/**/*", - "**/.build/**/*", - ], - lint_mode = "fix", - mode = "fix", -) - -buildifier( - name = "buildifier.check", - exclude_patterns = [ - "./.git/**/*", - "**/.build/**/*", - ], - lint_mode = "warn", - mode = "check", -) diff --git a/scripts/release b/scripts/release index 181a240f9a..f6a67ddf7e 100755 --- a/scripts/release +++ b/scripts/release @@ -53,7 +53,11 @@ fi cp LICENSE.md MODULE.bazel BUILD.bazel .release/ cp -R bazel Sources .release/ +rm -r .release/bazel/dev cp scripts/release_notes.md.template .release/release_notes.md +cat .release/MODULE.bazel | sed s/version = "0.0.0"/version = "${version}"/ > .release/MODULE.bazel + +confirm "\nContinue?" # Codesign cd .release From 48cbbaaa911f73718fb76aa28cf1613daf5fa075 Mon Sep 17 00:00:00 2001 From: Ian Leitch Date: Sat, 14 Dec 2024 23:52:15 +0000 Subject: [PATCH 17/63] Release 3.0.0.beta6 --- MODULE.bazel | 2 +- Sources/Frontend/Version.swift | 2 +- scripts/release | 5 +++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/MODULE.bazel b/MODULE.bazel index f0f1dce840..24cc658fb5 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -1,6 +1,6 @@ module( name = "periphery", - version = "0.0.0", + version = "3.0.0.beta6", compatibility_level = 1, ) diff --git a/Sources/Frontend/Version.swift b/Sources/Frontend/Version.swift index 8abd880196..2dfc26bc1e 100644 --- a/Sources/Frontend/Version.swift +++ b/Sources/Frontend/Version.swift @@ -1 +1 @@ -let PeripheryVersion = "3.0.0.beta5" +let PeripheryVersion = "3.0.0.beta6" diff --git a/scripts/release b/scripts/release index f6a67ddf7e..c5348cc1d9 100755 --- a/scripts/release +++ b/scripts/release @@ -40,6 +40,9 @@ mkdir .release cat scripts/Version.swift.template | sed s/__VERSION__/${version}/ > Sources/Frontend/Version.swift cat scripts/artifactbundle_info.json.template | sed s/__VERSION__/${version}/ > .release/info.json +cat MODULE.bazel | sed s/0.0.0/${version}/ > MODULE.bazel.new +rm MODULE.bazel +mv MODULE.bazel.new MODULE.bazel echo -e "\nUpdate CHANGELOG.md" confirm "Continue?" @@ -55,7 +58,6 @@ cp LICENSE.md MODULE.bazel BUILD.bazel .release/ cp -R bazel Sources .release/ rm -r .release/bazel/dev cp scripts/release_notes.md.template .release/release_notes.md -cat .release/MODULE.bazel | sed s/version = "0.0.0"/version = "${version}"/ > .release/MODULE.bazel confirm "\nContinue?" @@ -87,7 +89,6 @@ codesign "${bazel_zip_filename}" # Notarize notarize "${zip_filename}" notarize "${zip_artifactbundle}" -notarize "${bazel_zip_filename}" echo -e "\nVerify changes" confirm "Continue?" From 1afe5a40c7c0034c6af544be206409491cebae79 Mon Sep 17 00:00:00 2001 From: Ian Leitch Date: Sun, 15 Dec 2024 00:07:12 +0000 Subject: [PATCH 18/63] Fix Bazel bin path --- .mise/tasks/scripts/gen_bazel_rules.rb | 2 +- MODULE.bazel.lock | 2 +- bazel/internal/run.sh | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.mise/tasks/scripts/gen_bazel_rules.rb b/.mise/tasks/scripts/gen_bazel_rules.rb index 2e9ec7fee7..0dc924e04d 100644 --- a/.mise/tasks/scripts/gen_bazel_rules.rb +++ b/.mise/tasks/scripts/gen_bazel_rules.rb @@ -114,4 +114,4 @@ def generate_bazel_rule(path, rule, name, attrs) EOS puts -exec("bazel", "run", "//bazel/internal:buildifier.fix") +exec("bazel", "run", "//bazel/dev:buildifier.fix") diff --git a/MODULE.bazel.lock b/MODULE.bazel.lock index 9fdf4a4b6c..0182f20050 100644 --- a/MODULE.bazel.lock +++ b/MODULE.bazel.lock @@ -177,7 +177,7 @@ "//bazel:extensions.bzl%generated": { "general": { "bzlTransitiveDigest": "dgFs0JxcnjG85QvYWXzJGeKvxaxpucFtipSkimqsDhI=", - "usagesDigest": "Nc3pLwn+vmH9FKxV1v0U1kKXgBYhp8fPFbCIYKXh9uM=", + "usagesDigest": "Bm7np1xW9Jzr4hIpXIopstLe6EbiwmBbcqeElEkK3XI=", "recordedFileInputs": {}, "recordedDirentsInputs": {}, "envVariables": {}, diff --git a/bazel/internal/run.sh b/bazel/internal/run.sh index 8c97499596..0d144f352a 100755 --- a/bazel/internal/run.sh +++ b/bazel/internal/run.sh @@ -8,4 +8,4 @@ if test "${BUILD_WORKING_DIRECTORY+x}"; then cd $BUILD_WORKING_DIRECTORY fi -$LAUNCH_WORKING_DIRECTORY/Sources/Frontend "${@:1}" \ No newline at end of file +$LAUNCH_WORKING_DIRECTORY/Sources/Frontend_opt "${@:1}" \ No newline at end of file From accd67420a64820b39efbf7eae04ea7b122ae092 Mon Sep 17 00:00:00 2001 From: Ian Leitch Date: Sun, 15 Dec 2024 22:09:38 +0000 Subject: [PATCH 19/63] Improve handling of working directory for Bazel (#838) --- .mise/tasks/benchmark | 2 +- BUILD.bazel | 7 ++----- MODULE.bazel | 2 +- MODULE.bazel.lock | 4 ++-- Package.resolved | 6 +++--- Package.swift | 2 +- .../Extensions/FilenameMatcher+Extension.swift | 2 +- Sources/Frontend/Commands/ScanCommand.swift | 15 +++++++++++++++ Sources/Shared/PeripheryError.swift | 3 +++ bazel/internal/BUILD.bazel | 3 --- bazel/internal/run.sh | 11 ----------- bazel/internal/scan/scan_template.sh | 2 -- 12 files changed, 29 insertions(+), 30 deletions(-) delete mode 100755 bazel/internal/run.sh diff --git a/.mise/tasks/benchmark b/.mise/tasks/benchmark index 0fa8d07dee..b9facf57ba 100755 --- a/.mise/tasks/benchmark +++ b/.mise/tasks/benchmark @@ -8,7 +8,7 @@ cmd="" if [ "$usage_bazel" = "true" ]; then echo "INFO: Using Bazel" bazel build //:periphery - cmd='bazel-bin/Sources/Frontend scan --config /var/tmp/periphery_bazel/periphery.yml --generic-project-config bazel-bin/external/+generated+periphery_generated/rule/project_config.json' + cmd='bazel-bin/Sources/Frontend_opt scan --config /var/tmp/periphery_bazel/periphery.yml --generic-project-config bazel-bin/external/+generated+periphery_generated/rule/project_config.json' else mise r build --arch arm64 cmd='./.build/release/periphery scan --quiet --skip-build' diff --git a/BUILD.bazel b/BUILD.bazel index 89742929a3..e95711b88b 100644 --- a/BUILD.bazel +++ b/BUILD.bazel @@ -10,10 +10,7 @@ package_group( packages = ["//..."], ) -sh_binary( +alias( name = "periphery", - srcs = ["//bazel/internal:run.sh"], - data = [ - "//Sources:Frontend_opt", - ], + actual = "//Sources:Frontend_opt", ) diff --git a/MODULE.bazel b/MODULE.bazel index 24cc658fb5..76806b7546 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -13,7 +13,7 @@ bazel_dep(name = "apple_support", version = "1.17.1") # Swift dependencies bazel_dep(name = "aexml", version = "4.7.0") bazel_dep(name = "swift_argument_parser", version = "1.5.0") -bazel_dep(name = "swift-filename-matcher", version = "0.1.2") +bazel_dep(name = "swift-filename-matcher", version = "2.0.0") bazel_dep(name = "swift-indexstore", version = "0.3.0") bazel_dep(name = "swift-syntax", version = "600.0.1") bazel_dep(name = "swift-system", version = "1.4.0") diff --git a/MODULE.bazel.lock b/MODULE.bazel.lock index 0182f20050..a102832117 100644 --- a/MODULE.bazel.lock +++ b/MODULE.bazel.lock @@ -151,8 +151,8 @@ "https://bcr.bazel.build/modules/stardoc/0.7.0/MODULE.bazel": "05e3d6d30c099b6770e97da986c53bd31844d7f13d41412480ea265ac9e8079c", "https://bcr.bazel.build/modules/stardoc/0.7.1/MODULE.bazel": "3548faea4ee5dda5580f9af150e79d0f6aea934fc60c1cc50f4efdd9420759e7", "https://bcr.bazel.build/modules/stardoc/0.7.1/source.json": "b6500ffcd7b48cd72c29bb67bcac781e12701cc0d6d55d266a652583cfcdab01", - "https://bcr.bazel.build/modules/swift-filename-matcher/0.1.2/MODULE.bazel": "b93f54411684faafe3f5d7139d1895f1d6129ee36d211c1525935ff54c66776c", - "https://bcr.bazel.build/modules/swift-filename-matcher/0.1.2/source.json": "6309dcb0d2c002cd36645202c6de85be77a52c67b68b76ad901bc63ef72820ac", + "https://bcr.bazel.build/modules/swift-filename-matcher/2.0.0/MODULE.bazel": "76ee95eedb3cf70069de594746d482dfe41631d0b929eec2a0ef55bd6fa99fdd", + "https://bcr.bazel.build/modules/swift-filename-matcher/2.0.0/source.json": "1ec3000f619bbff02300a745b9bbf7c5339de984c606d15a067fe16f55dd1e2e", "https://bcr.bazel.build/modules/swift-indexstore/0.3.0/MODULE.bazel": "e1fcf17160d69cca7636f0f03eca99902577e0299d6f74843fdf2d0c272972ce", "https://bcr.bazel.build/modules/swift-indexstore/0.3.0/source.json": "0d13a7935be16621f918e68fb7def45100f153df93b7027ad06a7e633c029fab", "https://bcr.bazel.build/modules/swift-syntax/600.0.1/MODULE.bazel": "f6c886571884e56f979e2d08e27830fb20aea34cb5e518a5a9e47dbf230c6745", diff --git a/Package.resolved b/Package.resolved index 481aa8f9fc..51e4579f4d 100644 --- a/Package.resolved +++ b/Package.resolved @@ -1,5 +1,5 @@ { - "originHash" : "3ea0e89d1f3fe86c12ead60c3760805da8a51683f812784e5d6b4234cbe3a43b", + "originHash" : "e9d8baa60dce80cafa8b76899eb69396fc9c18d78f46733d4e15bc12127a6bd0", "pins" : [ { "identity" : "aexml", @@ -42,8 +42,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/ileitch/swift-filename-matcher", "state" : { - "revision" : "8cc02e902f651bb5812860011ee13707b9e037df", - "version" : "0.1.2" + "revision" : "516ff95f6a06c7a9eff8e944e989c7af076c5cdb", + "version" : "2.0.0" } }, { diff --git a/Package.swift b/Package.swift index d85973e879..7ee23a1548 100644 --- a/Package.swift +++ b/Package.swift @@ -8,7 +8,7 @@ var dependencies: [Package.Dependency] = [ .package(url: "https://github.com/apple/swift-argument-parser", from: "1.0.0"), .package(url: "https://github.com/kateinoigakukun/swift-indexstore", from: "0.3.0"), .package(url: "https://github.com/apple/swift-syntax", from: "600.0.1"), - .package(url: "https://github.com/ileitch/swift-filename-matcher", from: "0.0.0"), + .package(url: "https://github.com/ileitch/swift-filename-matcher", from: "2.0.0"), ] #if os(macOS) diff --git a/Sources/Extensions/FilenameMatcher+Extension.swift b/Sources/Extensions/FilenameMatcher+Extension.swift index 02bcc9df98..a8c0741791 100644 --- a/Sources/Extensions/FilenameMatcher+Extension.swift +++ b/Sources/Extensions/FilenameMatcher+Extension.swift @@ -19,6 +19,6 @@ public extension FilenameMatcher { let normalizedBase = traversedBase.hasSuffix("/") ? traversedBase : "\(traversedBase)/" let shouldPrependPwd = !["/", "*"].contains { relativePattern.hasPrefix($0) } let pattern = shouldPrependPwd ? "\(normalizedBase)\(traversedPattern)" : traversedPattern - self.init(pattern: pattern, caseSensitive: caseSensitive) + self.init(pattern: pattern, options: caseSensitive ? [.caseSensitive] : []) } } diff --git a/Sources/Frontend/Commands/ScanCommand.swift b/Sources/Frontend/Commands/ScanCommand.swift index aff85b9ab3..948f53617f 100644 --- a/Sources/Frontend/Commands/ScanCommand.swift +++ b/Sources/Frontend/Commands/ScanCommand.swift @@ -20,6 +20,9 @@ struct ScanCommand: FrontendCommand { @Flag(help: "Enable guided setup") var setup: Bool = defaultConfiguration.guidedSetup + @Option(help: "Path to the root directory of your project") + var projectRoot: FilePath = projectRootDefault + @Option(help: "Path to configuration file. By default Periphery will look for .periphery.yml in the current directory") var config: FilePath? @@ -140,6 +143,10 @@ struct ScanCommand: FrontendCommand { private static let defaultConfiguration = Configuration() func run() throws { + if !FileManager.default.changeCurrentDirectoryPath(projectRoot.string) { + throw PeripheryError.changeCurrentDirectoryFailed(projectRoot) + } + let configuration = Configuration() if !setup { @@ -247,6 +254,14 @@ struct ScanCommand: FrontendCommand { throw PeripheryError.foundIssues(count: filteredResults.count) } } + + // MARK: - Private + + private static var projectRootDefault: FilePath { + let bazelWorkspace = ProcessInfo.processInfo.environment["BUILD_WORKSPACE_DIRECTORY"] + let root = bazelWorkspace ?? FileManager.default.currentDirectoryPath + return FilePath(root) + } } extension OutputFormat: ExpressibleByArgument {} diff --git a/Sources/Shared/PeripheryError.swift b/Sources/Shared/PeripheryError.swift index 516fd85efc..56d9bc3ae3 100644 --- a/Sources/Shared/PeripheryError.swift +++ b/Sources/Shared/PeripheryError.swift @@ -18,6 +18,7 @@ public enum PeripheryError: Error, LocalizedError, CustomStringConvertible { case swiftVersionUnsupportedError(version: String, minimumVersion: String) case jsonDeserializationError(error: Error, json: String) case indexStoreNotFound(derivedDataPath: String) + case changeCurrentDirectoryFailed(FilePath) public var errorDescription: String? { switch self { @@ -55,6 +56,8 @@ public enum PeripheryError: Error, LocalizedError, CustomStringConvertible { return "JSON deserialization failed: \(describe(error))\nJSON:\n\(json)" case let .indexStoreNotFound(derivedDataPath): return "Failed to find index datastore at path: \(derivedDataPath)" + case let .changeCurrentDirectoryFailed(path): + return "Failed to change current directory to: \(path)" } } diff --git a/bazel/internal/BUILD.bazel b/bazel/internal/BUILD.bazel index a570874911..e69de29bb2 100644 --- a/bazel/internal/BUILD.bazel +++ b/bazel/internal/BUILD.bazel @@ -1,3 +0,0 @@ -exports_files([ - "run.sh", -]) diff --git a/bazel/internal/run.sh b/bazel/internal/run.sh deleted file mode 100755 index 0d144f352a..0000000000 --- a/bazel/internal/run.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/bash - -set -e - -LAUNCH_WORKING_DIRECTORY=$(pwd) - -if test "${BUILD_WORKING_DIRECTORY+x}"; then - cd $BUILD_WORKING_DIRECTORY -fi - -$LAUNCH_WORKING_DIRECTORY/Sources/Frontend_opt "${@:1}" \ No newline at end of file diff --git a/bazel/internal/scan/scan_template.sh b/bazel/internal/scan/scan_template.sh index fb0b037033..9e10494dc4 100644 --- a/bazel/internal/scan/scan_template.sh +++ b/bazel/internal/scan/scan_template.sh @@ -1,3 +1 @@ -cd $BUILD_WORKSPACE_DIRECTORY - %periphery_binary% scan --config "%config_path%" --generic-project-config "%project_config_path%" From d61eecf4fa6d1ff0e9126b6d72e687c77bca402a Mon Sep 17 00:00:00 2001 From: Ian Leitch Date: Sun, 15 Dec 2024 23:11:45 +0000 Subject: [PATCH 20/63] Release 3.0.0.beta7 --- MODULE.bazel | 2 +- Sources/Frontend/Version.swift | 2 +- scripts/release | 4 +--- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/MODULE.bazel b/MODULE.bazel index 76806b7546..392cac4ac7 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -1,6 +1,6 @@ module( name = "periphery", - version = "3.0.0.beta6", + version = "3.0.0.beta7", compatibility_level = 1, ) diff --git a/Sources/Frontend/Version.swift b/Sources/Frontend/Version.swift index 2dfc26bc1e..ed14170bee 100644 --- a/Sources/Frontend/Version.swift +++ b/Sources/Frontend/Version.swift @@ -1 +1 @@ -let PeripheryVersion = "3.0.0.beta6" +let PeripheryVersion = "3.0.0.beta7" diff --git a/scripts/release b/scripts/release index c5348cc1d9..96ddee4b6d 100755 --- a/scripts/release +++ b/scripts/release @@ -40,9 +40,7 @@ mkdir .release cat scripts/Version.swift.template | sed s/__VERSION__/${version}/ > Sources/Frontend/Version.swift cat scripts/artifactbundle_info.json.template | sed s/__VERSION__/${version}/ > .release/info.json -cat MODULE.bazel | sed s/0.0.0/${version}/ > MODULE.bazel.new -rm MODULE.bazel -mv MODULE.bazel.new MODULE.bazel +ruby -e "file = 'MODULE.bazel'; content = File.read(file); content.sub!(/version = \".+?\"/, 'version = \"${version}\"'); File.write(file, content)" echo -e "\nUpdate CHANGELOG.md" confirm "Continue?" From 623d1496b6545fad36c5bb645aa63f03d9c54cb5 Mon Sep 17 00:00:00 2001 From: Ian Leitch Date: Mon, 16 Dec 2024 10:50:43 +0000 Subject: [PATCH 21/63] Bazel ignore .release --- .bazelignore | 3 ++- MODULE.bazel.lock | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.bazelignore b/.bazelignore index db40dc9300..3dc065f56f 100644 --- a/.bazelignore +++ b/.bazelignore @@ -1,3 +1,4 @@ .build .git -.mise \ No newline at end of file +.mise +.release \ No newline at end of file diff --git a/MODULE.bazel.lock b/MODULE.bazel.lock index a102832117..2a51f23915 100644 --- a/MODULE.bazel.lock +++ b/MODULE.bazel.lock @@ -177,7 +177,7 @@ "//bazel:extensions.bzl%generated": { "general": { "bzlTransitiveDigest": "dgFs0JxcnjG85QvYWXzJGeKvxaxpucFtipSkimqsDhI=", - "usagesDigest": "Bm7np1xW9Jzr4hIpXIopstLe6EbiwmBbcqeElEkK3XI=", + "usagesDigest": "BkQfIUcbH0PIgWJ29JAsW4xDPLmyzRGAzZ3nGRCAsRw=", "recordedFileInputs": {}, "recordedDirentsInputs": {}, "envVariables": {}, From 5dfd43fe5800e603481e20d423ad86f3a43771d2 Mon Sep 17 00:00:00 2001 From: Ian Leitch Date: Mon, 16 Dec 2024 12:38:16 +0000 Subject: [PATCH 22/63] Fix generated Bazel repo naming (#843) --- .bazel_use_local_generated_repo | 0 Sources/ProjectDrivers/BazelProjectDriver.swift | 6 +++++- 2 files changed, 5 insertions(+), 1 deletion(-) create mode 100644 .bazel_use_local_generated_repo diff --git a/.bazel_use_local_generated_repo b/.bazel_use_local_generated_repo new file mode 100644 index 0000000000..e69de29bb2 diff --git a/Sources/ProjectDrivers/BazelProjectDriver.swift b/Sources/ProjectDrivers/BazelProjectDriver.swift index 3edfa584c4..2b2b367938 100644 --- a/Sources/ProjectDrivers/BazelProjectDriver.swift +++ b/Sources/ProjectDrivers/BazelProjectDriver.swift @@ -120,7 +120,7 @@ class BazelProjectDriver: ProjectDriver { "run", "--check_visibility=false", "--ui_event_filters=-info,-debug,-warning", - "@periphery_generated//rule:scan", + "\(generatedRepositoryName)//rule:scan", ]) // The actual scan is performed by Bazel. @@ -129,6 +129,10 @@ class BazelProjectDriver: ProjectDriver { // MARK: - Private + private var generatedRepositoryName: String { + fileManager.fileExists(atPath: ".bazel_use_local_generated_repo") ? "@periphery_generated" : "@@periphery++generated+periphery_generated" + } + private func queryTargets() throws -> [String] { try shell .exec(["bazel", "query", query], stderr: false) From 1390d13a06265cb68b1fec13cc1fb9a7c9321358 Mon Sep 17 00:00:00 2001 From: Ian Leitch Date: Mon, 16 Dec 2024 15:19:31 +0000 Subject: [PATCH 23/63] Release 3.0.0.beta8 --- MODULE.bazel | 2 +- Sources/Frontend/Version.swift | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/MODULE.bazel b/MODULE.bazel index 392cac4ac7..aad58ef2a9 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -1,6 +1,6 @@ module( name = "periphery", - version = "3.0.0.beta7", + version = "3.0.0.beta8", compatibility_level = 1, ) diff --git a/Sources/Frontend/Version.swift b/Sources/Frontend/Version.swift index ed14170bee..3bfa331905 100644 --- a/Sources/Frontend/Version.swift +++ b/Sources/Frontend/Version.swift @@ -1 +1 @@ -let PeripheryVersion = "3.0.0.beta7" +let PeripheryVersion = "3.0.0.beta8" From 1f9a5e031c00503cdcb17cded8fc6ef65242a58a Mon Sep 17 00:00:00 2001 From: Ian Leitch Date: Mon, 16 Dec 2024 21:30:01 +0000 Subject: [PATCH 24/63] Remove pristine shell env (#844) --- Sources/Shared/Shell.swift | 31 ++-------------------------- Tests/PeripheryTests/ShellTest.swift | 18 ---------------- 2 files changed, 2 insertions(+), 47 deletions(-) delete mode 100644 Tests/PeripheryTests/ShellTest.swift diff --git a/Sources/Shared/Shell.swift b/Sources/Shared/Shell.swift index f393e8ddb5..7be7eea451 100644 --- a/Sources/Shared/Shell.swift +++ b/Sources/Shared/Shell.swift @@ -38,38 +38,12 @@ open class Shell { self.logger = logger.contextualized(with: "shell") } - lazy var pristineEnvironment: [String: String] = { - let shell = environment["SHELL"] ?? "/bin/bash" - guard let pristineEnv = try? exec([shell, "-lc", "env"], environment: [:]).1 else { - return environment - } - - var newEnv = pristineEnv.trimmed - .split(separator: "\n").map { line -> (String, String) in - let pair = line.split(separator: "=", maxSplits: 1) - return (String(pair.first ?? ""), String(pair.last ?? "")) - } - .reduce(into: [String: String]()) { result, pair in - result[pair.0] = pair.1 - } - - let preservedKeys = ["TERM", "PATH", "DEVELOPER_DIR", "SSH_AUTH_SOCK"] - for key in preservedKeys { - if let value = environment[key] { - newEnv[key] = value - } - } - - return newEnv - }() - @discardableResult open func exec( _ args: [String], stderr: Bool = true ) throws -> String { - let env = pristineEnvironment - let (status, output) = try exec(args, environment: env, stderr: stderr) + let (status, output) = try exec(args, environment: environment, stderr: stderr) if status == 0 { return output @@ -87,8 +61,7 @@ open class Shell { _ args: [String], stderr: Bool = true ) throws -> Int32 { - let env = pristineEnvironment - let (status, _) = try exec(args, environment: env, stderr: stderr, captureOutput: false) + let (status, _) = try exec(args, environment: environment, stderr: stderr, captureOutput: false) return status } diff --git a/Tests/PeripheryTests/ShellTest.swift b/Tests/PeripheryTests/ShellTest.swift deleted file mode 100644 index ab2afd882c..0000000000 --- a/Tests/PeripheryTests/ShellTest.swift +++ /dev/null @@ -1,18 +0,0 @@ -import Logger -@testable import Shared -import XCTest - -final class ShellTest: XCTestCase { - func testPristineEnvironmentWithPreservedVariables() { - let path = "/path/to/bin" - let developerDir = "/path/to/Xcode.app/Contents/Developer" - let environment = [ - "PATH": path, - "DEVELOPER_DIR": developerDir, - ] - let logger = Logger(quiet: true) - let shell = Shell(environment: environment, logger: logger) - XCTAssertEqual(shell.pristineEnvironment["PATH"], path) - XCTAssertEqual(shell.pristineEnvironment["DEVELOPER_DIR"], developerDir) - } -} From a75b243e3cc6bc3d4731eeea436aeb31e62a282b Mon Sep 17 00:00:00 2001 From: Ian Leitch Date: Tue, 17 Dec 2024 13:29:02 +0000 Subject: [PATCH 25/63] Simplify Bazel support --- .bazel_use_local_generated_repo | 0 BUILD.bazel | 12 ------------ MODULE.bazel | 5 ++--- MODULE.bazel.lock | 8 ++++---- Sources/ProjectDrivers/BazelProjectDriver.swift | 9 +-------- bazel/{extensions.bzl => generated.bzl} | 13 ++----------- 6 files changed, 9 insertions(+), 38 deletions(-) delete mode 100644 .bazel_use_local_generated_repo rename bazel/{extensions.bzl => generated.bzl} (64%) diff --git a/.bazel_use_local_generated_repo b/.bazel_use_local_generated_repo deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/BUILD.bazel b/BUILD.bazel index e95711b88b..fb3fc8d637 100644 --- a/BUILD.bazel +++ b/BUILD.bazel @@ -1,15 +1,3 @@ -package_group( - name = "generated", - includes = [ - "@periphery_generated//:package_group", - ], -) - -package_group( - name = "package_group", - packages = ["//..."], -) - alias( name = "periphery", actual = "//Sources:Frontend_opt", diff --git a/MODULE.bazel b/MODULE.bazel index aad58ef2a9..9fe1c2f6ef 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -21,9 +21,8 @@ bazel_dep(name = "pathkit", version = "1.0.1") bazel_dep(name = "xcodeproj", version = "8.25.0") bazel_dep(name = "yams", version = "5.1.3") -# Extensions -generated = use_extension("//bazel:extensions.bzl", "generated") -use_repo(generated, "periphery_generated") +# Generated repo +use_repo(use_extension("//bazel:generated.bzl", "generated"), "periphery_generated") # Bazel dev dependencies bazel_dep(name = "buildifier_prebuilt", version = "7.3.1", dev_dependency = True) diff --git a/MODULE.bazel.lock b/MODULE.bazel.lock index 2a51f23915..679c0601b8 100644 --- a/MODULE.bazel.lock +++ b/MODULE.bazel.lock @@ -174,16 +174,16 @@ }, "selectedYankedVersions": {}, "moduleExtensions": { - "//bazel:extensions.bzl%generated": { + "//bazel:generated.bzl%generated": { "general": { - "bzlTransitiveDigest": "dgFs0JxcnjG85QvYWXzJGeKvxaxpucFtipSkimqsDhI=", - "usagesDigest": "BkQfIUcbH0PIgWJ29JAsW4xDPLmyzRGAzZ3nGRCAsRw=", + "bzlTransitiveDigest": "nMR2FBcoRPImVocN9DNOnm2NQWyTbJPu7SHJgAXsLFw=", + "usagesDigest": "wpzfE+FqjMSvrEYHa2419pepTym02qH7AT1nBCOagKY=", "recordedFileInputs": {}, "recordedDirentsInputs": {}, "envVariables": {}, "generatedRepoSpecs": { "periphery_generated": { - "repoRuleId": "@@//bazel:extensions.bzl%generated_repo", + "repoRuleId": "@@//bazel:generated.bzl%generated_repo", "attributes": {} } }, diff --git a/Sources/ProjectDrivers/BazelProjectDriver.swift b/Sources/ProjectDrivers/BazelProjectDriver.swift index 2b2b367938..a7ca70dd47 100644 --- a/Sources/ProjectDrivers/BazelProjectDriver.swift +++ b/Sources/ProjectDrivers/BazelProjectDriver.swift @@ -98,9 +98,6 @@ class BazelProjectDriver: ProjectDriver { testonly = True, config = "\(configPath)", periphery_binary = "\(executablePath)", - visibility = [ - "@periphery//:package_group" - ], deps = [ \(deps) ], @@ -120,7 +117,7 @@ class BazelProjectDriver: ProjectDriver { "run", "--check_visibility=false", "--ui_event_filters=-info,-debug,-warning", - "\(generatedRepositoryName)//rule:scan", + "@periphery_generated//:scan", ]) // The actual scan is performed by Bazel. @@ -129,10 +126,6 @@ class BazelProjectDriver: ProjectDriver { // MARK: - Private - private var generatedRepositoryName: String { - fileManager.fileExists(atPath: ".bazel_use_local_generated_repo") ? "@periphery_generated" : "@@periphery++generated+periphery_generated" - } - private func queryTargets() throws -> [String] { try shell .exec(["bazel", "query", query], stderr: false) diff --git a/bazel/extensions.bzl b/bazel/generated.bzl similarity index 64% rename from bazel/extensions.bzl rename to bazel/generated.bzl index 076ae68908..d7cb8665cb 100644 --- a/bazel/extensions.bzl +++ b/bazel/generated.bzl @@ -1,20 +1,11 @@ """ - Public module extensions. + Public generated repo extension. """ def _generated_repo_impl(repository_ctx): - repository_ctx.file( - "BUILD.bazel", - content = """ -package_group( - name = "package_group", - packages = ["//..."], -) -""", - ) repository_ctx.symlink( "/var/tmp/periphery_bazel/BUILD.bazel", - "rule/BUILD.bazel", + "BUILD.bazel", ) generated_repo = repository_rule( From 3e120ac1a70fe29e04ab98e877a0c5579449cbee Mon Sep 17 00:00:00 2001 From: Ian Leitch Date: Tue, 17 Dec 2024 17:13:02 +0000 Subject: [PATCH 26/63] Specify periphery binary location as target --- .mise/tasks/scripts/gen_bazel_rules.rb | 2 +- BUILD.bazel | 1 + Sources/BUILD.bazel | 2 +- Sources/ProjectDrivers/BazelProjectDriver.swift | 1 - bazel/internal/opt.bzl | 14 ++------------ bazel/internal/scan/scan.bzl | 16 +++++++++------- bazel/internal/scan/scan_template.sh | 2 +- 7 files changed, 15 insertions(+), 23 deletions(-) diff --git a/.mise/tasks/scripts/gen_bazel_rules.rb b/.mise/tasks/scripts/gen_bazel_rules.rb index 0dc924e04d..6838ea2032 100644 --- a/.mise/tasks/scripts/gen_bazel_rules.rb +++ b/.mise/tasks/scripts/gen_bazel_rules.rb @@ -73,7 +73,7 @@ def generate_bazel_rule(path, rule, name, attrs) optimized_swift_binary( name = "#{name}_opt", target = ":#{name}", - visibility = ["//visibility:public"], + visibility = ["//:__pkg__"], ) EOS else diff --git a/BUILD.bazel b/BUILD.bazel index fb3fc8d637..080c6834f2 100644 --- a/BUILD.bazel +++ b/BUILD.bazel @@ -1,4 +1,5 @@ alias( name = "periphery", actual = "//Sources:Frontend_opt", + visibility = ["//visibility:public"], ) diff --git a/Sources/BUILD.bazel b/Sources/BUILD.bazel index 0f5d3e15e6..16a566d889 100644 --- a/Sources/BUILD.bazel +++ b/Sources/BUILD.bazel @@ -235,7 +235,7 @@ swift_binary( optimized_swift_binary( name = "Frontend_opt", target = ":Frontend", - visibility = ["//visibility:public"], + visibility = ["//:__pkg__"], ) swift_library( diff --git a/Sources/ProjectDrivers/BazelProjectDriver.swift b/Sources/ProjectDrivers/BazelProjectDriver.swift index a7ca70dd47..fcccf7f95f 100644 --- a/Sources/ProjectDrivers/BazelProjectDriver.swift +++ b/Sources/ProjectDrivers/BazelProjectDriver.swift @@ -97,7 +97,6 @@ class BazelProjectDriver: ProjectDriver { name = "scan", testonly = True, config = "\(configPath)", - periphery_binary = "\(executablePath)", deps = [ \(deps) ], diff --git a/bazel/internal/opt.bzl b/bazel/internal/opt.bzl index 8e2b46cb35..ba5755b330 100644 --- a/bazel/internal/opt.bzl +++ b/bazel/internal/opt.bzl @@ -20,19 +20,9 @@ _enable_optimizations = transition( ) def _optimized_swift_binary_impl(ctx): - default_info = ctx.attr.target[0][DefaultInfo] new_exe = ctx.actions.declare_file(ctx.label.name) - ctx.actions.symlink( - output = new_exe, - target_file = ctx.executable.target, - ) - return [ - DefaultInfo( - executable = new_exe, - files = depset([new_exe], transitive = [default_info.files]), - runfiles = ctx.runfiles().merge(default_info.default_runfiles), - ), - ] + ctx.actions.symlink(output = new_exe, target_file = ctx.executable.target) + return [DefaultInfo(executable = new_exe)] optimized_swift_binary = rule( attrs = { diff --git a/bazel/internal/scan/scan.bzl b/bazel/internal/scan/scan.bzl index e15e8312f6..17dbb9988a 100644 --- a/bazel/internal/scan/scan.bzl +++ b/bazel/internal/scan/scan.bzl @@ -173,6 +173,8 @@ def _scan_impl(ctx): test_targets = test_targets, ) + periphery = ctx.attr.periphery[DefaultInfo].files_to_run.executable + project_config_json = json.encode_indent(project_config) project_config_file = ctx.actions.declare_file("project_config.json") ctx.actions.write(project_config_file, project_config_json) @@ -181,7 +183,7 @@ def _scan_impl(ctx): template = ctx.file._template, output = ctx.outputs.scan, substitutions = { - "%periphery_binary%": ctx.attr.periphery_binary, + "%periphery_path%": periphery.short_path, "%config_path%": ctx.attr.config, "%project_config_path%": project_config_file.path, }, @@ -189,14 +191,11 @@ def _scan_impl(ctx): return DefaultInfo( executable = ctx.outputs.scan, - files = depset( - [ctx.outputs.scan, project_config_file], - ), runfiles = ctx.runfiles( - # Swift sources are not included in the generate project file, yet they are referenced + # Swift sources are not included in the generated project file, yet they are referenced # in the indexstores and will be read by Periphery, and therefore must be present in # the runfiles. - files = swift_srcs + indexstores + plists + xibs + xcdatamodels + xcmappingmodels, + files = swift_srcs + indexstores + plists + xibs + xcdatamodels + xcmappingmodels + [periphery], ), ) @@ -215,7 +214,10 @@ scan = rule( doc = "Top-level project targets to scan.", ), "config": attr.string(doc = "Path to the periphery.yml configuration file."), - "periphery_binary": attr.string(doc = "Path to the periphery binary."), + "periphery": attr.label( + doc = "The periphery executable target.", + default = "@periphery//:periphery", + ), "_template": attr.label( allow_single_file = True, default = "@periphery//bazel/internal/scan:scan_template.sh", diff --git a/bazel/internal/scan/scan_template.sh b/bazel/internal/scan/scan_template.sh index 9e10494dc4..fed7a2c86b 100644 --- a/bazel/internal/scan/scan_template.sh +++ b/bazel/internal/scan/scan_template.sh @@ -1 +1 @@ -%periphery_binary% scan --config "%config_path%" --generic-project-config "%project_config_path%" +%periphery_path% scan --config "%config_path%" --generic-project-config "%project_config_path%" From 408b546d68f78c8312c5dad4107300e1b8327333 Mon Sep 17 00:00:00 2001 From: Ian Leitch Date: Tue, 17 Dec 2024 17:44:32 +0000 Subject: [PATCH 27/63] Release 3.0.0.beta9 --- MODULE.bazel | 2 +- Sources/Frontend/Version.swift | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/MODULE.bazel b/MODULE.bazel index 9fe1c2f6ef..3a0e7cc5d9 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -1,6 +1,6 @@ module( name = "periphery", - version = "3.0.0.beta8", + version = "3.0.0.beta9", compatibility_level = 1, ) diff --git a/Sources/Frontend/Version.swift b/Sources/Frontend/Version.swift index 3bfa331905..8b2322d1a1 100644 --- a/Sources/Frontend/Version.swift +++ b/Sources/Frontend/Version.swift @@ -1 +1 @@ -let PeripheryVersion = "3.0.0.beta8" +let PeripheryVersion = "3.0.0.beta9" From b45fc8feabe259a21d98f4d2a619f681b8d9823d Mon Sep 17 00:00:00 2001 From: Ian Leitch Date: Wed, 18 Dec 2024 12:44:13 +0000 Subject: [PATCH 28/63] Output stderr for failed commands. Closes #629 #840 (#847) --- MODULE.bazel.lock | 2 +- .../ProjectDrivers/BazelProjectDriver.swift | 2 +- Sources/ProjectDrivers/SPM.swift | 2 +- Sources/Shared/Shell.swift | 59 +++++++++++-------- Sources/XcodeSupport/Xcodebuild.swift | 2 +- Tests/XcodeTests/ShellMock.swift | 2 +- 6 files changed, 38 insertions(+), 31 deletions(-) diff --git a/MODULE.bazel.lock b/MODULE.bazel.lock index 679c0601b8..0ff47ee68f 100644 --- a/MODULE.bazel.lock +++ b/MODULE.bazel.lock @@ -177,7 +177,7 @@ "//bazel:generated.bzl%generated": { "general": { "bzlTransitiveDigest": "nMR2FBcoRPImVocN9DNOnm2NQWyTbJPu7SHJgAXsLFw=", - "usagesDigest": "wpzfE+FqjMSvrEYHa2419pepTym02qH7AT1nBCOagKY=", + "usagesDigest": "8mdYbdjeyWhYUhUViUkt2T2IwtnrN+PHXdKUhqo0aqk=", "recordedFileInputs": {}, "recordedDirentsInputs": {}, "envVariables": {}, diff --git a/Sources/ProjectDrivers/BazelProjectDriver.swift b/Sources/ProjectDrivers/BazelProjectDriver.swift index fcccf7f95f..942ac644a1 100644 --- a/Sources/ProjectDrivers/BazelProjectDriver.swift +++ b/Sources/ProjectDrivers/BazelProjectDriver.swift @@ -127,7 +127,7 @@ class BazelProjectDriver: ProjectDriver { private func queryTargets() throws -> [String] { try shell - .exec(["bazel", "query", query], stderr: false) + .exec(["bazel", "query", query]) .split(separator: "\n") .map { "\"@@\($0)\"" } } diff --git a/Sources/ProjectDrivers/SPM.swift b/Sources/ProjectDrivers/SPM.swift index 3afb262fe0..cfd465c6f3 100644 --- a/Sources/ProjectDrivers/SPM.swift +++ b/Sources/ProjectDrivers/SPM.swift @@ -46,7 +46,7 @@ public enum SPM { if let path = configuration.jsonPackageManifestPath { jsonData = try Data(contentsOf: path.url) } else { - let jsonString = try shell.exec(["swift", "package", "describe", "--type", "json"], stderr: false) + let jsonString = try shell.exec(["swift", "package", "describe", "--type", "json"]) guard let data = jsonString.data(using: .utf8) else { throw PeripheryError.packageError(message: "Failed to read swift package description.") diff --git a/Sources/Shared/Shell.swift b/Sources/Shared/Shell.swift index 7be7eea451..d9e8347327 100644 --- a/Sources/Shared/Shell.swift +++ b/Sources/Shared/Shell.swift @@ -39,29 +39,23 @@ open class Shell { } @discardableResult - open func exec( - _ args: [String], - stderr: Bool = true - ) throws -> String { - let (status, output) = try exec(args, environment: environment, stderr: stderr) + open func exec(_ args: [String]) throws -> String { + let (status, stdout, stderr) = try exec(args) if status == 0 { - return output + return stdout } throw PeripheryError.shellCommandFailed( cmd: args, status: status, - output: output + output: [stdout, stderr].filter { !$0.isEmpty }.joined(separator: "\n").trimmed ) } @discardableResult - open func execStatus( - _ args: [String], - stderr: Bool = true - ) throws -> Int32 { - let (status, _) = try exec(args, environment: environment, stderr: stderr, captureOutput: false) + open func execStatus(_ args: [String]) throws -> Int32 { + let (status, _, _) = try exec(args, captureOutput: false) return status } @@ -69,10 +63,8 @@ open class Shell { private func exec( _ args: [String], - environment: [String: String], - stderr: Bool = false, captureOutput: Bool = true - ) throws -> (Int32, String) { + ) throws -> (Int32, String, String) { let launchPath: String let newArgs: [String] @@ -92,22 +84,37 @@ open class Shell { logger.debug("\(launchPath) \(newArgs.joined(separator: " "))") ShellProcessStore.shared.add(process) - var outputPipe: Pipe? + var stdoutPipe: Pipe? + var stderrPipe: Pipe? if captureOutput { - outputPipe = Pipe() - process.standardOutput = outputPipe - process.standardError = stderr ? outputPipe : nil + stdoutPipe = Pipe() + stderrPipe = Pipe() + process.standardOutput = stdoutPipe + process.standardError = stderrPipe } process.launch() - var output = "" + var stdout = "" + var stderr = "" + + if let stdoutData = try stdoutPipe?.fileHandleForReading.readToEnd() { + guard let stdoutStr = String(data: stdoutData, encoding: .utf8) + else { + ShellProcessStore.shared.remove(process) + throw PeripheryError.shellOutputEncodingFailed( + cmd: launchPath, + args: newArgs, + encoding: .utf8 + ) + } + stdout = stdoutStr + } - if let outputPipe, - let outputData = try outputPipe.fileHandleForReading.readToEnd() - { - guard let str = String(data: outputData, encoding: .utf8) else { + if let stderrData = try stderrPipe?.fileHandleForReading.readToEnd() { + guard let stderrStr = String(data: stderrData, encoding: .utf8) + else { ShellProcessStore.shared.remove(process) throw PeripheryError.shellOutputEncodingFailed( cmd: launchPath, @@ -115,11 +122,11 @@ open class Shell { encoding: .utf8 ) } - output = str + stderr = stderrStr } process.waitUntilExit() ShellProcessStore.shared.remove(process) - return (process.terminationStatus, output) + return (process.terminationStatus, stdout, stderr) } } diff --git a/Sources/XcodeSupport/Xcodebuild.swift b/Sources/XcodeSupport/Xcodebuild.swift index 92ed1d3101..fb59a86a87 100644 --- a/Sources/XcodeSupport/Xcodebuild.swift +++ b/Sources/XcodeSupport/Xcodebuild.swift @@ -86,7 +86,7 @@ public final class Xcodebuild { let quotedArguments = quote(arguments: additionalArguments) let xcodebuild = "xcodebuild \((args + quotedArguments).joined(separator: " "))" - let lines = try shell.exec(["/bin/sh", "-c", xcodebuild], stderr: false).split(separator: "\n").map { String($0).trimmed } + let lines = try shell.exec(["/bin/sh", "-c", xcodebuild]).split(separator: "\n").map { String($0).trimmed } // xcodebuild may output unrelated warnings, we need to strip them out otherwise // JSON parsing will fail. diff --git a/Tests/XcodeTests/ShellMock.swift b/Tests/XcodeTests/ShellMock.swift index 0ae7918d63..8a99a60b7c 100644 --- a/Tests/XcodeTests/ShellMock.swift +++ b/Tests/XcodeTests/ShellMock.swift @@ -10,7 +10,7 @@ class ShellMock: Shell { self.init(environment: ProcessInfo.processInfo.environment, logger: logger) } - override func exec(_: [String], stderr _: Bool = true) throws -> String { + override func exec(_: [String]) throws -> String { output } } From a46a2538b515bf4836bd2b362e61a8153eebd473 Mon Sep 17 00:00:00 2001 From: Ian Leitch Date: Wed, 18 Dec 2024 17:05:01 +0000 Subject: [PATCH 29/63] Add support for Swift Testing (#848) --- CHANGELOG.md | 2 +- Sources/BUILD.bazel | 1 + Sources/Indexer/SwiftIndexer.swift | 1 + Sources/SourceGraph/Elements/SourceFile.swift | 1 + .../Mutators/SwiftTestingRetainer.swift | 35 +++++++++++++++++++ .../SourceGraphMutatorRunner.swift | 1 + .../testRetainsSwiftTestingDeclarations.swift | 22 ++++++++++++ Tests/PeripheryTests/RetentionTest.swift | 27 ++++++++++++++ 8 files changed, 89 insertions(+), 1 deletion(-) create mode 100644 Sources/SourceGraph/Mutators/SwiftTestingRetainer.swift create mode 100644 Tests/Fixtures/Sources/RetentionFixtures/testRetainsSwiftTestingDeclarations.swift diff --git a/CHANGELOG.md b/CHANGELOG.md index 37c2ed261c..493868e6c3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,7 +7,7 @@ ##### Enhancements -- None. +- Added support for Swift Testing. ##### Bug Fixes diff --git a/Sources/BUILD.bazel b/Sources/BUILD.bazel index 16a566d889..5cc503a1c5 100644 --- a/Sources/BUILD.bazel +++ b/Sources/BUILD.bazel @@ -79,6 +79,7 @@ swift_library( "SourceGraph/Mutators/ResultBuilderRetainer.swift", "SourceGraph/Mutators/StringInterpolationAppendInterpolationRetainer.swift", "SourceGraph/Mutators/StructImplicitInitializerReferenceBuilder.swift", + "SourceGraph/Mutators/SwiftTestingRetainer.swift", "SourceGraph/Mutators/SwiftUIRetainer.swift", "SourceGraph/Mutators/UnusedImportMarker.swift", "SourceGraph/Mutators/UnusedParameterRetainer.swift", diff --git a/Sources/Indexer/SwiftIndexer.swift b/Sources/Indexer/SwiftIndexer.swift index 7adb442ff8..8581cd413a 100644 --- a/Sources/Indexer/SwiftIndexer.swift +++ b/Sources/Indexer/SwiftIndexer.swift @@ -229,6 +229,7 @@ final class SwiftIndexer: Indexer { multiplexingSyntaxVisitor.visit() sourceFile.importStatements = importSyntaxVisitor.importStatements + sourceFile.importsSwiftTesting = importSyntaxVisitor.importStatements.contains(where: { $0.module == "Testing" }) if !configuration.disableUnusedImportAnalysis { for stmt in sourceFile.importStatements where stmt.isExported { diff --git a/Sources/SourceGraph/Elements/SourceFile.swift b/Sources/SourceGraph/Elements/SourceFile.swift index 69e9160009..e8944df847 100644 --- a/Sources/SourceGraph/Elements/SourceFile.swift +++ b/Sources/SourceGraph/Elements/SourceFile.swift @@ -5,6 +5,7 @@ public class SourceFile { public let path: FilePath public let modules: Set public var importStatements: [ImportStatement] = [] + public var importsSwiftTesting = false public init(path: FilePath, modules: Set) { self.path = path diff --git a/Sources/SourceGraph/Mutators/SwiftTestingRetainer.swift b/Sources/SourceGraph/Mutators/SwiftTestingRetainer.swift new file mode 100644 index 0000000000..f8feb48863 --- /dev/null +++ b/Sources/SourceGraph/Mutators/SwiftTestingRetainer.swift @@ -0,0 +1,35 @@ +import Configuration +import Foundation +import Shared + +/// Retains Swift Testing declarations. +/// https://developer.apple.com/xcode/swift-testing/ +final class SwiftTestingRetainer: SourceGraphMutator { + private let graph: SourceGraph + + required init(graph: SourceGraph, configuration _: Configuration, swiftVersion _: SwiftVersion) { + self.graph = graph + } + + func mutate() { + for decl in graph.declarations(ofKinds: [.class, .struct]) { + guard decl.location.file.importsSwiftTesting else { continue } + + if decl.attributes.contains("Suite") { + graph.markRetained(decl) + } + } + + for decl in graph.declarations(ofKinds: [.functionFree, .functionMethodInstance, .functionMethodClass, .functionMethodStatic]) { + guard decl.location.file.importsSwiftTesting else { continue } + + if decl.attributes.contains("Test") { + graph.markRetained(decl) + + if let parent = decl.parent { + graph.markRetained(parent) + } + } + } + } +} diff --git a/Sources/SourceGraph/SourceGraphMutatorRunner.swift b/Sources/SourceGraph/SourceGraphMutatorRunner.swift index f67ddeb587..43ca4de8a8 100644 --- a/Sources/SourceGraph/SourceGraphMutatorRunner.swift +++ b/Sources/SourceGraph/SourceGraphMutatorRunner.swift @@ -36,6 +36,7 @@ public final class SourceGraphMutatorRunner { EntryPointAttributeRetainer.self, PubliclyAccessibleRetainer.self, XCTestRetainer.self, + SwiftTestingRetainer.self, SwiftUIRetainer.self, StringInterpolationAppendInterpolationRetainer.self, PropertyWrapperRetainer.self, diff --git a/Tests/Fixtures/Sources/RetentionFixtures/testRetainsSwiftTestingDeclarations.swift b/Tests/Fixtures/Sources/RetentionFixtures/testRetainsSwiftTestingDeclarations.swift new file mode 100644 index 0000000000..80051ae9d4 --- /dev/null +++ b/Tests/Fixtures/Sources/RetentionFixtures/testRetainsSwiftTestingDeclarations.swift @@ -0,0 +1,22 @@ +#if canImport(Testing) +import Testing + +@Test func swiftTestingFreeFunction() {} + +class SwiftTestingClass { + @Test("displayName") func instanceMethod() {} + @Test class func classMethod() {} + @Test static func staticMethod() {} +} + +@Suite struct SwiftTestingStructWithSuite { + @Test func instanceMethod() {} + @Test("displayName") static func staticMethod() {} +} + +@Suite("displayName") class SwiftTestingClassWithSuite { + @Test func instanceMethod() {} + @Test("displayName") class func classMethod() {} + @Test static func staticMethod() {} +} +#endif diff --git a/Tests/PeripheryTests/RetentionTest.swift b/Tests/PeripheryTests/RetentionTest.swift index 0b5d6d687b..acc7a2d2d3 100644 --- a/Tests/PeripheryTests/RetentionTest.swift +++ b/Tests/PeripheryTests/RetentionTest.swift @@ -1059,6 +1059,33 @@ final class RetentionTest: FixtureSourceGraphTestCase { } } + // MARK: - Swift Testing + + #if canImport(Testing) + func testRetainsSwiftTestingDeclarations() { + analyze { + assertReferenced(.functionFree("swiftTestingFreeFunction()")) + + assertReferenced(.class("SwiftTestingClass")) { + self.assertReferenced(.functionMethodInstance("instanceMethod()")) + self.assertReferenced(.functionMethodClass("classMethod()")) + self.assertReferenced(.functionMethodStatic("staticMethod()")) + } + + assertReferenced(.struct("SwiftTestingStructWithSuite")) { + self.assertReferenced(.functionMethodInstance("instanceMethod()")) + self.assertReferenced(.functionMethodStatic("staticMethod()")) + } + + assertReferenced(.class("SwiftTestingClassWithSuite")) { + self.assertReferenced(.functionMethodInstance("instanceMethod()")) + self.assertReferenced(.functionMethodClass("classMethod()")) + self.assertReferenced(.functionMethodStatic("staticMethod()")) + } + } + } + #endif + // MARK: - Assign-only properties func testStructImplicitInitializer() { From ed0a87475d30ae3a5dbe9033a937d0dcaa9e3eda Mon Sep 17 00:00:00 2001 From: Ian Leitch Date: Thu, 19 Dec 2024 00:43:20 +0000 Subject: [PATCH 30/63] Add Bazel support to guided setup (#851) --- Sources/BUILD.bazel | 1 + Sources/Frontend/BazelProjectSetupGuide.swift | 32 +++++++++++++++++++ Sources/Frontend/GuidedSetup.swift | 13 ++++++-- Sources/Logger/Logger.swift | 2 +- 4 files changed, 45 insertions(+), 3 deletions(-) create mode 100644 Sources/Frontend/BazelProjectSetupGuide.swift diff --git a/Sources/BUILD.bazel b/Sources/BUILD.bazel index 5cc503a1c5..1edbc2559a 100644 --- a/Sources/BUILD.bazel +++ b/Sources/BUILD.bazel @@ -206,6 +206,7 @@ swift_library( swift_binary( name = "Frontend", srcs = [ + "Frontend/BazelProjectSetupGuide.swift", "Frontend/Commands/CheckUpdateCommand.swift", "Frontend/Commands/ClearCacheCommand.swift", "Frontend/Commands/FrontendCommand.swift", diff --git a/Sources/Frontend/BazelProjectSetupGuide.swift b/Sources/Frontend/BazelProjectSetupGuide.swift new file mode 100644 index 0000000000..c49ae7284a --- /dev/null +++ b/Sources/Frontend/BazelProjectSetupGuide.swift @@ -0,0 +1,32 @@ +import Foundation +import Logger +import ProjectDrivers +import Shared +import SystemPackage + +final class BazelProjectSetupGuide: SetupGuideHelpers, SetupGuide { + static func detect() -> Self? { + guard BazelProjectDriver.isSupported else { return nil } + return Self() + } + + var projectKindName: String { + "Bazel" + } + + func perform() throws -> ProjectKind { + print(colorize("\nAdd the following snippet to your MODULE.bazel file:", .bold)) + print(colorize(""" + bazel_dep(name = "periphery", version = "\(PeripheryVersion)") + use_repo(use_extension("@periphery//bazel:generated.bzl", "generated"), "periphery_generated") + """, .lightGray)) + print(colorize("\nEnter to continue when ready ", .bold), terminator: "") + _ = readLine() + + return .bazel + } + + var commandLineOptions: [String] { + ["--bazel"] + } +} diff --git a/Sources/Frontend/GuidedSetup.swift b/Sources/Frontend/GuidedSetup.swift index ebdeeeee5e..80d2c00e39 100644 --- a/Sources/Frontend/GuidedSetup.swift +++ b/Sources/Frontend/GuidedSetup.swift @@ -35,10 +35,14 @@ final class GuidedSetup: SetupGuideHelpers { } #endif + if let guide = BazelProjectSetupGuide.detect() { + projectGuides.append(guide) + } + var projectGuide_: SetupGuide? if projectGuides.count > 1 { - print(colorize("Please select which project to use:", .bold)) + print(colorize("Select which project to use:", .bold)) let kindName = select(single: projectGuides.map(\.projectKindName)) projectGuide_ = projectGuides.first { $0.projectKindName == kindName } print("") @@ -86,6 +90,11 @@ final class GuidedSetup: SetupGuideHelpers { } let parts = [bareCommand] + options - return parts.joined(separator: " \\\n ") + + if options.count > 1 { + return parts.joined(separator: " \\\n ") + } + + return parts.joined(separator: " ") } } diff --git a/Sources/Logger/Logger.swift b/Sources/Logger/Logger.swift index ed664d6fee..0376addd64 100644 --- a/Sources/Logger/Logger.swift +++ b/Sources/Logger/Logger.swift @@ -17,7 +17,7 @@ public enum ANSIColor: String { case magenta = "\u{001B}[0;35m" case boldMagenta = "\u{001B}[0;1;35m" case cyan = "\u{001B}[0;36m" - case white = "\u{001B}[0;37m" + case lightGray = "\u{001B}[0;37m" case gray = "\u{001B}[0;1;30m" } From 7a265ed4020bb727e5799726bff1d64d8a45a43b Mon Sep 17 00:00:00 2001 From: Ian Leitch Date: Thu, 19 Dec 2024 15:12:10 +0000 Subject: [PATCH 31/63] Add option to select --retain-objc-annotated to setup guide --- Sources/Frontend/CommonSetupGuide.swift | 2 +- Sources/Frontend/GuidedSetup.swift | 5 +- Sources/Frontend/SPMProjectSetupGuide.swift | 2 +- Sources/Shared/SetupGuide.swift | 46 ++++++++----------- .../XcodeSupport/XcodeProjectSetupGuide.swift | 34 +++++++++++--- 5 files changed, 52 insertions(+), 37 deletions(-) diff --git a/Sources/Frontend/CommonSetupGuide.swift b/Sources/Frontend/CommonSetupGuide.swift index 8fb491bca4..50504f89a4 100644 --- a/Sources/Frontend/CommonSetupGuide.swift +++ b/Sources/Frontend/CommonSetupGuide.swift @@ -13,7 +13,7 @@ final class CommonSetupGuide: SetupGuideHelpers { func perform() throws { print(colorize("\nAssume all 'public' declarations are in use?", .bold)) - print(colorize("?", .boldYellow) + " Choose 'Yes' if your project is a framework/library without a main application target.") + print("Choose 'Yes' if your project is a framework/library without a main application target.") configuration.retainPublic = selectBoolean() } diff --git a/Sources/Frontend/GuidedSetup.swift b/Sources/Frontend/GuidedSetup.swift index 80d2c00e39..6749041182 100644 --- a/Sources/Frontend/GuidedSetup.swift +++ b/Sources/Frontend/GuidedSetup.swift @@ -46,8 +46,9 @@ final class GuidedSetup: SetupGuideHelpers { let kindName = select(single: projectGuides.map(\.projectKindName)) projectGuide_ = projectGuides.first { $0.projectKindName == kindName } print("") - } else { - projectGuide_ = projectGuides.first + } else if let singleGuide = projectGuides.first { + print(colorize("*", .boldGreen) + " Detected \(singleGuide.projectKindName) project") + projectGuide_ = singleGuide } guard let projectGuide = projectGuide_ else { diff --git a/Sources/Frontend/SPMProjectSetupGuide.swift b/Sources/Frontend/SPMProjectSetupGuide.swift index e7ee155776..9afa3fb7c5 100644 --- a/Sources/Frontend/SPMProjectSetupGuide.swift +++ b/Sources/Frontend/SPMProjectSetupGuide.swift @@ -10,7 +10,7 @@ final class SPMProjectSetupGuide: SetupGuideHelpers, SetupGuide { } var projectKindName: String { - "Swift Project Manager" + "Swift Package" } func perform() throws -> ProjectKind { diff --git a/Sources/Shared/SetupGuide.swift b/Sources/Shared/SetupGuide.swift index 08a4710010..0cdec2b883 100644 --- a/Sources/Shared/SetupGuide.swift +++ b/Sources/Shared/SetupGuide.swift @@ -33,9 +33,9 @@ open class SetupGuideHelpers { } public func select(single options: [String]) -> String { - print(colorize("?", .boldYellow) + " Type the number for the option you wish to select") display(options: options) - print(colorize("> ", .bold), terminator: "") + print(colorize("?", .boldYellow) + " Type the number for the option you wish to select") + print(colorize("=> ", .bold), terminator: "") if let strChoice = readLine(strippingNewline: true)?.trimmed, let choice = Int(strChoice) @@ -51,40 +51,32 @@ open class SetupGuideHelpers { return select(single: options) } - public func select(multiple options: [String], allowAll: Bool) -> SetupSelection { + public func select(multiple options: [String]) -> SetupSelection { var helpMsg = " Delimit choices with a single space, e.g: 1 2 3" - if allowAll { - helpMsg += ", or 'all' to select all options" - } - - print(colorize("?", .boldYellow) + helpMsg) display(options: options) - print(colorize("> ", .bold), terminator: "") + print(colorize("?", .boldYellow) + helpMsg) + print(colorize("=> ", .bold), terminator: "") if let strChoices = readLine(strippingNewline: true)?.trimmed.split(separator: " ", omittingEmptySubsequences: true) { - if allowAll, strChoices.contains("all") { - return .all(options) - } else { - var selected: [String] = [] - - for strChoice in strChoices { - if let choice = Int(strChoice), - let option = options[safe: choice - 1] - { - selected.append(option) - } else { - print(colorize("\nInvalid option: \(strChoice)\n", .boldYellow)) - return select(multiple: options, allowAll: allowAll) - } + var selected: [String] = [] + + for strChoice in strChoices { + if let choice = Int(strChoice), + let option = options[safe: choice - 1] + { + selected.append(option) + } else { + print(colorize("\nInvalid option: \(strChoice)\n", .boldYellow)) + return select(multiple: options) } - - if !selected.isEmpty { return .some(selected) } } + + if !selected.isEmpty { return .some(selected) } } print(colorize("\nInvalid input, expected a number.\n", .boldYellow)) - return select(multiple: options, allowAll: allowAll) + return select(multiple: options) } public func selectBoolean() -> Bool { @@ -92,7 +84,7 @@ open class SetupGuideHelpers { "(" + colorize("Y", .boldGreen) + ")es" + "/" + "(" + colorize("N", .boldGreen) + ")o" + - colorize(" > ", .bold), + colorize("\n=> ", .bold), terminator: "" ) diff --git a/Sources/XcodeSupport/XcodeProjectSetupGuide.swift b/Sources/XcodeSupport/XcodeProjectSetupGuide.swift index 825493f54b..e8d55d3543 100644 --- a/Sources/XcodeSupport/XcodeProjectSetupGuide.swift +++ b/Sources/XcodeSupport/XcodeProjectSetupGuide.swift @@ -85,12 +85,30 @@ public final class XcodeProjectSetupGuide: SetupGuideHelpers, SetupGuide { project ).map { $0 }.sorted() - print(colorize("\nSelect the schemes necessary to build your chosen targets:", .bold)) - configuration.schemes = select(multiple: schemes, allowAll: false).selectedValues - - print(colorize("\nAssume Objective-C accessible declarations are in use?", .bold)) - print(colorize("?", .boldYellow) + " Declarations exposed to the Objective-C runtime explicitly with @objc, or implicitly by inheriting NSObject will be assumed to be in use. Choose 'No' if your project is pure Swift.") - configuration.retainObjcAccessible = selectBoolean() + print(colorize("\nSelect the schemes to build:", .bold)) + print("Periphery will scan all files built by your chosen schemes.") + configuration.schemes = select(multiple: schemes).selectedValues + + print(colorize("\nDoes this project contain Objective-C code?", .bold)) + let containsObjC = selectBoolean() + + if containsObjC { + print(colorize("\nPeriphery cannot scan Objective-C code and, as a result, cannot detect Swift types referenced by Objective-C code.", .bold)) + print("To avoid false positives, you have a few options:") + let retainObjcAccessibleOption = colorize("Assume all types accessible from Objective-C are in use:", .bold) + " This includes public NSObject instances (and their subclasses), as well as any types explicitly annotated with @objc. This approach will eliminate false positives but may also result in a lot of missed unused code." + let retainObjcAnnotationOption = colorize("Assume only types annotated with @objc are in use:", .bold) + " This option may lead to false positives, but they can be easily corrected by adding the necessary @objc annotations." + let objcChoice = select(single: [ + retainObjcAccessibleOption, + retainObjcAnnotationOption, + colorize("Do nothing:", .bold) + " Do not assume any Swift types are used in Objective-C code.", + ]) + + if objcChoice == retainObjcAccessibleOption { + configuration.retainObjcAccessible = true + } else if objcChoice == retainObjcAnnotationOption { + configuration.retainObjcAnnotated = true + } + } return .xcode(projectPath: project.path) } @@ -108,6 +126,10 @@ public final class XcodeProjectSetupGuide: SetupGuideHelpers, SetupGuide { options.append("--retain-objc-accessible") } + if configuration.retainObjcAnnotated { + options.append("--retain-objc-annotated") + } + return options } From 4b190d8340ebbf1a3a523e0b3cfb418fdd52da88 Mon Sep 17 00:00:00 2001 From: Ian Leitch Date: Thu, 19 Dec 2024 15:29:44 +0000 Subject: [PATCH 32/63] Sponsor plug --- .mise/tasks/scan | 2 +- Sources/Frontend/UpdateChecker.swift | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.mise/tasks/scan b/.mise/tasks/scan index c452a2545d..18cd269d39 100755 --- a/.mise/tasks/scan +++ b/.mise/tasks/scan @@ -3,4 +3,4 @@ set -euo pipefail swift build -time ./.build/debug/periphery scan "$@" +./.build/debug/periphery scan "$@" diff --git a/Sources/Frontend/UpdateChecker.swift b/Sources/Frontend/UpdateChecker.swift index 091102cdb0..448c7be5c6 100644 --- a/Sources/Frontend/UpdateChecker.swift +++ b/Sources/Frontend/UpdateChecker.swift @@ -81,14 +81,16 @@ final class UpdateChecker { guard latestVersion.isVersion(greaterThan: PeripheryVersion) else { return } - logger.info(colorize("\n* Update Available", .boldGreen)) + logger.info(colorize("\nUpdate Available!", .boldGreen)) let boldLatestVersion = colorize(latestVersion, .bold) let boldLocalVersion = colorize(PeripheryVersion, .bold) logger.info("Version \(boldLatestVersion) is now available, you are using version \(boldLocalVersion).") - logger.info("Release notes: https://github.com/peripheryapp/periphery/releases/tag/\(latestVersion)") + logger.info("Release notes: " + colorize("https://github.com/peripheryapp/periphery/releases/tag/\(latestVersion)", .bold)) let boldOption = colorize("--disable-update-check", .bold) let boldScan = colorize("scan", .bold) logger.info("To disable update checks pass the \(boldOption) option to the \(boldScan) command.") + + logger.info(colorize("\nIf you are enjoying Periphery, please consider becoming a sponsor.", .bold) + "\nYour support helps ensure the continued development of new features and updates to support new Swift versions.\n" + colorize("https://github.com/sponsors/peripheryapp", .boldMagenta)) } func wait() -> Result { From aa5594dd9601a76ad3c068f18cdd25e6c6d38b23 Mon Sep 17 00:00:00 2001 From: Ian Leitch Date: Sat, 21 Dec 2024 11:00:23 +0000 Subject: [PATCH 33/63] Update Linux baseline (#853) --- baselines/linux.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/baselines/linux.json b/baselines/linux.json index 65cd981bf9..5e1c814274 100644 --- a/baselines/linux.json +++ b/baselines/linux.json @@ -1 +1 @@ -{"v1":{"usrs":["import-Configuration-Sources\/ProjectDrivers\/XcodeProjectDriver.swift:2:5","import-Indexer-Sources\/ProjectDrivers\/XcodeProjectDriver.swift:4:5","import-Logger-Sources\/ProjectDrivers\/XcodeProjectDriver.swift:5:5","import-Shared-Sources\/ProjectDrivers\/XcodeProjectDriver.swift:6:5","import-SourceGraph-Sources\/ProjectDrivers\/XcodeProjectDriver.swift:7:5","import-TestShared-Tests\/PeripheryTests\/ObjcAccessibleRetentionTest.swift:2:1","import-TestShared-Tests\/PeripheryTests\/ObjcAnnotatedRetentionTest.swift:2:1","s:11SourceGraph15ProjectFileKindO10extensionsSaySSGvp","s:6Shared14SetupSelectionO","s:6Shared17SetupGuideHelpersC6select8multiple8allowAllAA0B9SelectionOSaySSG_SbtF","s:SS10ExtensionsE4djb2Sivp","s:SS10ExtensionsE7djb2HexSSvp"]}} \ No newline at end of file +{"v1":{"usrs":["import-Configuration-Sources\/ProjectDrivers\/XcodeProjectDriver.swift:2:5","import-Indexer-Sources\/ProjectDrivers\/XcodeProjectDriver.swift:4:5","import-Logger-Sources\/ProjectDrivers\/XcodeProjectDriver.swift:5:5","import-Shared-Sources\/ProjectDrivers\/XcodeProjectDriver.swift:6:5","import-SourceGraph-Sources\/ProjectDrivers\/XcodeProjectDriver.swift:7:5","import-TestShared-Tests\/PeripheryTests\/ObjcAccessibleRetentionTest.swift:2:1","import-TestShared-Tests\/PeripheryTests\/ObjcAnnotatedRetentionTest.swift:2:1","s:11SourceGraph15ProjectFileKindO10extensionsSaySSGvp","s:6Shared14SetupSelectionO","s:6Shared17SetupGuideHelpersC6select8multipleAA0B9SelectionOSaySSG_tF","s:SS10ExtensionsE4djb2Sivp","s:SS10ExtensionsE7djb2HexSSvp"]}} \ No newline at end of file From f02459d686c8c6d7ff847f5d4ef3fdfc60804063 Mon Sep 17 00:00:00 2001 From: Ian Leitch Date: Sat, 21 Dec 2024 11:17:01 +0000 Subject: [PATCH 34/63] Add Xcode 16.2 to test matrix (#834) --- .github/workflows/test.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 85da972ea2..9b0f80b7a3 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -33,8 +33,10 @@ jobs: strategy: fail-fast: false matrix: - xcode: ["16.1", "16.0", "15.4"] + xcode: ["16.2", "16.1", "16.0", "15.4"] include: + - xcode: "16.2" + macos: macos-15 - xcode: "16.1" macos: macos-15 - xcode: "16.0" From bbc67cb675d313fc208b5ffef5e218fdabfd35a6 Mon Sep 17 00:00:00 2001 From: Ian Leitch Date: Sat, 21 Dec 2024 12:02:46 +0000 Subject: [PATCH 35/63] Update to actions/cache@v4 (#854) --- .github/workflows/test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 9b0f80b7a3..03bf8daea0 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -56,7 +56,7 @@ jobs: shell: bash - name: Cache resolved dependencies id: cache-resolved-dependencies - uses: actions/cache@v2 + uses: actions/cache@v4 with: path: | .build @@ -95,7 +95,7 @@ jobs: shell: bash - name: Cache resolved dependencies id: cache-resolved-dependencies - uses: actions/cache@v2 + uses: actions/cache@v4 with: path: | .build From 5009ad460dadbdb5ddbcf792545ae58501e7e284 Mon Sep 17 00:00:00 2001 From: Ian Leitch Date: Sun, 22 Dec 2024 19:00:47 +0000 Subject: [PATCH 36/63] Invoke all commands in Bash (#855) --- .../ProjectDrivers/BazelProjectDriver.swift | 13 ++----- Sources/Shared/PeripheryError.swift | 8 ++--- Sources/Shared/Shell.swift | 34 ++++--------------- Sources/XcodeSupport/Xcodebuild.swift | 8 ++--- Tests/XcodeTests/ShellMock.swift | 2 +- 5 files changed, 19 insertions(+), 46 deletions(-) diff --git a/Sources/ProjectDrivers/BazelProjectDriver.swift b/Sources/ProjectDrivers/BazelProjectDriver.swift index 942ac644a1..5f20df3d8c 100644 --- a/Sources/ProjectDrivers/BazelProjectDriver.swift +++ b/Sources/ProjectDrivers/BazelProjectDriver.swift @@ -127,21 +127,14 @@ class BazelProjectDriver: ProjectDriver { private func queryTargets() throws -> [String] { try shell - .exec(["bazel", "query", query]) + .exec(["bazel", "query", "\"\(query)\""]) .split(separator: "\n") .map { "\"@@\($0)\"" } } private var query: String { - let query = """ - filter( - '^//.*', - kind( - '(\(Self.topLevelKinds.joined(separator: "|"))) rule', - deps(//...) - ) - ) - """ + let kinds = Self.topLevelKinds.joined(separator: "|") + let query = "filter('^//.*', kind('(\(kinds)) rule', deps(//...)))" if let pattern = configuration.bazelFilter { return "filter('\(pattern)', \(query))" diff --git a/Sources/Shared/PeripheryError.swift b/Sources/Shared/PeripheryError.swift index 56d9bc3ae3..79e655e7b1 100644 --- a/Sources/Shared/PeripheryError.swift +++ b/Sources/Shared/PeripheryError.swift @@ -3,7 +3,7 @@ import SystemPackage public enum PeripheryError: Error, LocalizedError, CustomStringConvertible { case shellCommandFailed(cmd: [String], status: Int32, output: String) - case shellOutputEncodingFailed(cmd: String, args: [String], encoding: String.Encoding) + case shellOutputEncodingFailed(cmd: [String], encoding: String.Encoding) case usageError(String) case underlyingError(Error) case invalidScheme(name: String, project: String) @@ -25,9 +25,9 @@ public enum PeripheryError: Error, LocalizedError, CustomStringConvertible { case let .shellCommandFailed(cmd, status, output): let joinedCmd = cmd.joined(separator: " ") return "Shell command '\(joinedCmd)' returned exit status '\(status)':\n\(output)" - case let .shellOutputEncodingFailed(cmd, args, encoding): - let joinedArgs = args.joined(separator: " ") - return "Shell command '\(cmd) \(joinedArgs)' output encoding to \(encoding) failed." + case let .shellOutputEncodingFailed(cmd, encoding): + let joinedCmd = cmd.joined(separator: " ") + return "Shell command '\(joinedCmd)' output encoding to \(encoding) failed." case let .usageError(message): return message case let .underlyingError(error): diff --git a/Sources/Shared/Shell.swift b/Sources/Shared/Shell.swift index d9e8347327..d7a302e0a3 100644 --- a/Sources/Shared/Shell.swift +++ b/Sources/Shared/Shell.swift @@ -26,15 +26,9 @@ public class ShellProcessStore { } open class Shell { - private let environment: [String: String] private let logger: ContextualLogger - public convenience init(logger: Logger) { - self.init(environment: ProcessInfo.processInfo.environment, logger: logger) - } - - public required init(environment: [String: String], logger: Logger) { - self.environment = environment + public required init(logger: Logger) { self.logger = logger.contextualized(with: "shell") } @@ -62,26 +56,14 @@ open class Shell { // MARK: - Private private func exec( - _ args: [String], + _ cmd: [String], captureOutput: Bool = true ) throws -> (Int32, String, String) { - let launchPath: String - let newArgs: [String] - - if let cmd = args.first, cmd.hasPrefix("/") { - launchPath = cmd - newArgs = Array(args.dropFirst()) - } else { - launchPath = "/usr/bin/env" - newArgs = args - } - let process = Process() - process.launchPath = launchPath - process.environment = environment - process.arguments = newArgs + process.launchPath = "/bin/bash" + process.arguments = ["-c", cmd.joined(separator: " ")] - logger.debug("\(launchPath) \(newArgs.joined(separator: " "))") + logger.debug("\(cmd.joined(separator: " "))") ShellProcessStore.shared.add(process) var stdoutPipe: Pipe? @@ -104,8 +86,7 @@ open class Shell { else { ShellProcessStore.shared.remove(process) throw PeripheryError.shellOutputEncodingFailed( - cmd: launchPath, - args: newArgs, + cmd: cmd, encoding: .utf8 ) } @@ -117,8 +98,7 @@ open class Shell { else { ShellProcessStore.shared.remove(process) throw PeripheryError.shellOutputEncodingFailed( - cmd: launchPath, - args: newArgs, + cmd: cmd, encoding: .utf8 ) } diff --git a/Sources/XcodeSupport/Xcodebuild.swift b/Sources/XcodeSupport/Xcodebuild.swift index fb59a86a87..8d098ad094 100644 --- a/Sources/XcodeSupport/Xcodebuild.swift +++ b/Sources/XcodeSupport/Xcodebuild.swift @@ -51,8 +51,8 @@ public final class Xcodebuild { ] let quotedArguments = quote(arguments: additionalArguments) - let xcodebuild = "xcodebuild \((args + envs + quotedArguments).joined(separator: " "))" - return try shell.exec(["/bin/sh", "-c", xcodebuild]) + let xcodebuild = ["xcodebuild"] + args + envs + quotedArguments + return try shell.exec(xcodebuild) } public func removeDerivedData(for project: XcodeProjectlike, allSchemes: [String]) throws { @@ -85,8 +85,8 @@ public final class Xcodebuild { ] let quotedArguments = quote(arguments: additionalArguments) - let xcodebuild = "xcodebuild \((args + quotedArguments).joined(separator: " "))" - let lines = try shell.exec(["/bin/sh", "-c", xcodebuild]).split(separator: "\n").map { String($0).trimmed } + let xcodebuild = ["xcodebuild"] + args + quotedArguments + let lines = try shell.exec(xcodebuild).split(separator: "\n").map { String($0).trimmed } // xcodebuild may output unrelated warnings, we need to strip them out otherwise // JSON parsing will fail. diff --git a/Tests/XcodeTests/ShellMock.swift b/Tests/XcodeTests/ShellMock.swift index 8a99a60b7c..c3cacb8bac 100644 --- a/Tests/XcodeTests/ShellMock.swift +++ b/Tests/XcodeTests/ShellMock.swift @@ -7,7 +7,7 @@ class ShellMock: Shell { convenience init() { let logger = Logger(quiet: true) - self.init(environment: ProcessInfo.processInfo.environment, logger: logger) + self.init(logger: logger) } override func exec(_: [String]) throws -> String { From eb2b39f55b930475aa4ab6309b2a6fd13879739a Mon Sep 17 00:00:00 2001 From: Ian Leitch Date: Thu, 26 Dec 2024 11:40:12 +0000 Subject: [PATCH 37/63] Add Linux docker setup (#852) --- .dockerignore | 6 ++++++ .mise/tasks/scan-linux | 7 +++++++ Sources/Shared/Shell.swift | 10 +++++----- docker/Dockerfile.linux | 5 +++++ 4 files changed, 23 insertions(+), 5 deletions(-) create mode 100644 .dockerignore create mode 100755 .mise/tasks/scan-linux create mode 100644 docker/Dockerfile.linux diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000000..6dd2e713d4 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,6 @@ +.git/ +.build/ +.swiftpm/ +.release/ +bazel-* +docker/ diff --git a/.mise/tasks/scan-linux b/.mise/tasks/scan-linux new file mode 100755 index 0000000000..3bd3bde9ac --- /dev/null +++ b/.mise/tasks/scan-linux @@ -0,0 +1,7 @@ +#!/bin/bash + +set -e + +export DOCKER_CLI_HINTS=false +docker build -t periphery -f docker/Dockerfile.linux . +docker run --rm -t periphery scan "$@" diff --git a/Sources/Shared/Shell.swift b/Sources/Shared/Shell.swift index d7a302e0a3..cd5e705c5b 100644 --- a/Sources/Shared/Shell.swift +++ b/Sources/Shared/Shell.swift @@ -78,8 +78,8 @@ open class Shell { process.launch() - var stdout = "" - var stderr = "" + var standardOutput = "" + var standardError = "" if let stdoutData = try stdoutPipe?.fileHandleForReading.readToEnd() { guard let stdoutStr = String(data: stdoutData, encoding: .utf8) @@ -90,7 +90,7 @@ open class Shell { encoding: .utf8 ) } - stdout = stdoutStr + standardOutput = stdoutStr } if let stderrData = try stderrPipe?.fileHandleForReading.readToEnd() { @@ -102,11 +102,11 @@ open class Shell { encoding: .utf8 ) } - stderr = stderrStr + standardError = stderrStr } process.waitUntilExit() ShellProcessStore.shared.remove(process) - return (process.terminationStatus, stdout, stderr) + return (process.terminationStatus, standardOutput, standardError) } } diff --git a/docker/Dockerfile.linux b/docker/Dockerfile.linux new file mode 100644 index 0000000000..045deace27 --- /dev/null +++ b/docker/Dockerfile.linux @@ -0,0 +1,5 @@ +FROM swift:latest +WORKDIR /workspace +COPY . /workspace +RUN swift build --product periphery +ENTRYPOINT [".build/debug/periphery"] From 9f07403fada4b33270539b369efef27f649de7c2 Mon Sep 17 00:00:00 2001 From: Ian Leitch Date: Thu, 26 Dec 2024 21:15:43 +0000 Subject: [PATCH 38/63] Migrate release script to mise --- {scripts => .mise/tasks}/release | 6 +++--- {scripts => .mise/tasks/scripts}/Periphery.podspec.template | 0 {scripts => .mise/tasks/scripts}/Version.swift.template | 0 .../tasks/scripts}/artifactbundle_info.json.template | 0 {scripts => .mise/tasks/scripts}/release_notes.md.template | 0 5 files changed, 3 insertions(+), 3 deletions(-) rename {scripts => .mise/tasks}/release (90%) rename {scripts => .mise/tasks/scripts}/Periphery.podspec.template (100%) rename {scripts => .mise/tasks/scripts}/Version.swift.template (100%) rename {scripts => .mise/tasks/scripts}/artifactbundle_info.json.template (100%) rename {scripts => .mise/tasks/scripts}/release_notes.md.template (100%) diff --git a/scripts/release b/.mise/tasks/release similarity index 90% rename from scripts/release rename to .mise/tasks/release index 96ddee4b6d..e480a3c29c 100755 --- a/scripts/release +++ b/.mise/tasks/release @@ -38,8 +38,8 @@ confirm "\nContinue?" rm -rf .release mkdir .release -cat scripts/Version.swift.template | sed s/__VERSION__/${version}/ > Sources/Frontend/Version.swift -cat scripts/artifactbundle_info.json.template | sed s/__VERSION__/${version}/ > .release/info.json +cat .mise/tasks/scripts/Version.swift.template | sed s/__VERSION__/${version}/ > Sources/Frontend/Version.swift +cat .mise/tasks/scripts/artifactbundle_info.json.template | sed s/__VERSION__/${version}/ > .release/info.json ruby -e "file = 'MODULE.bazel'; content = File.read(file); content.sub!(/version = \".+?\"/, 'version = \"${version}\"'); File.write(file, content)" echo -e "\nUpdate CHANGELOG.md" @@ -55,7 +55,7 @@ fi cp LICENSE.md MODULE.bazel BUILD.bazel .release/ cp -R bazel Sources .release/ rm -r .release/bazel/dev -cp scripts/release_notes.md.template .release/release_notes.md +cp .mise/tasks/scripts/release_notes.md.template .release/release_notes.md confirm "\nContinue?" diff --git a/scripts/Periphery.podspec.template b/.mise/tasks/scripts/Periphery.podspec.template similarity index 100% rename from scripts/Periphery.podspec.template rename to .mise/tasks/scripts/Periphery.podspec.template diff --git a/scripts/Version.swift.template b/.mise/tasks/scripts/Version.swift.template similarity index 100% rename from scripts/Version.swift.template rename to .mise/tasks/scripts/Version.swift.template diff --git a/scripts/artifactbundle_info.json.template b/.mise/tasks/scripts/artifactbundle_info.json.template similarity index 100% rename from scripts/artifactbundle_info.json.template rename to .mise/tasks/scripts/artifactbundle_info.json.template diff --git a/scripts/release_notes.md.template b/.mise/tasks/scripts/release_notes.md.template similarity index 100% rename from scripts/release_notes.md.template rename to .mise/tasks/scripts/release_notes.md.template From c7661fd4d6b6cf150875c799110699d9fde0ae48 Mon Sep 17 00:00:00 2001 From: Ian Leitch Date: Fri, 27 Dec 2024 16:57:53 +0000 Subject: [PATCH 39/63] v3 README (#857) --- .mise/tasks/release | 14 ++--- CHANGELOG.md | 13 ++++- README.md | 121 ++++++++++++++++++++++++++------------------ 3 files changed, 86 insertions(+), 62 deletions(-) diff --git a/.mise/tasks/release b/.mise/tasks/release index e480a3c29c..bb33f0bfe0 100755 --- a/.mise/tasks/release +++ b/.mise/tasks/release @@ -115,14 +115,6 @@ fi cd .. gh release create --latest="${is_latest}" -F .release/release_notes.md "${version}" ".release/${zip_filename}" ".release/${zip_artifactbundle}" ".release/${bazel_zip_filename}" -# Homebrew -if [ $is_latest = false ]; then - echo "Not releasing beta to Homebrew." -else - cd ../homebrew-periphery - cat periphery.rb.template | sed s/__VERSION__/${version}/ | sed s/__SHA256__/${sha256}/ > Casks/periphery.rb - git add Casks/periphery.rb - git commit -m "${version}" - git push origin master - cd ../periphery -fi \ No newline at end of file +echo "Next steps:" +echo "* Update Homebrew formula" +echo "* Update Bazel Central Registry" diff --git a/CHANGELOG.md b/CHANGELOG.md index 493868e6c3..e74cf7d6a9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,8 +2,17 @@ ##### Breaking +**3.0 is a major breaking change and requires some manual migration, please see the [3.0 Migration Guide](https://github.com/peripheryapp/periphery/wiki/3.0-Migration-Guide).** + - Support for installing via CocoaPods has been removed. - Removed support for Swift 5.9/Xcode 15.2. +- Periphery is now available directly from Homebrew, and the `peripheryapp/periphery` tap is no longer updated. To migrate run the following: +``` +brew remove periphery +brew untap peripheryapp/periphery +brew update +brew install periphery +``` ##### Enhancements @@ -11,7 +20,9 @@ ##### Bug Fixes -- None. +- Fix numerous issues where generated code could not be scanned. +- Fix support for Xcode's new folder format. +- Fix cloning private Swift package repositories. ## 2.21.2 (2024-11-01) diff --git a/README.md b/README.md index 434218fd08..c430e8cd30 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,6 @@ - [Installation](#installation) - [How To Use](#how-to-use) -- [How It Works](#how-it-works) - [Analysis](#analysis) - [Function Parameters](#function-parameters) - [Protocols](#protocols-1) @@ -49,7 +48,7 @@ ### [Homebrew](https://brew.sh/) ```sh -brew install peripheryapp/periphery/periphery +brew install periphery ``` ### [Mint](https://github.com/yonaskolb/mint) @@ -58,43 +57,48 @@ brew install peripheryapp/periphery/periphery mint install peripheryapp/periphery ``` +### [Bazel](https://bazel.build/) + +```python +bazel_dep(name = "periphery", version = "") +use_repo(use_extension("@periphery//bazel:generated.bzl", "generated"), "periphery_generated") +``` + +```sh +bazel run @periphery -- scan --bazel +``` + ## How To Use ### The `scan` Command -The scan command is Periphery's primary function. To begin a guided setup, simply change to your project directory and run: +The scan command is Periphery's primary function. To begin a guided setup, change to your project directory and run: ```sh periphery scan --setup ``` -> Guided setup only works for Xcode and SwiftPM projects, to use Periphery with non-Apple build systems such as Bazel, see [Build Systems](#build-systems). - -After answering a few questions, Periphery will print out the full scan command and execute it. +The guided setup will detect your project type and configure a few options. After answering a few questions, Periphery will print out the full scan command and execute it. The guided setup is only intended for introductory purposes, once you are familiar with Periphery you can try some more advanced options, all of which can be seen with `periphery help scan`. -To get coherent results from Periphery, it's crucial to understand the implications of the build targets you choose to analyze. For example, imagine a project consisting of three targets: App, Lib and Tests. The App target imports Lib, and the Tests targets imports both App and Lib. If you were to provide all three to the `--targets` option then Periphery will be able to analyze your project as a whole. However, if you only choose to analyze App and Lib, but not Tests, Periphery may report some instances of unused code that are _only_ referenced by Tests. Therefore when you suspect Periphery has provided an incorrect result, it's important to consider the targets that you have chosen to analyze. +To get the most from Periphery, it’s important to understand how it works. Periphery first builds your project; it does this to generate the “index store”. The index store contains detailed information about the declarations (class, struct, func, etc.) in your project and their references to other declarations. Using this store, Periphery builds an in-memory graph of the relational structure of your project, supplementing it with additional information obtained by parsing each source file. Next, the graph is mutated to make it more suitable for detecting unused code, e.g. marking your project’s entry points. Finally, the graph is traversed from its roots to identify unreferenced declarations. -If your project consists of one or more standalone frameworks that do not also contain some kind of application that consume their interfaces, then you'll need to tell Periphery to assume that all public declarations are in fact used by including the `--retain-public` option. +> **Tip** +> +> The index store only contains information about source files in the build targets compiled during the build phase. If a given class is only referenced in a source file that was not compiled, then Periphery will identify the class as unused. It’s important to ensure you build all the targets you expect to contain references. For an Xcode project, this is controlled using the `-—schemes` option. For a Swift package, all targets are built automatically. -For projects that are mixed Objective-C & Swift, it's highly recommend you [read about the implications](#objective-c) this can have on your results. +If your project consists of one or more standalone frameworks that do not also contain some kind of application that consumes their interfaces, you need to tell Periphery to assume that all public declarations are used with the `--retain-public` option. + +For projects that are mixed Objective-C & Swift, it's highly recommended you [read about the implications](#objective-c) this can have on your results. ### Configuration Once you've settled upon the appropriate options for your project, you may wish to persist them in a YAML configuration file. The simplest way to achieve this is to run Periphery with the `--verbose` option. Near the beginning of the output you will see the `[configuration:begin]` section with your configuration formatted as YAML below. Copy & paste the configuration into `.periphery.yml` in the root of your project folder. You can now simply run `periphery scan` and the YAML configuration will be used. -## How It Works - -Periphery first builds your project. For Xcode projects the schemes provided via the `--schemes` option are built using `xcodebuild`. For Swift Package Manager projects, the individual targets provided via the `--targets` option are built using `swift build`. The Swift compiler employs a technique called index-while-building to populate an index store that contains information about the structure of your project's source code. - -After your project is built, Periphery performs an indexing phase. For every source file that is a member of the targets provided via the `--targets` option, Periphery obtains its structural information from the index store and builds its own internal graph representation of your project. Periphery also analyzes each file's abstract syntax tree (AST) to fill in some details not provided by the index store. - -Once indexing is complete, Periphery analyzes the graph to identify unused code. This phase consists of a number of steps that mutate the graph to make it easier to identify specific scenarios of unused code. The final step walks the graph from its roots to identify declarations that are no longer referenced. - ## Analysis -The goal of Periphery is to report instances of unused _declarations_. A declaration is a `class`, `struct`, `protocol`, `function`, `property`, `constructor`, `enum`, `typealias`, `associatedtype`, etc. As you'd expect, Periphery is able to identify simple unreferenced declarations, e.g a `class` that is no longer used anywhere in your codebase. +The goal of Periphery is to report instances of unused _declarations_. A declaration is a `class`, `struct`, `protocol`, `function`, `property`, `constructor`, `enum`, `typealias`, `associatedtype`, etc. As you'd expect, Periphery can identify simple unreferenced declarations, e.g. a `class` that is no longer used anywhere in your codebase. Periphery can also identify more advanced instances of unused code. The following section explains these in detail. @@ -155,7 +159,7 @@ class InformalGreeter: BaseGreeter { #### Foreign Protocols & Classes -Unused parameters of protocols or classes defined in foreign modules (e.g Foundation) are always ignored, since you do not have access to modify the base function declaration. +Unused parameters of protocols or classes defined in foreign modules (e.g. Foundation) are always ignored since you do not have access to modify the base function declaration. #### fatalError Functions @@ -240,11 +244,11 @@ let myClass = MyClass() myClass.perform() ``` -Here we can see that `MyProtocol` is itself used, and cannot be removed. However, since `unusedProperty` is never called on `MyConformingClass`, Periphery is able to identify that the declaration of `unusedProperty` in `MyProtocol` is also unused and can be removed along with the unused implementation of `unusedProperty`. +Here we can see that `MyProtocol` is itself used, and cannot be removed. However, since `unusedProperty` is never called on `MyConformingClass`, Periphery can identify that the declaration of `unusedProperty` in `MyProtocol` is also unused and can be removed along with the unused implementation of `unusedProperty`. ### Enumerations -Along with being able to identify unused enumerations, Periphery can also identify individual unused enum cases. Plain enums that are not raw representable, i.e that _don't_ have a `String`, `Character`, `Int` or floating-point value type can be reliably identified. However, enumerations that _do_ have a raw value type can be dynamic in nature, and therefore must be assumed to be used. +Along with being able to identify unused enumerations, Periphery can also identify individual unused enum cases. Plain enums that are not raw representable, i.e. that _don't_ have a `String`, `Character`, `Int`, or floating-point value type can be reliably identified. However, enumerations that _do_ have a raw value type can be dynamic, and therefore must be assumed to be used. Let's clear this up with a quick example: @@ -260,7 +264,7 @@ func someFunction(value: String) { } ``` -There's no direct reference to the `myCase` case, so it's reasonable to expect it _might_ no longer be needed, however if it were removed we can see that `somethingImportant` would never be called if `someFunction` were passed the value of `"myCase"`. +There's no direct reference to the `myCase` case, so it's reasonable to expect it _might_ no longer be needed, however, if it were removed we can see that `somethingImportant` would never be called if `someFunction` were passed the value of `"myCase"`. ### Assign-only Properties @@ -279,7 +283,7 @@ class MyClass { In some cases this may be the intended behavior, therefore you have a few options available to silence such results: - Retain individual properties using [Comment Commands](#comment-commands). -- Retain all assign-only properties by their type with `--retain-assign-only-property-types`. Given types must match their exact usage in the property declaration (sans optional question mark), e.g `String`, `[String]`, `Set`. Periphery is unable to resolve inferred property types, therefore in some instances you may need to add explicit type annotations to your properties. +- Retain all assign-only properties by their type with `--retain-assign-only-property-types`. Given types must match their exact usage in the property declaration (sans optional question mark), e.g. `String`, `[String]`, `Set`. Periphery is unable to resolve inferred property types, therefore in some instances, you may need to add explicit type annotations to your properties. - Disable assign-only property analysis entirely with `--retain-assign-only-properties`. ### Redundant Public Accessibility @@ -301,13 +305,13 @@ Periphery will likely produce false positives for targets with mixed Swift and O Periphery cannot analyze Objective-C code since types may be dynamically typed. -By default Periphery does not assume that declarations accessible by the Objective-C runtime are in use. If your project is a mix of Swift & Objective-C, you can enable this behavior with the `--retain-objc-accessible` option. Swift declarations that are accessible by the Objective-C runtime are those that are explicitly annotated with `@objc` or `@objcMembers`, and classes that inherit `NSObject` either directly or indirectly via another class. +By default, Periphery does not assume that declarations accessible by the Objective-C runtime are in use. If your project is a mix of Swift & Objective-C, you can enable this behavior with the `--retain-objc-accessible` option. Swift declarations that are accessible by the Objective-C runtime are those that are explicitly annotated with `@objc` or `@objcMembers`, and classes that inherit `NSObject` either directly or indirectly via another class. -Alternatively, the `--retain-objc-annotated` can be used to only retain declarations that are explicitly annotated with `@objc` or `@objcMembers`. Types that inherit `NSObject` are not retained unless they have the explicit annotations. This option may uncover more unused code, but with the caveat that some of the results may be incorrect if the declaration is in fact used in Objective-C code. To resolve these incorrect results you must add an `@objc` annotation to the declaration. +Alternatively, the `--retain-objc-annotated` can be used to only retain declarations that are explicitly annotated with `@objc` or `@objcMembers`. Types that inherit `NSObject` are not retained unless they have explicit annotations. This option may uncover more unused code, but with the caveat that some of the results may be incorrect if the declaration is used in Objective-C code. To resolve these incorrect results you must add an `@objc` annotation to the declaration. ### Codable -Swift synthesizes additional code for `Codable` types that is not visible to Periphery, and can result in false positives for properties not directly referenced from non-synthesized code. If your project contains many such types, you can retain all properties on `Codable` types with `--retain-codable-properties`. Alternatively, you can retain properties only on `Encodable` types with `--retain-encodable-properties`. +Swift synthesizes additional code for `Codable` types that is not visible to Periphery and can result in false positives for properties not directly referenced from non-synthesized code. If your project contains many such types, you can retain all properties on `Codable` types with `--retain-codable-properties`. Alternatively, you can retain properties only on `Encodable` types with `--retain-encodable-properties`. If `Codable` conformance is declared by a protocol in an external module not scanned by Periphery, you can instruct Periphery to identify the protocols as `Codable` with `--external-codable-protocols "ExternalProtocol"`. @@ -321,7 +325,7 @@ If your project contains Interface Builder files (such as storyboards and XIBs), ## Comment Commands -For whatever reason, you may want to keep some unused code. Source code comment commands can be used to ignore specific declarations, and exclude them from the results. +For whatever reason, you may want to keep some unused code. Source code comment commands can be used to ignore specific declarations and exclude them from the results. An ignore comment command can be placed directly on the line above any declaration to ignore it, and all descendent declarations: @@ -350,7 +354,7 @@ class MyClass {} ## Xcode Integration -Before setting up Xcode integration, we highly recommend you first get Periphery working in a terminal, as you will be using the exact same command via Xcode. +Before setting up Xcode integration, we highly recommend you first get Periphery working in a terminal, as you will be using the same command via Xcode. ### Step 1: Create an Aggregate Target @@ -358,7 +362,7 @@ Select your project in the Project Navigator and click the + button at the botto ![Step 1](assets/xcode-integration/1.png) -Choose a name for the new target, e.g "Periphery" or "Unused Code". +Choose a name for the new target, e.g. "Periphery" or "Unused Code". ![Step 2](assets/xcode-integration/2.png) @@ -384,7 +388,7 @@ You're ready to roll. You should now see the new scheme in the dropdown. Select ## Excluding Files -Both exclusion options described below accept a Bash v4 style path glob, either absolute or relative to your project directory. You can delimit multiple globs with a space, e.g `--option "Sources/Single.swift" "**/Generated/*.swift" "**/*.{xib,storyboard}"`. +Both exclusion options described below accept a Bash v4 style path glob, either absolute or relative to your project directory. You can delimit multiple globs with a space, e.g. `--option "Sources/Single.swift" "**/Generated/*.swift" "**/*.{xib,storyboard}"`. ### Excluding Results @@ -392,7 +396,13 @@ To exclude the results from certain files, pass the `--report-exclude ` o ### Excluding Indexed Files -To exclude files from being indexed, pass the `--index-exclude ` option to the `scan` command. Excluding files from the index phase means that any declarations and references contained within the files will not be seen by Periphery. Periphery will be behave as if the files do not exist. For example, this option can be used to exclude generated code that holds references to non-generated code, or exclude all `.xib` and `.storyboard` files that hold references to code. +Excluding files from the indexing phase means that any declarations and references contained within the files will not be seen by Periphery. Periphery will behave as if the files do not exist. + +To exclude files from being indexed, there are a few options: + +1. Use `--exclude-targets "TargetA" "TargetB"` to exclude all source files in the chosen targets. +2. Use `--exclude-tests` to exclude all test targets. +3. Use `--index-exclude "file.swift" "path/*.swift"` to exclude individual source files. ### Retaining File Declarations @@ -400,7 +410,7 @@ To retain all declarations in files, pass the `--retain-files ` option to ## Continuous Integration -When integrating Periphery into a CI pipeline, you can potentially skip the build phase if your pipeline has already done so, e.g to run tests. This can be achieved using the `--skip-build` option. However, you also need to tell Periphery the location of the index store using `--index-store-path`. This location is dependent on your project type. +When integrating Periphery into a CI pipeline, you can potentially skip the build phase if your pipeline has already done so, e.g. to run tests. This can be achieved using the `--skip-build` option. However, you also need to tell Periphery the location of the index store using `--index-store-path`. This location is dependent on your project type. Note that when using `--skip-build` and `--index-store-path` it's vital that the index store contains data for all of the targets you specify via `--targets`. For example, if your pipeline previously built the targets 'App' and 'Lib', the index store will only contain data for the files in those targets. You cannot then instruct Periphery to scan additional targets, e.g 'Extension', or 'UnitTests'. @@ -410,20 +420,33 @@ The index store generated by `xcodebuild` exists in DerivedData at a location de ### SwiftPM -By default, Periphery looks for the index store at `.build/debug/index/store`. Therefore, if you intend to run Periphery directly after calling `swift test`, you can omit the `--index-store-path` option, and Periphery will use the index store created when the project was built for testing. However if this isn't the case, then you must provide Periphery the location of the index store with `--index-store-path`. +By default, Periphery looks for the index store at `.build/debug/index/store`. Therefore, if you intend to run Periphery directly after calling `swift test`, you can omit the `--index-store-path` option and Periphery will use the index store created when the project was built for testing. However, if this isn't the case, then you must provide Periphery the location of the index store with `--index-store-path`. ## Build Systems -Periphery can analyze projects using third-party build systems such as Bazel, though it cannot drive them automatically like SwiftPM and xcodebuild. Instead, you need to specify the index store location and provide a file-target mapping file. - -A file-target mapping file contains a simple mapping of source files to build targets. You will need to generate this file yourself using the appropriate tooling for your build system. The format is as follows: +Periphery can analyze projects using other build systems, though it cannot drive them automatically like SPM, Xcode and Bazel. Instead, you need to specify the location of indexstore and other resource files. The format is as follows: ```json { - "file_targets": { - "path/to/file_a.swift": ["TargetA"], - "path/to/file_b.swift": ["TargetB", "TargetC"] - } + "indexstores": [ + "path/to/file.indexstore" + ], + "test_targets": [ + "MyTests" + ], + "plists": [ + "path/to/file.plist" + ], + "xibs": [ + "path/to/file.xib", + "path/to/file.storyboard" + ], + "xcdatamodels": [ + "path/to/file.xcdatamodel" + ], + "xcmappingmodels": [ + "path/to/file.xcmappingmodel" + ] } ``` @@ -431,10 +454,10 @@ A file-target mapping file contains a simple mapping of source files to build ta > > Relative paths are assumed to be relative to the current directory. -You can then invoke periphery as follows: +You can then invoke Periphery as follows: ```sh -periphery scan --file-targets-path map.json --index-store-path index/store +periphery scan --generic-project-config config.json ``` > **Tip** @@ -447,11 +470,11 @@ Periphery supports both macOS and Linux. macOS supports both Xcode and Swift Pac ## Troubleshooting -### Erroneous results in one or more files, such as false-positives and incorrect source file locations +### Erroneous results in one or more files, such as false positives and incorrect source file locations It's possible for the index store to become corrupt, or out of sync with the source file. This can happen, for example, if you forcefully terminate (^C) a scan. To rectify this, you can pass the `--clean-build` flag to the scan command to force removal of existing build artifacts. -### Code referenced within preprocessor macro conditional branch is unused +### Code referenced within a preprocessor macro conditional branch is unused When Periphery builds your project it uses the default build configuration, which is typically 'debug'. If you use preprocessor macros to conditionally compile code, Periphery will only have visibility into the branches that are compiled. In the example below, `releaseName` will be reported as unused as it is only referenced within the non-debug branch of the macro. @@ -470,11 +493,11 @@ struct BuildInfo { } ``` -You've a few options to workaround this: +You have a few options to workaround this: - Use [Comment Commands](#comment-commands) to explicitly ignore `releaseName`. - Filter the results to remove known instances. -- Run Periphery once for each build configuration and merge the results. You can pass arguments to the underlying build by specifying them after `--`, e.g `periphery scan ... -- -configuration release`. +- Run Periphery once for each build configuration and merge the results. You can pass arguments to the underlying build by specifying them after `--`, e.g. `periphery scan ... -- -configuration release`. ### Swift package is platform-specific @@ -485,10 +508,10 @@ As a workaround, you can manually build the Swift package with `xcodebuild` and Example: ```sh -# 1. use xcodebuild +# 1. Use xcodebuild xcodebuild -scheme MyScheme -destination 'platform=iOS Simulator,OS=16.2,name=iPhone 14' -derivedDataPath '../dd' clean build -# 2. use produced index store for scanning +# 2. Use produced index store for scanning periphery scan --skip-build --index-store-path '../dd/Index.noindex/DataStore/' ``` @@ -498,12 +521,10 @@ Due to some underlying bugs in Swift, Periphery may in some instances report inc | ID | Title | | :--- | :--- | -| [56559](https://github.com/apple/swift/issues/56559) | Index store does not relate constructor referenced via Self | | [56541](https://github.com/apple/swift/issues/56541) | Index store does not relate static property getter used as subscript key | | [56327](https://github.com/apple/swift/issues/56327) | Index store does not relate objc optional protocol method implemented in subclass | | [56189](https://github.com/apple/swift/issues/56189) | Index store should relate appendInterpolation from string literals | | [56165](https://github.com/apple/swift/issues/56165) | Index store does not relate constructor via literal notation | -| [49641](https://github.com/apple/swift/issues/49641) | Index does not include reference to constructor of class/struct with generic types | ## Sponsors ![Sponsors](assets/sponsor-20.svg) From 2c970b28774d14433d37e5df24b166646b23b1d5 Mon Sep 17 00:00:00 2001 From: Ian Leitch Date: Fri, 27 Dec 2024 17:01:50 +0000 Subject: [PATCH 40/63] Release 3.0.0 --- CHANGELOG.md | 14 ++++++++++++++ MODULE.bazel | 2 +- Sources/Frontend/Version.swift | 2 +- 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e74cf7d6a9..9b4cdc5346 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,20 @@ ##### Breaking +- None. + +##### Enhancements + +- None. + +##### Bug Fixes + +- None. + +## 3.0.0 (2024-12-27) + +##### Breaking + **3.0 is a major breaking change and requires some manual migration, please see the [3.0 Migration Guide](https://github.com/peripheryapp/periphery/wiki/3.0-Migration-Guide).** - Support for installing via CocoaPods has been removed. diff --git a/MODULE.bazel b/MODULE.bazel index 3a0e7cc5d9..e3822bcd35 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -1,6 +1,6 @@ module( name = "periphery", - version = "3.0.0.beta9", + version = "3.0.0", compatibility_level = 1, ) diff --git a/Sources/Frontend/Version.swift b/Sources/Frontend/Version.swift index 8b2322d1a1..785efc4644 100644 --- a/Sources/Frontend/Version.swift +++ b/Sources/Frontend/Version.swift @@ -1 +1 @@ -let PeripheryVersion = "3.0.0.beta9" +let PeripheryVersion = "3.0.0" From d5feabd60ca6be7e011bfdf42fb4dc66c5a6f632 Mon Sep 17 00:00:00 2001 From: Ian Leitch Date: Sat, 28 Dec 2024 18:27:06 +0000 Subject: [PATCH 41/63] Don't throw an error when a source file does not exist, closes #858 (#859) --- CHANGELOG.md | 2 +- Sources/Indexer/SourceFileCollector.swift | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9b4cdc5346..64137af18a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,7 +10,7 @@ ##### Bug Fixes -- None. +- A clean build is no longer required when a file is deleted from the scanned project. ## 3.0.0 (2024-12-27) diff --git a/Sources/Indexer/SourceFileCollector.swift b/Sources/Indexer/SourceFileCollector.swift index 8df3b33c4d..e6b7936197 100644 --- a/Sources/Indexer/SourceFileCollector.swift +++ b/Sources/Indexer/SourceFileCollector.swift @@ -1,7 +1,6 @@ import Configuration import Foundation import Logger -import Shared import SourceGraph import SwiftIndexStore import SystemPackage @@ -43,7 +42,8 @@ public struct SourceFileCollector { if !isExcluded(file) { guard file.exists else { - throw PeripheryError.pathDoesNotExist(path: file.string) + logger.debug("Source file does not exist: \(file.string)") + return nil } let module = try indexStore.moduleName(for: unit) From 7a7fa35e07ab2d0b1034cadf46c7746b720a03df Mon Sep 17 00:00:00 2001 From: Ian Leitch Date: Sat, 28 Dec 2024 22:57:46 +0000 Subject: [PATCH 42/63] Release 3.0.1 --- CHANGELOG.md | 14 ++++++++++++++ MODULE.bazel | 2 +- Sources/Frontend/Version.swift | 2 +- 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 64137af18a..c0e3d7060c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,20 @@ ##### Bug Fixes +- None. + +## 3.0.1 (2024-12-28) + +##### Breaking + +- None. + +##### Enhancements + +- None. + +##### Bug Fixes + - A clean build is no longer required when a file is deleted from the scanned project. ## 3.0.0 (2024-12-27) diff --git a/MODULE.bazel b/MODULE.bazel index e3822bcd35..d33925a5ad 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -1,6 +1,6 @@ module( name = "periphery", - version = "3.0.0", + version = "3.0.1", compatibility_level = 1, ) diff --git a/Sources/Frontend/Version.swift b/Sources/Frontend/Version.swift index 785efc4644..31b07309e2 100644 --- a/Sources/Frontend/Version.swift +++ b/Sources/Frontend/Version.swift @@ -1 +1 @@ -let PeripheryVersion = "3.0.0" +let PeripheryVersion = "3.0.1" From 870dfeab498af32dece15d8329667066a18a9380 Mon Sep 17 00:00:00 2001 From: Ian Leitch Date: Mon, 30 Dec 2024 15:16:55 +0000 Subject: [PATCH 43/63] Improve Bazel setup instructions (#861) --- MODULE.bazel.lock | 2 +- README.md | 2 ++ bazel/internal/scan/scan.bzl | 32 +++----------------------------- bazel/rules.bzl | 32 +++++++++++++++++++++++++++----- 4 files changed, 33 insertions(+), 35 deletions(-) diff --git a/MODULE.bazel.lock b/MODULE.bazel.lock index 0ff47ee68f..82ff4a2c8e 100644 --- a/MODULE.bazel.lock +++ b/MODULE.bazel.lock @@ -177,7 +177,7 @@ "//bazel:generated.bzl%generated": { "general": { "bzlTransitiveDigest": "nMR2FBcoRPImVocN9DNOnm2NQWyTbJPu7SHJgAXsLFw=", - "usagesDigest": "8mdYbdjeyWhYUhUViUkt2T2IwtnrN+PHXdKUhqo0aqk=", + "usagesDigest": "RW2+z2kwE9p84qnYz0CxsJ3kl5x4i1Ps7ey0bnGHhEA=", "recordedFileInputs": {}, "recordedDirentsInputs": {}, "envVariables": {}, diff --git a/README.md b/README.md index c430e8cd30..c24c3a4909 100644 --- a/README.md +++ b/README.md @@ -68,6 +68,8 @@ use_repo(use_extension("@periphery//bazel:generated.bzl", "generated"), "periphe bazel run @periphery -- scan --bazel ``` +This command queries your project to identify all top-level targets, generates an implementation of the [scan](https://github.com/peripheryapp/periphery/blob/master/bazel/rules.bzl) rule, and then invokes Bazel. You can filter the top-level targets with the `-—bazel-filter ` option, where `` will be passed as the first argument to Bazel’s [filter](https://bazel.build/query/language#filter) operator. The generated query can be seen in the console with the `-—verbose` option. + ## How To Use ### The `scan` Command diff --git a/bazel/internal/scan/scan.bzl b/bazel/internal/scan/scan.bzl index 17dbb9988a..fcd0e14890 100644 --- a/bazel/internal/scan/scan.bzl +++ b/bazel/internal/scan/scan.bzl @@ -26,7 +26,7 @@ def _force_indexstore_impl(settings, _attr): ], } -_force_indexstore = transition( +force_indexstore = transition( implementation = _force_indexstore_impl, inputs = [ "//command_line_option:features", @@ -138,7 +138,8 @@ def _scan_inputs_aspect_impl(target, ctx): ), ] -def _scan_impl(ctx): +# buildifier: disable=function-docstring +def scan_impl(ctx): swift_srcs_set = sets.make() indexstores_set = sets.make() plists_set = sets.make() @@ -203,30 +204,3 @@ scan_inputs_aspect = aspect( _scan_inputs_aspect_impl, attr_aspects = ["deps", "swift_target"], ) - -scan = rule( - doc = "Scans the top-level deps and their transitive deps for unused code.", - attrs = { - "deps": attr.label_list( - cfg = _force_indexstore, - mandatory = True, - aspects = [scan_inputs_aspect], - doc = "Top-level project targets to scan.", - ), - "config": attr.string(doc = "Path to the periphery.yml configuration file."), - "periphery": attr.label( - doc = "The periphery executable target.", - default = "@periphery//:periphery", - ), - "_template": attr.label( - allow_single_file = True, - default = "@periphery//bazel/internal/scan:scan_template.sh", - ), - }, - outputs = { - "project_config": "project_config.json", - "scan": "scan.sh", - }, - implementation = _scan_impl, - executable = True, -) diff --git a/bazel/rules.bzl b/bazel/rules.bzl index 1a4efde119..4fbaa763b2 100644 --- a/bazel/rules.bzl +++ b/bazel/rules.bzl @@ -2,9 +2,31 @@ Periphery public rules. """ -load( - "//bazel/internal/scan:scan.bzl", - _scan = "scan", -) +load("//bazel/internal/scan:scan.bzl", "force_indexstore", "scan_impl", "scan_inputs_aspect") -scan = _scan +scan = rule( + doc = "Scans the top-level deps and their transitive deps for unused code.", + attrs = { + "deps": attr.label_list( + cfg = force_indexstore, + mandatory = True, + aspects = [scan_inputs_aspect], + doc = "Top-level project targets to scan.", + ), + "config": attr.string(doc = "Path to the periphery.yml configuration file."), + "periphery": attr.label( + doc = "The periphery executable target.", + default = "@periphery//:periphery", + ), + "_template": attr.label( + allow_single_file = True, + default = "@periphery//bazel/internal/scan:scan_template.sh", + ), + }, + outputs = { + "project_config": "project_config.json", + "scan": "scan.sh", + }, + implementation = scan_impl, + executable = True, +) From 174afcbfbc17364f61499c73ad7b1403a5201fa3 Mon Sep 17 00:00:00 2001 From: Ian Leitch Date: Mon, 30 Dec 2024 15:27:53 +0000 Subject: [PATCH 44/63] Move Bazel instructions to their own section --- README.md | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index c24c3a4909..994e8f3556 100644 --- a/README.md +++ b/README.md @@ -64,11 +64,7 @@ bazel_dep(name = "periphery", version = "") use_repo(use_extension("@periphery//bazel:generated.bzl", "generated"), "periphery_generated") ``` -```sh -bazel run @periphery -- scan --bazel -``` - -This command queries your project to identify all top-level targets, generates an implementation of the [scan](https://github.com/peripheryapp/periphery/blob/master/bazel/rules.bzl) rule, and then invokes Bazel. You can filter the top-level targets with the `-—bazel-filter ` option, where `` will be passed as the first argument to Bazel’s [filter](https://bazel.build/query/language#filter) operator. The generated query can be seen in the console with the `-—verbose` option. +See [Bazel](#build-systems) below for usage instructions. ## How To Use @@ -426,7 +422,17 @@ By default, Periphery looks for the index store at `.build/debug/index/store`. T ## Build Systems -Periphery can analyze projects using other build systems, though it cannot drive them automatically like SPM, Xcode and Bazel. Instead, you need to specify the location of indexstore and other resource files. The format is as follows: +### Bazel + +```sh +bazel run @periphery -- scan --bazel +``` + +The `--bazel` option enables Bazel mode which provides seamless integration with your project. It works by querying your project to identify all top-level targets, generates a hidden implementation of the [scan](https://github.com/peripheryapp/periphery/blob/master/bazel/rules.bzl) rule, and then invokes `bazel run`. You can filter the top-level targets with the `-—bazel-filter ` option, where `` will be passed as the first argument to Bazel’s [filter](https://bazel.build/query/language#filter) operator. The generated query can be seen in the console with the `-—verbose` option. + +### Other + +Periphery can analyze projects using other build systems, though it cannot drive them automatically like SPM, Xcode and Bazel. Instead, you need to create a configuration file that specifies the location of indexstore and other resource files. The format is as follows: ```json { From f2ddb6aab99fac80da8d847797e4491915ebf71b Mon Sep 17 00:00:00 2001 From: Ian Leitch Date: Fri, 3 Jan 2025 10:56:25 +0000 Subject: [PATCH 45/63] Add dev_dependency attr to Bazel usage --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 994e8f3556..78e9e011dd 100644 --- a/README.md +++ b/README.md @@ -60,7 +60,7 @@ mint install peripheryapp/periphery ### [Bazel](https://bazel.build/) ```python -bazel_dep(name = "periphery", version = "") +bazel_dep(name = "periphery", version = "", dev_dependency = True) use_repo(use_extension("@periphery//bazel:generated.bzl", "generated"), "periphery_generated") ``` From 6ebc6ffef70ce05f06322b71d96fcd5ec8a61acc Mon Sep 17 00:00:00 2001 From: John Szumski <784312+jszumski@users.noreply.github.com> Date: Fri, 14 Feb 2025 10:30:13 -0500 Subject: [PATCH 46/63] Mark prefix, postfix, and infix operators as function results (#878) --- Sources/SourceGraph/Elements/Declaration.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/SourceGraph/Elements/Declaration.swift b/Sources/SourceGraph/Elements/Declaration.swift index 7b1a41bc35..b8815f7632 100644 --- a/Sources/SourceGraph/Elements/Declaration.swift +++ b/Sources/SourceGraph/Elements/Declaration.swift @@ -198,7 +198,7 @@ public final class Declaration { "initializer" case .extension, .extensionEnum, .extensionClass, .extensionStruct, .extensionProtocol: "extension" - case .functionMethodClass, .functionMethodStatic, .functionMethodInstance, .functionFree, .functionOperator, .functionSubscript: + case .functionMethodClass, .functionMethodStatic, .functionMethodInstance, .functionFree, .functionOperator, .functionOperatorInfix, .functionOperatorPostfix, .functionOperatorPrefix, .functionSubscript: "function" case .varStatic, .varInstance, .varClass, .varGlobal, .varLocal: "property" From 933c8c5d4b5b16352d322d37309ed28cda511412 Mon Sep 17 00:00:00 2001 From: John Szumski <784312+jszumski@users.noreply.github.com> Date: Fri, 14 Feb 2025 10:30:53 -0500 Subject: [PATCH 47/63] Fix warnings in Xcode 16.2 (#879) --- Sources/Configuration/Configuration.swift | 4 ++-- Sources/Extensions/FilePath+Extension.swift | 2 +- Sources/Frontend/Commands/ScanCommand.swift | 2 +- Sources/Shared/SetupGuide.swift | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Sources/Configuration/Configuration.swift b/Sources/Configuration/Configuration.swift index dec444ab9c..df075b4b0d 100644 --- a/Sources/Configuration/Configuration.swift +++ b/Sources/Configuration/Configuration.swift @@ -329,13 +329,13 @@ extension Setting where Value == [String] { // MARK: - Yaml Encoding -extension OutputFormat: ScalarRepresentable { +extension OutputFormat: Yams.ScalarRepresentable { public func represented() -> Node.Scalar { rawValue.represented() } } -extension FilePath: ScalarRepresentable { +extension FilePath: Yams.ScalarRepresentable { public func represented() -> Node.Scalar { string.represented() } diff --git a/Sources/Extensions/FilePath+Extension.swift b/Sources/Extensions/FilePath+Extension.swift index 715e5cf479..a0ef339e70 100644 --- a/Sources/Extensions/FilePath+Extension.swift +++ b/Sources/Extensions/FilePath+Extension.swift @@ -68,7 +68,7 @@ public extension FilePath { } } -extension FilePath: Comparable { +extension FilePath: Swift.Comparable { public static func < (lhs: FilePath, rhs: FilePath) -> Bool { lhs.lexicallyNormalized().string < rhs.lexicallyNormalized().string } diff --git a/Sources/Frontend/Commands/ScanCommand.swift b/Sources/Frontend/Commands/ScanCommand.swift index 948f53617f..78eeee6c4a 100644 --- a/Sources/Frontend/Commands/ScanCommand.swift +++ b/Sources/Frontend/Commands/ScanCommand.swift @@ -266,7 +266,7 @@ struct ScanCommand: FrontendCommand { extension OutputFormat: ExpressibleByArgument {} -extension FilePath: ExpressibleByArgument { +extension FilePath: ArgumentParser.ExpressibleByArgument { public init?(argument: String) { self.init(argument) } diff --git a/Sources/Shared/SetupGuide.swift b/Sources/Shared/SetupGuide.swift index 0cdec2b883..26aac95d52 100644 --- a/Sources/Shared/SetupGuide.swift +++ b/Sources/Shared/SetupGuide.swift @@ -52,7 +52,7 @@ open class SetupGuideHelpers { } public func select(multiple options: [String]) -> SetupSelection { - var helpMsg = " Delimit choices with a single space, e.g: 1 2 3" + let helpMsg = " Delimit choices with a single space, e.g: 1 2 3" display(options: options) print(colorize("?", .boldYellow) + helpMsg) From adfd9eac6046ee025b6bfc18ccce9df5a1e653bb Mon Sep 17 00:00:00 2001 From: John Szumski <784312+jszumski@users.noreply.github.com> Date: Fri, 14 Feb 2025 10:48:52 -0500 Subject: [PATCH 48/63] Fixes issue where comment commands are ignored for import statements (#880) --- .../Elements/ImportStatement.swift | 5 ++- .../Mutators/UnusedImportMarker.swift | 8 ++-- .../SyntaxAnalysis/ImportSyntaxVisitor.swift | 3 +- Tests/Fixtures/Package.swift | 6 ++- .../testIgnoreComments.swift | 2 + .../UnusedModuleDeclaration.swift | 3 ++ Tests/PeripheryTests/RetentionTest.swift | 8 +++- Tests/Shared/DeclarationDescription.swift | 4 ++ Tests/Shared/FixtureSourceGraphTestCase.swift | 3 +- Tests/Shared/SourceGraphTestCase.swift | 40 +++++++++++++------ 10 files changed, 61 insertions(+), 21 deletions(-) create mode 100644 Tests/Fixtures/Sources/UnusedModuleFixtures/UnusedModuleDeclaration.swift diff --git a/Sources/SourceGraph/Elements/ImportStatement.swift b/Sources/SourceGraph/Elements/ImportStatement.swift index 324b7628a4..e2db6c1968 100644 --- a/Sources/SourceGraph/Elements/ImportStatement.swift +++ b/Sources/SourceGraph/Elements/ImportStatement.swift @@ -5,16 +5,19 @@ public struct ImportStatement { public let isTestable: Bool public let isExported: Bool public let location: Location + public let commentCommands: [CommentCommand] public init( module: String, isTestable: Bool, isExported: Bool, - location: Location + location: Location, + commentCommands: [CommentCommand] ) { self.module = module self.isTestable = isTestable self.isExported = isExported self.location = location + self.commentCommands = commentCommands } } diff --git a/Sources/SourceGraph/Mutators/UnusedImportMarker.swift b/Sources/SourceGraph/Mutators/UnusedImportMarker.swift index 0a48fb14f9..ee896df012 100644 --- a/Sources/SourceGraph/Mutators/UnusedImportMarker.swift +++ b/Sources/SourceGraph/Mutators/UnusedImportMarker.swift @@ -45,9 +45,11 @@ final class UnusedImportMarker: SourceGraphMutator { let unreferencedImports = file.importStatements .filter { - // Exclude exported/public imports because even though they may be unreferenced - // in the current file, their exported symbols may be referenced in others. - !$0.isExported && + // Exclude ignore commented imports + !$0.commentCommands.contains(.ignore) && + // Exclude exported/public imports because even though they may be unreferenced + // in the current file, their exported symbols may be referenced in others. + !$0.isExported && // Consider modules that have been indexed as we need to see which modules // they export. graph.indexedModules.contains($0.module) && diff --git a/Sources/SyntaxAnalysis/ImportSyntaxVisitor.swift b/Sources/SyntaxAnalysis/ImportSyntaxVisitor.swift index ae17117cab..e8b4cc05cc 100644 --- a/Sources/SyntaxAnalysis/ImportSyntaxVisitor.swift +++ b/Sources/SyntaxAnalysis/ImportSyntaxVisitor.swift @@ -26,7 +26,8 @@ public final class ImportSyntaxVisitor: PeripherySyntaxVisitor { module: module, isTestable: attributes.contains("testable"), isExported: attributes.contains("_exported") || node.modifiers.contains { $0.name.text == "public" }, - location: location + location: location, + commentCommands: CommentCommand.parseCommands(in: node.leadingTrivia) ) importStatements.append(statement) } diff --git a/Tests/Fixtures/Package.swift b/Tests/Fixtures/Package.swift index 56a9d91066..3ca2ae225e 100644 --- a/Tests/Fixtures/Package.swift +++ b/Tests/Fixtures/Package.swift @@ -5,6 +5,9 @@ var targets: [PackageDescription.Target] = [ .target( name: "ExternalModuleFixtures" ), + .target( + name: "UnusedModuleFixtures" + ), .target( name: "CrossModuleRetentionFixtures", dependencies: [ @@ -17,7 +20,8 @@ var targets: [PackageDescription.Target] = [ .target( name: "RetentionFixtures", dependencies: [ - .target(name: "ExternalModuleFixtures") + .target(name: "ExternalModuleFixtures"), + .target(name: "UnusedModuleFixtures") ] ), .target( diff --git a/Tests/Fixtures/Sources/RetentionFixtures/testIgnoreComments.swift b/Tests/Fixtures/Sources/RetentionFixtures/testIgnoreComments.swift index b1f010d08b..aa1e285399 100644 --- a/Tests/Fixtures/Sources/RetentionFixtures/testIgnoreComments.swift +++ b/Tests/Fixtures/Sources/RetentionFixtures/testIgnoreComments.swift @@ -1,4 +1,6 @@ import Foundation +// periphery:ignore +import UnusedModuleFixtures // periphery:ignore public class Fixture113 { diff --git a/Tests/Fixtures/Sources/UnusedModuleFixtures/UnusedModuleDeclaration.swift b/Tests/Fixtures/Sources/UnusedModuleFixtures/UnusedModuleDeclaration.swift new file mode 100644 index 0000000000..b02cd71db8 --- /dev/null +++ b/Tests/Fixtures/Sources/UnusedModuleFixtures/UnusedModuleDeclaration.swift @@ -0,0 +1,3 @@ +import Foundation + +public struct UnusedStruct {} diff --git a/Tests/PeripheryTests/RetentionTest.swift b/Tests/PeripheryTests/RetentionTest.swift index acc7a2d2d3..3b7080df00 100644 --- a/Tests/PeripheryTests/RetentionTest.swift +++ b/Tests/PeripheryTests/RetentionTest.swift @@ -885,7 +885,13 @@ final class RetentionTest: FixtureSourceGraphTestCase { } func testIgnoreComments() { - analyze(retainPublic: true) { + // ensure this external module is explicitly indexed so we can tell if it is unused + let additionalFilesToIndex = [ + FixturesProjectPath.appending("Sources/UnusedModuleFixtures/UnusedModuleDeclaration.swift"), + ] + + analyze(retainPublic: true, additionalFilesToIndex: additionalFilesToIndex) { + assertReferenced(.module("UnusedModuleFixtures")) assertReferenced(.class("Fixture113")) { self.assertReferenced(.functionMethodInstance("someFunc(param:)")) { self.assertReferenced(.varParameter("param")) diff --git a/Tests/Shared/DeclarationDescription.swift b/Tests/Shared/DeclarationDescription.swift index fd3ab23d40..487069331b 100644 --- a/Tests/Shared/DeclarationDescription.swift +++ b/Tests/Shared/DeclarationDescription.swift @@ -74,6 +74,10 @@ struct DeclarationDescription: CustomStringConvertible { self.init(kind: .functionSubscript, name: name, line: line) } + static func module(_ name: String, line: Int? = nil) -> Self { + self.init(kind: .module, name: name, line: line) + } + static func varStatic(_ name: String, line: Int? = nil) -> Self { self.init(kind: .varStatic, name: name, line: line) } diff --git a/Tests/Shared/FixtureSourceGraphTestCase.swift b/Tests/Shared/FixtureSourceGraphTestCase.swift index 24ce9d685b..ccdaee13d8 100644 --- a/Tests/Shared/FixtureSourceGraphTestCase.swift +++ b/Tests/Shared/FixtureSourceGraphTestCase.swift @@ -15,6 +15,7 @@ class FixtureSourceGraphTestCase: SPMSourceGraphTestCase { retainObjcAccessible: Bool = false, retainObjcAnnotated: Bool = false, disableRedundantPublicAnalysis: Bool = false, + additionalFilesToIndex: [FilePath] = [], testBlock: () throws -> Void ) rethrows -> [ScanResult] { configuration.retainPublic = retainPublic @@ -27,7 +28,7 @@ class FixtureSourceGraphTestCase: SPMSourceGraphTestCase { fatalError("\(testFixturePath.string) does not exist") } - Self.index(sourceFile: testFixturePath) + Self.index(sourceFiles: [testFixturePath] + additionalFilesToIndex) try testBlock() return Self.results } diff --git a/Tests/Shared/SourceGraphTestCase.swift b/Tests/Shared/SourceGraphTestCase.swift index a3c1aa7701..8ad411e62b 100644 --- a/Tests/Shared/SourceGraphTestCase.swift +++ b/Tests/Shared/SourceGraphTestCase.swift @@ -45,12 +45,12 @@ open class SourceGraphTestCase: XCTestCase { } } - static func index(sourceFile: FilePath? = nil) { + static func index(sourceFiles: [FilePath]? = nil) { var newPlan = plan! - if let sourceFile { + if let sourceFiles { newPlan = IndexPlan( - sourceFiles: plan.sourceFiles.filter { $0.key.path == sourceFile }, + sourceFiles: plan.sourceFiles.filter { sourceFiles.contains($0.key.path) }, plistPaths: plan.plistPaths, xibPaths: plan.xibPaths, xcDataModelPaths: plan.xcDataModelPaths, @@ -78,22 +78,36 @@ open class SourceGraphTestCase: XCTestCase { } func assertReferenced(_ description: DeclarationDescription, scopedAssertions: (() -> Void)? = nil, file: StaticString = #file, line: UInt = #line) { - guard let declaration = materialize(description, file: file, line: line) else { return } + if case .module = description.kind { + if let declaration = Self.graph.unusedModuleImports.first(where: { $0.name == description.name }) { + XCTFail("Expected declaration to be referenced: \(declaration)", file: file, line: line) + } - if !Self.graph.usedDeclarations.contains(declaration) { - XCTFail("Expected declaration to be referenced: \(declaration)", file: file, line: line) - } + } else { + guard let declaration = materialize(description, file: file, line: line) else { return } - scopeStack.append(.declaration(declaration)) - scopedAssertions?() - scopeStack.removeLast() + if !Self.graph.usedDeclarations.contains(declaration) { + XCTFail("Expected declaration to be referenced: \(declaration)", file: file, line: line) + } + + scopeStack.append(.declaration(declaration)) + scopedAssertions?() + scopeStack.removeLast() + } } func assertNotReferenced(_ description: DeclarationDescription, file: StaticString = #file, line: UInt = #line) { - guard let declaration = materialize(description, file: file, line: line) else { return } + if case .module = description.kind { + if Self.graph.unusedModuleImports.first(where: { $0.name == description.name }) == nil { + XCTFail("Expected module to not be referenced: \(description.name)", file: file, line: line) + } - if !Self.results.unusedDeclarations.contains(declaration) { - XCTFail("Expected declaration to not be referenced: \(declaration)", file: file, line: line) + } else { + guard let declaration = materialize(description, file: file, line: line) else { return } + + if !Self.results.unusedDeclarations.contains(declaration) { + XCTFail("Expected declaration to not be referenced: \(declaration)", file: file, line: line) + } } } From 48063c3256cee1fe1cf411b5e6ab29203a649c11 Mon Sep 17 00:00:00 2001 From: John Szumski <784312+jszumski@users.noreply.github.com> Date: Fri, 14 Feb 2025 11:29:09 -0500 Subject: [PATCH 49/63] Add the ability to add comment commands on the same line as an import statement (#881) --- .../SyntaxAnalysis/ImportSyntaxVisitor.swift | 2 +- .../ImportFixture.swift | 4 ++ .../Syntax/ImportVisitTest.swift | 39 +++++++++++++++++++ 3 files changed, 44 insertions(+), 1 deletion(-) create mode 100644 Tests/Fixtures/Sources/DeclarationVisitorFixtures/ImportFixture.swift create mode 100644 Tests/PeripheryTests/Syntax/ImportVisitTest.swift diff --git a/Sources/SyntaxAnalysis/ImportSyntaxVisitor.swift b/Sources/SyntaxAnalysis/ImportSyntaxVisitor.swift index e8b4cc05cc..25985eb97c 100644 --- a/Sources/SyntaxAnalysis/ImportSyntaxVisitor.swift +++ b/Sources/SyntaxAnalysis/ImportSyntaxVisitor.swift @@ -27,7 +27,7 @@ public final class ImportSyntaxVisitor: PeripherySyntaxVisitor { isTestable: attributes.contains("testable"), isExported: attributes.contains("_exported") || node.modifiers.contains { $0.name.text == "public" }, location: location, - commentCommands: CommentCommand.parseCommands(in: node.leadingTrivia) + commentCommands: CommentCommand.parseCommands(in: node.leadingTrivia.merging(node.trailingTrivia)) ) importStatements.append(statement) } diff --git a/Tests/Fixtures/Sources/DeclarationVisitorFixtures/ImportFixture.swift b/Tests/Fixtures/Sources/DeclarationVisitorFixtures/ImportFixture.swift new file mode 100644 index 0000000000..22137fe8c6 --- /dev/null +++ b/Tests/Fixtures/Sources/DeclarationVisitorFixtures/ImportFixture.swift @@ -0,0 +1,4 @@ +import Foundation +// periphery:ignore +import CoreFoundation +import Swift // periphery:ignore diff --git a/Tests/PeripheryTests/Syntax/ImportVisitTest.swift b/Tests/PeripheryTests/Syntax/ImportVisitTest.swift new file mode 100644 index 0000000000..1414218c54 --- /dev/null +++ b/Tests/PeripheryTests/Syntax/ImportVisitTest.swift @@ -0,0 +1,39 @@ +import Foundation +@testable import SourceGraph +@testable import SyntaxAnalysis +@testable import TestShared +import XCTest + +final class ImportVisitTest: XCTestCase { + private var results: [ImportStatement]! + + override func setUpWithError() throws { + try super.setUpWithError() + let multiplexingVisitor = try MultiplexingSyntaxVisitor(file: fixturePath) + let visitor = multiplexingVisitor.add(ImportSyntaxVisitor.self) + multiplexingVisitor.visit() + results = visitor.importStatements + } + + override func tearDown() { + results = nil + super.tearDown() + } + + func testCommentCommands() { + let expectedIgnored = ["CoreFoundation", "Swift"] + let actualIgnored = results.filter { $0.commentCommands.contains(.ignore) }.map(\.module) + XCTAssertEqual(actualIgnored, expectedIgnored, "Ignored modules did not match the expected set") + + let actualUnignored = results.filter { !$0.commentCommands.contains(.ignore) }.map(\.module) + let expectedUnignored = ["Foundation"] + XCTAssertEqual(actualUnignored, expectedUnignored, "Unignored modules did not match the expected set") + } + + // MARK: - Private + + private var fixturePath: SourceFile { + let path = FixturesProjectPath.appending("Sources/DeclarationVisitorFixtures/ImportFixture.swift") + return SourceFile(path: path, modules: ["DeclarationVisitorFixtures"]) + } +} From 2c3e5351c3fd3b97fccfa05193ef60ed7d097c1d Mon Sep 17 00:00:00 2001 From: Ian Leitch Date: Mon, 3 Mar 2025 13:13:11 +0100 Subject: [PATCH 50/63] Update deps (#884) --- .bazelversion | 2 +- MODULE.bazel | 6 +++--- MODULE.bazel.lock | 35 ++++++++++------------------------- Package.resolved | 14 +++++++------- Package.swift | 2 +- 5 files changed, 22 insertions(+), 37 deletions(-) diff --git a/.bazelversion b/.bazelversion index ae9a76b924..0e79152459 100644 --- a/.bazelversion +++ b/.bazelversion @@ -1 +1 @@ -8.0.0 +8.1.1 diff --git a/MODULE.bazel b/MODULE.bazel index d33925a5ad..7777841af0 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -16,10 +16,10 @@ bazel_dep(name = "swift_argument_parser", version = "1.5.0") bazel_dep(name = "swift-filename-matcher", version = "2.0.0") bazel_dep(name = "swift-indexstore", version = "0.3.0") bazel_dep(name = "swift-syntax", version = "600.0.1") -bazel_dep(name = "swift-system", version = "1.4.0") +bazel_dep(name = "swift-system", version = "1.4.2") bazel_dep(name = "pathkit", version = "1.0.1") -bazel_dep(name = "xcodeproj", version = "8.25.0") -bazel_dep(name = "yams", version = "5.1.3") +bazel_dep(name = "xcodeproj", version = "8.27.3") +bazel_dep(name = "yams", version = "5.3.1") # Generated repo use_repo(use_extension("//bazel:generated.bzl", "generated"), "periphery_generated") diff --git a/MODULE.bazel.lock b/MODULE.bazel.lock index 82ff4a2c8e..a37e7c8f2d 100644 --- a/MODULE.bazel.lock +++ b/MODULE.bazel.lock @@ -1,5 +1,5 @@ { - "lockFileVersion": 16, + "lockFileVersion": 18, "registryFileHashes": { "https://bcr.bazel.build/bazel_registry.json": "8a28e4aff06ee60aed2a8c281907fb8bcbf3b753c91fb5a5c57da3215d5b3497", "https://bcr.bazel.build/modules/abseil-cpp/20210324.2/MODULE.bazel": "7cd0312e064fde87c8d1cd79ba06c876bd23630c83466e9500321be55c96ace2", @@ -88,7 +88,8 @@ "https://bcr.bazel.build/modules/rules_cc/0.0.14/MODULE.bazel": "5e343a3aac88b8d7af3b1b6d2093b55c347b8eefc2e7d1442f7a02dc8fea48ac", "https://bcr.bazel.build/modules/rules_cc/0.0.15/MODULE.bazel": "6704c35f7b4a72502ee81f61bf88706b54f06b3cbe5558ac17e2e14666cd5dcc", "https://bcr.bazel.build/modules/rules_cc/0.0.16/MODULE.bazel": "7661303b8fc1b4d7f532e54e9d6565771fea666fbdf839e0a86affcd02defe87", - "https://bcr.bazel.build/modules/rules_cc/0.0.16/source.json": "227e83737046aa4f50015da48e98e0d8ab42fd0ec74d8d653b6cc9f9a357f200", + "https://bcr.bazel.build/modules/rules_cc/0.0.17/MODULE.bazel": "2ae1d8f4238ec67d7185d8861cb0a2cdf4bc608697c331b95bf990e69b62e64a", + "https://bcr.bazel.build/modules/rules_cc/0.0.17/source.json": "4db99b3f55c90ab28d14552aa0632533e3e8e5e9aea0f5c24ac0014282c2a7c5", "https://bcr.bazel.build/modules/rules_cc/0.0.2/MODULE.bazel": "6915987c90970493ab97393024c156ea8fb9f3bea953b2f3ec05c34f19b5695c", "https://bcr.bazel.build/modules/rules_cc/0.0.6/MODULE.bazel": "abf360251023dfe3efcef65ab9d56beefa8394d4176dd29529750e1c57eaa33f", "https://bcr.bazel.build/modules/rules_cc/0.0.8/MODULE.bazel": "964c85c82cfeb6f3855e6a07054fdb159aced38e99a5eecf7bce9d53990afa3e", @@ -157,16 +158,16 @@ "https://bcr.bazel.build/modules/swift-indexstore/0.3.0/source.json": "0d13a7935be16621f918e68fb7def45100f153df93b7027ad06a7e633c029fab", "https://bcr.bazel.build/modules/swift-syntax/600.0.1/MODULE.bazel": "f6c886571884e56f979e2d08e27830fb20aea34cb5e518a5a9e47dbf230c6745", "https://bcr.bazel.build/modules/swift-syntax/600.0.1/source.json": "2256d164120b8ff1dfe39e93dff88be482eb2f665867ed6e99e1ad6be3c9dc49", - "https://bcr.bazel.build/modules/swift-system/1.4.0/MODULE.bazel": "2554190bc0b3651a6d9f83da29b70213aba346ca498c521c789c876f577c0eae", - "https://bcr.bazel.build/modules/swift-system/1.4.0/source.json": "420ea1ed244d7a9ea3967484e6bc5f5f681dc188bd34dda1cf1bbd3ae56f6d10", + "https://bcr.bazel.build/modules/swift-system/1.4.2/MODULE.bazel": "4cc7eb6d348b79e55db30d9a55d1c639df20292ae3883f63902c366b6c36f680", + "https://bcr.bazel.build/modules/swift-system/1.4.2/source.json": "b57177fe7dc26ec5292eef5feff3707530ebcd50ee420a99be6a6791bbb6f95b", "https://bcr.bazel.build/modules/swift_argument_parser/1.3.1.1/MODULE.bazel": "5e463fbfba7b1701d957555ed45097d7f984211330106ccd1352c6e0af0dcf91", "https://bcr.bazel.build/modules/swift_argument_parser/1.5.0/MODULE.bazel": "fabd6256994e7dbb7e7f800770f3d0a70b0dc23d7111cf293ff9dc8053ec8d12", "https://bcr.bazel.build/modules/swift_argument_parser/1.5.0/source.json": "a8b1945eb173459ea00998e804fd4d58dcf1917976981ed51033eaeeb5d10240", "https://bcr.bazel.build/modules/upb/0.0.0-20220923-a547704/MODULE.bazel": "7298990c00040a0e2f121f6c32544bab27d4452f80d9ce51349b1a28f3005c43", - "https://bcr.bazel.build/modules/xcodeproj/8.25.0/MODULE.bazel": "da378f64c3cd7aa4bebc8fba4fc159a44df088e305b9b84f5716b3fb80d091cb", - "https://bcr.bazel.build/modules/xcodeproj/8.25.0/source.json": "7f6a70ba57295561a79ff9071245e3bb7dd90aaab7c1bf9933f7df5ced4f3ac9", - "https://bcr.bazel.build/modules/yams/5.1.3/MODULE.bazel": "5f3b2e674671971092540aafbdbd4953a8fc4348acc8c1cb3e94160fcb4f76af", - "https://bcr.bazel.build/modules/yams/5.1.3/source.json": "f9f54bc0ee648b42b4f385b71b9bf56db9f59774039fe2f1e33f7fe9a15d8874", + "https://bcr.bazel.build/modules/xcodeproj/8.27.3/MODULE.bazel": "49276599207dae3df1e4336c2067505323dfb0606b53ef63e144087d1226e0eb", + "https://bcr.bazel.build/modules/xcodeproj/8.27.3/source.json": "bbbb718187dcbdfbb3a9a0ec7d49446cdf48c67657cafd79b5cf33aa8918f608", + "https://bcr.bazel.build/modules/yams/5.3.1/MODULE.bazel": "97a4c9bb03be7ef15b4de4086c9a226ad604114c91170c0c695628f10d536d36", + "https://bcr.bazel.build/modules/yams/5.3.1/source.json": "2958ed6c6a46d1a4866cfc701471427d9eca961ba08342cfd797c2a641bc2273", "https://bcr.bazel.build/modules/zlib/1.2.11/MODULE.bazel": "07b389abc85fdbca459b69e2ec656ae5622873af3f845e1c9d80fe179f3effa0", "https://bcr.bazel.build/modules/zlib/1.3.1.bcr.3/MODULE.bazel": "af322bc08976524477c79d1e45e241b6efbeb918c497e8840b8ab116802dda79", "https://bcr.bazel.build/modules/zlib/1.3.1.bcr.3/source.json": "2be409ac3c7601245958cd4fcdff4288be79ed23bd690b4b951f500d54ee6e7d", @@ -174,25 +175,9 @@ }, "selectedYankedVersions": {}, "moduleExtensions": { - "//bazel:generated.bzl%generated": { - "general": { - "bzlTransitiveDigest": "nMR2FBcoRPImVocN9DNOnm2NQWyTbJPu7SHJgAXsLFw=", - "usagesDigest": "RW2+z2kwE9p84qnYz0CxsJ3kl5x4i1Ps7ey0bnGHhEA=", - "recordedFileInputs": {}, - "recordedDirentsInputs": {}, - "envVariables": {}, - "generatedRepoSpecs": { - "periphery_generated": { - "repoRuleId": "@@//bazel:generated.bzl%generated_repo", - "attributes": {} - } - }, - "recordedRepoMappingEntries": [] - } - }, "@@apple_support+//crosstool:setup.bzl%apple_cc_configure_extension": { "general": { - "bzlTransitiveDigest": "gMOsQY7zqLH6vNcwyNeAqWPLKKmyJ29OLPdX+FMk+jE=", + "bzlTransitiveDigest": "Ync9nL0AbHC6ondeEY7fBjBjLxojTsiXcJh65ZDTRlA=", "usagesDigest": "yI5Mh2z+Xz7nk0srvgIU8/75tb/cZsZGWgUI/rlzsqo=", "recordedFileInputs": {}, "recordedDirentsInputs": {}, diff --git a/Package.resolved b/Package.resolved index 51e4579f4d..9715824876 100644 --- a/Package.resolved +++ b/Package.resolved @@ -1,5 +1,5 @@ { - "originHash" : "e9d8baa60dce80cafa8b76899eb69396fc9c18d78f46733d4e15bc12127a6bd0", + "originHash" : "564f682d7bdc21f92e080a8c7de90ea373fb3c339d2f29e5ab3e3b22f01e2897", "pins" : [ { "identity" : "aexml", @@ -69,8 +69,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/apple/swift-system", "state" : { - "revision" : "c8a44d836fe7913603e246acab7c528c2e780168", - "version" : "1.4.0" + "revision" : "a34201439c74b53f0fd71ef11741af7e7caf01e1", + "version" : "1.4.2" } }, { @@ -78,8 +78,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/tuist/xcodeproj", "state" : { - "revision" : "d3df4265b8383dd56dae4b01f817d30c22e7612c", - "version" : "8.25.0" + "revision" : "02bc2dd6224aa59147941d85fdc45a7677af62f6", + "version" : "8.27.3" } }, { @@ -87,8 +87,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/jpsim/Yams", "state" : { - "revision" : "3036ba9d69cf1fd04d433527bc339dc0dc75433d", - "version" : "5.1.3" + "revision" : "b4b8042411dc7bbb696300a34a4bf3ba1b7ad19b", + "version" : "5.3.1" } } ], diff --git a/Package.swift b/Package.swift index 7ee23a1548..532a97deb5 100644 --- a/Package.swift +++ b/Package.swift @@ -15,7 +15,7 @@ var dependencies: [Package.Dependency] = [ dependencies.append( .package( url: "https://github.com/tuist/xcodeproj", - from: "8.25.0" + from: "8.27.3" ) ) #endif From ff147721dddf4e009abe20c5e391161ac173c6ef Mon Sep 17 00:00:00 2001 From: Ian Leitch Date: Mon, 3 Mar 2025 13:19:15 +0100 Subject: [PATCH 51/63] Update changelog --- CHANGELOG.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c0e3d7060c..b22a811454 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,7 +10,8 @@ ##### Bug Fixes -- None. +- Updated XcodeProj dependency provides support for Xcode 16's new project format. +- Fix retain comment commands for imports. ## 3.0.1 (2024-12-28) From 69555c16adbc2a2c6c2ebc7526d0f72822e70ba3 Mon Sep 17 00:00:00 2001 From: Ian Leitch Date: Mon, 3 Mar 2025 13:27:10 +0100 Subject: [PATCH 52/63] Release 3.0.2 --- CHANGELOG.md | 14 ++++++++++++++ MODULE.bazel | 2 +- Sources/Frontend/Version.swift | 2 +- 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b22a811454..7e88f344f5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,20 @@ ##### Bug Fixes +- None. + +## 3.0.2 (2023-03-03) + +##### Breaking + +- None. + +##### Enhancements + +- None. + +##### Bug Fixes + - Updated XcodeProj dependency provides support for Xcode 16's new project format. - Fix retain comment commands for imports. diff --git a/MODULE.bazel b/MODULE.bazel index 7777841af0..91465d9b9b 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -1,6 +1,6 @@ module( name = "periphery", - version = "3.0.1", + version = "3.0.2", compatibility_level = 1, ) diff --git a/Sources/Frontend/Version.swift b/Sources/Frontend/Version.swift index 31b07309e2..67a93022a3 100644 --- a/Sources/Frontend/Version.swift +++ b/Sources/Frontend/Version.swift @@ -1 +1 @@ -let PeripheryVersion = "3.0.1" +let PeripheryVersion = "3.0.2" From fba769bdf15ef12b52dec65ff4b8e0ec0c218a25 Mon Sep 17 00:00:00 2001 From: coffmark <52638834+coffmark@users.noreply.github.com> Date: Sat, 15 Mar 2025 20:35:09 +0900 Subject: [PATCH 53/63] Modified folder structure of artifact bundle (#886) ref. https://github.com/swiftlang/swift-evolution/blob/main/proposals/0305-swiftpm-binary-target-improvements.md --- .mise/tasks/release | 9 ++++++++- .mise/tasks/scripts/artifactbundle_info.json.template | 2 +- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/.mise/tasks/release b/.mise/tasks/release index bb33f0bfe0..47fb8531c3 100755 --- a/.mise/tasks/release +++ b/.mise/tasks/release @@ -72,8 +72,15 @@ echo -e "\n${zip_filename} checksum:" sha256=$( shasum -a 256 ${zip_filename} | awk '{print $1}' ) echo ${sha256} +macos_artifact="periphery-${version}-macos" +artifactbundle="periphery-${version}.artifactbundle" zip_artifactbundle="periphery-${version}.artifactbundle.zip" -zip "${zip_artifactbundle}" periphery LICENSE.md info.json + +mkdir -p ${macos_artifact}/bin +cp periphery ${macos_artifact}/bin +mkdir ${artifactbundle} +cp -R ${macos_artifact} LICENSE.md info.json ${artifactbundle} +zip -r "${zip_artifactbundle}" periphery-${version}.artifactbundle codesign "${zip_artifactbundle}" echo -e "\n${zip_artifactbundle} checksum:" diff --git a/.mise/tasks/scripts/artifactbundle_info.json.template b/.mise/tasks/scripts/artifactbundle_info.json.template index c3a505667c..11e0c9c697 100644 --- a/.mise/tasks/scripts/artifactbundle_info.json.template +++ b/.mise/tasks/scripts/artifactbundle_info.json.template @@ -6,7 +6,7 @@ "type": "executable", "variants": [ { - "path": "periphery", + "path": "periphery-__VERSION__-macos/bin/periphery", "supportedTriples": ["x86_64-apple-macosx", "arm64-apple-macosx"] } ] From 1fc094d2d3a2920a1d7235361200bf3b5acfdda5 Mon Sep 17 00:00:00 2001 From: Ian Leitch Date: Sat, 15 Mar 2025 12:50:31 +0100 Subject: [PATCH 54/63] Test release binary during release --- .mise/tasks/release | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.mise/tasks/release b/.mise/tasks/release index 47fb8531c3..7f17f5ab3f 100755 --- a/.mise/tasks/release +++ b/.mise/tasks/release @@ -9,7 +9,7 @@ confirm () { green "$1 (y/n): " read answer - if [ $answer != "y" ] + if [ "$answer" != "y" ] then exit 0 fi @@ -52,6 +52,11 @@ if [ ! -f .release/periphery ]; then exit 1 fi +echo "Testing release binary..." +for i in {1..3}; do + .release/periphery scan --strict +done + cp LICENSE.md MODULE.bazel BUILD.bazel .release/ cp -R bazel Sources .release/ rm -r .release/bazel/dev From b916cd9a5fa450bddedcf96c3b4212bc10d77d1f Mon Sep 17 00:00:00 2001 From: Ian Leitch Date: Sat, 15 Mar 2025 12:55:03 +0100 Subject: [PATCH 55/63] Release 3.0.3 --- CHANGELOG.md | 16 +++++++++++++++- MODULE.bazel | 2 +- Sources/Frontend/Version.swift | 2 +- 3 files changed, 17 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7e88f344f5..4dd35f632f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,7 +12,21 @@ - None. -## 3.0.2 (2023-03-03) +## 3.0.3 (2025-03-15) + +##### Breaking + +- None. + +##### Enhancements + +- None. + +##### Bug Fixes + +- Rebuilt defective release binary. + +## 3.0.2 (2025-03-03) ##### Breaking diff --git a/MODULE.bazel b/MODULE.bazel index 91465d9b9b..5781f04ada 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -1,6 +1,6 @@ module( name = "periphery", - version = "3.0.2", + version = "3.0.3", compatibility_level = 1, ) diff --git a/Sources/Frontend/Version.swift b/Sources/Frontend/Version.swift index 67a93022a3..f3b039bdeb 100644 --- a/Sources/Frontend/Version.swift +++ b/Sources/Frontend/Version.swift @@ -1 +1 @@ -let PeripheryVersion = "3.0.2" +let PeripheryVersion = "3.0.3" From 5c77476dd87771233828b15800887727691775e8 Mon Sep 17 00:00:00 2001 From: John Szumski <784312+jszumski@users.noreply.github.com> Date: Wed, 26 Mar 2025 11:01:08 -0400 Subject: [PATCH 56/63] Allow inline comment commands on most declarations (#891) --- .../DeclarationSyntaxVisitor.swift | 95 +++++++++++++++---- .../testIgnoreComments.swift | 46 +++++++++ Tests/PeripheryTests/RetentionTest.swift | 24 +++++ 3 files changed, 148 insertions(+), 17 deletions(-) diff --git a/Sources/SyntaxAnalysis/DeclarationSyntaxVisitor.swift b/Sources/SyntaxAnalysis/DeclarationSyntaxVisitor.swift index 2134078542..8d28b0fa27 100644 --- a/Sources/SyntaxAnalysis/DeclarationSyntaxVisitor.swift +++ b/Sources/SyntaxAnalysis/DeclarationSyntaxVisitor.swift @@ -43,7 +43,7 @@ public final class DeclarationSyntaxVisitor: PeripherySyntaxVisitor { parse( modifiers: node.modifiers, attributes: node.attributes, - trivia: node.leadingTrivia, + trivia: node.commentCommandTrivia, inheritanceClause: node.inheritanceClause, genericParameterClause: node.genericParameterClause, genericWhereClause: node.genericWhereClause, @@ -56,7 +56,7 @@ public final class DeclarationSyntaxVisitor: PeripherySyntaxVisitor { parse( modifiers: node.modifiers, attributes: node.attributes, - trivia: node.leadingTrivia, + trivia: node.commentCommandTrivia, inheritanceClause: node.inheritanceClause, genericParameterClause: node.genericParameterClause, genericWhereClause: node.genericWhereClause, @@ -69,7 +69,7 @@ public final class DeclarationSyntaxVisitor: PeripherySyntaxVisitor { parse( modifiers: node.modifiers, attributes: node.attributes, - trivia: node.leadingTrivia, + trivia: node.commentCommandTrivia, inheritanceClause: node.inheritanceClause, genericWhereClause: node.genericWhereClause, at: node.name.positionAfterSkippingLeadingTrivia @@ -80,7 +80,7 @@ public final class DeclarationSyntaxVisitor: PeripherySyntaxVisitor { parse( modifiers: node.modifiers, attributes: node.attributes, - trivia: node.leadingTrivia, + trivia: node.commentCommandTrivia, inheritanceClause: node.inheritanceClause, genericParameterClause: node.genericParameterClause, genericWhereClause: node.genericWhereClause, @@ -93,7 +93,7 @@ public final class DeclarationSyntaxVisitor: PeripherySyntaxVisitor { parse( modifiers: node.modifiers, attributes: node.attributes, - trivia: node.leadingTrivia, + trivia: node.commentCommandTrivia, inheritanceClause: node.inheritanceClause, genericParameterClause: node.genericParameterClause, genericWhereClause: node.genericWhereClause, @@ -128,7 +128,7 @@ public final class DeclarationSyntaxVisitor: PeripherySyntaxVisitor { parse( modifiers: node.modifiers, attributes: node.attributes, - trivia: node.leadingTrivia, + trivia: node.commentCommandTrivia, inheritanceClause: node.inheritanceClause, genericWhereClause: node.genericWhereClause, consumeCapitalSelfFunctionCalls: true, @@ -140,7 +140,7 @@ public final class DeclarationSyntaxVisitor: PeripherySyntaxVisitor { parse( modifiers: node.modifiers, attributes: node.attributes, - trivia: node.leadingTrivia, + trivia: node.commentCommandTrivia, parameterClause: node.signature.parameterClause, returnClause: node.signature.returnClause, genericParameterClause: node.genericParameterClause, @@ -153,7 +153,7 @@ public final class DeclarationSyntaxVisitor: PeripherySyntaxVisitor { parse( modifiers: node.modifiers, attributes: node.attributes, - trivia: node.leadingTrivia, + trivia: node.commentCommandTrivia, parameterClause: node.signature.parameterClause, genericParameterClause: node.genericParameterClause, genericWhereClause: node.genericWhereClause, @@ -165,7 +165,7 @@ public final class DeclarationSyntaxVisitor: PeripherySyntaxVisitor { parse( modifiers: node.modifiers, attributes: node.attributes, - trivia: node.leadingTrivia, + trivia: node.commentCommandTrivia, at: node.deinitKeyword.positionAfterSkippingLeadingTrivia ) } @@ -174,7 +174,7 @@ public final class DeclarationSyntaxVisitor: PeripherySyntaxVisitor { parse( modifiers: node.modifiers, attributes: node.attributes, - trivia: node.leadingTrivia, + trivia: node.commentCommandTrivia, parameterClause: node.parameterClause, returnClause: node.returnClause, genericParameterClause: node.genericParameterClause, @@ -192,7 +192,7 @@ public final class DeclarationSyntaxVisitor: PeripherySyntaxVisitor { parse( modifiers: node.modifiers, attributes: node.attributes, - trivia: node.leadingTrivia, + trivia: node.commentCommandTrivia, variableType: binding.typeAnnotation?.type, closureParameterClause: closureParameters, returnClause: closureSignature?.returnClause, @@ -210,7 +210,7 @@ public final class DeclarationSyntaxVisitor: PeripherySyntaxVisitor { parse( modifiers: node.modifiers, attributes: node.attributes, - trivia: node.leadingTrivia, + trivia: node.leadingTrivia.merging(node.trailingTrivia), at: binding.positionAfterSkippingLeadingTrivia ) } @@ -237,7 +237,7 @@ public final class DeclarationSyntaxVisitor: PeripherySyntaxVisitor { parse( modifiers: node.modifiers, attributes: node.attributes, - trivia: node.leadingTrivia, + trivia: node.commentCommandTrivia, variableType: type?.type, variableInitFunctionCallExpr: initializer?.expression.as(FunctionCallExprSyntax.self), at: element.positionAfterSkippingLeadingTrivia @@ -250,7 +250,7 @@ public final class DeclarationSyntaxVisitor: PeripherySyntaxVisitor { parse( modifiers: node.modifiers, attributes: node.attributes, - trivia: node.leadingTrivia, + trivia: node.leadingTrivia.merging(node.trailingTrivia), genericParameterClause: node.genericParameterClause, genericWhereClause: node.genericWhereClause, typeInitializerClause: node.initializer, @@ -262,7 +262,7 @@ public final class DeclarationSyntaxVisitor: PeripherySyntaxVisitor { parse( modifiers: node.modifiers, attributes: node.attributes, - trivia: node.leadingTrivia, + trivia: node.leadingTrivia.merging(node.trailingTrivia), inheritanceClause: node.inheritanceClause, genericWhereClause: node.genericWhereClause, typeInitializerClause: node.initializer, @@ -274,7 +274,7 @@ public final class DeclarationSyntaxVisitor: PeripherySyntaxVisitor { parse( modifiers: nil, attributes: nil, - trivia: node.leadingTrivia, + trivia: node.commentCommandTrivia, at: node.name.positionAfterSkippingLeadingTrivia ) } @@ -283,7 +283,7 @@ public final class DeclarationSyntaxVisitor: PeripherySyntaxVisitor { parse( modifiers: node.modifiers, attributes: node.attributes, - trivia: node.leadingTrivia, + trivia: node.commentCommandTrivia, at: node.name.positionAfterSkippingLeadingTrivia ) } @@ -517,3 +517,64 @@ public final class DeclarationSyntaxVisitor: PeripherySyntaxVisitor { } } } + +// MARK: - Inline Comment Commands + +private extension SyntaxProtocol { + /// All trivia where inline comment commands can be found. + /// + /// Matches uses like these: + /// + /// ``` + /// // periphery:ignore + /// Foo { + /// } + /// ``` + /// + /// ``` + /// Foo { // periphery:ignore + /// } + /// ``` + /// + /// ``` + /// Foo {} // periphery:ignore + /// ``` + var commentCommandTrivia: Trivia { + var commandTrivia = leadingTrivia + + if let hasMemberBlock = self as? HasMemberBlock { + commandTrivia = commandTrivia + .merging(hasMemberBlock.memberBlock.leftBrace.trailingTrivia) + .merging(hasMemberBlock.memberBlock.rightBrace.trailingTrivia) + } + + if let hasCodeBody = self as? HasCodeBody, let body = hasCodeBody.body { + commandTrivia = commandTrivia + .merging(body.leftBrace.trailingTrivia) + .merging(body.rightBrace.trailingTrivia) + } + + return commandTrivia + } +} + +/// Identifies types with a MemberBlockSyntax child +private protocol HasMemberBlock { + var memberBlock: MemberBlockSyntax { get } +} + +extension ActorDeclSyntax: HasMemberBlock {} +extension ClassDeclSyntax: HasMemberBlock {} +extension ProtocolDeclSyntax: HasMemberBlock {} +extension ExtensionDeclSyntax: HasMemberBlock {} +extension StructDeclSyntax: HasMemberBlock {} +extension EnumDeclSyntax: HasMemberBlock {} + +/// Identifies types with a CodeBlockSyntax child +private protocol HasCodeBody { + var body: CodeBlockSyntax? { get } +} + +extension FunctionDeclSyntax: HasCodeBody {} +extension InitializerDeclSyntax: HasCodeBody {} +extension DeinitializerDeclSyntax: HasCodeBody {} diff --git a/Tests/Fixtures/Sources/RetentionFixtures/testIgnoreComments.swift b/Tests/Fixtures/Sources/RetentionFixtures/testIgnoreComments.swift index aa1e285399..38a5099bd1 100644 --- a/Tests/Fixtures/Sources/RetentionFixtures/testIgnoreComments.swift +++ b/Tests/Fixtures/Sources/RetentionFixtures/testIgnoreComments.swift @@ -67,3 +67,49 @@ public class FixtureClass213: Fixture114 { public protocol Fixture205Protocol {} // periphery:ignore public class Fixture205: Fixture205Protocol {} + +// MARK: - Inline comment commands + +public class Fixture300Class { // periphery:ignore +} + +public class Fixture301Class {} // periphery:ignore + +public protocol Fixture302Protocol { // periphery:ignore +} + +public protocol Fixture303Protocol {} // periphery:ignore + +public struct Fixture304Struct { // periphery:ignore +} + +public struct Fixture305Struct {} // periphery:ignore + +public protocol Fixture306Protocol {} +public extension Fixture306Protocol { // periphery:ignore + func foo() {} +} + +public enum Fixture307Enum { // periphery:ignore + case foo +} + +public class Fixture308Class { + var storage: String + + public init() { + storage = "noValue" + } + + public init(string: String) { // periphery:ignore + storage = string + } + + public func someFunc() { // periphery:ignore + storage = "someFunc" + } +} + +public class Fixture309Class { // periphery:ignore + public let reference = Fixture308Class() +} diff --git a/Tests/PeripheryTests/RetentionTest.swift b/Tests/PeripheryTests/RetentionTest.swift index 3b7080df00..f5020860f4 100644 --- a/Tests/PeripheryTests/RetentionTest.swift +++ b/Tests/PeripheryTests/RetentionTest.swift @@ -938,6 +938,30 @@ final class RetentionTest: FixtureSourceGraphTestCase { assertReferenced(.protocol("Fixture205Protocol")) assertNotRedundantProtocol("Fixture205Protocol") } + + // inline comment command tests + analyze(retainPublic: false) { + assertReferenced(.class("Fixture300Class")) + assertReferenced(.class("Fixture301Class")) + + assertReferenced(.protocol("Fixture302Protocol")) + assertNotRedundantProtocol("Fixture302Protocol") + assertReferenced(.protocol("Fixture303Protocol")) + assertNotRedundantProtocol("Fixture303Protocol") + + assertReferenced(.struct("Fixture304Struct")) + assertReferenced(.struct("Fixture305Struct")) + + assertReferenced(.extensionProtocol("Fixture306Protocol")) + assertNotRedundantProtocol("Fixture306Protocol") + + assertReferenced(.enum("Fixture307Enum")) + + assertReferenced(.class("Fixture308Class")) { + self.assertReferenced(.functionMethodInstance("someFunc()")) + self.assertReferenced(.functionConstructor("init(string:)")) + } + } } func testIgnoreAllComment() { From 81d2fb5fff1a0208d9ff4e2f9f8436a5e66d7238 Mon Sep 17 00:00:00 2001 From: Ian Leitch Date: Sat, 29 Mar 2025 19:09:45 +0100 Subject: [PATCH 57/63] Ignore unused parameters in universally unavailable functions. Closes #894 (#896) --- CHANGELOG.md | 2 +- .../UnusedParameterAnalyzer.swift | 10 ++- .../UnusedParameterParser.swift | 89 ++++++------------- .../testUnavailableFunction.swift | 6 ++ .../Syntax/UnusedParameterTest.swift | 5 ++ baselines/bazel.json | 2 +- 6 files changed, 50 insertions(+), 64 deletions(-) create mode 100644 Tests/Fixtures/Sources/UnusedParameterFixtures/testUnavailableFunction.swift diff --git a/CHANGELOG.md b/CHANGELOG.md index 4dd35f632f..7f8e1a49c8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,7 +10,7 @@ ##### Bug Fixes -- None. +- Unused parameter warnings are suppressed in `@available(*, unavailable)` functions. ## 3.0.3 (2025-03-15) diff --git a/Sources/SyntaxAnalysis/UnusedParameterAnalyzer.swift b/Sources/SyntaxAnalysis/UnusedParameterAnalyzer.swift index eb2bfad324..d46c8b2a99 100644 --- a/Sources/SyntaxAnalysis/UnusedParameterAnalyzer.swift +++ b/Sources/SyntaxAnalysis/UnusedParameterAnalyzer.swift @@ -36,7 +36,7 @@ public final class UnusedParameterAnalyzer { // MARK: - Private private func unusedParams(in function: Function) -> [Parameter] { - guard !function.attributes.contains("IBAction") else { return [] } + guard !function.attributes.contains(where: { $0.name == "IBAction" }) else { return [] } return function.parameters.filter { !isParam($0, usedIn: function) } } @@ -54,9 +54,17 @@ public final class UnusedParameterAnalyzer { return true } + if isFunctionUnavailable(function) { + return true + } + return isParam(param, usedIn: function.items) } + private func isFunctionUnavailable(_ function: Function) -> Bool { + function.attributes.contains { $0.name == "available" && $0.arguments == "*, unavailable" } + } + private func isFunctionFatalErrorOnly(_ function: Function) -> Bool { guard let codeBlockList = function.items.first as? GenericItem, codeBlockList.node.is(CodeBlockItemListSyntax.self), diff --git a/Sources/SyntaxAnalysis/UnusedParameterParser.swift b/Sources/SyntaxAnalysis/UnusedParameterParser.swift index 391a69e224..c5d083be85 100644 --- a/Sources/SyntaxAnalysis/UnusedParameterParser.swift +++ b/Sources/SyntaxAnalysis/UnusedParameterParser.swift @@ -4,11 +4,11 @@ import SwiftParser import SwiftSyntax import SystemPackage -public protocol Item: AnyObject { +public protocol Item { var items: [Item] { get } } -public final class Function: Item, Hashable { +public struct Function: Item, Hashable { public static func == (lhs: Function, rhs: Function) -> Bool { lhs.location == rhs.location } @@ -23,28 +23,15 @@ public final class Function: Item, Hashable { public let items: [Item] public let parameters: [Parameter] public let genericParameters: [String] - public let attributes: [String] - - init( - name: String, - fullName: String, - location: Location, - items: [Item], - parameters: [Parameter], - genericParameters: [String], - attributes: [String] - ) { - self.name = name - self.fullName = fullName - self.location = location - self.items = items - self.parameters = parameters - self.genericParameters = genericParameters - self.attributes = attributes - } + public let attributes: [Attribute] } -public final class Parameter: Item, Hashable { +public struct Attribute { + let name: String + let arguments: String? +} + +public struct Parameter: Item, Hashable { public static func == (lhs: Parameter, rhs: Parameter) -> Bool { lhs.location == rhs.location } @@ -58,67 +45,39 @@ public final class Parameter: Item, Hashable { let metatype: String? let location: Location public let items: [Item] = [] - var function: Function? public var name: String { secondName ?? firstName ?? "" } public func makeDeclaration(withParent parent: Declaration) -> Declaration { - let functionName = function?.fullName ?? "func()" let parentUsrs = parent.usrs.joined(separator: "-") - let usr = "param-\(name)-\(functionName)-\(parentUsrs)" + let usr = "param-\(name)-\(parent.name ?? "unknown-function")-\(parentUsrs)" let decl = Declaration(kind: .varParameter, usrs: [usr], location: location) decl.name = name decl.parent = parent return decl } - - init(firstName: String?, secondName: String?, metatype: String?, location: Location) { - self.firstName = firstName - self.secondName = secondName - self.metatype = metatype - self.location = location - } } -final class Variable: Item { +struct Variable: Item { let names: [String] let items: [Item] - - init(names: [String], items: [Item]) { - self.names = names - self.items = items - } } -final class Closure: Item { +struct Closure: Item { let params: [String] let items: [Item] - - init(params: [String], items: [Item]) { - self.params = params - self.items = items - } } -final class Identifier: Item { +struct Identifier: Item { let name: String let items: [Item] = [] - - init(name: String) { - self.name = name - } } -final class GenericItem: Item { +struct GenericItem: Item { let node: Syntax let items: [Item] - - init(node: Syntax, items: [Item]) { - self.node = node - self.items = items - } } struct UnusedParameterParser { @@ -338,20 +297,28 @@ struct UnusedParameterParser { let items = parse(node: body, collector)?.items ?? [] let fullName = buildFullName(for: name, with: params) let genericParamNames = genericParams?.parameters.map(\.name.text) ?? [] - let attributeNames = attributes?.children(viewMode: .sourceAccurate).compactMap { AttributeSyntax($0)?.attributeName.trimmedDescription } ?? [] + let parsedAttributes: [Attribute] = attributes? + .compactMap { $0 } + .compactMap { + if case let .attribute(attr) = $0 { + return Attribute( + name: attr.attributeName.trimmedDescription, + arguments: attr.arguments?.trimmedDescription + ) + } - let function = Function( + return nil + } ?? [] + + return Function( name: name, fullName: fullName, location: sourceLocation(of: position), items: items, parameters: params, genericParameters: genericParamNames, - attributes: attributeNames + attributes: parsedAttributes ) - - params.forEach { $0.function = function } - return function } private func buildFullName(for function: String, with params: [Parameter]) -> String { diff --git a/Tests/Fixtures/Sources/UnusedParameterFixtures/testUnavailableFunction.swift b/Tests/Fixtures/Sources/UnusedParameterFixtures/testUnavailableFunction.swift new file mode 100644 index 0000000000..ac43b369dc --- /dev/null +++ b/Tests/Fixtures/Sources/UnusedParameterFixtures/testUnavailableFunction.swift @@ -0,0 +1,6 @@ +import Foundation + +public class FixtureClass135 { + @available(*, unavailable) + func myFunc(param: String) {} +} diff --git a/Tests/PeripheryTests/Syntax/UnusedParameterTest.swift b/Tests/PeripheryTests/Syntax/UnusedParameterTest.swift index 3a9ab30df9..b4c39ddcaf 100644 --- a/Tests/PeripheryTests/Syntax/UnusedParameterTest.swift +++ b/Tests/PeripheryTests/Syntax/UnusedParameterTest.swift @@ -123,6 +123,11 @@ final class UnusedParameterTest: XCTestCase { assertUsed("param", in: "init(param:)") } + func testUnavailableFunction() { + analyze() + assertUsed("param", in: "myFunc(param:)") + } + func testParameterPosition() { analyze() let function = functions.first! diff --git a/baselines/bazel.json b/baselines/bazel.json index 723bd90fb8..e5b72dabe4 100644 --- a/baselines/bazel.json +++ b/baselines/bazel.json @@ -1 +1 @@ -{"v1":{"usrs":["s:13Configuration15AbstractSettingP5resetyyF","s:13Configuration7SettingC5resetyyF","s:13ConfigurationAAC13resetMatchersyyF","s:13ConfigurationAAC5resetyyF","s:13SystemPackage8FilePathV10ExtensionsE5chdir7closureyyyKXE_tKF","s:14SyntaxAnalysis21UnusedParameterParserV5parse4file0F9ProtocolsSayAA8FunctionCG11SourceGraph0J4FileC_SbtKFZ"]}} \ No newline at end of file +{"v1":{"usrs":["s:13Configuration15AbstractSettingP5resetyyF","s:13Configuration7SettingC5resetyyF","s:13ConfigurationAAC13resetMatchersyyF","s:13ConfigurationAAC5resetyyF","s:13SystemPackage8FilePathV10ExtensionsE5chdir7closureyyyKXE_tKF","s:14SyntaxAnalysis21UnusedParameterParserV5parse4file0F9ProtocolsSayAA8FunctionVG11SourceGraph0J4FileC_SbtKFZ","s:14SyntaxAnalysis8FunctionV8fullNameSSvp"]}} \ No newline at end of file From f7d52a08a771222d48aae8106cbeaf7050006c5d Mon Sep 17 00:00:00 2001 From: Ian Leitch Date: Sat, 29 Mar 2025 19:19:24 +0100 Subject: [PATCH 58/63] Enable Bazel cache (#897) --- .github/workflows/test.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 03bf8daea0..49c3421458 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -25,6 +25,11 @@ jobs: steps: - uses: actions/checkout@master - uses: jdx/mise-action@v2 + - uses: bazel-contrib/setup-bazel@0.14.0 + with: + bazelisk-cache: true + disk-cache: ${{ github.workflow }} + repository-cache: true - name: Check generated rules run: mise r gen-bazel-rules && git diff --quiet --exit-code - name: Scan From e6bf1e4602b72ae1a30cee8e15b8b589b664879b Mon Sep 17 00:00:00 2001 From: Ian Leitch Date: Sun, 30 Mar 2025 15:01:31 +0200 Subject: [PATCH 59/63] Add task to write Linux baseline --- .mise/tasks/write-linux-baseline | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100755 .mise/tasks/write-linux-baseline diff --git a/.mise/tasks/write-linux-baseline b/.mise/tasks/write-linux-baseline new file mode 100755 index 0000000000..be7060fc1a --- /dev/null +++ b/.mise/tasks/write-linux-baseline @@ -0,0 +1,9 @@ +#!/bin/bash + +set -e + +export DOCKER_CLI_HINTS=false +docker build -t periphery -f docker/Dockerfile.linux . +docker run --name periphery_write_linux_baseline -t periphery scan "$@" --write-baseline /linux.json +docker cp periphery_write_linux_baseline:linux.json ./baselines/linux.json +docker rm periphery_write_linux_baseline From 6aeae1d6c51bdd0f92248b324e4d96cd8805f30d Mon Sep 17 00:00:00 2001 From: Ian Leitch Date: Sun, 30 Mar 2025 15:02:05 +0200 Subject: [PATCH 60/63] Fix handling of Xcode projects with quotes in their path and scheme names. Closes #730 (#898) --- CHANGELOG.md | 1 + Sources/Extensions/String+Extension.swift | 4 ++++ Sources/XcodeSupport/XcodeProjectSetupGuide.swift | 4 ++-- Sources/XcodeSupport/Xcodebuild.swift | 6 +++--- baselines/linux.json | 2 +- 5 files changed, 11 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7f8e1a49c8..4dae1d2354 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ ##### Bug Fixes - Unused parameter warnings are suppressed in `@available(*, unavailable)` functions. +- Fix handling of Xcode projects with single and double quotes in their path and scheme names. ## 3.0.3 (2025-03-15) diff --git a/Sources/Extensions/String+Extension.swift b/Sources/Extensions/String+Extension.swift index f59c683a44..d3ddfba5ab 100644 --- a/Sources/Extensions/String+Extension.swift +++ b/Sources/Extensions/String+Extension.swift @@ -32,4 +32,8 @@ public extension String { @inlinable var djb2Hex: String { String(format: "%02x", djb2) } + + @inlinable var withEscapedQuotes: String { + replacingOccurrences(of: "\"", with: "\\\"") + } } diff --git a/Sources/XcodeSupport/XcodeProjectSetupGuide.swift b/Sources/XcodeSupport/XcodeProjectSetupGuide.swift index e8d55d3543..dafbc49c77 100644 --- a/Sources/XcodeSupport/XcodeProjectSetupGuide.swift +++ b/Sources/XcodeSupport/XcodeProjectSetupGuide.swift @@ -117,10 +117,10 @@ public final class XcodeProjectSetupGuide: SetupGuideHelpers, SetupGuide { var options: [String] = [] if let project = configuration.project { - options.append("--project \"\(project)\"") + options.append("--project \"\(project.string.withEscapedQuotes)\"") } - options.append("--schemes " + configuration.schemes.map { "\"\($0)\"" }.joined(separator: ",")) + options.append("--schemes " + configuration.schemes.map { "\"\($0.withEscapedQuotes)\"" }.joined(separator: ",")) if configuration.retainObjcAccessible { options.append("--retain-objc-accessible") diff --git a/Sources/XcodeSupport/Xcodebuild.swift b/Sources/XcodeSupport/Xcodebuild.swift index 8d098ad094..2594928a3d 100644 --- a/Sources/XcodeSupport/Xcodebuild.swift +++ b/Sources/XcodeSupport/Xcodebuild.swift @@ -35,8 +35,8 @@ public final class Xcodebuild { @discardableResult public func build(project: XcodeProjectlike, scheme: String, allSchemes: [String], additionalArguments: [String] = []) throws -> String { let args = try [ - "-\(project.type)", "'\(project.path.lexicallyNormalized().string)'", - "-scheme", "'\(scheme)'", + "-\(project.type)", "\"\(project.path.lexicallyNormalized().string.withEscapedQuotes)\"", + "-scheme", "\"\(scheme.withEscapedQuotes)\"", "-parallelizeTargets", "-derivedDataPath", "'\(derivedDataPath(for: project, schemes: allSchemes).string)'", "-quiet", @@ -79,7 +79,7 @@ public final class Xcodebuild { func schemes(type: String, path: String, additionalArguments: [String]) throws -> Set { let args = [ - "-\(type)", "'\(path)'", + "-\(type)", "\"\(path.withEscapedQuotes)\"", "-list", "-json", ] diff --git a/baselines/linux.json b/baselines/linux.json index 5e1c814274..2f7123741a 100644 --- a/baselines/linux.json +++ b/baselines/linux.json @@ -1 +1 @@ -{"v1":{"usrs":["import-Configuration-Sources\/ProjectDrivers\/XcodeProjectDriver.swift:2:5","import-Indexer-Sources\/ProjectDrivers\/XcodeProjectDriver.swift:4:5","import-Logger-Sources\/ProjectDrivers\/XcodeProjectDriver.swift:5:5","import-Shared-Sources\/ProjectDrivers\/XcodeProjectDriver.swift:6:5","import-SourceGraph-Sources\/ProjectDrivers\/XcodeProjectDriver.swift:7:5","import-TestShared-Tests\/PeripheryTests\/ObjcAccessibleRetentionTest.swift:2:1","import-TestShared-Tests\/PeripheryTests\/ObjcAnnotatedRetentionTest.swift:2:1","s:11SourceGraph15ProjectFileKindO10extensionsSaySSGvp","s:6Shared14SetupSelectionO","s:6Shared17SetupGuideHelpersC6select8multipleAA0B9SelectionOSaySSG_tF","s:SS10ExtensionsE4djb2Sivp","s:SS10ExtensionsE7djb2HexSSvp"]}} \ No newline at end of file +{"v1":{"usrs":["import-Configuration-Sources\/ProjectDrivers\/XcodeProjectDriver.swift:2:5","import-Indexer-Sources\/ProjectDrivers\/XcodeProjectDriver.swift:4:5","import-Logger-Sources\/ProjectDrivers\/XcodeProjectDriver.swift:5:5","import-Shared-Sources\/ProjectDrivers\/XcodeProjectDriver.swift:6:5","import-SourceGraph-Sources\/ProjectDrivers\/XcodeProjectDriver.swift:7:5","import-TestShared-Tests\/PeripheryTests\/ObjcAccessibleRetentionTest.swift:2:1","import-TestShared-Tests\/PeripheryTests\/ObjcAnnotatedRetentionTest.swift:2:1","s:11SourceGraph15ProjectFileKindO10extensionsSaySSGvp","s:6Shared14SetupSelectionO","s:6Shared17SetupGuideHelpersC6select8multipleAA0B9SelectionOSaySSG_tF","s:SS10ExtensionsE17withEscapedQuotesSSvp","s:SS10ExtensionsE4djb2Sivp","s:SS10ExtensionsE7djb2HexSSvp"]}} \ No newline at end of file From 0d42e0f2a90d8878a054225fbee70f2a65258cdf Mon Sep 17 00:00:00 2001 From: Ian Leitch Date: Sun, 30 Mar 2025 15:58:27 +0200 Subject: [PATCH 61/63] Retain '@_dynamicReplacement' members. Closes #874 (#899) --- .swiftlint.yml | 1 + CHANGELOG.md | 1 + Sources/BUILD.bazel | 2 +- ...lder.swift => DynamicMemberRetainer.swift} | 8 +- .../SourceGraphMutatorRunner.swift | 2 +- .../testRetainsDynamicReplacement.swift | 26 ++++++ Tests/PeripheryTests/RetentionTest.swift | 83 +++++++++++-------- 7 files changed, 86 insertions(+), 37 deletions(-) rename Sources/SourceGraph/Mutators/{DynamicMemberLookupReferenceBuilder.swift => DynamicMemberRetainer.swift} (63%) create mode 100644 Tests/Fixtures/Sources/RetentionFixtures/testRetainsDynamicReplacement.swift diff --git a/.swiftlint.yml b/.swiftlint.yml index ee8faf64ef..44f81728df 100644 --- a/.swiftlint.yml +++ b/.swiftlint.yml @@ -36,3 +36,4 @@ disabled_rules: - non_optional_string_data_conversion # https://github.com/realm/SwiftLint/issues/5263#issuecomment-2115182747 - balanced_xctest_lifecycle - todo + - for_where diff --git a/CHANGELOG.md b/CHANGELOG.md index 4dae1d2354..5343428f14 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,7 @@ - Unused parameter warnings are suppressed in `@available(*, unavailable)` functions. - Fix handling of Xcode projects with single and double quotes in their path and scheme names. +- `@_dynamicReplacement` members are now retained. ## 3.0.3 (2025-03-15) diff --git a/Sources/BUILD.bazel b/Sources/BUILD.bazel index 1edbc2559a..df238b8c9f 100644 --- a/Sources/BUILD.bazel +++ b/Sources/BUILD.bazel @@ -61,7 +61,7 @@ swift_library( "SourceGraph/Mutators/CodingKeyEnumReferenceBuilder.swift", "SourceGraph/Mutators/ComplexPropertyAccessorReferenceBuilder.swift", "SourceGraph/Mutators/DefaultConstructorReferenceBuilder.swift", - "SourceGraph/Mutators/DynamicMemberLookupReferenceBuilder.swift", + "SourceGraph/Mutators/DynamicMemberRetainer.swift", "SourceGraph/Mutators/EntryPointAttributeRetainer.swift", "SourceGraph/Mutators/EnumCaseReferenceBuilder.swift", "SourceGraph/Mutators/ExtensionReferenceBuilder.swift", diff --git a/Sources/SourceGraph/Mutators/DynamicMemberLookupReferenceBuilder.swift b/Sources/SourceGraph/Mutators/DynamicMemberRetainer.swift similarity index 63% rename from Sources/SourceGraph/Mutators/DynamicMemberLookupReferenceBuilder.swift rename to Sources/SourceGraph/Mutators/DynamicMemberRetainer.swift index d20dd3c353..2969ef6ad4 100644 --- a/Sources/SourceGraph/Mutators/DynamicMemberLookupReferenceBuilder.swift +++ b/Sources/SourceGraph/Mutators/DynamicMemberRetainer.swift @@ -2,7 +2,7 @@ import Configuration import Foundation import Shared -final class DynamicMemberLookupReferenceBuilder: SourceGraphMutator { +final class DynamicMemberRetainer: SourceGraphMutator { private let graph: SourceGraph required init(graph: SourceGraph, configuration _: Configuration, swiftVersion _: SwiftVersion) { @@ -15,5 +15,11 @@ final class DynamicMemberLookupReferenceBuilder: SourceGraphMutator { graph.markRetained(decl) } } + + for decl in graph.declarations(ofKinds: [.functionSubscript, .varInstance, .functionMethodInstance]) { + if decl.attributes.contains("_dynamicReplacement") { + graph.markRetained(decl) + } + } } } diff --git a/Sources/SourceGraph/SourceGraphMutatorRunner.swift b/Sources/SourceGraph/SourceGraphMutatorRunner.swift index 43ca4de8a8..93aaf963c0 100644 --- a/Sources/SourceGraph/SourceGraphMutatorRunner.swift +++ b/Sources/SourceGraph/SourceGraphMutatorRunner.swift @@ -27,10 +27,10 @@ public final class SourceGraphMutatorRunner { ExternalTypeProtocolConformanceReferenceRemover.self, ComplexPropertyAccessorReferenceBuilder.self, EnumCaseReferenceBuilder.self, - DynamicMemberLookupReferenceBuilder.self, DefaultConstructorReferenceBuilder.self, StructImplicitInitializerReferenceBuilder.self, + DynamicMemberRetainer.self, UnusedParameterRetainer.self, AssetReferenceRetainer.self, EntryPointAttributeRetainer.self, diff --git a/Tests/Fixtures/Sources/RetentionFixtures/testRetainsDynamicReplacement.swift b/Tests/Fixtures/Sources/RetentionFixtures/testRetainsDynamicReplacement.swift new file mode 100644 index 0000000000..e55db310a3 --- /dev/null +++ b/Tests/Fixtures/Sources/RetentionFixtures/testRetainsDynamicReplacement.swift @@ -0,0 +1,26 @@ +struct FixtureStruct8 { + dynamic static func originalStaticMethod() {} + dynamic func originalMethod() {} + dynamic var originalProperty: Int { 0 } + dynamic subscript(original index: Int) -> Int { 0} +} + +extension FixtureStruct8 { + @_dynamicReplacement(for: originalMethod) + func replacementMethod() {} + + @_dynamicReplacement(for: originalProperty) + var replacementProperty: Int { 0 } + + @_dynamicReplacement(for: subscript(original:)) + subscript(replacement index: Int) -> Int { 0} +} + +public struct FixtureStruct8Retainer { + public func retain() { + let strct = FixtureStruct8() + strct.originalMethod() + _ = strct.originalProperty + _ = strct[original: 0] + } +} diff --git a/Tests/PeripheryTests/RetentionTest.swift b/Tests/PeripheryTests/RetentionTest.swift index f5020860f4..400236d0d1 100644 --- a/Tests/PeripheryTests/RetentionTest.swift +++ b/Tests/PeripheryTests/RetentionTest.swift @@ -1089,6 +1089,55 @@ final class RetentionTest: FixtureSourceGraphTestCase { } } + func testMainActorAnnotation() { + analyze(retainPublic: true) { + assertReferenced(.class("FixtureClass132")) { + self.assertReferenced(.functionConstructor("init(value:)")) + } + assertReferenced(.class("FixtureClass133")) + } + } + + // https://github.com/apple/swift/issues/64686 + // https://github.com/peripheryapp/periphery/issues/264 + func testSelfReferencedConstructor() { + analyze(retainPublic: true) { + assertReferenced(.struct("FixtureStruct3")) { + self.assertReferenced(.functionConstructor("init(value:)")) + } + assertReferenced(.struct("FixtureStruct4")) { + self.assertReferenced(.functionConstructor("init(value:)")) + } + assertReferenced(.struct("FixtureStruct5")) { + self.assertNotReferenced(.functionConstructor("init(value:)")) + } + } + } + + // https://github.com/apple/swift/issues/56541 + func testStaticMemberUsedAsSubscriptKey() { + analyze(retainPublic: true) { + assertReferenced(.enum("FixtureEnum128")) { + self.assertReferenced(.varStatic("someVar")) + } + } + } + + func testRetainsDynamicReplacement() { + analyze(retainPublic: true) { + assertReferenced(.struct("FixtureStruct8")) { + self.assertReferenced(.functionMethodInstance("originalMethod()")) + self.assertReferenced(.functionMethodInstance("replacementMethod()")) + + self.assertReferenced(.varInstance("originalProperty")) + self.assertReferenced(.varInstance("replacementProperty")) + + self.assertReferenced(.functionSubscript("subscript(original:)")) + self.assertReferenced(.functionSubscript("subscript(replacement:)")) + } + } + } + // MARK: - Swift Testing #if canImport(Testing) @@ -1613,40 +1662,6 @@ final class RetentionTest: FixtureSourceGraphTestCase { } } - func testMainActorAnnotation() { - analyze(retainPublic: true) { - assertReferenced(.class("FixtureClass132")) { - self.assertReferenced(.functionConstructor("init(value:)")) - } - assertReferenced(.class("FixtureClass133")) - } - } - - // https://github.com/apple/swift/issues/64686 - // https://github.com/peripheryapp/periphery/issues/264 - func testSelfReferencedConstructor() { - analyze(retainPublic: true) { - assertReferenced(.struct("FixtureStruct3")) { - self.assertReferenced(.functionConstructor("init(value:)")) - } - assertReferenced(.struct("FixtureStruct4")) { - self.assertReferenced(.functionConstructor("init(value:)")) - } - assertReferenced(.struct("FixtureStruct5")) { - self.assertNotReferenced(.functionConstructor("init(value:)")) - } - } - } - - // https://github.com/apple/swift/issues/56541 - func testStaticMemberUsedAsSubscriptKey() { - analyze(retainPublic: true) { - assertReferenced(.enum("FixtureEnum128")) { - self.assertReferenced(.varStatic("someVar")) - } - } - } - // MARK: - Known Failures // https://github.com/apple/swift/issues/56165 From 33184368444af31913956c0ec60a60d0b2cd6a6e Mon Sep 17 00:00:00 2001 From: Ian Leitch Date: Sun, 30 Mar 2025 19:05:39 +0200 Subject: [PATCH 62/63] Apply Linux baseline --- .mise/tasks/scan-linux | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mise/tasks/scan-linux b/.mise/tasks/scan-linux index 3bd3bde9ac..d4fc1a54bf 100755 --- a/.mise/tasks/scan-linux +++ b/.mise/tasks/scan-linux @@ -4,4 +4,4 @@ set -e export DOCKER_CLI_HINTS=false docker build -t periphery -f docker/Dockerfile.linux . -docker run --rm -t periphery scan "$@" +docker run --rm -t periphery scan "$@" --baseline baselines/linux.json From 12a37d0d63bf03c527be563aa27b2eab5a5ffc1b Mon Sep 17 00:00:00 2001 From: Gorbenko Roman Date: Mon, 18 Aug 2025 08:44:44 +0300 Subject: [PATCH 63/63] Fix build --- Sources/ProjectDrivers/BazelProjectDriver.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Sources/ProjectDrivers/BazelProjectDriver.swift b/Sources/ProjectDrivers/BazelProjectDriver.swift index 28e0989f97..8727554a82 100644 --- a/Sources/ProjectDrivers/BazelProjectDriver.swift +++ b/Sources/ProjectDrivers/BazelProjectDriver.swift @@ -4,8 +4,8 @@ import Logger import Shared import SystemPackage -class BazelProjectDriver: ProjectDriver { - static var isSupported: Bool { +public class BazelProjectDriver: ProjectDriver { + public static var isSupported: Bool { FilePath("MODULE.bazel").exists || FilePath("WORKSPACE").exists }