diff --git a/.bazel_use_local_generated_repo b/.bazel_use_local_generated_repo new file mode 100644 index 000000000..e69de29bb diff --git a/Sources/ProjectDrivers/BazelProjectDriver.swift b/Sources/ProjectDrivers/BazelProjectDriver.swift index 6678ac8eb..81506c8b0 100644 --- a/Sources/ProjectDrivers/BazelProjectDriver.swift +++ b/Sources/ProjectDrivers/BazelProjectDriver.swift @@ -120,7 +120,7 @@ public 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 @@ public 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)