You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: cli/src/main/kotlin/com/bazel_diff/cli/GenerateHashesCommand.kt
+8Lines changed: 8 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -78,6 +78,13 @@ class GenerateHashesCommand : Callable<Int> {
78
78
)
79
79
var fineGrainedHashExternalRepos:Set<String> = emptySet()
80
80
81
+
@CommandLine.Option(
82
+
names = ["--fineGrainedHashExternalReposFile"],
83
+
description =
84
+
[
85
+
"A text file containing a newline separated list of external repos. Similar to --fineGrainedHashExternalRepos but helps you avoid exceeding max arg length. Mutually exclusive with --fineGrainedHashExternalRepos."])
86
+
var fineGrainedHashExternalReposFile:File?=null
87
+
81
88
@CommandLine.Option(
82
89
names = ["--useCquery"],
83
90
negatable =true,
@@ -192,6 +199,7 @@ class GenerateHashesCommand : Callable<Int> {
Copy file name to clipboardExpand all lines: cli/src/main/kotlin/com/bazel_diff/di/Modules.kt
+14-3Lines changed: 14 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -30,8 +30,19 @@ fun hasherModule(
30
30
keepGoing:Boolean,
31
31
trackDeps:Boolean,
32
32
fineGrainedHashExternalRepos:Set<String>,
33
+
fineGrainedHashExternalReposFile:File?,
33
34
excludeExternalTargets:Boolean,
34
35
): Module= module {
36
+
if (fineGrainedHashExternalReposFile !=null&& fineGrainedHashExternalRepos.isNotEmpty()) {
37
+
System.err.println("Error: fineGrainedHashExternalReposFile and fineGrainedHashExternalRepos are mutually exclusive - please provide only one of them")
38
+
System.exit(1)
39
+
}
40
+
val updatedFineGrainedHashExternalRepos = fineGrainedHashExternalReposFile?.let { file ->
41
+
file.readLines()
42
+
.filter { it.isNotBlank() }
43
+
.toSet()
44
+
} ?: fineGrainedHashExternalRepos
45
+
35
46
val cmd:MutableList<String> =
36
47
ArrayList<String>().apply {
37
48
add(bazelPath.toString())
@@ -60,11 +71,11 @@ fun hasherModule(
60
71
keepGoing,
61
72
debug)
62
73
}
63
-
single { BazelClient(useCquery, fineGrainedHashExternalRepos, excludeExternalTargets) }
74
+
single { BazelClient(useCquery, updatedFineGrainedHashExternalRepos, excludeExternalTargets) }
64
75
single { BuildGraphHasher(get()) }
65
76
single { TargetHasher() }
66
-
single { RuleHasher(useCquery, trackDeps, fineGrainedHashExternalRepos) }
0 commit comments