Skip to content

Commit

Permalink
Fix generated Bazel repo naming (#843)
Browse files Browse the repository at this point in the history
  • Loading branch information
ileitch authored Dec 16, 2024
1 parent 21950d5 commit 606dbb7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
Empty file added .bazel_use_local_generated_repo
Empty file.
6 changes: 5 additions & 1 deletion Sources/ProjectDrivers/BazelProjectDriver.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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)
Expand Down

0 comments on commit 606dbb7

Please sign in to comment.